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
Switch to docker buildx
for conformance image
#98569
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,9 +54,14 @@ endif | |
chmod a+rx ${TEMP_DIR}/e2e.test | ||
chmod a+rx ${TEMP_DIR}/gorunner | ||
|
||
cd ${TEMP_DIR} && sed -i.back "s|ARCH|${ARCH}|g; s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile | ||
cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile | ||
|
||
docker build --pull -t ${REGISTRY}/conformance-${ARCH}:${VERSION} ${TEMP_DIR} | ||
docker buildx build \ | ||
--platform linux/${ARCH} \ | ||
--load \ | ||
--pull \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @saschagrunert are we not concerned about the base image caching issue that previously broke this when switching to buildx? (see #97982 for more info) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a bit (?) 😇 I tested it right now and it seems to work: Can you share some more insights which error cases we might face? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @saschagrunert we were previously hitting a bug with the base image not being cached on registry mirror, but it is possible that issue has been addressed on GCR side (#92042) 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is also addressed on the buildx side going forward (should fallback to the non mirror endpoint like docker build does), thought it may be some time before we're using the patched version. |
||
-t ${REGISTRY}/conformance-${ARCH}:${VERSION} \ | ||
${TEMP_DIR} | ||
rm -rf "${TEMP_DIR}" | ||
|
||
push: build | ||
|
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.
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.
Currently nowhere, we have an
init-buildx.sh
script in k/release which could be vendored over here: https://github.com/kubernetes/release/blob/master/hack/init-buildx.shDo we wanna do that?
Same as above, the CI / release process right now ensures that it is set. Following docker versions will set it per default as well: https://github.com/docker/cli/blob/e31e00585363e6a989e37fa92cf06481ea218344/docs/deprecated.md#configuration-options-for-experimental-cli-features
Anyways, we can still add it to the build scripts, which should not hurt.
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.
@saschagrunert Related: looks like we are not setting it currently in the build canary (https://prow.k8s.io/view/gcs/kubernetes-jenkins/logs/ci-kubernetes-build-canary/1355584153801723904)
Do you want to go ahead and handle setup in k/k or try to just fix jobs in intermediate?
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.
well I'd say yes, but the original source for that is in fact:
https://github.com/kubernetes-sigs/kind/commits/master/hack/build/init-buildx.sh
🙃
Without this, you can't consistently rely on there being a builder provisioned, causing builds to fail on clean hosts (except on docker desktop, where there's one provided OOTB).