fix(ci): Cloud Build OOM and empty image revision label#6328
Draft
ivankatliarchuk wants to merge 1 commit intokubernetes-sigs:masterfrom
Draft
fix(ci): Cloud Build OOM and empty image revision label#6328ivankatliarchuk wants to merge 1 commit intokubernetes-sigs:masterfrom
ivankatliarchuk wants to merge 1 commit intokubernetes-sigs:masterfrom
Conversation
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Pull Request Test Coverage Report for Build 23742899117Details
💛 - Coveralls |
ivankatliarchuk
commented
Mar 30, 2026
| path: /go/pkg/mod | ||
| steps: | ||
| # Pre-warm the Go module cache so test and build steps don't compete for downloads. | ||
| - name: 'docker.io/library/golang:1.26-bookworm' |
Member
Author
There was a problem hiding this comment.
┌──────────┬────────────┬──────────────────────┬───────────────────────────────────────────────────────────────────┐
│ Step │ entrypoint │ args │ Result │
├──────────┼────────────┼──────────────────────┼───────────────────────────────────────────────────────────────────┤
│ pre-warm │ go │ mod download │ go mod download ✓ │
├──────────┼────────────┼──────────────────────┼───────────────────────────────────────────────────────────────────┤
│ test │ make │ test │ make test → go test -race ./... ✓ │
├──────────┼────────────┼──────────────────────┼───────────────────────────────────────────────────────────────────┤
│ build │ make │ build.push/multiarch │ make build.push/multiarch with VERSION, GIT_REVISION, IMAGE env ✓ │
└──────────┴────────────┴──────────────────────┴───────────────────────────────────────────────────────────────────┘
Contributor
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does it do ?
I'm not sure where this PR fixes cloudbuild, but worth to try, and we should split the one massive job, as currently cloudbuild runs for quite a while, and hard to understand where exactly it fails.
At most we could rollback certain changes. The split-step + cache-prewarming changes are still worthwhile regardless, because they reduce peak memory, eliminate redundant module downloads, and give cleaner failure reason. But if the next build fails with INTERNAL_ERROR again, that would suggest it's a transient infra issue rather than resource exhaustion.
pre-warm → test → build/push, each sharing a named volume (go-modules) so dependencies are downloaded once, not as currently per multiple architectures--image-label org.opencontainers.image.revision; added _GIT_COMMIT substitution to cloudbuild.yaml so prow can pass the commit SHALooks like we could also use N1_HIGHCPU_32 https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/8ee57b6871d5434bef21d05480c4745f97767be1/cloudbuild.yaml#L24
Motivation
The staging Cloud Build was failing with INTERNAL_ERROR - tests and the multi-arch ko build ran in the same step, causing memory exhaustion on N1_HIGHCPU_8. The org.opencontainers.image.revision label was also always empty because git rev-parse HEAD fails in the tarball-based Cloud Build environment.
Failed cloudbuild jobs
Example job took ~50 minutes to fail https://prow.k8s.io/view/gs/kubernetes-ci-logs/logs/post-external-dns-push-images/2038528233506344960
^ No git, so we could not run
I don't know for certain where there is OOM or similar issue it was an educated guess. What I can say from the logs:
But it could equally be:
Why cache is required, currently in pulls same library multiple times
More
Missed version, as there is no git in cloud build (tar/zip archive is only avaialble there)
Another example
https://prow.k8s.io/view/gs/kubernetes-ci-logs/logs/post-external-dns-push-images/2039609054623436800