-
Notifications
You must be signed in to change notification settings - Fork 26
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
docker library: build when all base packages are ready #656
base: dev
Are you sure you want to change the base?
docker library: build when all base packages are ready #656
Conversation
1. Save space Rather than building parts of the manifest on the assumption that all architectures will catch up, wait for all of them. When the are all there, build them all in one go, and clean them all up at the end. The *-reference.txt file contains the name of the builders that are ready. Its used as a counter so the only thing that matters is the number of unique lines. Removed use of podman. There where probably some incompatible things here. 2. be retriggerable If any part of the build fails, clean the images up. Any manual retrigger on the tarbuildnum for a ubi/non-ubi will retrigger the building of the manifest, and test. This saves us rebuilding the packages. So this includes docker-library-build.sh. Failure of an architecture cleans them all. 3. tests now x86_64 only The docker-library-test.sh is adjusted because of the manifest name. The less obvious change is because the image is a manifest, running the test suite on this will only run on the native amd64 architecture. There where timeouts on non-amd64 sometimes still which where pretty much always false positives. 4. simplified docker-library-manifest With the manifest already done in the build step, this is simply pushing that manifest and all the tags around it. A re-arrangements means we push the tags (latest/earliest...) first (with image). Then the image with its main tag (like :10.5). Then we build the debug images. As there is now an easy implementation for this so its a one run process. Cleanup is aslo part of this script. The reference.txt files are removed. buildah rmi --prune --force will remove all untagged images, including any that had running containers on them during a build process. The rest of the cleanup is the same (without an if condition around it). The is probably scope for cleaning this up some more.
Hit a buildah quirk/bug so disabling debug image build until better solution presents itself.
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.
Looks good. There are some minor improvement/fix.
I have the feeling that maintenance would be eased by creating a bash library on the model of install/upgrade tests.
It's complex to correctly review it without testing, so, I suggest that we iterate on DEV for that.
|
||
# ensure unique entries for each arch | ||
echo "$buildername" >> "$reffile" | ||
sort -u "$reffile" -o "$reffile" |
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.
nice
entries=$(wc -l < "$reffile") | ||
if [ "$entries" -lt ${#arches[@]} ]; then | ||
echo "Only $entries architectures so far" | ||
exit |
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.
specify exit, either 0
or >0
. This helps understanding if it's "normal" or "error".
Not mandatory but since we are in bash, you could use integer comparison:
if (($entries < ${#arches[@]})); then
...
fi
else | ||
build "${builderarch}" | ||
fi | ||
trap cleanup ERR |
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.
good!
@@ -87,49 +113,81 @@ annotate() { | |||
done |
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.
annotate
function does not seem to be used.
image=mariadb-${tarbuildnum}-${builderarch}${ubi} | ||
if ! buildah manifest exists "$image"; then | ||
echo "No manifest we can't push" | ||
exit |
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.
- echo "No manifest we can't push"
+ echo "No manifest, we can't push"
- exit
+ exit 0/1
^^ see previous comment about exit codes.
if [[ "$buildername" = *-rhel-9-rpm-autobake ]]; then | ||
image=${image}-ubi | ||
fi | ||
|
||
if ! buildah manifest exists "$image"; then | ||
echo "No manifest we can't test" | ||
exit |
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.
~Same comment as previous one.
debug info containers disabled for now. Scripts test locally ok when passed same BB arguments.
Rather than building parts of the manifest on the assumption that all architectures will catch up, wait for all of them.
When the are all there, build them all in one go, and clean them all up at the end.
The *-reference.txt file contains the name of the builders that are ready. Its used as a counter so the only thing that matters is the number of unique lines.
Removed use of podman. There where probably some incompatible things here.
If any part of the build fails, clean the images up. Any manual retrigger on the tarbuildnum for a ubi/non-ubi will retrigger the building of the manifest, and test. This saves us rebuilding the packages.
So this includes docker-library-build.sh. Failure of an architecture cleans them all.
The docker-library-test.sh is adjusted because of the manifest name.
The less obvious change is because the image is a manifest, running the test suite on this will only run on the native amd64 architecture.
There where timeouts on non-amd64 sometimes still which where pretty much always false positives.
With the manifest already done in the build step,
this is simply pushing that manifest and all the
tags around it.
A re-arrangements means we push the tags (latest/earliest...) first (with image). Then the image with its main tag (like :10.5).
Then we build the debug images. As there is now an easy implementation for this so its a one run process.
Cleanup is also part of this script. The reference.txt files are removed.
buildah rmi --prune --force will remove all untagged images, including any that had running containers on them during a build process.
The rest of the cleanup is the same (without an if condition around it). The is probably scope for cleaning this up some more.