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

build: support local arm64 and amd64 image #12754

Merged
merged 12 commits into from
Apr 7, 2024
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SRC := $(GOPATH)/src/github.com/argoproj/argo-workflows
# docker image publishing options
IMAGE_NAMESPACE ?= quay.io/argoproj
DEV_IMAGE ?= $(shell [ `uname -s` = Darwin ] && echo true || echo false)
TARGET_PLATFORM := $(shell [ `uname -m` = arm64 ] && echo linux/arm64 || echo linux/amd64)

# declares which cluster to import to in case it's not the default name
K3D_CLUSTER_NAME ?= k3s-default
Expand Down Expand Up @@ -99,7 +100,7 @@ ALWAYS_OFFLOAD_NODE_STATUS := false
POD_STATUS_CAPTURE_FINALIZER ?= true

$(info GIT_COMMIT=$(GIT_COMMIT) GIT_BRANCH=$(GIT_BRANCH) GIT_TAG=$(GIT_TAG) GIT_TREE_STATE=$(GIT_TREE_STATE) RELEASE_TAG=$(RELEASE_TAG) DEV_BRANCH=$(DEV_BRANCH) VERSION=$(VERSION))
$(info KUBECTX=$(KUBECTX) DOCKER_DESKTOP=$(DOCKER_DESKTOP) K3D=$(K3D) DOCKER_PUSH=$(DOCKER_PUSH))
$(info KUBECTX=$(KUBECTX) DOCKER_DESKTOP=$(DOCKER_DESKTOP) K3D=$(K3D) DOCKER_PUSH=$(DOCKER_PUSH) TARGET_PLATFORM=$(TARGET_PLATFORM))
$(info RUN_MODE=$(RUN_MODE) PROFILE=$(PROFILE) AUTH_MODE=$(AUTH_MODE) SECURE=$(SECURE) STATIC_FILES=$(STATIC_FILES) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) LOG_LEVEL=$(LOG_LEVEL) NAMESPACED=$(NAMESPACED))

override LDFLAGS += \
Expand Down Expand Up @@ -243,6 +244,7 @@ argoexec-image:
%-image:
[ ! -e dist/$* ] || mv dist/$* .
docker buildx build \
--platform $(TARGET_PLATFORM) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
--build-arg GIT_TAG=$(GIT_TAG) \
--build-arg GIT_TREE_STATE=$(GIT_TREE_STATE) \
Expand Down
7 changes: 7 additions & 0 deletions docs/running-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ If you made changes to the executor, you need to build the image:
make argoexec-image
```

You can use the `TARGET_PLATFORM` environment variable to compile images for specific platforms:

```bash
# compile for both arm64 and amd64
make argoexec-image TARGET_PLATFORM=linux/arm64,linux/amd64
```

To also start the API on <http://localhost:2746>:

```bash
Expand Down
Loading