-
Notifications
You must be signed in to change notification settings - Fork 188
feat: make rpm-ostree use oci-dir + rootless CI #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+17
−15
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,3 +3,4 @@ _build_* | |
| output | ||
| _build-*/** | ||
| *_chunkah_* | ||
| *_rpm-ostree_* | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,28 +168,29 @@ ostree-rechunk $target_image=image_name $tag=default_tag: | |
|
|
||
| set -xeuo pipefail | ||
|
|
||
| # TODO: This is the only blocker for rootless CI | ||
| # https://github.com/coreos/rpm-ostree/issues/5346 | ||
| if [[ ! "${UID}" -eq "0" ]]; then | ||
| echo "This needs to run as root." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Use the already-built local image to avoid pulling from a remote registry | ||
| RPM_OSTREE_CHUNKER_IMAGE="localhost/${target_image}:${tag}" | ||
|
|
||
| RPM_OSTREE_OUTPUT_DIR="$(mktemp -d ./"${target_image}"_rpm-ostree_XXXXXX)" | ||
|
|
||
| trap 'rm -rf "${RPM_OSTREE_OUTPUT_DIR}"' EXIT | ||
|
|
||
| podman run --rm \ | ||
| --pull=never \ | ||
| --mount=type=image,src="${target_image}:${tag}",target=/rpm-ostree \ | ||
| --privileged \ | ||
| -v "/var/lib/containers:/var/lib/containers" \ | ||
| -v "${RPM_OSTREE_OUTPUT_DIR}:/run/out:Z" \ | ||
| --entrypoint /usr/bin/rpm-ostree \ | ||
| "${RPM_OSTREE_CHUNKER_IMAGE}" \ | ||
| compose build-chunked-oci \ | ||
| --max-layers 127 \ | ||
| --format-version=2 \ | ||
| --bootc \ | ||
| --from "localhost/${target_image}:${tag}" \ | ||
| --output containers-storage:"localhost/${target_image}:${tag}" | ||
| --rootfs /rpm-ostree \ | ||
| --output oci-archive:/run/out/"${target_image}.oci" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| CHUNKED_IMAGE="$(podman pull oci-archive:"${RPM_OSTREE_OUTPUT_DIR}/${target_image}.oci")" | ||
| podman tag "${CHUNKED_IMAGE}" "${target_image}:${tag}" | ||
|
|
||
| # Generate Default Tag | ||
| [group('Utility')] | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
There was a problem hiding this comment.
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.