Skip to content

chore(tekton): enable hermetic builds with dependency prefetching - #91

Draft
yalzhang wants to merge 2 commits into
confidential-clusters:mainfrom
yalzhang:update_pipefile
Draft

chore(tekton): enable hermetic builds with dependency prefetching#91
yalzhang wants to merge 2 commits into
confidential-clusters:mainfrom
yalzhang:update_pipefile

Conversation

@yalzhang

@yalzhang yalzhang commented Feb 15, 2026

Copy link
Copy Markdown
Contributor

Enable hermetic builds across all Tekton pipelines and fix build
failures by vendoring git dependencies and pre-building build tools.

Problem:
Hermetic builds isolate the network during container builds, breaking:

  1. Makefile's 'go install' commands for build tools (controller-gen, yq)
  2. Cargo's git dependency fetching for compute-pcrs-lib from GitHub
  3. Manual 'git clone' for reference-values repository
    All of these require network access which is unavailable in hermetic mode.

Solution:

  1. Add compute-pcrs and reference-values as git submodules at specific
    commits for reproducible builds
  2. COPY submodules into build directory and patch Cargo.toml to use
    local path dependencies instead of git URLs
  3. Pre-build Go tools using 'go build' (not 'go install') with dynamic
    version detection from go.mod
  4. Pre-build Rust tools (kopium) from prefetched dependencies
  5. Use 'cargo metadata --frozen --offline' to prevent network access
    during dependency resolution

Changes:

  • Add git submodules:
    • compute-pcrs (commit 1e7b9f74) - provides compute-pcrs-lib for all components
    • reference-values (commit e296603) - provides reference values for compute-pcrs
  • Update all component Containerfiles:
    • COPY git submodules into build directory
    • Patch Cargo.toml to replace git URLs with local paths
    • Pre-build controller-gen and yq using 'go build' (not 'go install')
    • Pre-build kopium using 'cargo install' from prefetched deps
    • Use 'cargo metadata --frozen --offline' to avoid network access
    • Remove manual 'git clone' commands
  • Enable hermetic mode in all Tekton pipeline configurations
  • Configure dependency prefetching for gomod and cargo
  • Enable source image building for supply chain traceability

Affects components:

  • attestation-key-register
  • compute-pcrs
  • confidential-cluster-operator (operator)
  • registration-server

@yalzhang

Copy link
Copy Markdown
Contributor Author

/rerun

@yalzhang

Copy link
Copy Markdown
Contributor Author

/retest

@yalzhang

Copy link
Copy Markdown
Contributor Author

The pipeline run fail because of a version mismatch:

@yalzhang

Copy link
Copy Markdown
Contributor Author

/retest

@yalzhang
yalzhang force-pushed the update_pipefile branch 3 times, most recently from be088db to 94e1342 Compare February 25, 2026 13:24
@yalzhang

Copy link
Copy Markdown
Contributor Author

/retest

@yalzhang
yalzhang force-pushed the update_pipefile branch 5 times, most recently from 7e815ab to 84c74b0 Compare February 26, 2026 02:36
Enable hermetic builds across all Tekton pipelines and fix build
failures by vendoring git dependencies and pre-building build tools.

Problem:
Hermetic builds isolate the network during container builds, breaking:
1. Makefile's 'go install' commands for build tools (controller-gen, yq)
2. Cargo's git dependency fetching for compute-pcrs-lib from GitHub
3. Manual 'git clone' for reference-values repository
All of these require network access which is unavailable in hermetic mode.

Solution:
1. Add compute-pcrs and reference-values as git submodules at specific
   commits for reproducible builds
2. COPY submodules into build directory and patch Cargo.toml to use
   local path dependencies instead of git URLs
3. Pre-build Go tools using 'go build' (not 'go install') with dynamic
   version detection from go.mod
4. Pre-build Rust tools (kopium) from prefetched dependencies
5. Use 'cargo metadata --frozen --offline' to prevent network access
   during dependency resolution

Changes:
- Add git submodules:
  - compute-pcrs (commit 1e7b9f74) - provides compute-pcrs-lib for all components
  - reference-values (commit e296603) - provides reference values for compute-pcrs
- Update all component Containerfiles:
  - COPY git submodules into build directory
  - Patch Cargo.toml to replace git URLs with local paths
  - Pre-build controller-gen and yq using 'go build' (not 'go install')
  - Pre-build kopium using 'cargo install' from prefetched deps
  - Use 'cargo metadata --frozen --offline' to avoid network access
  - Remove manual 'git clone' commands
- Enable hermetic mode in all Tekton pipeline configurations
- Configure dependency prefetching for gomod and cargo
- Enable source image building for supply chain traceability

Affects components:
- attestation-key-register
- compute-pcrs
- confidential-cluster-operator (operator)
- registration-server

Signed-off-by: Yalan Zhang <yalzhang@redhat.com>
…hermetic builds

Add clevis-pin-trustee as git submodule at commit 75015a58 and vendor it
for hermetic builds. This resolves network access failures during builds
when Cargo attempts to fetch the dependency from GitHub.

Changes:
- Add clevis-pin-trustee git submodule at 75015a580a738fe153b5592e16e920a7595c90c6
- Copy clevis-pin-trustee into build containers (operator, registration-server, attestation-key-register)
- Patch Cargo.toml to use local path for clevis-pin-trustee-lib instead of git URL
- Pre-set KOPIUM_VERSION environment variable from Cargo.lock before calling make
  - Prevents Makefile from evaluating its default KOPIUM_VERSION definition
  - Makefile's default uses 'cargo metadata' which requires network access to crates.io index
  - Extracted value automatically stays in sync with locked version in Cargo.lock

This enables all four components (operator, registration-server,
attestation-key-register, compute-pcrs) to build successfully in hermetic
mode without network access.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Yalan Zhang <yalzhang@redhat.com>
@yalzhang
yalzhang marked this pull request as draft February 26, 2026 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant