4.4 KiB
4.4 KiB
pdftract-68pe: pdftract-docker-build WorkflowTemplate
Summary
The pdftract-docker-build WorkflowTemplate was already implemented. This bead enhanced it with SLSA provenance attestation and added the missing ghcr-registry ExternalSecret.
Changes Made
1. SLSA Provenance Attestation Enhancement (commit df031e2)
Enhanced the sign-image template with SLSA provenance attestation:
- Added
cosign atteststep to attach SLSA provenance to each signed image - Builder ID:
https://iad-ci.ardenone.com/argo-workflows/pdftract-docker-build - Build type:
https://images.sigstore.dev/argo-build@v1 - Materials include git commit SHA for supply chain traceability
- Invocation parameters include variant, tag, and version
- Provenance metadata includes build timestamp, completeness info, and reproducibility flag
2. Cosign Verification Improvements
- Added
--certificate-identity-regexpparameter to verify step - Added
--certificate-oidc-issuerparameter to verify step - Added
COSIGN_CERTIFICATE_IDENTITYenv var:https://iad-ci-oidc.ardenone.com.*
3. GHCR Registry ExternalSecret (k8s/iad-ci/argo-workflows/ghcr-registry-externalsecret.yml)
Created an ExternalSecret that:
- Fetches the GitHub PAT from OpenBao (
rs-manager/iad-ci/github/pat-pdftract) - Formats it as a
kubernetes.io/dockerconfigjsonsecret for GHCR authentication - Syncs to
argo-workflowsnamespace asghcr-registrysecret - Uses the same GitHub PAT as repo access (requires
read:packages+write:packagesscopes)
4. WorkflowTemplate Structure
The pdftract-docker-build.yaml (14,270 bytes after enhancement) includes:
- 3 image variants:
latest(default features),ocr(default + OCR),full(all features) - Multi-arch build: linux/amd64 + linux/arm64 via
docker buildxwith QEMU emulation - GHCR push: Pushes to
ghcr.io/jedarden/pdftractwith versioned (X.Y.Z) and floating (latest,ocr,full) tags - Cosign keyless signing: Uses OIDC from iad-ci cluster (
https://iad-ci-oidc.ardenone.com) - Dockerfile support: The pdftract repo has a Dockerfile that accepts
FEATURESbuild arg - Parallel builds: All 3 variants build in parallel via DAG tasks
- Idempotent: Re-running on the same tag overwrites existing tags
Acceptance Criteria Status
- PASS: WorkflowTemplate file exists at
k8s/iad-ci/argo-workflows/pdftract-docker-build.yaml - PASS: 3 image variants (latest, ocr, full) defined
- PASS: Multi-arch build (amd64 + arm64) using docker buildx
- PASS: GHCR push configuration (
ghcr.io/jedarden/pdftract) - PASS: Cosign keyless signing with OIDC from iad-ci cluster
- PASS: SLSA provenance attestation via
cosign attest - PASS: GHCR registry secret created (
ghcr-registry-externalsecret.yml) - WARN: Test run not performed (requires actual tag push to trigger)
- WARN:
cosign verifynot tested (requires signed images in GHCR) - PASS: Re-running workflow on same tag is idempotent (uses
--pushwhich overwrites)
Infrastructure Dependencies
- OpenBao Secret:
rs-manager/iad-ci/github/pat-pdftract(GitHub PAT with packages scope) - OIDC Issuer:
https://iad-ci-oidc.ardenone.com(registered with Sigstore for keyless signing) - ArgoCD Application:
applications-iad-cisyncsk8s/iad-ci/argo-workflows/to iad-ci cluster - ServiceAccount:
argo-workflowwith OIDC token projection for cosign signing
Image Specifications
| Variant | Features | Base Image | Size (est.) | Tags |
|---|---|---|---|---|
latest |
default | gcr.io/distroless/cc-debian12 |
~20 MB | :X.Y.Z, :latest |
ocr |
default + OCR | debian:bookworm-slim |
~120 MB | :ocr-X.Y.Z, :ocr |
full |
all | debian:bookworm-slim |
~140 MB | :full-X.Y.Z, :full |
Workflow Invocation
The workflow is invoked from pdftract-release-cascade on milestone tag push.
Notes
- The Dockerfile in pdftract repo supports
FEATURES=default|ocr|fullbuild arg - QEMU emulation for arm64 is slow (~3x amd64), so
activeDeadlineSeconds: 2400(40 min) is set - Cosign signatures are stored in
ghcr.io/jedarden/pdftract-signaturesrepository - License files (MIT/Apache) are copied to
/usr/share/doc/pdftract/in all images
Bead Closure
The workflow template was already complete. This bead added the missing GHCR ExternalSecret to enable Docker pushes to GitHub Container Registry.