-
Notifications
You must be signed in to change notification settings - Fork 151
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
Container installation support #2393
Conversation
As systems become leaner and functionality moves from system installed packages (RPM, deb or other) to containers it is important that kiwi can pre-install conatiners from specified registries to build system images.
@schaefi can you give this a once over to see if I am going in the right direction? The idea is to eventually have kiwi execute |
@rjschwei thanks for starting this effort. I took a look to the schema changes you are about to add and those for sure makes sense when the task is to pull a container into the local registry of the image. However, I've been tasked with this several times in the past and had to deal with some hurdles which held me back to do what you started now. Let me share some thoughts:
There is more but I don't want to scare you ;) With the above in mind I did not add an extra container tag to the kiwi schema so far. The concept we use so far uses a different approach based on the following design:
I setup all images that needs containers that way. Yes it requires putting the container into a package which might be considered cumbersome to people If we add a new container tag I strongly recommend that we don't aim for a direct pull into the local registry but load the container archive as file first and then allow via an attribute what should happen with it: stay as archive, try-loading-but-might-fail---document-exceptions. I could also imagine if we add a new mime type to reference the container name e.g Thus from my perspective a step that we can go is something like this <packages type="image">
<container name="URI" save_as="/usr/share/my/containers/" preload="true|false"/>
</packages> The URI references from where to fetch it and supports the format that you can use with podman pull plus additional mime types that we might need for integration with OBS ... or others Sorry long story, but I had some experience and trouble with all this already 😃 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea to reference a container and operate on it, but I think for consistency and simplicity the way to describe it should be changed. Also see my initial comment. Thoughts ?
@@ -65,7 +65,7 @@ div { | |||
attribute xsi:schemaLocation { xsd:anyURI } | |||
k.image.schemaversion.attribute = | |||
## The allowed Schema version (fixed value) | |||
attribute schemaversion { "7.6" } | |||
attribute schemaversion { "7.7" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only change the schema version on incompatible schema changes which requires an XSLT transformation. You are only adding stuff which is not an incompatible change. For tracking features according to the version of kiwi we use the main kiwi version not the schema version. Please keep the version as it is
This also obsoletes your XSLT transformation which does basically nothing than changing the version. So please drop the XSLT
Also please drop the adaptions to the various XML snippets that only changes the schema version.
It will make the pull request a lot smaller :)
Thanks much
@@ -3516,6 +3565,7 @@ div { | |||
k.namedCollection* & | |||
k.collectionModule* & | |||
k.product* & | |||
k.container* & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I wrote in my long first comment I think we can make our live a bit easier if we just add a new container element inside of the <packages>
section. A packages sub-element in kiwi speak can be a package, an archive and now also a container. The registry information should be imho placed in an URI reference which is the way we support source references in kiwi. I don't think we need to invent a different way to do this unless I forgot something ?
@schaefi thanks for sharing your thoughts. On the OBS side, yes while we want this feature in OBS, OBS is not the only place where to build images. Therefore, if kiwi would have a feature that doesn't work in OBS then that would just be it. I am not certain we should let potential limitations of 1 tool dictate features in kiwi. That said, the problem can certainly be solved in a similar way to repositories, as you already stated At first I also thought about adding the location of the container to the container xml-element but then I decided that this could lead to a lot of repetition, if for every container I want to get installed I need to add
and that then works with
While the default install would render a choice problem. Meaning kiwi would have to overwrite the default distribution setup. Which in and off itself is not a problem since the user has specified the registries to search with the setting of the This can be handled by the user via config.sh with the emission of the
in config.sh if containers from those registries are getting installed and OBS has some magic to make them available. Or if the image builder simply wants those registries to be available for search in the image being built. While this is not super convenient it is also not a total horror show. Still would leave kiwi with dealing with the default config files and for that my initial thought was that kiwi would move them out of the way for the image builder to restore as the builder sees fit, i.e. for SUSE that would look like
of course this would have to be implemented in a generic name, but that's pretty straight forward as the locations of the config files are known. The packaging of containers in RPMs brings it's own problems and there have been a number of discussions about that. Well at least we have this documented now for referencing. I am going to close this PR and we'll see where the conversation in other places around containers wrapped in RPMs leads. I will prepare a branch with just the XML changes |
I agree and have no problem with that. The feature should just at least in theory allow to be expanded for the OBS use case. I think the idea would have covered that part
yes and as you explained this can be done in kiwi code for the time the image is being built. I don't think it would be problematic to implement that. We had to do it for all package managers we support too
right and it has one advantage in a way that it does not require extra implementations in kiwi. The handling of the installed data via package or by a pull from a registry would be the same code I wonder why you closed your PR. I think adding a feature that allows to fetch a container from a registry (without looking at OBS for the moment) would be a nice and great addition. We only need to agree on the format to describe it in XML speak and you could go ahead. I hope I did not demotivate with you with my feedback, it was not my intention |
@schaefi rather than changing this PR I created a new branch 4ff11a5 in light of what I learned today this is getting a bit more pressing as well. So no you did not break my motivation. Just thought it would be nicer to start with the smaller scope schema changes rather than undoing some of the schema work I did here. |
As systems become leaner and functionality moves from system installed packages (RPM, deb or other) to containers it is important that kiwi can pre-install conatiners from specified registries to build system images.
Changes proposed in this pull request: