Skip to content

chore(ci): add PHP unit tests with Ceph S3 - #714

Merged
phil-davis merged 6 commits into
masterfrom
ci/php-unit-ceph
Jul 21, 2026
Merged

phil-davis merged 6 commits into
masterfrom
ci/php-unit-ceph

Conversation

@DeepDiver1975

Copy link
Copy Markdown
Contributor

Summary

Adds a Ceph S3 PHP-unit CI job to complement the Scality jobs that #706 already merged.

#706 wired scality unit tests through the shared owncloud/reusable-workflows php-unit.yml, but that reusable workflow does not support ceph. This PR adds ceph coverage via a local .github/workflows/php-unit.yml callable workflow plus a php-unit-ceph job in main.yml. Scality keeps using the reusable workflow untouched.

This supersedes the ceph portion of #704 (which was based on the pre-#706 local-workflow approach and is now obsolete). #704 has been left at its original state.

Ceph setup — verified end-to-end against owncloudci/ceph:tag-build-master-jewel-ubuntu-16.04

  1. Forward container env with -e. NETWORK_AUTO_DETECT, RGW_NAME, CEPH_DEMO_* were previously set as step shell env but never passed into docker run, so the container aborted with ERROR- CEPH_PUBLIC_NETWORK must be defined.
  2. Use RGW_CIVETWEB_PORT=8080 (the variable the image actually reads; CEPH_DEMO_RGW_PORT is ignored) so radosgw's civetweb frontend binds 8080, matching the ceph.config.php endpoint.
  3. Create the OWNCLOUD bucket (uppercase) that ceph.config.php points at — RGW bucket names are case-sensitive.

ceph.config.php endpoint updated http://ceph:80/ → http://localhost:8080/ for the host-networked GitHub Actions runner. The core-checkout ref also uses the standard &&/|| expression instead of the invalid case() function.

🤖 Generated with Claude Code

@DeepDiver1975
DeepDiver1975 requested a review from a team as a code owner July 15, 2026 22:07
@phil-davis

Copy link
Copy Markdown
Contributor

https://github.com/owncloud/files_primary_s3/actions/runs/29475044481/job/87546140350?pr=714
Ceph S3 Server took about 12 seconds to start. But still it could not be reached at the expected place.
There must be something more to do to get the connection working to the Ceph S3 Server.

Comment thread .github/workflows/php-unit.yml Outdated
@phil-davis

Copy link
Copy Markdown
Contributor

I suppose that we can merge this, and then port the known-working ceph workflow code into the reusable php-unit, and then make another PR to use that here.

DeepDiver1975 and others added 6 commits July 21, 2026 12:42
Master (#706) added scality unit-test jobs via the shared
owncloud/reusable-workflows php-unit workflow, but that workflow does
not support ceph. Add ceph coverage with a local php-unit.yml callable
workflow and a php-unit-ceph job in main.yml; scality keeps using the
reusable workflow.

The ceph setup is verified end-to-end against
owncloudci/ceph:tag-build-master-jewel-ubuntu-16.04:

- Forward the container env (NETWORK_AUTO_DETECT, RGW_NAME, CEPH_DEMO_*)
  into `docker run` with `-e`; otherwise the container aborts with
  "ERROR- CEPH_PUBLIC_NETWORK must be defined".
- Use RGW_CIVETWEB_PORT=8080 (the variable the image reads) so radosgw's
  civetweb frontend binds 8080, matching the ceph.config.php endpoint.
  CEPH_DEMO_RGW_PORT is ignored by the image.
- Create the "OWNCLOUD" bucket (uppercase) that ceph.config.php points
  at; RGW bucket names are case-sensitive.

ceph.config.php endpoint is updated from http://ceph:80/ to
http://localhost:8080/ for the host-networked GitHub Actions runner.

The core-checkout ref also uses the standard `&&`/`||` expression
instead of the invalid `case()` function.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
The Ceph and Scality S3 servers are started detached with `docker run -d`
but nothing waited for them to accept connections before the tests used
them. The Ceph jewel demo image takes longer than ~20s to bootstrap its
RADOS gateway (civetweb on port 8080), so `s3:create-bucket` raced ahead
and failed with `cURL error 7: Failed to connect to localhost port 8080`.
All four Ceph matrix jobs failed this way while the faster-booting Scality
jobs passed by luck.

Add a TCP readiness poll after each server launch, mirroring the old
Drone CI `wait-for-it ceph:80` / `scality:8000` steps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
All four Ceph matrix jobs time out at "Wait for Ceph S3 Server" (exit
124): radosgw's civetweb frontend never binds localhost:8080 within the
poll window. The same `docker run` reproduces cleanly on a local host in
~90s, so the fault is specific to the GitHub runner environment — yet CI
captures no evidence from the ceph container itself, only the postgres
service logs.

Add a `Ceph diagnostics` step (if: always()) that dumps `docker ps -a`,
the host interfaces / /proc/net/dev (what NETWORK_AUTO_DETECT=4 ranks),
the resolved ceph.conf (mon host / public network), the in-container
listening ports, and `docker logs ceph`. Drop `--rm` from the ceph
`docker run` so a crashed container survives for inspection, and shorten
the readiness poll 600s -> 180s to speed up the evidence-gathering loop.

This commit gathers root-cause evidence; it is not expected to make the
job pass. The `--rm` removal is reverted once the real fix lands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
Root cause of the failing Ceph jobs, confirmed from the diagnostics
step: the ceph image's NETWORK_AUTO_DETECT chooses the highest-traffic
interface from /proc/net/dev. Under `docker run --network host` on the
GitHub runner that is the Azure accelerated-networking VF (enP31395s1),
which carries the most traffic but has no IPv4 address. get_ip/get_network
therefore return empty, the mon bootstrap aborts with

  ERROR- it looks like we have not been able to discover the network settings

and the container exits 1 before radosgw ever binds civetweb on 8080 —
so "Wait for Ceph S3 Server" timed out (exit 124). It reproduced only in
CI because a typical dev host has a single addressed NIC, leaving
auto-detect nothing wrong to pick.

Set NETWORK_AUTO_DETECT=0 and derive MON_IP / CEPH_PUBLIC_NETWORK at
runtime from the default-route interface (eth0), which is the NIC that
actually has an IPv4 address. Verified locally end-to-end: radosgw binds
8080 in ~15s and ceph.conf gets the real routable mon host / public
network. Loopback (127.0.0.1/8) was tried and rejected by ceph-mon
("unable to find any IP address in networks").

Also switch the Ceph diagnostics step to `if: failure()` so it stays out
of the way on green runs but still captures container logs, resolved
ceph.conf and host interfaces automatically on any future regression.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
The krb5 extension is the only one in the list that must be compiled
(via KRB5_LINUX_LIBS: libkrb5-dev), and its build intermittently fails
with "Could not install krb5 on PHP 8.3.32", flaking the whole job at the
Setup PHP step. This app has no kerberos dependency (info.xml declares
only php >= 8.3; nothing in lib/ or tests/ uses krb5/smbclient-kerberos),
so it should not pay for an extension it never loads.

Remove krb5 from the base extension set and add an optional
`additional-php-extensions` input so callers that genuinely need it can
opt in (`additional-php-extensions: krb5`). The base set still covers the
extensions every app relies on. KRB5_LINUX_LIBS is kept so opting back in
still resolves the build dependency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
@phil-davis

Copy link
Copy Markdown
Contributor

Rebased to get fresh CI with the latest code.

@phil-davis phil-davis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will next make a reusable-workflows PR to add this to there, then a PR here to use the reusable-workflow code.

@phil-davis
phil-davis merged commit 9225626 into master Jul 21, 2026
19 checks passed
@phil-davis
phil-davis deleted the ci/php-unit-ceph branch July 21, 2026 03:44
@phil-davis

phil-davis commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

See owncloud/reusable-workflows#83 and #718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants