Skip to content

Commit

Permalink
Make tier2 work with arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 committed Sep 21, 2021
1 parent e45b54c commit cc76e61
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ 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: 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
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -76,6 +81,7 @@ jobs:
run: |
echo "$CR_PAT" | docker login ghcr.io -u "$CR_USER" --password-stdin
docker push ghcr.io/dmoj/runtimes-tier1:aarch64-latest
docker push ghcr.io/dmoj/runtimes-tier2:aarch64-latest
env:
CR_USER: ${{ secrets.CR_USER }}
CR_PAT: ${{ secrets.CR_PAT }}
13 changes: 7 additions & 6 deletions tier2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ 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 && \
openjdk-17-jdk-headless clang ghc golang racket ruby scala nasm $([ "$(arch)" = x86_64 ] && echo libc6-dev-i386) && \
( \
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 -j$(nproc) && \
runuser -u judge -- opam install -y -j$(nproc) 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 && \
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 +32,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 && \
(cd /tmp && \
Expand Down

0 comments on commit cc76e61

Please sign in to comment.