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

make buildah available on MPC VMs #291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

brianwcook
Copy link

This PR makes buildah available on the VM image in addition to podman to support the development of buildpack builder image task so that buildpack tools will work properly.

@cmoulliard
Copy link

I did a couple of tests and was able to replace the buildah commands able to create a container and mount it using podman

container=$(podman create ${IMAGE})
podman unshare
podman mount $container | tee ${HOME}/shared/container_path

I suggest that you wait till we have finished the tests we are doing to build "buildpack" artifacts before to merge or close this PR

@ifireball
Copy link
Member

I'd rather we make the actual pipeline task worry about this kind of detail - instead of adding more and more stuff to the provision task.

I suppose we also have a local version of the task - could we run the same container that the local version runs on the cluster - on the VM? I suppose that would already contain all the dependencies we would need

@cmoulliard
Copy link

I'd rather we make the actual pipeline task worry about this kind of detail - instead of adding more and more stuff to the provision task.

I agree with you but until now a user is not allowed to add additional software within the VM created. So what is then the strategy that you propose in this case ?

@ifireball
Copy link
Member

I'd rather we make the actual pipeline task worry about this kind of detail - instead of adding more and more stuff to the provision task.

I agree with you but until now a user is not allowed to add additional software within the VM created. So what is then the strategy that you propose in this case ?

Perhaps run a container with the required software on the VM.

@cmoulliard
Copy link

Perhaps run a container with the required software on the VM.

This idea is interesting but we will have, for some applications, an issue when they will need to access the DOCKER_HOST (unix socket, etc) from the container

@ifireball
Copy link
Member

Perhaps run a container with the required software on the VM.

This idea is interesting but we will have, for some applications, an issue when they will need to access the DOCKER_HOST (unix socket, etc) from the container

If you were doing a similar task inside the cluster - how would you manage it?

@cmoulliard
Copy link

If you were doing a similar task inside the cluster - how would you manage it?

Until now, we do this within the remote VM where we execute a bash script

https://github.com/redhat-buildpacks/builder-ubi-base/blob/463234816d380e4e2e1882af824a9dbf976cb7b8/.tekton/pipelinerun-builder-ubi-base.yaml#L267-L275

systemctl --user start podman.socket
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock

pack builder create ${IMAGE} --config builder.toml ${PACK_ARGS}

@ifireball
Copy link
Member

If you were doing a similar task inside the cluster - how would you manage it?

Until now, we do this within the remote VM where we execute a bash script

https://github.com/redhat-buildpacks/builder-ubi-base/blob/463234816d380e4e2e1882af824a9dbf976cb7b8/.tekton/pipelinerun-builder-ubi-base.yaml#L267-L275

systemctl --user start podman.socket
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock

pack builder create ${IMAGE} --config builder.toml ${PACK_ARGS}

I wonder - how does the buildah build task manage to run in-cluster? Could we use the same trick?

@brianwcook
Copy link
Author

brianwcook commented Sep 12, 2024

Buildah and Podman share libraries, but Podman adds more. Buildah is a lower level tool. It is the more that Podman brings that is the issue. Buildah in Podman / CRI-O works fine; Podman in podman / CRI-O does not. A lot of it has to do with how Podman tries to remap uids and gids.

@ifireball
Copy link
Member

Buildah and Podman share libraries, but Podman adds more. Buildah is a lower level tool. It is the more that Podman brings that is the issue. Buildah in Podman / CRI-O works fine; Podman in podman / CRI-O does not. A lot of it has to do with how Podman tries to remap uids and gids.

so IIRC this PR is about getting Buildah on the VM - so could we have it running inside a PODMAN container on the VM instead?

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.

3 participants