Skip to content

Commit 9f6a5b8

Browse files
authored
download memStress and stress-ng according to the architecture (#198)
* download memStress and stress-ng according to the architecture Signed-off-by: YangKeao <[email protected]> * use the same tag for stress-ng and memStress Signed-off-by: YangKeao <[email protected]> Signed-off-by: YangKeao <[email protected]>
1 parent ad91098 commit 9f6a5b8

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ endif
3030
PACKAGE_LIST := go list ./... | grep -vE "chaos-daemon/test|pkg/ptrace|zz_generated|vendor"
3131
PACKAGE_DIRECTORIES := $(PACKAGE_LIST) | sed 's|github.com/chaos-mesh/chaosd/||'
3232

33+
UNAME_M := $(shell uname -m)
34+
ifeq ($(UNAME_M),x86_64)
35+
ARCH = x86_64
36+
endif
37+
ifeq ($(UNAME_M),amd64)
38+
ARCH = x86_64
39+
endif
40+
ifeq ($(UNAME_M),aarch64)
41+
ARCH = aarch64
42+
endif
43+
ifeq ($(UNAME_M),arm64)
44+
ARCH = aarch64
45+
endif
46+
3347
$(GOBIN)/revive:
3448
$(GO) install github.com/mgechev/[email protected]
3549

@@ -67,7 +81,7 @@ chaos-tools:
6781
$(CGOENV) go build -o bin/tools/PortOccupyTool tools/PortOccupyTool.go
6882
$(CGOENV) go build -o bin/tools/FileTool tools/file/*.go
6983
ifeq (,$(wildcard bin/tools/stress-ng))
70-
curl -fsSL -o ./bin/tools/stress-ng https://mirrors.chaos-mesh.org/latest/stress-ng
84+
curl -fsSL -o ./bin/tools/stress-ng https://github.com/chaos-mesh/stress-ng/releases/download/v0.14.02/stress-ng-${ARCH}
7185
chmod +x ./bin/tools/stress-ng
7286
endif
7387
ifeq (,$(wildcard bin/tools/byteman))
@@ -76,7 +90,7 @@ ifeq (,$(wildcard bin/tools/byteman))
7690
mv ${BYTEMAN_DIR} ./bin/tools/byteman
7791
endif
7892
ifeq (,$(wildcard bin/tools/memStress))
79-
curl -fsSL -o memStress_v0.3-x86_64-linux-gnu.tar.gz https://github.com/chaos-mesh/memStress/releases/download/v0.3/memStress_v0.3-x86_64-linux-gnu.tar.gz
93+
curl -fsSL -o memStress_v0.3-x86_64-linux-gnu.tar.gz https://github.com/chaos-mesh/memStress/releases/download/v0.3/memStress_v0.3-${ARCH}-linux-gnu.tar.gz
8094
tar zxvf memStress_v0.3-x86_64-linux-gnu.tar.gz
8195
mv memStress ./bin/tools/memStress
8296
endif

0 commit comments

Comments
 (0)