Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build arm64 images for higher tiers #51

Merged
merged 2 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,21 @@ jobs:
run: make TAG=aarch64-latest image-tier1
- name: Test tier 1 Docker image
run: make TAG=aarch64-latest test-tier1
- name: Build tier 2 Docker image
run: make TAG=aarch64-latest image-tier2
- name: Test tier 2 Docker image
run: make TAG=aarch64-latest test-tier2
- name: Build tier 3 Docker image
run: make TAG=aarch64-latest image-tier3
- name: Test tier 3 Docker image
run: make TAG=aarch64-latest test-tier3
- name: Push images to Docker
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master'
run: |
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
docker push dmoj/runtimes-tier1:aarch64-latest
docker push dmoj/runtimes-tier2:aarch64-latest
docker push dmoj/runtimes-tier3:aarch64-latest
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -74,5 +84,7 @@ jobs:
run: |
echo "$GITHUB_TOKEN" | docker login ghcr.io -u $ --password-stdin
docker push ghcr.io/dmoj/runtimes-tier1:aarch64-latest
docker push ghcr.io/dmoj/runtimes-tier2:aarch64-latest
docker push ghcr.io/dmoj/runtimes-tier3:aarch64-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion tier1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN echo deb http://deb.debian.org/debian/ stretch main > /etc/apt/sources.list.
apt-get update && \
apt-get install -y --no-install-recommends \
curl file gcc g++ python3-pip python3-dev python3-setuptools python3-wheel cython3 libseccomp-dev bzip2 gzip \
python2 fp-compiler libxtst6 tini ca-certificates-java && \
python2 fp-compiler libxtst6 tini ca-certificates-java $([ "$(arch)" = aarch64 ] && echo binutils-arm-linux-gnueabihf) && \
apt-get install -y -t stretch --no-install-recommends openjdk-8-jdk-headless openjdk-8-jre-headless && \
apt-get install -y -t experimental --no-install-recommends g++-11 && \
mkdir -p /etc/perl && \
Expand Down
17 changes: 10 additions & 7 deletions tier2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@ FROM dmoj/runtimes-tier1
RUN apt-get update && \
apt-get install -y --no-install-recommends \
jq apt-transport-https dirmngr gnupg ca-certificates \
openjdk-17-jdk-headless clang ghc golang racket ruby scala nasm libc6-dev-i386 chicken-bin && \
$([ "$(arch)" = x86_64 ] && echo libc6-dev-i386) $([ "$(arch)" = aarch64 ] && echo libffi6) \
openjdk-17-jdk-headless clang ghc golang racket ruby scala nasm chicken-bin && \
( export OPAMYES=1 OPAMJOBS=$(($(nproc) + 2)); \
apt-get install -y --no-install-recommends make m4 patch unzip libgmp-dev && \
bash -c 'echo | sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh) --no-backup' && \
runuser -u judge -- opam init --shell-setup --disable-sandboxing && \
runuser -u judge -- opam install base core stdio zarith && \
runuser -u judge -- opam clean && rm -rf ~judge/.opam/repo \
) && \
mkdir /opt/pypy2 && curl -L "$(curl https://www.pypy.org/download.html | grep /pypy2 | head -n1 | cut -d'"' -f4)" | \
if [ "$(arch)" = x86_64 ]; then PYPY_ARCH=linux64; else PYPY_ARCH="$(arch)"; fi && \
mkdir /opt/pypy2 && curl -L "$(curl https://www.pypy.org/download.html | grep "/pypy2.*$PYPY_ARCH" | head -n1 | cut -d'"' -f4)" | \
tar xj -C /opt/pypy2 --strip-components=1 && /opt/pypy2/bin/pypy -mcompileall && \
chmod a+rx /opt/pypy2/lib /opt/pypy2/lib/*.so* && \
rm -f /opt/pypy2/bin/python* && \
mkdir /opt/pypy3 && curl -L "$(curl https://www.pypy.org/download.html | grep /pypy3 | head -n1 | cut -d'"' -f4)" | \
mkdir /opt/pypy3 && curl -L "$(curl https://www.pypy.org/download.html | grep "/pypy3.*$PYPY_ARCH" | head -n1 | cut -d'"' -f4)" | \
tar xj -C /opt/pypy3 --strip-components=1 && /opt/pypy3/bin/pypy -mcompileall && \
rm -f /opt/pypy3/bin/python* && \
runuser judge -c 'curl https://sh.rustup.rs -sSf | sh -s -- -y' && \
Expand All @@ -31,13 +34,13 @@ RUN apt-get update && \
runuser -u judge /home/judge/.cargo/bin/cargo fetch \
) && \
rm -rf rust && \
curl -L -odmd.deb "$(curl -s https://dlang.org/download.html | perl -ne 'if(/"([^"~]*_amd64.deb)/){print $1;exit}')" && \
apt install ./dmd.deb && rm dmd.deb && \
if [ "$(arch)" = x86_64 ]; then curl -L -odmd.deb "$(curl -s https://dlang.org/download.html | perl -ne 'if(/"([^"~]*_amd64.deb)/){print $1;exit}')" && \
apt install ./dmd.deb && rm dmd.deb; fi && \
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
echo "deb https://download.mono-project.com/repo/debian stable-buster main" > \
/etc/apt/sources.list.d/mono-official-stable.list && \
curl https://dmoj.ca/dmoj-apt.key | apt-key add - && \
echo 'deb [arch=amd64] https://apt.dmoj.ca/ stretch main non-free' > /etc/apt/sources.list.d/dmoj.list && \
echo 'deb https://apt.dmoj.ca/ bullseye main' > /etc/apt/sources.list.d/dmoj.list && \
(echo 'Package: *'; echo 'Pin: origin download.mono-project.com'; echo 'Pin-Priority: 990') > /etc/apt/preferences.d/mono && \
apt-get update && \
dpkg-divert --package mono-roslyn --divert /usr/bin/chicken-csc --rename /usr/bin/csc && \
Expand All @@ -52,4 +55,4 @@ RUN apt-get update && \
rm -f *.deb) && \
rm -rf /var/lib/apt/lists/*

ENV PATH="/home/judge/.cargo/bin:/opt/pypy2/bin:/opt/pypy3/bin:${PATH}" DMOJ_CARGO_OFFLINE="1"
ENV PATH="/home/judge/.cargo/bin:/opt/pypy2/bin:/opt/pypy3/bin:/opt/dart-sdk/bin:${PATH}" DMOJ_CARGO_OFFLINE="1"
27 changes: 17 additions & 10 deletions tier3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
FROM dmoj/runtimes-tier2

RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo 'deb [arch=amd64] https://storage.googleapis.com/download.dartlang.org/linux/debian stable main' > /etc/apt/sources.list.d/dart.list && \
RUN (cd /opt && \
case "$(arch)" in x86_64) DART_ARCH=x64;; aarch64) DART_ARCH=arm64;; *) false;; esac && \
curl -L -odart.zip "https://storage.googleapis.com/dart-archive/channels/stable/release/$( \
curl -sSL https://storage.googleapis.com/dart-archive/channels/stable/release/latest/VERSION | jq -r .version \
)/sdk/dartsdk-linux-$DART_ARCH-release.zip" && \
unzip dart.zip && find /opt/dart-sdk -type d -exec chmod go+rx {} + && rm dart.zip) && \
apt-get update && \
apt-get install -y --no-install-recommends unzip libtinfo5 xz-utils libncurses5 \
gnucobol4 gnat gfortran tcl lua5.3 intercal php-cli dart/stable gforth swi-prolog pike8.0 sbcl && \
gnucobol4 gnat gfortran tcl lua5.3 intercal php-cli gforth swi-prolog pike8.0 sbcl && \
rm -rf /var/lib/apt/lists/* && \
mkdir /opt/swift && \
curl https://download.swift.org/swift-5.4.3-release/ubuntu1804/swift-5.4.3-RELEASE/swift-5.4.3-RELEASE-ubuntu18.04.tar.gz | \
tar xz -C /opt/swift --strip-components=1 && \
if [ "$(arch)" = x86_64 ]; then \
curl https://download.swift.org/swift-5.4.3-release/ubuntu1804/swift-5.4.3-RELEASE/swift-5.4.3-RELEASE-ubuntu18.04.tar.gz | \
tar xz -C /opt/swift --strip-components=1; fi && \
curl -L -ogroovy.zip "$(curl -s https://groovy.apache.org/download.html | perl -ne 'if(/(['"'"'"])(https:[^'"'"'"]+-binary-[\d.]+\.zip)\1/){print$2;exit}')" && \
unzip groovy.zip && \
mkdir /opt/groovy && \
Expand All @@ -17,12 +22,14 @@ RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &
curl -L -okotlin.zip "$(curl -s https://api.github.com/repos/JetBrains/kotlin/releases | \
jq -r '[.[] | select(.prerelease | not) | .assets | flatten | .[] | select(.name | startswith("kotlin-compiler")) | .browser_download_url][0]')" && \
unzip kotlin.zip && mv kotlinc /opt/kotlin && rm kotlin.zip && \
curl -L -otprolog.zip "https://github.com/yingted/OpenTuring/releases/download/v1.0.0-beta/tprolog-v1.0.0-beta.zip" && \
unzip tprolog.zip && mv tprolog /opt && rm tprolog.zip && \
if [ "$(arch)" = x86_64 ]; then \
curl -L -otprolog.zip "https://github.com/yingted/OpenTuring/releases/download/v1.0.0-beta/tprolog-v1.0.0-beta.zip" && \
unzip tprolog.zip && mv tprolog /opt && rm tprolog.zip; fi && \
mkdir /opt/zig && \
curl "https://ziglang.org/download/0.6.0/zig-linux-$(arch)-0.6.0.tar.xz" | tar xJ -C /opt/zig --strip-components=1 && \
mkdir /opt/lean && \
curl --compressed -L "https://github.com/leanprover/lean4/releases/download/v4.0.0-m2/lean-4.0.0-m2-linux.tar.gz" | \
tar xz -C /opt/lean --strip-components=1
if [ "$(arch)" = x86_64 ]; then \
mkdir /opt/lean && \
curl --compressed -L "https://github.com/leanprover/lean4/releases/download/v4.0.0-m2/lean-4.0.0-m2-linux.tar.gz" | \
tar xz -C /opt/lean --strip-components=1; fi

ENV PATH "/opt/tprolog:/opt/groovy/bin:/opt/kotlin/bin:${PATH}:/opt/swift/usr/bin:/opt/zig:/opt/lean/bin"