Skip to content

test(e2e): verify the published combined image per architecture - #488

Merged
hossain-rayhan merged 3 commits into
documentdb:mainfrom
hossain-rayhan:rayhan/e2e-combined-image
Nov 2, 2026
Merged

hossain-rayhan merged 3 commits into
documentdb:mainfrom
hossain-rayhan:rayhan/e2e-combined-image

Conversation

@hossain-rayhan

@hossain-rayhan hossain-rayhan commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds CI coverage for the combined-image fallback (#487). When Kubernetes ImageVolume is unusable, the default imageMode: auto must run PostgreSQL from the combined image, and each node must run the variant for its own architecture. The new combined-image job tests both the published image and the image built from this PR's Dockerfile_combined, so changes to the Dockerfile are tested before anything is published.

Changes

  • test-build-and-package.yml: new build-combined job (amd64 and arm64).
    • Builds documentdb-combined from .github/dockerfiles/Dockerfile_combined.
      • Build mode uses the source-built .deb.
      • Registry mode downloads the pinned postgresql-18-documentdb (<version-dash>-*) from PGDG trixie-pgdg.
    • Tags the image with the name the operator resolves for the CI documentdb image (…/documentdb-combined:18-<ext tag>-<arch>) and uploads it as build-docker-documentdb-combined-<arch>. It's kept out of the consolidated platform artifact that every E2E job downloads.
    • Opt-in through the new build_combined input (default false; only TEST - E2E sets it), so longhaul-smoke is 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: sets build_combined: true and adds the combined-image job.
  • .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

Image source Arch Runner Kubernetes Runtime ImageVolume gate Detection path
published amd64 ubuntu-22.04 v1.33.7 containerd 2.x off API probe
published arm64 ubuntu-22.04-arm v1.33.7 containerd 2.x off API probe
PR-built amd64 ubuntu-22.04 v1.32.0 containerd 1.7.24 n/a node runtime check
PR-built arm64 ubuntu-22.04-arm v1.33.7 containerd 2.x off API probe
  • Published rows: pin spec.documentDBVersion to the chart's documentDbVersion, so the node pulls the released multi-arch documentdb-combined:18-<version> from GHCR. The job first checks that the image is published for linux/<arch>. Pinning is needed because CI tags database images per run (<version>-test-<run_id>), and no combined image exists for those tags.
  • PR-built rows: load the PR-built image into kind and set spec.image.documentDB to the CI documentdb image. The operator reuses that tag for the combined image, so it resolves to the loaded one.

What each row asserts

  • CNPG documentdb.io/image-mode is combined; the CNPG spec.imageName, the postgres container image and status.documentDBImage are the expected combined image.
  • There are no extension image volumes on the CNPG Cluster or the pod.
  • Architecture: the node arch matches the row, crictl inspecti on the kind node reports that architecture for the pulled image, and uname -m in the postgres container agrees.
  • The documentdb extension is at the expected version (X.Y.Z → X.Y-Z).
  • A Mongo wire-protocol write, index and read through the gateway succeeds.

Testing

  • Lint: actionlint reports no new findings (the remaining ones in test-build-and-package.yml already exist on main), and shellcheck is clean.
  • Local runs on arm64, executing the run: blocks extracted from the workflow files:
    • build-combined (registry mode): downloads postgresql-18-documentdb=1.0-0-1.pgdg13+1 and builds documentdb-combined:18-1.0.0-test-local-arm64. This run caught a missing DOCUMENTDB_GATEWAY_IMAGE_REPO env, now fixed.
    • PR-built row: kind 1.33.4 with ImageVolume=false. The operator selected combined mode and ran the PR-built image; all assertions passed (arm64 via crictl and uname -m, extension 1.0-0, Mongo OK).
    • Published row: pulled the published documentdb-combined:18-1.0.0 arm64 variant; all assertions passed.
    • Negative check: expecting amd64 on the arm64 cluster fails the three architecture checks and exits with code 1. A missing cluster or pod fails fast.
  • CI: the amd64 rows (including containerd 1.7) and the source-build path run for the first time in this PR's CI.

Prerequisites

documentdb-combined:18-1.0.0 is published and public on GHCR for linux/amd64 and linux/arm64. It's signed by build_documentdb_images.yml@refs/heads/main, digest sha256:d5c35ed9….

hossain-rayhan and others added 2 commits October 30, 2026 15:00
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]>
Copilot AI balanced review requested due to automatic review settings November 2, 2026 16:39

Copilot AI 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.

🟡 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

Comment thread .github/workflows/test-e2e.yml Resolved
Comment thread .github/workflows/test-e2e.yml Resolved
@documentdb-triage-tool documentdb-triage-tool Bot added CI/CD documentation Improvements or additions to documentation enhancement New feature or request labels Nov 2, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: CI/CD, documentation, enhancement
Project fields suggested: Component ci · Priority P2 · Effort M · Status Needs Review
Confidence: 0.88 (mixed)

Reasoning

component 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 @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

- 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 WentingWu666666 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving to unblock this coverage improvement. Please track combined-mode binary/schema upgrade E2E coverage, including data preservation, as a follow-up.

@hossain-rayhan

Copy link
Copy Markdown
Collaborator Author

Approving to unblock this coverage improvement. Please track combined-mode binary/schema upgrade E2E coverage, including data preservation, as a follow-up.

#489

@xgerman xgerman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@hossain-rayhan
hossain-rayhan merged commit 7951db3 into documentdb:main Nov 2, 2026
102 of 104 checks passed
hossain-rayhan added a commit to hossain-rayhan/documentdb-kubernetes-operator that referenced this pull request Nov 2, 2026
Co-authored-by: Copilot <[email protected]>
Copilot-Session: 6c85cd4b-f086-46f7-8823-7e63c33e4de7
Signed-off-by: Rayhan Hossain <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants