CI: make integration containers ephemeral (drop volumes) + log container output on boot timeout#73
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-moodleimage, 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 themoodlehtmlandmoodledatanamed 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/htmltree. A single CI run's correctness is unchanged. Local dev keeps working (code from image; data no longer persisted acrossdocker compose down, which is fine for a disposable test instance).Makefile(upd): dump the last 80 lines of themoodlecontainer 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-moodle5.1 image never starts nginx within the window: Moodle 5.1 movedversion.phpintopublic/, somoosh(pointed at/var/www/html) can't bootstrap and every moosh command inPOST_CONFIGURE_COMMANDSfails; 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.ymlis valid YAML withvolumes: [postgres]only and no straymoodledata/moodlehtmlrefs;make -n updparses. 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.