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

add multi-arch (arm64) support for docker/podman drivers #9969

Merged
merged 25 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0c68a59
kic-base-image-multiarch target
ilya-zuyev Dec 14, 2020
1860291
kic-base-image-multiarch target
ilya-zuyev Dec 14, 2020
d116030
allow to override the list of ma-kicbase registries
ilya-zuyev Dec 14, 2020
405ccc5
skip docker login if AUTOPUSH is not defined
ilya-zuyev Dec 14, 2020
6044006
add multi-arch images to kic driver list
ilya-zuyev Dec 14, 2020
342b34c
fix unit tests
ilya-zuyev Dec 15, 2020
6335658
Revert single-arch kicbase fallback support
ilya-zuyev Jan 6, 2021
65cf998
Merge branch 'master' into ilyaz/multiarch_kicbase
ilya-zuyev Jan 6, 2021
df47190
fix docker builder creation args
ilya-zuyev Jan 6, 2021
3aaf9c0
Add buildx debug flags
ilya-zuyev Jan 8, 2021
1993e2e
fix kicbase image name
ilya-zuyev Jan 8, 2021
9184efe
fix Makefile rules
ilya-zuyev Jan 8, 2021
da87abd
enable docker driver for arm64
ilya-zuyev Jan 8, 2021
f24a3e0
fix Makefile
ilya-zuyev Jan 8, 2021
6c860a4
confirm kicbase push
ilya-zuyev Jan 8, 2021
9c4a765
Merge branch 'master' into ilyaz/multiarch_kicbase
ilya-zuyev Jan 8, 2021
921306d
fix fallback kicbaseimages list
ilya-zuyev Jan 8, 2021
2622e95
bump kicbase version to v0.0.16-snapshot1
ilya-zuyev Jan 8, 2021
7ca1503
fix kicbase sha1
ilya-zuyev Jan 12, 2021
813094b
Merge branch 'master' into ilyaz/multiarch_kicbase
ilya-zuyev Jan 12, 2021
d886639
fix unit tests
ilya-zuyev Jan 12, 2021
480c36d
trigger build
ilya-zuyev Jan 12, 2021
a13d15f
remove old make target for pushing kicbase
ilya-zuyev Jan 12, 2021
837cfb7
Revert "remove old make target for pushing kicbase"
ilya-zuyev Jan 12, 2021
2ca3cd2
Fix Makefile
ilya-zuyev Jan 13, 2021
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
31 changes: 29 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,33 @@ kic-base-image: ## builds the kic base image and tags local/kicbase:latest and l
docker tag local/kicbase:$(KIC_VERSION) local/kicbase:latest
docker tag local/kicbase:$(KIC_VERSION) local/kicbase:$(KIC_VERSION)-$(COMMIT_SHORT)

# multi-arch docker images
X_DOCKER_BUILDER ?= minikube-builder
X_BUILD_ENV ?= DOCKER_CLI_EXPERIMENTAL=enabled

.PHONY: docker-multi-arch-builder
docker-multi-arch-builder:
medyagh marked this conversation as resolved.
Show resolved Hide resolved
env $(X_BUILD_ENV) docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
env $(X_BUILD_ENV) docker buildx rm --builder $(X_DOCKER_BUILDER) || true
env $(X_BUILD_ENV) docker buildx create --name kicbase-builder --buildkitd-flags '--debug' --use || true

KICBASE_ARCH = linux/arm64,linux/amd64
KICBASE_IMAGE_REGISTRIES ?= $(REGISTRY)/kicbase:$(KIC_VERSION) $(REGISTRY_GH)/kicbase:$(KIC_VERSION) kicbase/stable:$(KIC_VERSION)

.PHONY: push-kic-base-image
push-kic-base-image: docker-multi-arch-builder
ifdef AUTOPUSH
docker login gcr.io/k8s-minikube
docker login docker.pkg.github.com
docker login
endif
$(foreach REG,$(KICBASE_IMAGE_REGISTRIES), \
@docker pull $(REG) && echo "Image already exist in registry" && exit 1 || echo "Image doesn't exist in registry";)
ifndef AUTOPUSH
$(call user_confirm, 'Are you sure you want to push $(KICBASE_IMAGE_REGISTRIES) ?')
endif
env $(X_BUILD_ENV) docker buildx build --platform $(KICBASE_ARCH) $(addprefix -t ,$(KICBASE_IMAGE_REGISTRIES)) --push --build-arg COMMIT_SHA=${VERSION}-$(COMMIT) ./deploy/kicbase

medyagh marked this conversation as resolved.
Show resolved Hide resolved
.PHONY: upload-preloaded-images-tar
upload-preloaded-images-tar: out/minikube # Upload the preloaded images for oldest supported, newest supported, and default kubernetes versions to GCS.
go build -ldflags="$(MINIKUBE_LDFLAGS)" -o out/upload-preload ./hack/preload-images/*.go
Expand Down Expand Up @@ -648,8 +675,8 @@ push-kic-base-image-hub: kic-base-image ## Push kic-base to docker hub
docker tag local/kicbase:latest $(KIC_BASE_IMAGE_HUB)
$(MAKE) push-docker IMAGE=$(KIC_BASE_IMAGE_HUB)

.PHONY: push-kic-base-image
push-kic-base-image: ## Push local/kicbase:latest to all remote registries
.PHONY: push-kic-base-image-x86
push-kic-base-image-x86: ## Push local/kicbase:latest to all remote registries
medyagh marked this conversation as resolved.
Show resolved Hide resolved
ifndef AUTOPUSH
$(call user_confirm, 'Are you sure you want to push: $(KIC_BASE_IMAGE_GH) & $(KIC_BASE_IMAGE_GCR) & $(KIC_BASE_IMAGE_HUB) ?')
$(MAKE) push-kic-base-image AUTOPUSH=true
Expand Down
2 changes: 1 addition & 1 deletion pkg/drivers/kic/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

const (
// Version is the current version of kic
Version = "v0.0.15-snapshot4"
Version = "v0.0.16-snapshot1"
medyagh marked this conversation as resolved.
Show resolved Hide resolved
// SHA of the kic base image
baseImageSHA = "ef1f485b5a1cfa4c989bc05e153f0a8525968ec999e242efff871cbb31649c16"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/minikube/registry/drvs/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
}

func status() registry.State {
if runtime.GOARCH != "amd64" {
if runtime.GOARCH != "amd64" && runtime.GOARCH != "arm64" {
return registry.State{Error: fmt.Errorf("docker driver is not supported on %q systems yet", runtime.GOARCH), Installed: false, Healthy: false, Fix: "Try other drivers", Doc: docURL}
}

Expand Down