Repository navigation
test(e2e): verify the published combined image per architecture - #488
Conversation
Add a combined-image job to TEST - E2E. With ImageVolume unusable and the default imageMode=auto, it deploys a DocumentDB pinned to the chart's documentDbVersion and asserts that the operator runs the published documentdb-combined:18-<version> image without image volumes, that the node pulled the variant for its own architecture (node arch, crictl image spec and uname -m in the postgres container), that the extension is at the expected version, and that Mongo wire-protocol reads and writes work. Rows cover both detection paths: Kubernetes 1.33.7 with the ImageVolume gate off on amd64 and arm64, and kindest/node:v1.32.0 (containerd 1.7) on amd64. The assertions live in .github/scripts/assert-combined-image.sh. Co-authored-by: Copilot <[email protected]> Copilot-Session: 6c85cd4b-f086-46f7-8823-7e63c33e4de7 Signed-off-by: Rayhan Hossain <[email protected]>
Build the combined image from the checkout's Dockerfile_combined in test-build-and-package (new build-combined job, opt-in through the build_combined input that TEST - E2E sets). Build mode uses the source-built .deb; registry mode downloads the pinned postgresql-18-documentdb from PGDG. The image is uploaded as its own per-arch artifact, so only the combined-image job downloads it, and the job uses continue-on-error so a failure there does not skip every E2E job. The combined-image E2E matrix now covers both image sources: - published: amd64 and arm64, k8s v1.33.7 with the ImageVolume gate off - PR-built: amd64 on kindest/node:v1.32.0 (containerd 1.7) and arm64 on k8s v1.33.7 with the gate off For PR-built rows the DocumentDB uses the CI documentdb image, whose tag the operator reuses for the combined image loaded into kind. The assertion script now fails fast when the CNPG Cluster or pod is missing. Co-authored-by: Copilot <[email protected]> Copilot-Session: 6c85cd4b-f086-46f7-8823-7e63c33e4de7 Signed-off-by: Rayhan Hossain <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
CI filters skip combined Dockerfile or assertion-only changes, while RC handling can select stable packages instead of RC binaries and incorrectly reject healthy combined-image deployments.
3 open issues
What changed in this PR
Adds end-to-end coverage for the operator’s combined-image fallback when Kubernetes ImageVolume is unavailable, testing both published images and images built from the PR.
Changes:
- Adds amd64 and arm64 scenarios covering disabled ImageVolume gates and containerd 1.7.
- Adds optional combined-image builds and assertions for image selection, architecture, extension version, and Mongo access.
- Updates the design documentation to describe the new coverage.
| File | Description |
|---|---|
docs/designs/combined-image-fallback.md |
Documents published and PR-built combined-image testing. |
.github/workflows/test-e2e.yml |
Adds the combined-image test matrix and failure diagnostics. |
.github/workflows/test-build-and-package.yml |
Builds and uploads optional combined-image artifacts per architecture. |
.github/scripts/assert-combined-image.sh |
Checks image layout, architecture, extension version, and Mongo operations. |
Review effort: Balanced
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (ci, docs); effort from diff stats (435+3 LOC, 4 files); LLM: Adds multi-architecture E2E CI coverage for the combined-image fallback path across new workflow jobs, a shell assertion script, and updated docs — touching multiple CI files and a design doc. If a label is wrong, remove it manually and ping |
- Use source-built packages for RC combined images: probe-images exposes the resolver's package_source; build-packages also runs in registry mode when build_combined is set and the version is an RC (package_source=source), and build-combined uses those packages instead of searching PGDG, which has no RC packages. - Run TEST - E2E on PRs that change Dockerfile_combined, the combined-image assertion script, or the version resolver. - Derive the expected pg_extension version from resolve-documentdb-version.sh (documentdb_version_dash) after stripping the CI run suffix, so RC tags such as 1.0-RC2 and 1.0-rc2-test-123 resolve to 1.0-0. Co-authored-by: Copilot <[email protected]> Copilot-Session: 6c85cd4b-f086-46f7-8823-7e63c33e4de7 Signed-off-by: Rayhan Hossain <[email protected]>
WentingWu666666
left a comment
There was a problem hiding this comment.
Approving to unblock this coverage improvement. Please track combined-mode binary/schema upgrade E2E coverage, including data preservation, as a follow-up.
|
xgerman
left a comment
There was a problem hiding this comment.
Reviewed commit 1e7218f. No actionable correctness or duplication issues found. The earlier path-filter, RC package-source, and RC extension-version findings are addressed. Verified shell syntax and the stable/RC version-normalization cases; all four combined-image CI rows passed, including the PR-built amd64/containerd 1.7 row whose logs confirm the expected image, architecture, and Mongo read/write assertions. Combined-mode upgrade/data-preservation coverage is already tracked in #489.
Co-authored-by: Copilot <[email protected]> Copilot-Session: 6c85cd4b-f086-46f7-8823-7e63c33e4de7 Signed-off-by: Rayhan Hossain <[email protected]>

Summary
Adds CI coverage for the combined-image fallback (#487). When Kubernetes ImageVolume is unusable, the default
imageMode: automust run PostgreSQL from the combined image, and each node must run the variant for its own architecture. The newcombined-imagejob tests both the published image and the image built from this PR'sDockerfile_combined, so changes to the Dockerfile are tested before anything is published.Changes
test-build-and-package.yml: newbuild-combinedjob (amd64 and arm64).documentdb-combinedfrom.github/dockerfiles/Dockerfile_combined..deb.postgresql-18-documentdb(<version-dash>-*) from PGDGtrixie-pgdg.…/documentdb-combined:18-<ext tag>-<arch>) and uploads it asbuild-docker-documentdb-combined-<arch>. It's kept out of the consolidated platform artifact that every E2E job downloads.build_combinedinput (defaultfalse; only TEST - E2E sets it), solonghaul-smokeis unaffected.continue-on-error: a failure here (for example a PGDG outage) fails only the PR-built rows instead of skipping every E2E job.test-e2e.yml: setsbuild_combined: trueand adds thecombined-imagejob..github/scripts/assert-combined-image.sh: the assertions, which fail fast if the CNPG Cluster or pod is missing.docs/designs/combined-image-fallback.md: the Testing section describes the job, and the CI follow-up is removed.Matrix
ubuntu-22.04ubuntu-22.04-armubuntu-22.04ubuntu-22.04-armspec.documentDBVersionto the chart'sdocumentDbVersion, so the node pulls the released multi-archdocumentdb-combined:18-<version>from GHCR. The job first checks that the image is published forlinux/<arch>. Pinning is needed because CI tags database images per run (<version>-test-<run_id>), and no combined image exists for those tags.spec.image.documentDBto the CI documentdb image. The operator reuses that tag for the combined image, so it resolves to the loaded one.What each row asserts
documentdb.io/image-modeiscombined; the CNPGspec.imageName, thepostgrescontainer image andstatus.documentDBImageare the expected combined image.crictl inspection the kind node reports that architecture for the pulled image, anduname -min thepostgrescontainer agrees.documentdbextension is at the expected version (X.Y.Z→X.Y-Z).Testing
actionlintreports no new findings (the remaining ones intest-build-and-package.ymlalready exist on main), andshellcheckis clean.run:blocks extracted from the workflow files:build-combined(registry mode): downloadspostgresql-18-documentdb=1.0-0-1.pgdg13+1and buildsdocumentdb-combined:18-1.0.0-test-local-arm64. This run caught a missingDOCUMENTDB_GATEWAY_IMAGE_REPOenv, now fixed.ImageVolume=false. The operator selected combined mode and ran the PR-built image; all assertions passed (arm64 via crictl anduname -m, extension1.0-0, Mongo OK).documentdb-combined:18-1.0.0arm64 variant; all assertions passed.amd64on the arm64 cluster fails the three architecture checks and exits with code 1. A missing cluster or pod fails fast.Prerequisites
documentdb-combined:18-1.0.0is published and public on GHCR for linux/amd64 and linux/arm64. It's signed bybuild_documentdb_images.yml@refs/heads/main, digestsha256:d5c35ed9….