Skip to content
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

cli: Add a new bootc image subcommand #620

Merged
merged 3 commits into from
Jun 28, 2024

Conversation

cgwalters
Copy link
Collaborator

We have a basic bootc image list but more interesting is
bootc image push which defaults to copying the booted
image into the container storage.

Signed-off-by: Colin Walters [email protected]

@github-actions github-actions bot added the area/install Issues related to `bootc install` label Jun 20, 2024
@cgwalters
Copy link
Collaborator Author

$ bootc image list
docker://<your image here>
$ bootc image push
...
$ podman run --rm -ti localhost/bootc bash
# Now we're in the booted host as a container

This is aimed to close the biggest gap in https://containers.github.io/bootc/booting-local-builds.html - because then we can easily add something like bootc switch --local which would default to pulling from localhost/bootc in the container storage, closing the loop.

This builds on ostreedev/ostree-rs-ext#642 which has notes about its inefficiencies.

@cgwalters
Copy link
Collaborator Author

OK yes, this PR also hit the install flake (I added it to #579 )

Creating root filesystem (xfs) on device /dev/loop0p1 (size=1M)
> mkfs.xfs -m uuid=790e772b-c617-47dc-af23-04ca799c8aad -L root /dev/loop0p1
size 256 of data subvolume is too small, minimum 4096 blocks

With the new size printing we can clearly see that the partition size is just 1M. I'm going to add some more logging to see if I can figure out more here.

@cgwalters
Copy link
Collaborator Author

OK this one now has a test based on the framework added in #625

@cgwalters cgwalters force-pushed the container-push branch 2 times, most recently from 5c5b02a to b777459 Compare June 24, 2024 20:53
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

I´d love to see docs (no blocker) and like to bikeshed a bit on the naming of push. It feels more like a write-to-storage or something down these lines.

lib/src/cli.rs Outdated Show resolved Hide resolved
@cgwalters cgwalters force-pushed the container-push branch 2 times, most recently from 92d9568 to f1c8355 Compare June 26, 2024 16:37
@cgwalters cgwalters marked this pull request as ready for review June 26, 2024 16:37
@cgwalters
Copy link
Collaborator Author

I´d love to see docs (no blocker)

I've updated that, though note that right now this is hidden from the CLI as an experimental feature so we can use it in our own CI, and stabilize things later.

and like to bikeshed a bit on the naming of push. It feels more like a write-to-storage or something down these lines.

The default is indeed like copy-to-storage or so, but the functionality is more general than that in that we support e.g. bootc image push --target quay.io/exampleos/someimage:latest.

That said...it would actually simplify things perhaps if we only supported bootc image copy-to-storage <tag> because one can then of course directly use podman for them.

There's also the longer term bikeshed topic of (assuming we made it actually efficient and not a physical copy) if the default should actually be to keep the bootc image visible in containers-storage or so.

@vrothberg
Copy link
Member

That said...it would actually simplify things perhaps if we only supported bootc image copy-to-storage <tag> because one can then of course directly use podman for them.

Agreed, that sounds like a good idea 👍

@cgwalters cgwalters force-pushed the container-push branch 2 times, most recently from cee62b0 to e252383 Compare June 27, 2024 15:15
@cgwalters
Copy link
Collaborator Author

OK it's now called bootc image copy-to-storage and I dropped the --transport option, so it only supports containers-storage:.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM thank you!

We have a basic `bootc image list` but more interesting is
`bootc image push` which defaults to copying the booted
image into the container storage.

Signed-off-by: Colin Walters <[email protected]>
We might as well roll in a bunch of things into this
"local container build changes" test.

I wanted to get some coverage for kargs, so this adds
some.

Signed-off-by: Colin Walters <[email protected]>
Drop the transport support; we only support copying to
`containers-storage`. Anyone who wants to push directly
to a remote registry can do so by first copying to
containers-storage and then pushing via e.g. `podman` or `skopeo`.

Signed-off-by: Colin Walters <[email protected]>
@cgwalters
Copy link
Collaborator Author

I dropped the conflicting logging change to kargs from here for now, will split it out separately.

@cgwalters cgwalters merged commit 71b87ba into containers:main Jun 28, 2024
16 of 19 checks passed
cgwalters pushed a commit to cgwalters/bootc that referenced this pull request Nov 5, 2024
…-1.0.80

build(deps): bump anyhow from 1.0.79 to 1.0.80
cgwalters added a commit to cgwalters/bootc that referenced this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/install Issues related to `bootc install`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants