Support for podman in breeze tooling
Description
Enable breeze to utilize podman for container management.
Use case/motivation
Given the open source nature, lack of licensing issues, OCI-compliant images, and improved security and performance, enable podman as a container management option for breeze tooling.
Related issues
No response
Are you willing to submit a PR?
- [x] Yes I am willing to submit a PR!
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
I believe most people already use podman and there are little to no incompatibilities, but if you feel like testing it and adding documentation explicitly and solve any problems you might see - feel absolutely free to work on it and updating documenetation.
Ideally also it would be great if some basic testing is added in our CI to test that breze works with podman - building images with podman maybe, running some shell commands with breeze maybe runing some pre-commits that require docker container.
I see there is an attempting to keep the CLI interfaces the same for scripting, BUT there are some issues I am running into the buildx area, and I'll work through these are part of this ticket.
I can take the issue. Thanks.
I opened a PR #58599 to add a warning in breeze that podman isn't fully supported yet. I will hopefully be able to add the full support podman including tests.
Cool. Merged and back-ported,
I don't think full support of podman is possible yet. One way to approach it would be to create new separate containers that are podman friendly. The syntax isn't easily recognized by podman engine. Heredoc isn't recognized yet, even though podman claims to support it after 4.8
I think it should - it's the matter of using buildkit for building the images. The declaration at the top of the Dockerfile tells which version of syntax to use:
# syntax=docker/dockerfile:1.4
Maybe you should look at how to enable buildkit support for podman - this should work for any container engine, buildkit is delivered by moby (they are behind docker) - but it is really an oci-standard container and should run also with podman.
There are many sources on setting up podman to use buildkit.
I can get the image builds to start with podman outside of breeze. Looks like it is possible to build the images with
# run podmans buldkit container
podman run -d --name buildkitd --privileged \
docker.io/moby/buildkit:latest
and
buildctl --addr=podman-container://buildkitd build \
--frontend dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--export-cache type=inline \
--output type=docker,name=mynewimage | podman load
Or for the ci image build
buildctl build \
--frontend=dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--opt filename=Dockerfile.ci \
--opt target=main \
--opt platform=linux/amd64 \
--output type=docker,name=example:latest \
--progress=plain | podman load
So would we want to add the podman buildkit image build to breeze? I noticed that buildkit detection is already in breeze.
# dev/breeze/src/airflow_breeze/utils/run_utils.py
def check_if_buildx_plugin_installed() -> bool:
"""
Checks if buildx plugin is locally available.
:return True if the buildx plugin is installed.
"""
check_buildx = ["docker", "buildx", "version"]
docker_buildx_version_result = run_command(
check_buildx,
no_output_dump_on_exception=True,
capture_output=True,
text=True,
check=False,
)
if docker_buildx_version_result.returncode == 0:
return True
return False
Likely, Have a persistent config to use podman (see breeze config) and if set - the build stteps should be replaced by podman commands.
Likely, Have a persistent config to use podman (see
breeze config) and if set - the build stteps should be replaced by podman commands.
I added some more support warnings based on this discussion to a PR #59775
@aaron-wolmutt We are unassigning you from this issue as part of our updated assignment policy.
This is not meant to discourage your contribution — quite the opposite! You are still very welcome to work on this issue and submit a PR for it. Simply comment that you are working on it and open a PR when ready.
We found that formal assignments were not working well, as they often prevented others from contributing when the assignee was not actively working on the issue.
@fredthomsen We are unassigning you from this issue as part of our updated assignment policy.
This is not meant to discourage your contribution — quite the opposite! You are still very welcome to work on this issue and submit a PR for it. Simply comment that you are working on it and open a PR when ready.
We found that formal assignments were not working well, as they often prevented others from contributing when the assignee was not actively working on the issue.
Can I work on this.
@ajayboddeda-dev feel free to create a PR. By project policy, we do not assign people to issues - https://github.com/apache/airflow/blob/main/contributing-docs/04_how_to_contribute.rst#contribute-code-changes
Hi, I'd like to work on Podman support in Breeze. Is this still available to pick up?
@ayushmishra-18, no PR linked, so I assume yes. Feel free to create one!