Skip to content

feat: make rpm-ostree use oci-dir + rootless CI - #261

Merged
renner0e merged 3 commits into
ublue-os:mainfrom
renner0e:rpm-ostree-chunked-dir
Aug 14, 2026
Merged

feat: make rpm-ostree use oci-dir + rootless CI#261
renner0e merged 3 commits into
ublue-os:mainfrom
renner0e:rpm-ostree-chunked-dir

Conversation

@renner0e

Copy link
Copy Markdown
Member

This is a way to use rpm-ostree inside a container without root
privileges during the build.

Fixes: #260

This is a way to use rpm-ostree inside a container without root
privileges during the build.

Fixes: ublue-os#260
@renner0e

renner0e commented Aug 13, 2026

Copy link
Copy Markdown
Member Author

with this PR
2m 45s for build
10m 19s for rechunk (I'm guessing this might be a coincidence)

with this PR + oci-archive
11m 24s for rechunk

before

5m 20s for build
11m 52s for rechunk

@renner0e
renner0e requested review from bsherman, ledif and m2Giles August 13, 2026 19:33
@renner0e
renner0e marked this pull request as ready for review August 13, 2026 19:34
This is created now when rechunking with rpm-ostree. We always clean it
up but users may want to inspect it, it should never be committed.
@renner0e

Copy link
Copy Markdown
Member Author

We especially want rooless CI in the future because ubuntu 26.04 uses sudo-rs where the -E flag doesn't behave the same

sudo: preserving the entire environment is not supported, '-E' is ignored

@m2Giles

m2Giles commented Aug 13, 2026

Copy link
Copy Markdown
Member

We can output to oci-archive which makes uploading as an artifact a bit nicer (and podman/skopeo can directly consume)

This would add some time likely to the output.

But I very much like going down this path to avoid using sudo -E

@renner0e

Copy link
Copy Markdown
Member Author

We can output to oci-archive which makes uploading as an artifact a bit nicer (and podman/skopeo can directly consume)
This would add some time likely to the output.

I don't really have a strong opinion about it

Comment thread Justfile
--from "localhost/${target_image}:${tag}" \
--output containers-storage:"localhost/${target_image}:${tag}"
--rootfs /rpm-ostree \
--output oci-archive:/run/out/"${target_image}.oci"

@renner0e renner0e Aug 13, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

with the oci-archive I get this now sometimes when running it locally and yeah it definitely takes longer than oci-dir

Copying config 8aebf9f31a done   |
Writing manifest to image destination
+ CHUNKED_IMAGE=8aebf9f31ac8f7ebc95270507de2edf6ed1fb44ffbde7e2c4a5dc656725e2fb2
+ podman tag 8aebf9f31ac8f7ebc95270507de2edf6ed1fb44ffbde7e2c4a5dc656725e2fb2 image-template:latest
+ rm -rf ./image-template_rpm-ostree_OvEZzt
error: interrupted by SIGINT

m2 likes this for direct uploads via workflow artifacts
@renner0e
renner0e force-pushed the rpm-ostree-chunked-dir branch from 06c1924 to cd98ea3 Compare August 13, 2026 21:30

@bsherman bsherman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I didn't measure any timings, but I did run this locally doing a just build and a just ostree-rechunk (and a just rechunk for giggles).

Seems to work well.

@renner0e
renner0e merged commit 3430fb6 into ublue-os:main Aug 14, 2026
1 check passed
@renner0e
renner0e deleted the rpm-ostree-chunked-dir branch August 14, 2026 14:25
Comment thread Justfile
--pull=never \
--mount=type=image,src="${target_image}:${tag}",target=/rpm-ostree \
--privileged \
-v "/var/lib/containers:/var/lib/containers" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Out of curiosity could this line just have been -v "~/.local/share/containers/storage:/var/lib/containers" \ and then we wouldnt have to mess around with the oci archive?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no, I would have preferred it this way actually IF IT WORKED, try what happens if you use ~/.local/share/containers/storage in any capacity

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You are actually able to specify a driver to make container storage work. See MDev-Linux@ecf2b3b

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

huh, really good to know that you can actually make this work, was this documented somewhere?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

https://github.com/containers/image/blob/main/docs/containers-transports.5.md Would you like me to open a PR for that?

If it faster then I think it might me worth looking at, it doesn't matter super much anyway, although we would be losing out on the potential of pushing the oci archive as a workflow artifact (without additional steps)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm thinking it may be better to do it in a later step, because it seems wastefull to compress the image into an archive and then decompress it back to container storage just to push it to the registry. CHUNKED_IMAGE="$(podman pull oci-archive:"${RPM_OSTREE_OUTPUT_DIR}/${target_image}.oci")"
Ill open a PR here shortly.

Xarianne added a commit to Xarianne/bluewhale that referenced this pull request Aug 16, 2026
renner0e added a commit that referenced this pull request Aug 18, 2026
Improves build performace on #261 by writing the image layers directly to the
host container store instead of compressing to an OCI archive then
decompressing before pushing to the registry.

Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
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.

Build Performance Regression After #218

4 participants