Support importing preinstallimage as container image #1105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, this change would allow the build to use preinstallimage as the base container image for podman and docker build environments. This speeds up the build process since there would be no need to untar the preinstallimage and install the packages inside it.
For making sure it's actually saving time, it would only import the preinstallimage if it doesn't already find it in the host. This check is implemented in
preinstall_container_image().For finding the package ID and HDRMD5 of packages in preinstallimage, it prioritizes the preinstallimageinfo, and if not found, it would fall back to the previous method of reading unpacked preinstallimage.
Added randomization for container name in both podman and Docker to avoid issues in concurrent builds.
This change is intended to be used in conjunction with the change in OSC openSUSE/osc#1957. After this is available in obs-build, it can be utilized with the changes in this fork https://github.com/mahdiyehmr/open-build-service to work with OBS.
I've tested this change with
osc buildand also in OBS for using Podman and Docker.I'm not familiar with your PR process. Please let me know if I need to make any changes or if you have any comments.
Thanks