Skip to content
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

🌱 Improve release staging build speed #9536

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,9 @@ release-binary: $(RELEASE_DIR)

.PHONY: release-staging
release-staging: ## Build and push container images to the staging bucket
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-build-all docker-push-all release-alias-tag
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-build-all
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-push-all
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am I correct to understand that docker-push-all and docker-build-all won't and can't run in parallel (because push depends on build)? if so which parts are parallelized by using the -j option? Is it the docker build commands themselves?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am I correct to understand that docker-push-all and docker-build-all won't and can't run in parallel (because push depends on build)?

yes that's true. in one iteration of the previous PR i got around this with the suggestion of mdbooth by defining "docker-build-% as a dependency of docker-push-%". but this also introduced some complexity in the push target that we decided was not worth the tradeoff

if so which parts are parallelized by using the -j option? Is it the docker build commands themselves?

yep exactly, the default is to run one job at a time, by passing -j 8 each sub-make (e.g. docker-build-all, docker-push-all) make will run 8 jobs in parallel

REGISTRY=$(STAGING_REGISTRY) $(MAKE) release-alias-tag

.PHONY: release-staging-nightly
release-staging-nightly: ## Tag and push container images to the staging bucket. Example image tag: cluster-api-controller:nightly_main_20210121
Expand Down
5 changes: 2 additions & 3 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ steps:
- TAG=$_GIT_TAG
- PULL_BASE_REF=$_PULL_BASE_REF
- DOCKER_BUILDKIT=1
args:
- release-staging
args: ['release-staging', '-j', '8', '-O']
substitutions:
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
# can be used as a substitution
_GIT_TAG: '12345'
_PULL_BASE_REF: 'dev'
_PULL_BASE_REF: 'dev'