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
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ endif

ALWAYS_OFFLOAD_NODE_STATUS := false
POD_STATUS_CAPTURE_FINALIZER ?= true
TARGET_PLATFORM := $(shell [ `uname -m` = arm64 ] && echo linux/arm64 || echo linux/amd64)
agilgur5 marked this conversation as resolved.
Show resolved Hide resolved

$(info TARGET_PLATFORM=$(TARGET_PLATFORM))
$(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))
agilgur5 marked this conversation as resolved.
Show resolved Hide resolved
$(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))
Expand Down Expand Up @@ -243,6 +245,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
11 changes: 11 additions & 0 deletions docs/running-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ If you made changes to the executor, you need to build the image:
make argoexec-image
```

Or you can use parameters to compile images that support specific platforms or multiple platforms with `TARGET_PLATFORM`:

agilgur5 marked this conversation as resolved.
Show resolved Hide resolved
```bash
# only support arm64
make argoexec-image TARGET_PLATFORM=linux/arm64
# only support amd64
make argoexec-image TARGET_PLATFORM=linux/amd64
# support arm64 and amd64
agilgur5 marked this conversation as resolved.
Show resolved Hide resolved
make argoexec-image TARGET_PLATFORM=linux/arm64,linux/amd64
```

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

```bash
Expand Down
Loading