Skip to content

CI: make integration containers ephemeral (drop volumes) + log container output on boot timeout#73

Merged
erseco merged 2 commits into
mainfrom
fix-moodle-5.1-boot
Jul 7, 2026
Merged

CI: make integration containers ephemeral (drop volumes) + log container output on boot timeout#73
erseco merged 2 commits into
mainfrom
fix-moodle-5.1-boot

Conversation

@erseco

@erseco erseco commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

Two small CI-infrastructure improvements to the Docker-backed integration setup. Note: this does not by itself fix the Moodle 5.1 boot failure — that is a moosh-vs-Moodle-5.1 bug in the erseco/alpine-moodle image, fixed separately in erseco/alpine-moodle#149. What this PR adds is the on-timeout container-log dump that made that root cause diagnosable, plus ephemeral-CI cleanup.

Linked issue

Closes #72

Changes

  • docker-compose.yml: drop the moodlehtml and moodledata named volumes. A CI integration container is created, tested, and destroyed in a single run (no restarts), so persisting the code tree or data directory across restarts provides no benefit; the image is self-contained and manages both paths on its own writable layer within the run. This also removes the slow first-boot image→volume copy of the (larger, on 5.1) /var/www/html tree. A single CI run's correctness is unchanged. Local dev keeps working (code from image; data no longer persisted across docker compose down, which is fine for a disposable test instance).
  • Makefile (upd): dump the last 80 lines of the moodle container log on readiness timeout, so a boot failure is diagnosable from the CI log instead of an opaque "did not become ready". This is exactly what surfaced the moosh/5.1 root cause.

Root cause of the 5.1 timeout (for context; fixed in the image PR)

The erseco/alpine-moodle 5.1 image never starts nginx within the window: Moodle 5.1 moved version.php into public/, so moosh (pointed at /var/www/html) can't bootstrap and every moosh command in POST_CONFIGURE_COMMANDS fails; the non-zero exit crash-loops the container. Fixed in erseco/alpine-moodle#149.

Test plan

Infra-only (docker-compose + Makefile); no unit surface. Verified: docker-compose.yml is valid YAML with volumes: [postgres] only and no stray moodledata/moodlehtml refs; make -n upd parses. The 4.5.5 and 5.0.1 legs still boot and run the suite (confirmed on earlier runs of this branch: 48–49 tests ran; remaining errors are the separately-tracked login race and the #63 context bug).

Backwards compatibility

No application/library/CLI change. Local dev unaffected except that a disposable test instance no longer persists data across docker compose down.

erseco added 2 commits July 7, 2026 23:46
…eout

The Moodle 5.1.x integration leg (added in #62) consistently timed out on
container boot ('Moodle did not become ready in time'), never running any
tests, while 4.5.5/5.0.1 boot fine.

Root cause: since Moodle 5.1 the web root moved to /var/www/html/public and
the erseco/alpine-moodle entrypoint now runs 'composer install' at startup,
making first boot much heavier. Combined with the empty moodlehtml named
volume mounted at /var/www/html, Docker must copy that now-larger tree
(public/ + composer vendor/) into the volume on first boot before the app is
usable, exceeding even the 10-minute readiness window.

- Drop the moodlehtml:/var/www/html volume. A CI container runs once (no
  restart), so persisting the code tree across restarts gives no benefit and
  the image is self-contained; removing it eliminates the slow first-boot
  image->volume copy. moodledata (uploads/sessions) is kept, so a single CI
  run's correctness is unchanged.
- Dump the last 80 lines of the moodle container log on readiness timeout so
  future boot failures are diagnosable instead of opaque.

Closes #72.
A CI integration container is created, tested, and destroyed in a single
run, so no named volume is needed for the Moodle data directory any more
than for the code tree. The image manages /var/www/moodledata on its own
writable layer within the run. Removing it leaves the moodle service
volume-less, so nothing is persisted across the (nonexistent) restarts.

Note: this does not by itself fix the Moodle 5.1 boot failure, which is a
moosh-vs-5.1 issue in the erseco/alpine-moodle image (fixed separately);
these are ephemeral-CI cleanups plus the on-timeout container-log dump
that made that root cause diagnosable.
@erseco erseco changed the title Fix Moodle 5.1+ CI container boot (drop moodlehtml volume; log on timeout) CI: make integration containers ephemeral (drop volumes) + log container output on boot timeout Jul 7, 2026
@erseco erseco merged commit 4333222 into main Jul 7, 2026
29 of 33 checks passed
@erseco erseco deleted the fix-moodle-5.1-boot branch July 7, 2026 23:36
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.

Moodle 5.1+ integration container fails to boot in CI (public/ dir + composer install + moodlehtml volume copy)

1 participant