Skip to content

Commit ccf6830

Browse files
authored
Merge pull request #3299 from apostasie/dev-binfmt
Ensure binfmt does install emulation for arm7 on the CI
2 parents 76f37c6 + 4fce7aa commit ccf6830

File tree

2 files changed

+40
-5
lines changed

2 files changed

+40
-5
lines changed

.github/workflows/test-canary.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,14 @@ jobs:
3232
sudo losetup -Dv
3333
sudo losetup -lv
3434
- name: "Register QEMU (tonistiigi/binfmt)"
35-
run: docker run --privileged --rm tonistiigi/binfmt --install all
35+
run: |
36+
# `--install all` will only install emulation for architectures that cannot be natively executed
37+
# Since some arm64 platforms do provide native fallback execution for 32 bits,
38+
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
39+
# To avoid that, we explicitly list the architectures we do want emulation for.
40+
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
41+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
42+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
3643
- name: "Run unit tests"
3744
run: go test -v ./pkg/...
3845
- name: "Run integration tests"

.github/workflows/test.yml

+32-4
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ jobs:
8484
sudo losetup -Dv
8585
sudo losetup -lv
8686
- name: "Register QEMU (tonistiigi/binfmt)"
87-
run: docker run --privileged --rm tonistiigi/binfmt --install all
87+
run: |
88+
# `--install all` will only install emulation for architectures that cannot be natively executed
89+
# Since some arm64 platforms do provide native fallback execution for 32 bits,
90+
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
91+
# To avoid that, we explicitly list the architectures we do want emulation for.
92+
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
93+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
94+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
8895
- name: "Run integration tests"
8996
uses: nick-fields/retry@v3
9097
with:
@@ -128,7 +135,14 @@ jobs:
128135
sudo losetup -Dv
129136
sudo losetup -lv
130137
- name: "Register QEMU (tonistiigi/binfmt)"
131-
run: docker run --privileged --rm tonistiigi/binfmt --install all
138+
run: |
139+
# `--install all` will only install emulation for architectures that cannot be natively executed
140+
# Since some arm64 platforms do provide native fallback execution for 32 bits,
141+
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
142+
# To avoid that, we explicitly list the architectures we do want emulation for.
143+
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
144+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
145+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
132146
- name: "Run integration tests"
133147
# The nested IPv6 network inside docker and qemu is complex and needs a bunch of sysctl config.
134148
# Therefore it's hard to debug why the IPv6 tests fail in such an isolation layer.
@@ -191,7 +205,14 @@ jobs:
191205
with:
192206
fetch-depth: 1
193207
- name: "Register QEMU (tonistiigi/binfmt)"
194-
run: docker run --privileged --rm tonistiigi/binfmt --install all
208+
run: |
209+
# `--install all` will only install emulation for architectures that cannot be natively executed
210+
# Since some arm64 platforms do provide native fallback execution for 32 bits,
211+
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
212+
# To avoid that, we explicitly list the architectures we do want emulation for.
213+
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
214+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
215+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
195216
- name: "Prepare (network driver=slirp4netns, port driver=builtin)"
196217
run: docker build -t ${TEST_TARGET} --target ${TEST_TARGET} --build-arg UBUNTU_VERSION=${UBUNTU_VERSION} --build-arg CONTAINERD_VERSION=${CONTAINERD_VERSION} --build-arg ROOTLESSKIT_VERSION=${ROOTLESSKIT_VERSION} .
197218
- name: "Disable BuildKit for RootlessKit v1 (workaround for issue #622)"
@@ -246,7 +267,14 @@ jobs:
246267
docker info
247268
docker version
248269
- name: "Register QEMU (tonistiigi/binfmt)"
249-
run: docker run --privileged --rm tonistiigi/binfmt --install all
270+
run: |
271+
# `--install all` will only install emulation for architectures that cannot be natively executed
272+
# Since some arm64 platforms do provide native fallback execution for 32 bits,
273+
# armv7 emulation may or may not be installed, causing variance in the result of `uname -m`.
274+
# To avoid that, we explicitly list the architectures we do want emulation for.
275+
docker run --privileged --rm tonistiigi/binfmt --install linux/amd64
276+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm64
277+
docker run --privileged --rm tonistiigi/binfmt --install linux/arm/v7
250278
- name: "Prepare integration test environment"
251279
run: |
252280
sudo apt-get install -y expect

0 commit comments

Comments
 (0)