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

bib/composer integration: add manifest job for osbuild processing (HMS-4843) #4452

Closed
wants to merge 1 commit into from

Conversation

amirfefer
Copy link
Member

With this change:

  • bib is used to generate a manifest without initiating a full build.
  • Composer’s osbuild job can now process the manifest independently.

This setup improves modularity and prepares for future enhancements in the osbuild processing pipeline.

This pull request includes:

  • adequate testing for the new functionality or fixed issue
  • adequate documentation informing people about the change such as
    • submit a PR for the READMEs listed here
    • submit a PR for the osbuild.org website repository if this PR changed any behavior not covered by the automatically updated READMEs

func buildManifestCommand(args *worker.BootcManifestJob) *exec.Cmd {
baseArgs := []string{
"sudo", "podman", "run",
"--privileged",
Copy link
Member Author

@amirfefer amirfefer Oct 30, 2024

Choose a reason for hiding this comment

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

Using --privileged mode with Podman is a security concern.
Currently, rootless Podman fails to run bib in unprivileged mode for manifest creation due to limitations with nested containers.

Two potential approaches on my mind to address this:

  1. Investigate fixes for the nested container environment to support rootless, non-privileged execution.
  2. Embed the manifest creation process directly within the worker during its build, reducing the need for privileged Podman in the runtime environment.

With this change:
- Bib is used to generate a manifest without initiating a full build.
- Composer’s osbuild job can now process the manifest independently.

This setup improves modularity and prepares for future enhancements in the osbuild processing pipeline.
@ezr-ondrej ezr-ondrej changed the title bib/composer integration: add manifest job for osbuild processing bib/composer integration: add manifest job for osbuild processing (HMS-4843) Oct 30, 2024
Copy link
Member

@ondrejbudai ondrejbudai left a comment

Choose a reason for hiding this comment

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

Awesome! :) Some comments about the podman integration inline.


func buildManifestCommand(args *worker.BootcManifestJob) *exec.Cmd {
baseArgs := []string{
"sudo", "podman", "run",
Copy link
Member

Choose a reason for hiding this comment

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

Note that the worker runs as a root, so sudo is not needed for rootful. If we want to run podman rootless, we need to find a way to do it.

Copy link
Member Author

@amirfefer amirfefer Oct 31, 2024

Choose a reason for hiding this comment

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

I've been trying to enable bib for manifest generation in a rootless unprivileged podman with no success so far, I asked @mvo5 for an advice here. A different solution would be to able to embed bib into the worker (just for the manifest part), or using a secure instance to run this in a rootful and privileged env.

"--privileged",
"--rm",
"--pull=missing",
"--storage-driver=vfs",
Copy link
Member

Choose a reason for hiding this comment

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

Why vfs?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a leftover, I needed it for my local env when I used bib as whole to generate the image's artifact. vfs worked well for mapping the output folder across nested containers.

"--rm",
"--pull=missing",
"--storage-driver=vfs",
"--cgroup-manager=cgroupfs",
Copy link
Member

Choose a reason for hiding this comment

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

Is this really needed? If it is, a comment would be nice explaining it.

"--pull=missing",
"--storage-driver=vfs",
"--cgroup-manager=cgroupfs",
"--runtime=runc",
Copy link
Member

Choose a reason for hiding this comment

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

Is this really needed? If it is, a comment would be nice explaining it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I use docker for loca devl setup, so the worker runs on a docker instance. using crun ended with bunch of errors, so I switched it to runc with cgroupfs v2. In our production's k8s environment we probably can use crun, but this needs a verification.

"--runtime=runc",
"--security-opt=label=type:unconfined_t",
"quay.io/centos-bootc/bootc-image-builder:latest",
"manifest",
Copy link
Member

Choose a reason for hiding this comment

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

Adding --local, and running podman pull REF before bib is the preferred way, see osbuild/bootc-image-builder#423

"sudo", "podman", "run",
"--privileged",
"--rm",
"--pull=missing",
Copy link
Member

Choose a reason for hiding this comment

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

missing is the default, I suggest dropping it.

Copy link

github-actions bot commented Dec 1, 2024

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Dec 1, 2024
Copy link

github-actions bot commented Dec 9, 2024

This PR was closed because it has been stalled for 30+7 days with no activity.

@github-actions github-actions bot closed this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants