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

Concerning mutil arch builds #651

Open
cidrblock opened this issue Feb 14, 2024 · 1 comment
Open

Concerning mutil arch builds #651

cidrblock opened this issue Feb 14, 2024 · 1 comment
Labels
needs_triage New item that needs to be triaged

Comments

@cidrblock
Copy link

Using a simple starting point:

---
version: 3

dependencies:
  ansible_core:
    package_pip: ansible-core==2.16.3
  ansible_runner:
    package_pip: ansible-runner
  python_interpreter:
    package_system: "python3.12"

images:
  base_image:
    name: registry.fedoraproject.org/fedora-minimal:39

options:
  package_manager_path: /usr/bin/microdnf

multi-arch can be accomplished with:

$ ansible-builder create                                                                           
Complete! The build context can be found at: /home/bthornto/github/builder-march/context
$ podman manifest create ee-test
$ podman build --platform linux/amd64,linux/arm64  --manifest ee-test -f context/Containerfile
$ podman manifest inspect ee-test | grep 'arch\|digest'
            "digest": "sha256:969841c4a366c835c8a0ddf28688487bf29b363af1b9853e8d8b3c6860576a1c",
                "architecture": "arm64",
            "digest": "sha256:4068e51486c0d89313c3542b5b21e9e8a15a7b83d4937db3983f498471045600",
                "architecture": "amd64",
$ podman images --digests | grep '6a1c\|5600'         
<none>                                     <none>      sha256:4068e51486c0d89313c3542b5b21e9e8a15a7b83d4937db3983f498471045600  d2f04819aabd  10 minutes ago  250 MB
<none>                                     <none>      sha256:969841c4a366c835c8a0ddf28688487bf29b363af1b9853e8d8b3c6860576a1c  e08bdf83069c  10 minutes ago  335 MB

Later pushing as needed podman manifest push ee-test

Some questions come to mind:

  1. Can it be assumed the resulting images are configured in the same manner they would be had ansible-builder build been used instead? (Are there any reasons to not do the above when a multi-arch is needed?)
  2. Is there an opportunity here for the user to provide an alternative to the built-in "build" command https://github.com/ansible/ansible-builder/blob/devel/src/ansible_builder/main.py#L189 If supported in the execution-environment.yml file it could be used later or shared to rebuild in the same manner if needed. (the tag and manifest keywords would need to be account for) If supplied as podman/docker specific this could acount for buildx.
  3. (if not) Can we document the above approach in a FAQ or examples section of the docs? What would be the best place? (happy to PR)

thank again for all the builder work, everytime I use it I reappreciate how handy it is.

-brad

@github-actions github-actions bot added the needs_triage New item that needs to be triaged label Feb 14, 2024
@keys1234249
Copy link

I would also enjoy the option to include --platform linux/amd64 within the ansible-builder build command. It would make things a bit easier :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_triage New item that needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants