Skip to content

Commit 402ea90

Browse files
committed
Atttempt to fix s390x CI
- Dockerfile to build multiarch Bazel - CI update to use the published image Signed-off-by: Martijn Stevenson <[email protected]>
1 parent 06399e7 commit 402ea90

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ jobs:
251251
arch: s390x
252252
action: test
253253
flags: --config=clang --test_timeout=1800
254-
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x piotrsikora/build-tools:bazel-5.2.0-clang-14-gcc-12
254+
# s390x build-tools image built from bazel/external/Dockerfile.bazel
255+
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x ghcr.io/proxy-wasm/build-tools:ubuntu-20.04-bazel-6.5.0
255256
cache: true
256257
- name: 'Wasmtime on macOS/x86_64'
257258
engine: 'wasmtime'

bazel/external/Dockerfile.bazel

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# Prep:
4+
# docker run --rm --privileged tonistiigi/binfmt --install all
5+
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
6+
# Need to see "F" flag: cat /proc/sys/fs/binfmt_misc/qemu-*
7+
#
8+
# Build:
9+
# docker buildx build --platform linux/s390x -t $IMAGE -f Dockerfile.bazel
10+
#
11+
# Push:
12+
# docker image tag $IMAGE ghcr.io/proxy-wasm/$IMAGE
13+
# docker push ghcr.io/proxy-wasm/$IMAGE
14+
#
15+
# Test:
16+
# docker run --rm --volume $(pwd):/mnt --workdir /mnt \
17+
# --platform linux/s390x $IMAGE \
18+
# bazel test --verbose_failures --test_output=errors \
19+
# --define engine=null --config=clang --test_timeout=1800 \
20+
# -- //test/...
21+
22+
# Update base image
23+
ARG UBUNTU_VERSION=20.04
24+
FROM ubuntu:${UBUNTU_VERSION} as build
25+
RUN apt update && apt upgrade -y
26+
RUN apt autoremove -y
27+
28+
# Install Bazel deps
29+
RUN apt install -y software-properties-common
30+
RUN add-apt-repository ppa:openjdk-r/ppa
31+
RUN apt install -y \
32+
build-essential \
33+
openjdk-11-jdk \
34+
python3 \
35+
curl \
36+
zip \
37+
unzip
38+
39+
# Download Bazel source
40+
ARG BAZEL_VERSION=6.5.0
41+
RUN cd ~ && mkdir bazel && cd bazel
42+
RUN curl -LO https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-dist.zip
43+
RUN unzip -q bazel-${BAZEL_VERSION}-dist.zip
44+
45+
# Build Bazel
46+
# NOTE: This step is flaky and frequently hangs for multiarch / buildx.
47+
# If it takes more than 2 hours, restart the Docker build and try again.
48+
ENV EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk"
49+
RUN bash ./compile.sh
50+
51+
# Copy output to /usr/bin
52+
RUN cp /output/bazel /usr/bin/bazel
53+
54+
# Install ProxyWasm build deps
55+
RUN apt install -y \
56+
git \
57+
python3-distutils \
58+
clang \
59+
libstdc++6

0 commit comments

Comments
 (0)