Skip to content

Containerfile: trail FROM builder - #344

Merged
Jakob-Naucke merged 1 commit into
trusted-execution-clusters:mainfrom
Jakob-Naucke:from-builder
Aug 20, 2026
Merged

Containerfile: trail FROM builder#344
Jakob-Naucke merged 1 commit into
trusted-execution-clusters:mainfrom
Jakob-Naucke:from-builder

Conversation

@Jakob-Naucke

@Jakob-Naucke Jakob-Naucke commented Aug 20, 2026

Copy link
Copy Markdown
Member

Allow environments without --target support, which only read the last stage, to read from the builder stage

To reviewers: I f.d up a little in #318 when I said we could set the build_args in OpenShift CI -- that's only for container build args (like BUILD_TYPE), and targets do not appear to be supported. The proposed change that would consume this is openshift/release#83720. If you think that's mighty ugly, I'm not aware of an option besides reverting or setting up a registry for the job to use by itself 😕

Summary by Sourcery

Enhancements:

  • Add a configurable final Containerfile stage so build environments that cannot select a target can still choose which image stage to produce.

@sourcery-ai

sourcery-ai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the Containerfile so that environments which only consume the last stage of a multi-stage build (and don’t support --target) will now get the artifacts from the existing builder stage instead of the final compute-pcrs stage.

File-Level Changes

Change Details Files
Ensure the final stage of the Containerfile is the existing builder stage so non---target environments consume builder outputs.
  • Appended a comment documenting the reason for changing the final stage.
  • Added a trailing FROM instruction that references the builder stage, making it the last stage of the multi-stage build.
Containerfile

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Since CI now depends on the builder stage being the final one, consider adding a brief comment near the builder stage definition explaining that it is consumed as the last stage in target-less environments to prevent future refactors from unintentionally breaking this behavior.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since CI now depends on the `builder` stage being the final one, consider adding a brief comment near the `builder` stage definition explaining that it is consumed as the last stage in target-less environments to prevent future refactors from unintentionally breaking this behavior.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@yairpod

yairpod commented Aug 20, 2026

Copy link
Copy Markdown
Member

@Jakob-Naucke
Alternative suggestion:
Instead of adding:
FROM builder
as the final step and having the build instructions copied to the openShift CI via 83720
We can add the build:
ARG BUILD_TARGET=operator
And:
FROM ${BUILD_TARGET} AS final

Then if you add --build-arg BUILD_TARGET=compute-pcrs it will build the compute-pcrs container.

P.S.
This will have the additional side-effect of making the default make target the operator and not the compute-pcrs.

Allow environments without --target support, which only read the last
stage, to read from the specified stage

Signed-off-by: Jakob Naucke <jnaucke@redhat.com>
@Jakob-Naucke

Copy link
Copy Markdown
Member Author

@yairpod oh neat, that is cleaner. In that case I even think we should be able to go without duplicating the RV clone logic

@yairpod

yairpod commented Aug 20, 2026

Copy link
Copy Markdown
Member

@yairpod oh neat, that is cleaner. In that case I even think we should be able to go without duplicating the RV clone logic

Yes, no duplication should be needed, just :

  - build_args:
    - name: build_type
      value: release
    - name: build_target
      value: operator
    dockerfile_path: Containerfile
    to: operator
  - build_args:
    - name: build_type
      value: release
    - name: build_target
      value: compute-pcrs
    dockerfile_path: Containerfile
    to: compute-pcrs
  - build_args:
    - name: build_type
      value: release
    - name: build_target
      value: register-server
    dockerfile_path: Containerfile
    to: register-server
  - build_args:
    - name: build_type
      value: release
    - name: build_target
      value: attestation-key-register
    dockerfile_path: Containerfile
    to: attestation-key-register

@openshift-ci

openshift-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown

@Jakob-Naucke: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/azure-images 513c171 link true /test azure-images
ci/prow/azure-integration-test 513c171 link false /test azure-integration-test

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@yairpod yairpod left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@openshift-ci

openshift-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Jakob-Naucke, yairpod

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Jakob-Naucke
Jakob-Naucke merged commit 54653ee into trusted-execution-clusters:main Aug 20, 2026
12 of 15 checks passed
@Jakob-Naucke
Jakob-Naucke deleted the from-builder branch August 20, 2026 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants