Skip to content

Commit

Permalink
Merge pull request #5867 from voelzmo/fix/create-and-remove-buildx-bu…
Browse files Browse the repository at this point in the history
…ilders

Explicitly create and remove buildx builders for VPA components
  • Loading branch information
k8s-ci-robot authored Jun 20, 2023
2 parents c7ddd5a + e84f770 commit 7bc37f7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
11 changes: 9 additions & 2 deletions vertical-pod-autoscaler/pkg/admission-controller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ifndef TAG
ERR = $(error TAG is undefined)
$(ERR)
endif
docker buildx build --pull --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .
docker buildx build --pull --load --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .

.PHONY: docker-push
docker-push: $(addprefix sub-push-,$(ALL_ARCHITECTURES)) push-multi-arch;
Expand Down Expand Up @@ -83,9 +83,16 @@ build-in-docker-%: clean docker-builder
echo '=============== bulding from the above ==============='
docker run -v `pwd`/../..:/gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler vpa-autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler && make build-binary-with-vendor-$* -C pkg/admission-controller'

.PHONY: create-buildx-builder
create-buildx-builder:
BUILDER=$(shell docker buildx create --driver=docker-container --use)

.PHONY: remove-buildx-builder
remove-buildx-builder:
docker buildx rm ${BUILDER}

.PHONY: release
release: build-in-docker docker-build docker-push
release: build-in-docker create-buildx-builder docker-build remove-buildx-builder docker-push
@echo "Full in-docker release ${FULL_COMPONENT}:${TAG} completed"

clean: $(addprefix clean-,$(ALL_ARCHITECTURES))
Expand Down
12 changes: 10 additions & 2 deletions vertical-pod-autoscaler/pkg/recommender/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ifndef TAG
ERR = $(error TAG is undefined)
$(ERR)
endif
docker buildx build --pull --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .
docker buildx build --pull --load --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .

.PHONY: docker-push
docker-push: $(addprefix sub-push-,$(ALL_ARCHITECTURES)) push-multi-arch;
Expand Down Expand Up @@ -83,7 +83,15 @@ build-in-docker-%: clean docker-builder
echo '=============== bulding from the above ==============='
docker run -v `pwd`/../..:/gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler vpa-autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler && make build-binary-with-vendor-$* -C pkg/recommender'

release: build-in-docker docker-build docker-push
.PHONY: create-buildx-builder
create-buildx-builder:
BUILDER=$(shell docker buildx create --driver=docker-container --use)

.PHONY: remove-buildx-builder
remove-buildx-builder:
docker buildx rm ${BUILDER}

release: build-in-docker create-buildx-builder docker-build remove-buildx-builder docker-push
@echo "Full in-docker release ${FULL_COMPONENT}:${TAG} completed"

clean: $(addprefix clean-,$(ALL_ARCHITECTURES))
Expand Down
12 changes: 10 additions & 2 deletions vertical-pod-autoscaler/pkg/updater/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ifndef TAG
ERR = $(error TAG is undefined)
$(ERR)
endif
docker buildx build --pull --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .
docker buildx build --pull --load --platform linux/$* -t ${REGISTRY}/${FULL_COMPONENT}-$*:${TAG} --build-arg ARCH=$* .

.PHONY: docker-push
docker-push: $(addprefix sub-push-,$(ALL_ARCHITECTURES)) push-multi-arch;
Expand Down Expand Up @@ -83,8 +83,16 @@ build-in-docker-%: clean docker-builder
echo '=============== bulding from the above ==============='
docker run -v `pwd`/../..:/gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler vpa-autoscaling-builder:latest bash -c 'cd /gopath/src/k8s.io/autoscaler/vertical-pod-autoscaler && make build-binary-with-vendor-$* -C pkg/updater'

.PHONY: create-buildx-builder
create-buildx-builder:
BUILDER=$(shell docker buildx create --driver=docker-container --use)

.PHONY: remove-buildx-builder
remove-buildx-builder:
docker buildx rm ${BUILDER}

.PHONY: release
release: build-in-docker docker-build docker-push
release: build-in-docker create-buildx-builder docker-build remove-buildx-builder docker-push
@echo "Full in-docker release ${FULL_COMPONENT}:${TAG} completed"

clean: $(addprefix clean-,$(ALL_ARCHITECTURES))
Expand Down

0 comments on commit 7bc37f7

Please sign in to comment.