Hi folks!
This is a continuation of our discussion in the last team meeting. It concerns the future of delivering IPA images for Metal3 and is independent of the recent issues around caching downloads from
tarballs.opendev.org.
# Problem space
For years, we have relied on the IPA-downloader [1] initContainer to download IPA images from the upstream location [2] where they're built each time a commit happens in ironic-python-agent. This approach has numerous issues:
1.
Tarballs.opendev.org is not a real CDN and can be quite slow, especially from certain locations (like github runners, unfortunately). We're working on a transparent proxy to mitigate this for our CI, but the consumers of Metal3 may experience the same issue.
2. Official images that we use are x86-64 only. There are also images for aarch64 built at a different location [3] which we don't yet support.
3. Official images are only built for major OpenStack releases and the
main branch. ARM images are only built for the main branch. We have zero
influence on the images our users consume.
4. Using custom images is confusing and error prone: you need to set several variables in an exact way. Multi-arch support makes this issue even worse.
5. Using a local cache (think: disconnected case) requires a separate HTTP server.
6. Since Quay is our official distribution site, users expect all our
official artifacts to come from it. The OpenDev location may not even be
allowed on firewalls.
# Proposal
Ironic 29.0 and newer supports [4] downloading images from oci:// URLs referring to OCI Artefacts [5]. These artefacts behave pretty similarly to container images: they are essentially manifests that point to binary blobs. They can have tags and meta-information, such as CPU architecture.
As an aside, using OCI artefacts as instance images works today, as long as the registry does not require authentication. Just set image.url to oci://host/namespace/container:tag (or better use the hash).
We could have a periodic job in our Jenkins that takes the upstream images and uploads them as artefacts to our Quay namespace. Then we could update ironic-image to default to something like (subject to further bikeshedding on what becomes a part of the name and what of the tag):
For stable branches it will become
even if the tag points to the same manifest as latest.
## Limitations
The Ironic documentation claims that tags are not supported for deploy_kernel/ramdisk. We had a quick discussion yesterday, and nobody could remember the reason, nor find evidence in the code that it's actually the case. Needs double-checking and potentially fixing.
I'm not sure if the code is multi-arch aware, i.e. it will fetch the right manifest depending on the architecture of the BMH. Again, something to investigate and potentially fix. Worst case scenario, fall back to different tags and use deploy_kernel_by_arch.
Finally, we need to investigate how Ironic's cache behaves with such images. Normal HTTP images are cached locally and validated each time using a HEAD request to the server. Ideally, Ironic needs to check if the tag still resolves to the same hash. I don't know if it does. We can check it and fix it if necessary.
## How it solves the problems above
1. Quay is designed to distribute artefacts to users. High-scale users can easily set up a mirror.
2. Path forward for multi-arch support. Our Jenkins job can pull images from different locations or even build them.
3. Eventually, we may start building IPA images ourselves and provide different images for different Ironic branches.
4. Custom images will be easy: upload your own artefacts to your registry, point ironic-image to it. I expect IrSO to make it even easier.
5. Disconnected users will already have a registry for containers, no extra service is needed for IPA Images.
Bonus: IPA downloader becomes entirely optional and may even eventually be phased out.
Thoughts?
Thanks for reading so far!
Dmitry
-- Red Hat GmbH, Registered seat: Werner von Siemens Ring 12, D-85630 Grasbrunn, Germany
Commercial register: Amtsgericht Muenchen/Munich, HRB 153243,
Managing Directors: Ryan Barnhart, Charles Cachera, Avril Crosse O'Flaherty