Generalize focal PG core build to a parameterized PG13-17 pipeline#1185
Draft
kemalbuyukkaya wants to merge 9 commits into
Draft
Generalize focal PG core build to a parameterized PG13-17 pipeline#1185kemalbuyukkaya wants to merge 9 commits into
kemalbuyukkaya wants to merge 9 commits into
Conversation
PGDG dropped PostgreSQL 16 binaries for Ubuntu 20.04 (focal) after focal reached EOL standard support (last official focal build: 16.9-1.pgdg20.04+1). This adds a standalone, signed pipeline that rebuilds newer 16.x core packages for focal. Approach (validated locally; produces the full 13-package set that installs and runs on stock focal with working JIT): - Combine the newer upstream orig.tar.bz2 with the focal-era debian/ packaging (16.9-1.pgdg20.04+1), whose default toolchain (clang/llvm-dev = LLVM 10) yields focal-native dependencies (libicu66, libssl1.1, libldap-2.4-2, libllvm10) instead of the clang-19/llvm-19 required by newer packaging. - Restore the removed focal-pgdg build tooling (debhelper 13, dh-exec, postgresql-common-dev) from apt-archive.postgresql.org. - Drop the obsolete hurd-iovec patch (merged upstream as of 16.14) and gate on the full quilt series applying cleanly so future drift fails loudly. - Sign with the existing debsigner image (debsigs --sign=maint), using the pg-azure-storage signing secrets (PGAZ_PACKAGE_SECRET_KEY / PGAZ_PACKAGE_PASSPHRASE), matching build-pgazure-nightlies.yml. The minor version is parameterized: set PG_UPSTREAM_VERSION (workflow input pg_upstream_version) to build e.g. 16.15; the orig/debian checksums are auto-resolved from the official .dsc unless pinned. Files: - dockerfiles/pg16-focal-builder/Dockerfile: focal builder image - scripts/build_pg16_focal: fetch/verify/assemble/build entrypoint - .github/workflows/build-pg16-focal.yml: build -> sign -> verify -> upload
The packaging signing secrets in this repo (incl. PGAZ_PACKAGE_SECRET_KEY) are
stored as raw ASCII-armored keys, not base64. import_and_sign assumed base64 and
ran `base64 -d` first, which fails on armored input ("base64: invalid input" ->
"no valid OpenPGP data found" -> "secret key not available").
Detect the format: import ASCII-armored keys directly, otherwise base64-decode
as before (backward compatible). Also verify a PRIVATE key was actually imported
and exit non-zero with an actionable message if only a public key is present, so
debsigs never silently emits unsigned packages.
Validated in the xenial debsigner image: armored private key -> signs
(_gpgmaint added); base64 key -> signs; armored public-only key -> exits 78.
build-package.yml and build-package-test.yml trigger on every branch (branches: "**") and run the Citus extension build plus test_build_packages, which is unrelated to the PostgreSQL-core focal pipeline and fails here on a pre-existing PACKAGING_PASSPHRASE mismatch. Exclude pg16-focal via branches-ignore so it no longer blocks this work; workflow_dispatch stays.
Roll back the earlier workarounds now that signing uses the prebuilt citusdata/packaging:debsigner image: - dockerfiles/debsigner/scripts/import_and_sign: back to upstream (we no longer build our own signer, so the armored-key handling is unnecessary). - build-package.yml / build-package-test.yml: restore branches: "**" (drop the pg16-focal branches-ignore guard) to avoid touching shared extension CI. These three files now match develop; only the PostgreSQL-core focal pipeline remains in this branch.
The signer images are maintained out-of-band (not built by this repo's image pipeline), so the deployed citusdata/packaging:debsigner has drifted from dockerfiles/debsigner. Building our own signer from that source could not import the same signing key that signs every other Citus package, while the deployed image does (pg-azure-storage nightlies are green with PGAZ_PACKAGE_SECRET_KEY). Use the prebuilt citusdata/packaging:debsigner with a Docker Hub login and pipe the passphrase via stdin + env, mirroring citus_package.sign_packages. Pin the job to ubuntu-20.04 to match the green pg-azure-storage signing pipeline.
Revert the ubuntu-20.04 pin to ubuntu-latest to stay future-proof as GitHub retires the hosted ubuntu-20.04 image. Signing uses the prebuilt citusdata/packaging:debsigner image (same as all-citus, which signs fine on ubuntu-latest), so the runner version is not the relevant factor.
PGAZ_PACKAGE_SECRET_KEY is only referenced on the pg-azure-storage branches and did not import in our run. Switch to the common signing secrets used across the other pipelines (PACKAGING_SECRET_KEY / PACKAGING_PASSPHRASE) to match the standard convention.
Replace the PG16-only focal pipeline with a single parameterized one keyed on PG_MAJOR, covering every focal-buildable major (PG 13, 14, 15, 16, 17). PGDG dropped focal binaries once focal reached EOL; these are the majors that still receive new upstream minors beyond their last focal build. - scripts/build_pg16_focal -> scripts/build_pg_focal: add PG_MAJOR; auto- resolve the latest minor per major from the live pool (PG_UPSTREAM_VERSION override stays); static frozen DEBIAN_BASE map per major (focal is EOL, so these never change) with a PG_DEBIAN_BASE override; replace the hardcoded hurd-iovec drop with a declarative PG_DROP_PATCHES list (default hurd-iovec, a no-op where absent) so future drift is a one-line, no-code change. The quilt-series gate stays as the fail-loud safety net. - dockerfiles/pg16-focal-builder -> dockerfiles/focal-pg-builder: one generic builder image (focal-pgdg main 13 14 15 16 17); built once, reused per major. - build-pg16-focal.yml -> build-pg-focal.yml: a setup job computes the matrix (single major via workflow_dispatch, or all 13-17), build-and-sign matrixes over majors with fail-fast: false; sign/verify/upload are unchanged but namespaced per major. Trigger on the pg-focal branch. Validated end-to-end for all five majors (full 13-package set each, depending on focal-native libllvm10/libssl1.1, hurd-iovec dropped only on 16/17): 13.23, 14.23, 15.18, 16.14, 17.10.
The debsigner entrypoint signs exactly "/packages/*/*.deb" (one directory
level deep) and, with no nullglob, passes the unexpanded literal to debsigs
when nothing matches -> "File /packages/*/*.deb does not exist".
The build writes to packages/focal/pg<major>/, so mounting ${PWD}/packages
left the debs one level too deep (/packages/focal/pg<major>/*.deb) and the
glob matched nothing. Mount ${PWD}/packages/focal instead, so the signer
sees /packages/pg<major>/*.deb. Verified against citusdata/packaging:debsigner.
|
@kemalbuyukkaya please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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.
What
Generalizes the PG16-only focal pipeline (#1182) into a single parameterized pipeline keyed on
PG_MAJOR, covering every focal-buildable major: PostgreSQL 13, 14, 15, 16, 17.PGDG stopped shipping Ubuntu 20.04 (focal) binaries once focal reached EOL standard support. These five majors are the ones that still receive new upstream minors beyond their last focal build, so rebuilding them gives focal users newer minors with a working, focal-native JIT.
How
scripts/build_pg16_focal→scripts/build_pg_focalPG_MAJORinput (13|14|15|16|17).PG_UPSTREAM_VERSIONnow auto-resolves to the latest minor for the major from the live PGDG pool (still pinnable) — no edit needed on a new minor release.DEBIAN_BASEcomes from a static, frozen per-major map (focal is EOL, so the last focal packaging never changes), overridable viaPG_DEBIAN_BASE.hurd-iovecdrop is replaced by a declarativePG_DROP_PATCHESlist (defaulthurd-iovec, a no-op where absent); future patch drift becomes a one-line, no-code change. The quilt-series gate stays as the fail-loud safety net.dockerfiles/pg16-focal-builder/→dockerfiles/focal-pg-builder/— one generic builder image (focal-pgdg main 13 14 15 16 17), built once and reused per major..github/workflows/build-pg16-focal.yml→.github/workflows/build-pg-focal.yml— asetupjob computes the matrix (a single major viaworkflow_dispatch, or all of 13–17 by default);build-and-signmatrixes over majors withfail-fast: false. Signing/verify/upload are unchanged but namespaced per major. Triggers on thepg-focalbranch.Validation
Built end-to-end for all five majors (real compiles on focal). Each produced the full 13-package set, depending on focal-native
libllvm10/libssl1.1(working JIT);hurd-iovecdropped only on 16/17:65
.debs total; each server package contains thepostgresbinary. The signing step is unchanged from #1182 and only runs in CI (needs the deployedcitusdata/packaging:debsignerimage +PACKAGING_SECRET_KEY/PACKAGING_PASSPHRASE).Notes
pg16-focalso the generalization is a traceable diff;pg16-focalcan be deleted once this is accepted.Supersedes #1182.