Add GHCR-seeded PostgreSQL images and wire CI matrix jobs to consume deterministic pgseed tags#164
Closed
Copilot wants to merge 10 commits into
Closed
Add GHCR-seeded PostgreSQL images and wire CI matrix jobs to consume deterministic pgseed tags#164Copilot wants to merge 10 commits into
Copilot wants to merge 10 commits into
Conversation
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/b7b4fd6b-0316-4721-93ca-0239a76241bc Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/b7b4fd6b-0316-4721-93ca-0239a76241bc Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/b7b4fd6b-0316-4721-93ca-0239a76241bc Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add seeded PostgreSQL images for faster CI
Add GHCR-seeded PostgreSQL images and wire CI matrix jobs to consume deterministic pgseed tags
May 7, 2026
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/cd506e69-d033-44d0-86c8-7e3c931bba7a Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/cd506e69-d033-44d0-86c8-7e3c931bba7a Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/cd506e69-d033-44d0-86c8-7e3c931bba7a Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/cd506e69-d033-44d0-86c8-7e3c931bba7a Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/cd506e69-d033-44d0-86c8-7e3c931bba7a Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Agent-Logs-Url: https://github.com/catalyst/catalyst-moodle-workflows/sessions/cd506e69-d033-44d0-86c8-7e3c931bba7a Co-authored-by: brendanheywood <187449+brendanheywood@users.noreply.github.com>
Contributor
|
This has been re-done in #166 |
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.
util.php --restoreusage from CI phpunit flowOriginal prompt
Create a PR in
catalyst/catalyst-moodle-workflows(base branchmain) implementing Option A: build and publish seeded PostgreSQL images to GHCR and use them in CI.Context:
services.postgres.image: postgres:${{ matrix.pgsql-ver }}in.github/workflows/ci.ymlfor phpunit and behat jobs.Requirements:
Add a new GitHub Actions workflow (e.g.
.github/workflows/build-pgseed.yml) that builds and pushes seeded Postgres images to GHCR..github/actions/matrix/matrix_includes.yml(similar to.github/workflows/build-dockerfiles.yml).ghcr.io/catalyst/...with deterministic tag(s).latesttag per tuple.docker/login-action@v3withGITHUB_TOKENand set job permissions to allow pushing packages.Create the Docker build context necessary for the seeded image.
docker/pgseed/(or similar) that produce a Postgres image with the seeded DB.Update
.github/workflows/ci.ymlto use the seeded Postgres image for jobs that currently use Postgres service.services.postgres.imageshould reference the seeded image tag computed from the matrix fields including the 10-digit moodle minor version.Update matrix generation if needed to pass through the moodle minor version and/or pg seed image reference.
parse-versionaction/script) to output the minor version and include it in phpunit/behat matrices.Add documentation:
Deliverables:
Repository details:
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: what is the fastest way to restore a database into a specific shape to make github or gitlab ci faster
Assistant: The fastest way is to stop restoring full backups on every CI run and instead start each job from a pre-shaped database snapshot/image (or a template DB) that already contains the schema + baseline data you need. Then apply only a tiny delta (migrations for that commit, or a small fixture set). Which mechanism is “fastest” depends on your database engine:
Best options (fastest → slower)
1) Use a pre-baked DB image/snapshot (CI pulls it)
When it’s fastest: integration tests need realistic data and you can keep a “golden” dataset.
pg_basebackup/pg_dumpartifact and restore from local cache.Key trick: have a scheduled pipeline (nightly or on-demand) that regenerates this snapshot when baseline data changes, and publish it to your registry/object storage.
2) Postgres: use a TEMPLATE database +
CREATE DATABASE … TEMPLATE …Often the best “pure Postgres” solution if your tests can share a server per job.
template_cionce (schema + baseline fixtures).CREATE DATABASE test_db TEMPLATE template_ci;Constraints:
3) Copy-on-write storage snapshots (ZFS/LVM/EBS) if you control runners
If you run **self-hosted ru...
This pull request was created from Copilot chat.