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

Implement the bootc provision plugin #3161

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ckyrouac
Copy link

@ckyrouac ckyrouac commented Aug 21, 2024

This creates a new provision plugin that is built on top of the existing TestCloud (virtual) plugin. It adds new parameters to pass a Containerfile or container image. The plugin will then build a container image (if necessary) then build a bootc disk image from the container image using bootc image builder. Currently, bootc requires podman to be run as root when building a disk image. This is typically handled by running a podman machine as root.

An additional parameter "add-deps" toggles building a derived container image with the tmt test requirements.

Resolves #3013

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • modify the json schema
  • mention the version
  • include a release note

This is a work in progress. I'm opening this PR early to get feedback on the high level design. I will add tests, docs, etc. after we solidify the higher level design.

If you want to try running the code here is an example fmf plan:

provision:
  how: bootc
  containerimage: quay.io/centos-bootc/centos-bootc:stream9
  disk: 20
summary: Testing bootc plugin
execute:
  how: tmt
  script: |
    echo "ok"

@ckyrouac ckyrouac marked this pull request as draft August 21, 2024 20:16
@ckyrouac
Copy link
Author

@cgwalters fyi

Copy link
Contributor

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

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

Mostly a skim (I don't know the tmt codebase either) but looks sane to me!

tmt/steps/provision/bootc.py Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
@happz
Copy link
Collaborator

happz commented Aug 22, 2024

  • LGTM, I like the reuse of existing plugins, that's very nice.
  • Would it also make sense to support the container plugin? IIUIC, the image produced by podman can be run both with podman run, or, converted to qcow2, as a VM. I could imagine both ways being available to use, maybe through some runtime-plugin: container|virtual switch. Is it a bad idea?
  • I will have more low-level comments related to the actual implementation, but I won't bother you now till you receive the high-level review. Just ping when you're ready for the boring stuff :)

Copy link
Collaborator

@martinhoyer martinhoyer left a comment

Choose a reason for hiding this comment

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

I'm still trying to speedrun reading/learning all things bootc (and tmt provisioning plugins), but fwiw, looks cool to me.

@happz about the container plugin support - Fedora docs says:

for fully-fledged tests it is not recommended to run a bootable container via, for instance, podman-run. One reason among others is that the filesystem is writable when being executed as an OCI container while most of the filesystem is mounted read-only on a deployed bootc system. That means the running container behaves differently than a deployed system. Yet, if you desire to run some quick tests it is recommended to run the container in detached mode.

From what I understand, podman-bootc could be pretty cool to use, once available.

@happz
Copy link
Collaborator

happz commented Aug 22, 2024

I'm still trying to speedrun reading/learning all things bootc (and tmt provisioning plugins), but fwiw, looks cool to me.

@happz about the container plugin support - Fedora docs says:

for fully-fledged tests it is not recommended to run a bootable container via, for instance, podman-run. One reason among others is that the filesystem is writable when being executed as an OCI container while most of the filesystem is mounted read-only on a deployed bootc system. That means the running container behaves differently than a deployed system. Yet, if you desire to run some quick tests it is recommended to run the container in detached mode.

From what I understand, podman-bootc could be pretty cool to use, once available.

I agree, it's not a perfect 1:1 substitution, but, exactly: for quick tests or basic test development, it may give me results faster than VM. I for one work on binutils and C/C++ toolchain in general, and my area of focus is fairly simple - compile this, run objdump on that, grep for expected section names, this kind of stuff. Learning about a typo in my reproducer quickly is very valuable, and once I'm done, I can always use full VM. I do it today already: I develop tests with container, then I switch to beaker or 1minutetip to get a more real environment before committing the new test to git. So, podman-run, for my trivial component, would be very welcome, even with caveats like the one you mentioned :)

@martinhoyer
Copy link
Collaborator

I agree, it's not a perfect 1:1 substitution, but, exactly: for quick tests or basic test development, it may give me results faster than VM. I for one work on binutils and C/C++ toolchain in general, and my area of focus is fairly simple - compile this, run objdump on that, grep for expected section names, this kind of stuff. Learning about a typo in my reproducer quickly is very valuable, and once I'm done, I can always use full VM. I do it today already: I develop tests with container, then I switch to beaker or 1minutetip to get a more real environment before committing the new test to git. So, podman-run, for my trivial component, would be very welcome, even with caveats like the one you mentioned :)

Thank you for the insight in your development process. I hope I can see it in more detail one day.

@ckyrouac
Copy link
Author

Would it also make sense to support the container plugin? IIUIC, the image produced by podman can be run both with podman run, or, converted to qcow2, as a VM. I could imagine both ways being available to use, maybe through some runtime-plugin: container|virtual switch. Is it a bad idea?

I think the existing container plugin will handle this case without any additional code. The bootc image is just another container that can be run like a typical image.

Copy link
Collaborator

@lukaszachy lukaszachy left a comment

Choose a reason for hiding this comment

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

--add-deps doesn't install require/recommend yet, right?

Either way, we have chicken&egg problem in the case 'dist-git-source' is used as the list of packages is known after provision :/ But IMO we can ignore that for now to have something working.

@ckyrouac ckyrouac force-pushed the bootc-provision branch 2 times, most recently from e3058f9 to 44ff728 Compare September 10, 2024 14:00
@ckyrouac ckyrouac marked this pull request as ready for review September 10, 2024 14:00
@ckyrouac
Copy link
Author

@happz This is ready for a review. I added some docs, tests, and code to cleanup the container images.

tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
@ckyrouac
Copy link
Author

@happz thanks for the review! I believe I addressed all your suggestions.

ckyrouac added a commit to ckyrouac/bootc that referenced this pull request Sep 17, 2024
Prep for LBI install tests.
This is temporary until the plugin is released upstream by tmt.

teemtee/tmt#3161

Signed-off-by: Chris Kyrouac <[email protected]>
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
tmt/steps/provision/bootc.py Outdated Show resolved Hide resolved
@happz happz added the step | provision Stuff related to the provision step label Sep 18, 2024
@happz happz added this to the 1.37 milestone Sep 18, 2024
This creates a new provision plugin that is built on top of the existing
TestCloud (virtual) plugin. It adds new parameters to pass a
Containerfile or container image. The plugin will then build a container
image (if necessary) then build a bootc disk image from the container
image using bootc image builder. Currently, bootc requires podman to be
run as root when building a disk image. This is typically handled by
running a podman machine as root.

An additional parameter "add-deps" toggles building a derived container
image with the tmt test requirements.

Signed-off-by: Chris Kyrouac <[email protected]>
@martinhoyer
Copy link
Collaborator

@happz let's rebase and run the pipeline here?

@thrix thrix modified the milestones: 1.37, 1.38 Oct 1, 2024
@thrix thrix added the priority | must high priority, must be included in the next release label Oct 1, 2024
@thrix
Copy link
Collaborator

thrix commented Oct 1, 2024

We agreed to focus on getting this in 1.38, the due date for finishing is 24th October.

@ckyrouac
Copy link
Author

ckyrouac commented Oct 4, 2024

thanks for looking at this and planning for 1.38. Is there anything I can do to help move it along?

@psss psss changed the title plugins: Add bootc provision plugin Implement the bootc provision plugin Oct 15, 2024
@thrix
Copy link
Collaborator

thrix commented Oct 21, 2024

thanks for looking at this and planning for 1.38. Is there anything I can do to help move it along?

@ckyrouac not really, the team is overhelmed with reviews.

I am getting validation errors, I assume the jsonschema needs an update for the new provision plugin:

❯ pwd
/var/home/mvadkert/git/github.com/teemtee/tmt/tests/provision/bootc/data

❯ tmt lint
    warn: /containerfile_includes_deps:provision - {'how': 'bootc', 'add-deps': False, 'containerfile': '$TMT_BOOTC_CONTAINERFILE_RUNDIR/includes_deps.containerfile', 'containerfile-workdir': '.', 'disk': 20} is not valid under any of the given schemas
    warn: /containerfile_needs_deps:provision - {'how': 'bootc', 'add-deps': True, 'containerfile': '$TMT_BOOTC_CONTAINERFILE_RUNDIR/needs_deps.containerfile', 'containerfile-workdir': '.', 'disk': 20} is not valid under any of the given schemas
    warn: /image_includes_deps:provision - {'how': 'bootc', 'add-deps': False, 'containerimage': 'localhost/tmt-bootc-includes-deps', 'disk': 20} is not valid under any of the given schemas
    warn: /image_needs_deps:provision - {'how': 'bootc', 'add-deps': True, 'containerimage': 'localhost/tmt-bootc-needs-deps', 'disk': 20} is not valid under any of the given schemas
/containerfile_includes_deps
warn C000 key "add-deps" not recognized by schema /schemas/provision/container
warn C000 key "containerfile" not recognized by schema /schemas/provision/container
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/container
warn C000 key "disk" not recognized by schema /schemas/provision/container
warn C000 value of "how" is not "container"
warn C000 key "add-deps" not recognized by schema /schemas/provision/mrack
warn C000 key "containerfile" not recognized by schema /schemas/provision/mrack
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/mrack
warn C000 key "disk" not recognized by schema /schemas/provision/mrack
warn C000 value of "how" is not "beaker"
warn C000 key "add-deps" not recognized by schema /schemas/provision/virtual
warn C000 key "containerfile" not recognized by schema /schemas/provision/virtual
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/virtual
warn C000 value of "how" is not "virtual"
warn C000 key "add-deps" not recognized by schema /schemas/provision/artemis
warn C000 key "containerfile" not recognized by schema /schemas/provision/artemis
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/artemis
warn C000 key "disk" not recognized by schema /schemas/provision/artemis
warn C000 value of "how" is not "artemis"
warn C000 key "add-deps" not recognized by schema /schemas/provision/minute
warn C000 key "containerfile" not recognized by schema /schemas/provision/minute
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/minute
warn C000 key "disk" not recognized by schema /schemas/provision/minute
warn C000 value of "how" is not "minute"
warn C000 key "add-deps" not recognized by schema /schemas/provision/connect
warn C000 key "containerfile" not recognized by schema /schemas/provision/connect
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/connect
warn C000 key "disk" not recognized by schema /schemas/provision/connect
warn C000 value of "how" is not "connect"
warn C000 key "add-deps" not recognized by schema /schemas/provision/local
warn C000 key "containerfile" not recognized by schema /schemas/provision/local
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/local
warn C000 key "disk" not recognized by schema /schemas/provision/local
warn C000 value of "how" is not "local"
warn C000 fmf node failed schema validation
warn C001 summary key is missing
pass P001 correct keys are used
pass P002 execute step defined with "how"
pass P003 execute step methods are all known
pass P004 discover step methods are all known
skip P005 no remote fmf ids defined
pass P006 phases have unique names
pass P007 execute phase 'default-0' does not require specific guest

/containerfile_needs_deps
warn C000 key "add-deps" not recognized by schema /schemas/provision/container
warn C000 key "containerfile" not recognized by schema /schemas/provision/container
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/container
warn C000 key "disk" not recognized by schema /schemas/provision/container
warn C000 value of "how" is not "container"
warn C000 key "add-deps" not recognized by schema /schemas/provision/mrack
warn C000 key "containerfile" not recognized by schema /schemas/provision/mrack
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/mrack
warn C000 key "disk" not recognized by schema /schemas/provision/mrack
warn C000 value of "how" is not "beaker"
warn C000 key "add-deps" not recognized by schema /schemas/provision/virtual
warn C000 key "containerfile" not recognized by schema /schemas/provision/virtual
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/virtual
warn C000 value of "how" is not "virtual"
warn C000 key "add-deps" not recognized by schema /schemas/provision/artemis
warn C000 key "containerfile" not recognized by schema /schemas/provision/artemis
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/artemis
warn C000 key "disk" not recognized by schema /schemas/provision/artemis
warn C000 value of "how" is not "artemis"
warn C000 key "add-deps" not recognized by schema /schemas/provision/minute
warn C000 key "containerfile" not recognized by schema /schemas/provision/minute
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/minute
warn C000 key "disk" not recognized by schema /schemas/provision/minute
warn C000 value of "how" is not "minute"
warn C000 key "add-deps" not recognized by schema /schemas/provision/connect
warn C000 key "containerfile" not recognized by schema /schemas/provision/connect
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/connect
warn C000 key "disk" not recognized by schema /schemas/provision/connect
warn C000 value of "how" is not "connect"
warn C000 key "add-deps" not recognized by schema /schemas/provision/local
warn C000 key "containerfile" not recognized by schema /schemas/provision/local
warn C000 key "containerfile-workdir" not recognized by schema /schemas/provision/local
warn C000 key "disk" not recognized by schema /schemas/provision/local
warn C000 value of "how" is not "local"
warn C000 fmf node failed schema validation
warn C001 summary key is missing
pass P001 correct keys are used
pass P002 execute step defined with "how"
pass P003 execute step methods are all known
pass P004 discover step methods are all known
skip P005 no remote fmf ids defined
pass P006 phases have unique names
pass P007 execute phase 'default-0' does not require specific guest

/image_includes_deps
warn C000 key "add-deps" not recognized by schema /schemas/provision/container
warn C000 key "containerimage" not recognized by schema /schemas/provision/container
warn C000 key "disk" not recognized by schema /schemas/provision/container
warn C000 value of "how" is not "container"
warn C000 key "add-deps" not recognized by schema /schemas/provision/mrack
warn C000 key "containerimage" not recognized by schema /schemas/provision/mrack
warn C000 key "disk" not recognized by schema /schemas/provision/mrack
warn C000 value of "how" is not "beaker"
warn C000 key "add-deps" not recognized by schema /schemas/provision/virtual
warn C000 key "containerimage" not recognized by schema /schemas/provision/virtual
warn C000 value of "how" is not "virtual"
warn C000 key "add-deps" not recognized by schema /schemas/provision/artemis
warn C000 key "containerimage" not recognized by schema /schemas/provision/artemis
warn C000 key "disk" not recognized by schema /schemas/provision/artemis
warn C000 value of "how" is not "artemis"
warn C000 key "add-deps" not recognized by schema /schemas/provision/minute
warn C000 key "containerimage" not recognized by schema /schemas/provision/minute
warn C000 key "disk" not recognized by schema /schemas/provision/minute
warn C000 value of "how" is not "minute"
warn C000 key "add-deps" not recognized by schema /schemas/provision/connect
warn C000 key "containerimage" not recognized by schema /schemas/provision/connect
warn C000 key "disk" not recognized by schema /schemas/provision/connect
warn C000 value of "how" is not "connect"
warn C000 key "add-deps" not recognized by schema /schemas/provision/local
warn C000 key "containerimage" not recognized by schema /schemas/provision/local
warn C000 key "disk" not recognized by schema /schemas/provision/local
warn C000 value of "how" is not "local"
warn C000 fmf node failed schema validation
warn C001 summary key is missing
pass P001 correct keys are used
pass P002 execute step defined with "how"
pass P003 execute step methods are all known
pass P004 discover step methods are all known
skip P005 no remote fmf ids defined
pass P006 phases have unique names
pass P007 execute phase 'default-0' does not require specific guest

/image_needs_deps
warn C000 key "add-deps" not recognized by schema /schemas/provision/container
warn C000 key "containerimage" not recognized by schema /schemas/provision/container
warn C000 key "disk" not recognized by schema /schemas/provision/container
warn C000 value of "how" is not "container"
warn C000 key "add-deps" not recognized by schema /schemas/provision/mrack
warn C000 key "containerimage" not recognized by schema /schemas/provision/mrack
warn C000 key "disk" not recognized by schema /schemas/provision/mrack
warn C000 value of "how" is not "beaker"
warn C000 key "add-deps" not recognized by schema /schemas/provision/virtual
warn C000 key "containerimage" not recognized by schema /schemas/provision/virtual
warn C000 value of "how" is not "virtual"
warn C000 key "add-deps" not recognized by schema /schemas/provision/artemis
warn C000 key "containerimage" not recognized by schema /schemas/provision/artemis
warn C000 key "disk" not recognized by schema /schemas/provision/artemis
warn C000 value of "how" is not "artemis"
warn C000 key "add-deps" not recognized by schema /schemas/provision/minute
warn C000 key "containerimage" not recognized by schema /schemas/provision/minute
warn C000 key "disk" not recognized by schema /schemas/provision/minute
warn C000 value of "how" is not "minute"
warn C000 key "add-deps" not recognized by schema /schemas/provision/connect
warn C000 key "containerimage" not recognized by schema /schemas/provision/connect
warn C000 key "disk" not recognized by schema /schemas/provision/connect
warn C000 value of "how" is not "connect"
warn C000 key "add-deps" not recognized by schema /schemas/provision/local
warn C000 key "containerimage" not recognized by schema /schemas/provision/local
warn C000 key "disk" not recognized by schema /schemas/provision/local
warn C000 value of "how" is not "local"
warn C000 fmf node failed schema validation
warn C001 summary key is missing
pass P001 correct keys are used
pass P002 execute step defined with "how"
pass P003 execute step methods are all known
pass P004 discover step methods are all known
skip P005 no remote fmf ids defined
pass P006 phases have unique names
pass P007 execute phase 'default-0' does not require specific guest

    warn: /containerfile_includes_deps:provision - {'how': 'bootc', 'add-deps': False, 'containerfile': '$TMT_BOOTC_CONTAINERFILE_RUNDIR/includes_deps.containerfile', 'containerfile-workdir': '.', 'disk': 20, 'name': 'default-0'} is not valid under any of the given schemas
    warn: /containerfile_needs_deps:provision - {'how': 'bootc', 'add-deps': True, 'containerfile': '$TMT_BOOTC_CONTAINERFILE_RUNDIR/needs_deps.containerfile', 'containerfile-workdir': '.', 'disk': 20, 'name': 'default-0'} is not valid under any of the given schemas
    warn: /image_includes_deps:provision - {'how': 'bootc', 'add-deps': False, 'containerimage': 'localhost/tmt-bootc-includes-deps', 'disk': 20, 'name': 'default-0'} is not valid under any of the given schemas
    warn: /image_needs_deps:provision - {'how': 'bootc', 'add-deps': True, 'containerimage': 'localhost/tmt-bootc-needs-deps', 'disk': 20, 'name': 'default-0'} is not valid under any of the given schemas
Lint checks on all
pass G001 no duplicate ids detected

@thrix
Copy link
Collaborator

thrix commented Oct 21, 2024

/packit build

""" Build the bootc disk from a container image using bootc image builder """
self._logger.debug("Building bootc disk image")
tmt.utils.Command(
"podman", "run", "--rm", "--privileged",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Whould this not run under root user for it to work? I get this error on my laptop when trying to run it:

❯ pwd
/var/home/mvadkert/git/github.com/teemtee/tmt/tests/provision/bootc/data
❯ tmt run -vvv -e TMT_BOOTC_CONTAINERFILE_RUNDIR=.
/var/home/mvadkert/.local/share/tmt/run-002
    warn: /containerfile_includes_deps:provision - {'how': 'bootc', 'add-deps': False, 'containerfile': '$TMT_BOOTC_CONTAINERFILE_RUNDIR/includes_deps.containerfile', 'containerfile-workdir': '.', 'disk': 20} is not valid under any of the given schemas
    warn: /containerfile_needs_deps:provision - {'how': 'bootc', 'add-deps': True, 'containerfile': '$TMT_BOOTC_CONTAINERFILE_RUNDIR/needs_deps.containerfile', 'containerfile-workdir': '.', 'disk': 20} is not valid under any of the given schemas
    warn: /image_includes_deps:provision - {'how': 'bootc', 'add-deps': False, 'containerimage': 'localhost/tmt-bootc-includes-deps', 'disk': 20} is not valid under any of the given schemas
    warn: /image_needs_deps:provision - {'how': 'bootc', 'add-deps': True, 'containerimage': 'localhost/tmt-bootc-needs-deps', 'disk': 20} is not valid under any of the given schemas
Found 4 plans.

/containerfile_includes_deps
    discover
        how: shell
        order: 50
        summary: 1 test selected
            /booted image
    provision
        queued provision.provision task #1: default-0
        
        provision.provision task #1: default-0
        how: bootc
        order: 50
        name: default-0
        how: bootc
        image: file:///var/home/mvadkert/.local/share/tmt/run-002/containerfile_includes_deps/provision/default-0/qcow2/disk.qcow2
        containerfile: ./includes_deps.containerfile
        add deps: False
        memory: 2048 MB
        disk: 20 GB
        fail: Command 'podman run --rm --privileged -v /var/lib/containers/storage:/var/lib/containers/storage --security-opt label=type:unconfined_t -v /var/home/mvadkert/.local/share/tmt/run-002/containerfile_includes_deps/provision/default-0:/output quay.io/centos-bootc/bootc-image-builder:latest build --type qcow2 --local localhost/tmtbase-1729527982' returned 1.
    finish
        warn: Nothing to finish, no guests provisioned.

plan failed

The exception was caused by 1 earlier exceptions

Cause number 1:

    provision step failed

    The exception was caused by 1 earlier exceptions

    Cause number 1:

        Command 'podman run --rm --privileged -v /var/lib/containers/storage:/var/lib/containers/storage --security-opt label=type:unconfined_t -v /var/home/mvadkert/.local/share/tmt/run-002/containerfile_includes_deps/provision/default-0:/output quay.io/centos-bootc/bootc-image-builder:latest build --type qcow2 --local localhost/tmtbase-1729527982' returned 1.

        stderr (8/8 lines)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Trying to pull quay.io/centos-bootc/bootc-image-builder:latest...
        Getting image source signatures
        Copying blob sha256:311336741819859e92064b81199a47397788d736d764f561a89cba9583600387
        Copying blob sha256:35056b112ca2a75be2e91b1076785d9712b1790aea49ebfd61f1799d090d9057
        Copying blob sha256:2edf720f10afc7137e2387bdb3ba800eec2602ac16da698ec19642a4d6fbc4dd
        Copying config sha256:767a10b2f63a72d479d9b102c2016790c63b045f6b9533c639fed605c299ee14
        Writing manifest to image destination
        2024/10/21 16:27:47 error: cannot validate the setup: this command must be run in rootful (not rootless) podman
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

per:

https:/osbuild/bootc-image-builder?tab=readme-ov-file#building

And we will need to put it under the --feeling-safe option.

Personally I feel this might a bit limit the usability here, I am wondering if it would not make more sense to spin a VM and run this command in it, but yeah, that will make this a lot harder to do, but avoid the root requirement of this feature.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We can do that later, any idea if this privileged root requirement will ever go away?

Copy link
Author

Choose a reason for hiding this comment

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

currently, creating the bootc disk requires a loopback mount which is why root is required. I don't think that requirement will go away anytime soon, although it's a common pain point so it might happen sooner rather than later.

Personally I feel this might a bit limit the usability here, I am wondering if it would not make more sense to spin a VM and run this command in it

A common pattern is to run podman-machine (a VM) to enable rootful podman. Then default all podman commands to use the machine, e.g.

podman machine init --rootful --disk-size 200 --memory 8192 --cpus 8 -v /var/tmp/tmt:/var/tmp/tmt -v $HOME:$HOME
export CONTAINER_CONNECTION=podman-machine-default-root
podman run ...

Copy link
Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority | must high priority, must be included in the next release step | provision Stuff related to the provision step
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a podman-bootc provisioner
6 participants