File tree Expand file tree Collapse file tree 5 files changed +20
-54
lines changed Expand file tree Collapse file tree 5 files changed +20
-54
lines changed Original file line number Diff line number Diff line change 11SPIN_VERSION = v2
22IMAGE_NAME ?= ghcr.io/spinkube/containerd-shim-spin/node-installer
3- PLATFORM ?= linux/amd64
4- ARCH ?= x86_64
3+
4+ # we only support x86_64 and aarch64 on Linux
5+ UNAME := $(shell uname -m)
6+ ifeq ($(UNAME ) ,x86_64)
7+ PLATFORM ?= linux/amd64
8+ ARCH ?= x86_64
9+ else ifeq ($(UNAME),aarch64)
10+ PLATFORM ?= linux/arm64
11+ ARCH ?= aarch64
12+ else ifeq ($(UNAME),arm64)
13+ PLATFORM ?= linux/arm64
14+ ARCH ?= aarch64
15+ else
16+ $(error Unsupported platform : $(UNAME ) )
17+ endif
18+
519TARGET ?= $(ARCH ) -unknown-linux-musl
620BINARY := ./.tmp/$(PLATFORM ) /containerd-shim-spin-$(SPIN_VERSION )
721
Original file line number Diff line number Diff line change @@ -21,19 +21,7 @@ kubectl apply -f ./tests/workloads/runtime.yaml
2121echo " === Step 3: Build and deploy the KWasm node installer ==="
2222if ! docker image inspect $IMAGE_NAME > /dev/null 2>&1 ; then
2323 echo " Building node installer image..."
24- PLATFORM=$( uname -m)
25- if [ " $PLATFORM " = " x86_64" ]; then
26- PLATFORM=" linux/amd64"
27- ARCH=" x86_64"
28- elif [ " $PLATFORM " = " aarch64" ] || [ " $PLATFORM " = " arm64" ]; then
29- PLATFORM=" linux/arm64"
30- ARCH=" aarch64"
31- else
32- echo " Unsupported platform: $PLATFORM "
33- exit 1
34- fi
35-
36- PLATFORM=$PLATFORM ARCH=$ARCH IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
24+ IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
3725fi
3826
3927echo " Loading node installer image into K3s..."
Original file line number Diff line number Diff line change @@ -30,19 +30,7 @@ kubectl --context=kind-spin-test apply -f ./tests/workloads/runtime.yaml
3030echo " === Step 3: Build and deploy the KWasm node installer ==="
3131if ! docker image inspect $IMAGE_NAME > /dev/null 2>&1 ; then
3232 echo " Building node installer image..."
33- PLATFORM=$( uname -m)
34- if [ " $PLATFORM " = " x86_64" ]; then
35- PLATFORM=" linux/amd64"
36- ARCH=" x86_64"
37- elif [ " $PLATFORM " = " aarch64" ] || [ " $PLATFORM " = " arm64" ]; then
38- PLATFORM=" linux/arm64"
39- ARCH=" aarch64"
40- else
41- echo " Unsupported platform: $PLATFORM "
42- exit 1
43- fi
44-
45- PLATFORM=$PLATFORM ARCH=$ARCH IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
33+ IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
4634fi
4735
4836echo " Loading node installer image into kind..."
Original file line number Diff line number Diff line change @@ -30,19 +30,7 @@ kubectl apply -f ./tests/workloads/runtime.yaml
3030echo " === Step 3: Build and deploy the KWasm node installer ==="
3131if ! docker image inspect $IMAGE_NAME > /dev/null 2>&1 ; then
3232 echo " Building node installer image..."
33- PLATFORM=$( uname -m)
34- if [ " $PLATFORM " = " x86_64" ]; then
35- PLATFORM=" linux/amd64"
36- ARCH=" x86_64"
37- elif [ " $PLATFORM " = " aarch64" ] || [ " $PLATFORM " = " arm64" ]; then
38- PLATFORM=" linux/arm64"
39- ARCH=" aarch64"
40- else
41- echo " Unsupported platform: $PLATFORM "
42- exit 1
43- fi
44-
45- PLATFORM=$PLATFORM ARCH=$ARCH IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
33+ IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
4634fi
4735
4836echo " Loading node installer image into MicroK8s..."
Original file line number Diff line number Diff line change @@ -14,19 +14,7 @@ kubectl apply -f ./tests/workloads/runtime.yaml
1414echo " === Step 3: Build and deploy the KWasm node installer ==="
1515if ! docker image inspect $IMAGE_NAME > /dev/null 2>&1 ; then
1616 echo " Building node installer image..."
17- PLATFORM=$( uname -m)
18- if [ " $PLATFORM " = " x86_64" ]; then
19- PLATFORM=" linux/amd64"
20- ARCH=" x86_64"
21- elif [ " $PLATFORM " = " aarch64" ] || [ " $PLATFORM " = " arm64" ]; then
22- PLATFORM=" linux/arm64"
23- ARCH=" aarch64"
24- else
25- echo " Unsupported platform: $PLATFORM "
26- exit 1
27- fi
28-
29- PLATFORM=$PLATFORM ARCH=$ARCH IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
17+ IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
3018fi
3119
3220echo " Loading node installer image into MiniKube..."
You can’t perform that action at this time.
0 commit comments