Skip to content

ostree-ext: Point ostree container commit users at bootc container lint - #8

Closed
cgwalters-bot wants to merge 2 commits into
mainfrom
bot/ostree-container-commit-noop
Closed

cgwalters-bot wants to merge 2 commits into
mainfrom
bot/ostree-container-commit-noop

Conversation

@cgwalters-bot

@cgwalters-bot cgwalters-bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

People keep putting RUN ... && ostree container commit in their Containerfiles because older docs told them to, while bootc container lint is now the supported way to check a bootc image. Making the command a no-op would silently change what ends up in existing images (it empties /run, /tmp, /var/tmp and /var/cache), so this keeps its behavior as is. It now prints a prominent deprecation note on stderr pointing at bootc container lint, then pauses 5 seconds so the note stands out in build logs.

Related: bootc-dev#2396

Testing

On a 16-core RHEL 10 devspace, branch head 7cb98ec (on main 41049cc):

  • just validate passed.
  • just unit-tests passed: 444 tests, including the new commit::tests::container_commit_notice, which checks the note's text (the sleep lives outside the tested function, so the suite doesn't wait).
  • just build built the image (bootc-202609252226.g7cb98ecb5d). I copied its /usr/bin/bootc onto quay.io/centos-bootc/centos-bootc:stream10 and ran ostree container commit in a RUN step that first writes files to /var/cache, /var/tmp and /tmp. The note was printed, the command took 5s, and the files were removed as before. The same step on the stock image took 0s, printed nothing and removed the files too.

Generated-by: https://github.com/cgwalters/#llms


Review draft in cgwalters-forge, not upstream yet. This section is removed when the PR is opened upstream.

  • Upstream: bootc-dev/bootc, base main
  • Board item: PVTI_lAHOAQ_SPs4Bj2Gizg8Phvc
  • Fork CI: off; the devspace testing described above is this PR's CI, and upstream CI runs once it is opened there

To review:

  • Approve, or comment /promote on a line of its own, to open it upstream, ready for review. Either covers only the commits pushed so far.
  • If upstream requires DCO, approving also signs off: promote adds Signed-off-by: Colin Walters <[email protected]> to the commits lacking it (the bot's and yours; anyone else's only if you ask), with you as committer.
  • Add a /draft line (in the same comment or before) to open it upstream as a draft (/ready undoes that).
  • Close to drop it.
  • Edit the title and description freely: they become the upstream PR's. Review comments are squashed into the commits they concern, with a reply here.

Comment thread crates/ostree-ext/src/commit.rs Outdated
const CONTAINER_COMMIT_NOOP_MSG: &str = "note: `ostree container commit` is no longer needed and \
can be removed from container builds. It no longer cleans /run, /tmp, /var/tmp or /var/cache; \
use `dnf clean all` or `RUN --mount=type=cache,target=/var/cache/...` to keep images \
small, and `bootc container lint` to check the image.";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No we can't do that I was wrong, let's keep our current semantics BUT add a loud note (with a short e.g. 5s sleep) that bootc container lint is the new interface.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done in 7cb98ec: ostree container commit keeps its current behavior (still requires an ostree container and empties /run, /tmp, /var/tmp and /var/cache), but first prints a boxed note on stderr that it is deprecated in favor of bootc container lint, then sleeps 5s. The unit test checks the note's text and doesn't sleep. On a devspace, a derived centos-bootc:stream10 build with this bootc showed the note, took 5s and still cleaned those directories. Title, body and commit message are updated; I changed Closes: #2396 to Related: since that issue asks for a no-op.

Generated-by: https://github.com/cgwalters/#llms

The integration test jobs consume the RPMs built by the package job
in the same workflow run. With a 1 day retention, re-running a flaked
test job on a PR that has been sitting for more than a day fails with
"Artifact not found for name: packages-<os>", and the only way out is
re-running the whole workflow, including rebuilding the packages.

The tradeoff is storage: each packages-<os> artifact is about 8MB, and
at recent volume (~10-25 runs a day, 5-6 OSes) a week of them is a few
GB at steady state rather than a few hundred MB. That's still small
next to the tmt-log artifacts each run uploads with the default
90 day retention (tens of MB each, dozens per run), and artifact storage
isn't billed for public repositories anyway. We could go longer if
a week turns out not to be enough.

Related: bootc-dev#2177
Generated-by: AI
Signed-off-by: Colin Walters <[email protected]>
@cgwalters-bot
cgwalters-bot force-pushed the bot/ostree-container-commit-noop branch from 78bd310 to 7cb98ec Compare September 25, 2026 23:00
@cgwalters-bot cgwalters-bot changed the title ostree-ext: Make ostree container commit a no-op ostree-ext: Point ostree container commit users at bootc container lint Sep 25, 2026
… lint`

People keep carrying `RUN ... && ostree container commit` in their
Containerfiles because older docs told them to, while `bootc container
lint` is now the supported way to check a bootc image. We can't just
drop or neuter the command: existing builds rely on it emptying /run,
/tmp, /var/tmp and /var/cache, and changing that would silently grow
images or leak build-time files into layers.

So keep its behavior, but print a prominent note on stderr that it is
deprecated in favor of `bootc container lint`, and pause for 5 seconds
so the note stands out in build logs rather than scrolling by.

Related: bootc-dev#2396
Generated-by: AI
Signed-off-by: Colin Walters <[email protected]>
@cgwalters-bot
cgwalters-bot force-pushed the bot/ostree-container-commit-noop branch from 7cb98ec to e0710c4 Compare September 26, 2026 00:49
@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

Signed off 1 commit(s) with Signed-off-by: Colin Walters <[email protected]> for bootc-dev/bootc's DCO check, on cgwalters's approval #8 (review) of 7cb98ecb5d3f. Same trees; the head is now 42dfeb6f174b.

@cgwalters-bot
cgwalters-bot force-pushed the bot/ostree-container-commit-noop branch from e0710c4 to 42dfeb6 Compare September 26, 2026 00:49
@cgwalters-bot

Copy link
Copy Markdown
Collaborator Author

Opened upstream as bootc-dev#2504. Closing this review draft.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants