Skip to content

Commit 7980968

Browse files
committed
Add ARM64 architecture support to e2e tests
This change allows Mac users to run e2e tests locally with reduced build time. Signed-off-by: abicky <takeshi.arabiki@gmail.com>
1 parent b103dad commit 7980968

File tree

4 files changed

+40
-22
lines changed

4 files changed

+40
-22
lines changed

e2e/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
.PHONY:chain
22
chain:
3-
# For Apple Silicon explicit declaration 'linux/amd64' is required
4-
DOCKER_DEFAULT_PLATFORM=linux/amd64 make -C chains build
5-
DOCKER_DEFAULT_PLATFORM=linux/amd64 make -C chains network
3+
make -C chains build
4+
make -C chains network
65
# Wait for one epoch to use BEP-126 validator
76
sleep 60
87

e2e/chains/bsc/Dockerfile.bootstrap

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
1-
FROM ghcr.io/foundry-rs/foundry:v0.3.0
1+
FROM ghcr.io/foundry-rs/foundry:v1.2.3
22

3-
RUN apk add --d --no-cache npm nodejs bash alpine-sdk expect jq curl bash python3-dev py3-pip
3+
USER root
4+
5+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
6+
curl \
7+
expect \
8+
jq \
9+
python3 \
10+
python3-poetry \
11+
&& rm -rf /var/cache/apt/*
12+
13+
# Manually install poetry because the apt version (1.1.12) is too old
14+
# and causes "The Poetry configuration is invalid" errors
415
RUN curl -sSL https://install.python-poetry.org | python3 -
516

17+
# Manually install Node.js because the apt version (v12.22.9) is too old
18+
# and causes "Error: Cannot find module 'node:crypto'" errors
19+
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x nodesource_setup.sh | bash \
20+
&& apt-get install --no-install-recommends -y nodejs \
21+
&& rm -rf /var/cache/apt/*
22+
623
RUN git clone https://github.com/bnb-chain/bsc-genesis-contract -b develop /root/genesis \
724
&& cd /root/genesis && git checkout bf3ac733f8aaf93ed88ca0ad2dcddd051166e4e1 && npm ci
825

926
RUN cd /root/genesis && /root/.local/bin/poetry install
10-
RUN cd /root/genesis && forge install --no-git --no-commit foundry-rs/forge-std@v1.7.3
27+
RUN cd /root/genesis && forge install --no-git foundry-rs/forge-std@v1.7.3
1128

1229
# override resources
1330
COPY genesis/ /root/genesis/

e2e/chains/bsc/Dockerfile.bsc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
FROM golang:1.23-alpine
1+
FROM golang:1.23
22

33
ARG GIT_SOURCE
44
ARG GIT_CHECKOUT_BRANCH
55

6-
RUN apk add --no-cache make cmake gcc musl-dev linux-headers git bash build-base libc-dev jq
6+
RUN apt-get update && apt-get install --no-install-recommends -y \
7+
netcat-openbsd \
8+
&& rm -rf /var/cache/apt/*
79

810
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
911
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"

e2e/chains/bsc/docker-compose.simple.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ services:
7070
- bsc-rpc:/root/.ethereum
7171
- ./scripts:/scripts
7272
- ./config:/config
73-
command: ash /scripts/bsc-rpc.sh
73+
command: bash /scripts/bsc-rpc.sh
7474
healthcheck:
75-
test: ["CMD", "ash", "/scripts/healthcheck.sh"]
75+
test: ["CMD", "bash", "/scripts/healthcheck.sh"]
7676
interval: "5s"
7777
start_period: "10s"
7878

@@ -89,9 +89,9 @@ services:
8989
- bsc-rpc2:/root/.ethereum
9090
- ./scripts:/scripts
9191
- ./config:/config
92-
command: ash /scripts/bsc-rpc.sh
92+
command: bash /scripts/bsc-rpc.sh
9393
healthcheck:
94-
test: ["CMD", "ash", "/scripts/healthcheck.sh"]
94+
test: ["CMD", "bash", "/scripts/healthcheck.sh"]
9595
interval: "5s"
9696
start_period: "10s"
9797

@@ -106,7 +106,7 @@ services:
106106
volumes:
107107
- bsc-validator1-1:/root/.ethereum
108108
- ./scripts:/scripts
109-
command: ash /scripts/bsc-validator.sh
109+
command: bash /scripts/bsc-validator.sh
110110

111111
bsc-validator1-2:
112112
image: bsc-geth:docker-local
@@ -119,7 +119,7 @@ services:
119119
volumes:
120120
- bsc-validator1-2:/root/.ethereum
121121
- ./scripts:/scripts
122-
command: ash /scripts/bsc-validator.sh
122+
command: bash /scripts/bsc-validator.sh
123123

124124
bsc-validator1-3:
125125
image: bsc-geth:docker-local
@@ -132,7 +132,7 @@ services:
132132
volumes:
133133
- bsc-validator1-3:/root/.ethereum
134134
- ./scripts:/scripts
135-
command: ash /scripts/bsc-validator.sh
135+
command: bash /scripts/bsc-validator.sh
136136

137137
bsc-validator1-4:
138138
image: bsc-geth:docker-local
@@ -145,7 +145,7 @@ services:
145145
volumes:
146146
- bsc-validator1-4:/root/.ethereum
147147
- ./scripts:/scripts
148-
command: ash /scripts/bsc-validator.sh
148+
command: bash /scripts/bsc-validator.sh
149149

150150
bsc-validator1-5:
151151
image: bsc-geth:docker-local
@@ -158,7 +158,7 @@ services:
158158
volumes:
159159
- bsc-validator1-5:/root/.ethereum
160160
- ./scripts:/scripts
161-
command: ash /scripts/bsc-validator.sh
161+
command: bash /scripts/bsc-validator.sh
162162

163163
bsc-validator2-1:
164164
image: bsc-geth:docker-local
@@ -171,7 +171,7 @@ services:
171171
volumes:
172172
- bsc-validator2-1:/root/.ethereum
173173
- ./scripts:/scripts
174-
command: ash /scripts/bsc-validator.sh
174+
command: bash /scripts/bsc-validator.sh
175175

176176
bsc-validator2-2:
177177
image: bsc-geth:docker-local
@@ -184,7 +184,7 @@ services:
184184
volumes:
185185
- bsc-validator2-2:/root/.ethereum
186186
- ./scripts:/scripts
187-
command: ash /scripts/bsc-validator.sh
187+
command: bash /scripts/bsc-validator.sh
188188

189189
bsc-validator2-3:
190190
image: bsc-geth:docker-local
@@ -197,7 +197,7 @@ services:
197197
volumes:
198198
- bsc-validator2-3:/root/.ethereum
199199
- ./scripts:/scripts
200-
command: ash /scripts/bsc-validator.sh
200+
command: bash /scripts/bsc-validator.sh
201201

202202
bsc-validator2-4:
203203
image: bsc-geth:docker-local
@@ -210,7 +210,7 @@ services:
210210
volumes:
211211
- bsc-validator2-4:/root/.ethereum
212212
- ./scripts:/scripts
213-
command: ash /scripts/bsc-validator.sh
213+
command: bash /scripts/bsc-validator.sh
214214

215215
bsc-validator2-5:
216216
image: bsc-geth:docker-local
@@ -223,7 +223,7 @@ services:
223223
volumes:
224224
- bsc-validator2-5:/root/.ethereum
225225
- ./scripts:/scripts
226-
command: ash /scripts/bsc-validator.sh
226+
command: bash /scripts/bsc-validator.sh
227227

228228
autoheal:
229229
restart: always

0 commit comments

Comments
 (0)