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 @@ -29,19 +29,7 @@ kubectl apply -f ./tests/workloads/runtime.yaml
2929echo " === Step 3: Build and deploy the KWasm node installer ==="
3030if ! docker image inspect $IMAGE_NAME > /dev/null 2>&1 ; then
3131 echo " Building node installer image..."
32- PLATFORM=$( uname -m)
33- if [ " $PLATFORM " = " x86_64" ]; then
34- PLATFORM=" linux/amd64"
35- ARCH=" x86_64"
36- elif [ " $PLATFORM " = " aarch64" ] || [ " $PLATFORM " = " arm64" ]; then
37- PLATFORM=" linux/arm64"
38- ARCH=" aarch64"
39- else
40- echo " Unsupported platform: $PLATFORM "
41- exit 1
42- fi
43-
44- PLATFORM=$PLATFORM ARCH=$ARCH IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
32+ IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
4533fi
4634
4735echo " Loading node installer image into MicroK8s..."
Original file line number Diff line number Diff line change @@ -13,19 +13,7 @@ kubectl apply -f ./tests/workloads/runtime.yaml
1313echo " === Step 3: Build and deploy the KWasm node installer ==="
1414if ! docker image inspect $IMAGE_NAME > /dev/null 2>&1 ; then
1515 echo " Building node installer image..."
16- PLATFORM=$( uname -m)
17- if [ " $PLATFORM " = " x86_64" ]; then
18- PLATFORM=" linux/amd64"
19- ARCH=" x86_64"
20- elif [ " $PLATFORM " = " aarch64" ] || [ " $PLATFORM " = " arm64" ]; then
21- PLATFORM=" linux/arm64"
22- ARCH=" aarch64"
23- else
24- echo " Unsupported platform: $PLATFORM "
25- exit 1
26- fi
27-
28- PLATFORM=$PLATFORM ARCH=$ARCH IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
16+ IMAGE_NAME=$IMAGE_NAME make build-dev-installer-image
2917fi
3018
3119echo " Loading node installer image into MiniKube..."
You can’t perform that action at this time.
0 commit comments