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

Bundle container images with appliances #22979

Open
Tracked by #22956
agrare opened this issue Apr 5, 2024 · 5 comments
Open
Tracked by #22956

Bundle container images with appliances #22979

agrare opened this issue Apr 5, 2024 · 5 comments
Assignees
Milestone

Comments

@agrare
Copy link
Member

agrare commented Apr 5, 2024

In order to run podman-based workers or built-in floe containers on appliances we have to be able to package docker images and deploy them on an appliance without requiring a podman pull at runtime.

One possibility is to package the images in an RPM that would podman load the image into a podman image registry.

It is simple to create alternate image registries by specifying an alternate graphRoot via --root when pulling or loading images.

Related:

@agrare agrare changed the title pre-pull runner image on an appliance Bundle container images with appliances Apr 5, 2024
@agrare
Copy link
Member Author

agrare commented Apr 5, 2024

It seems the image storage directory has to be owned by manageiq if we are going to run the containers as that user. I tried to have e.g. /var/lib/manageiq/containers/storage owned by root with runRoot and tmpDir pointing somewhere else, but podman always tries to create other files/directories in the main imagestore

TODO try additionalimagestores in /etc/containers/storage.conf, doesn't seem to work for non-root containers?

@agrare
Copy link
Member Author

agrare commented Apr 5, 2024

For building the RPM I tried using podman load in manageiq.spec.in but that fails due to UID/GID errors

+ podman load --root=/root/rpmbuild/BUILDROOT/manageiq-19.0.0-20240405144727.el9.x86_64/var/lib/manageiq/data/containers/storage --input manageiq-gemset-19.0.0/bundler/gems/manageiq-providers-embedded_terraform-a6319eeb8602/content/containers/opentofu-runner_latest
time="2024-04-05T14:59:24Z" level=warning msg="Using rootless single mapping into the namespace. This might break some images. Check /etc/subuid and /etc/subgid for adding sub*ids if not using a network user"
Getting image source signatures
Copying blob sha256:d858e3d4ed076bae0562df26c2c251d1140619a80531f5e6edf1b4b2af55cdb3
Copying blob sha256:4222f9694f4be6c22d86d8a24a6e26d49ed01d1c393bb053ea8003928635446a
Copying blob sha256:c0d7d10a1b4e234d1c9057f8f793cff397a738d3334d3d40b93519d9e81a25ee
Copying blob sha256:716476e198e5a004dab028219afa022f8d56cc497b4f92ee770c52b01d9b61e6
Copying blob sha256:048b0fef4f933bbe51ac1da3d7d93ed17f8bc3c46c05703f41a24f243da46a90
Copying blob sha256:39146e33ec19ce2b054da412b06ccc57e648f3078cdc01dfd1523b9cb22de066
Error: payload does not match any of the supported image formats:
 * oci: writing blob: adding layer with blob "sha256:d858e3d4ed076bae0562df26c2c251d1140619a80531f5e6edf1b4b2af55cdb3": processing tar file(potentially insufficient UIDs or GIDs available in user namespace (requested 0:42 for /etc/shadow): Check /etc/subuid and /etc/subgid if configured locally and run "podman system migrate": lchown /etc/shadow: invalid argument): exit status 1
 * oci-archive: creating temp directory: untarring file "/var/tmp/container_images_oci172047747": read /root/rpmbuild/BUILD/manageiq-gemset-19.0.0/bundler/gems/manageiq-providers-embedded_terraform-a6319eeb8602/content/containers/opentofu-runner_latest: is a directory
 * docker-archive: detecting compression for file "manageiq-gemset-19.0.0/bundler/gems/manageiq-providers-embedded_terraform-a6319eeb8602/content/containers/opentofu-runner_latest": detecting compression: read manageiq-gemset-19.0.0/bundler/gems/manageiq-providers-embedded_terraform-a6319eeb8602/content/containers/opentofu-runner_latest: is a directory
 * dir: open manageiq-gemset-19.0.0/bundler/gems/manageiq-providers-embedded_terraform-a6319eeb8602/content/containers/opentofu-runner_latest/manifest.json: no such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.LXgPB2 (%install)

And it doesn't seem possible to add subuid/subgid in the build container for podman to work properly.

++ whoami
+ echo root:100000:65536
++ whoami
+ echo root:100000:65536
+ podman system migrate
time="2024-04-05T15:30:43Z" level=error msg="running `/usr/bin/newuidmap 13160 0 0 1 1 100000 65536`: newuidmap: write to uid_map failed: Operation not permitted\n"
Error: cannot set up namespace using "/usr/bin/newuidmap": exit status 1
error: Bad exit status from /var/tmp/rpm-tmp.vbVQ1m (%install)

We might need to package the .tar.gz files and podman load them at install time.

@Fryguy
Copy link
Member

Fryguy commented Apr 5, 2024

@bdunne Please also take a look here.

@Fryguy Fryguy added this to Roadmap Jun 12, 2024
@Fryguy Fryguy moved this to In progress in Roadmap Jun 12, 2024
@miq-bot miq-bot added the stale label Jul 8, 2024
@miq-bot
Copy link
Member

miq-bot commented Jul 8, 2024

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

@bdunne bdunne removed the stale label Jul 8, 2024
@miq-bot miq-bot added the stale label Oct 14, 2024
@miq-bot
Copy link
Member

miq-bot commented Oct 14, 2024

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

@bdunne bdunne removed the stale label Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

No branches or pull requests

4 participants