Skip to content

Commit

Permalink
tiericpc
Browse files Browse the repository at this point in the history
  • Loading branch information
hieplpvip committed Jul 31, 2024
1 parent 8b45cf9 commit 8b56266
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build tier icpc Docker image
run: make TAG=amd64-latest image-tiericpc
- name: Test tier icpc Docker image
run: make TAG=amd64-latest test-tiericpc
- name: Build tier 1 Docker image
run: make TAG=amd64-latest image-tier1
- name: Test tier 1 Docker image
Expand All @@ -28,6 +32,7 @@ jobs:
docker push vnoj/runtimes-tier1:amd64-latest
docker push vnoj/runtimes-tier2:amd64-latest
docker push vnoj/runtimes-tier3:amd64-latest
docker push vnoj/runtimes-tiericpc:amd64-latest
docker run -v "$(pwd)":/code mplatform/manifest-tool \
--username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD" \
push from-spec /code/tier1/manifest.yml
Expand All @@ -37,6 +42,9 @@ jobs:
docker run -v "$(pwd)":/code mplatform/manifest-tool \
--username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD" \
push from-spec /code/tier3/manifest.yml
docker run -v "$(pwd)":/code mplatform/manifest-tool \
--username="$DOCKER_USERNAME" --password="$DOCKER_PASSWORD" \
push from-spec /code/tiericpc/manifest.yml
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
TAG ?= latest

.PHONY: all image-tier1 image-tier2 image-tier3 test-tier1 test-tier2 test-tier3
.PHONY: all image-tiericpc image-tier1 image-tier2 image-tier3 test-tiericpc test-tier1 test-tier2 test-tier3

all: image-tier1 image-tier2 image-tier3
all: image-tiericpc image-tier1 image-tier2 image-tier3

image-tiericpc:
cd tiericpc && docker build -t vnoj/runtimes-tiericpc -t vnoj/runtimes-tiericpc:$(TAG) -t ghcr.io/vnoj/runtimes-tiericpc:$(TAG) .

image-tier1:
cd tier1 && docker build -t vnoj/runtimes-tier1 -t vnoj/runtimes-tier1:$(TAG) -t ghcr.io/vnoj/runtimes-tier1:$(TAG) .
Expand All @@ -13,7 +16,10 @@ image-tier2: image-tier1
image-tier3: image-tier2
cd tier3 && docker build -t vnoj/runtimes-tier3 -t vnoj/runtimes-tier3:$(TAG) -t ghcr.io/vnoj/runtimes-tier3:$(TAG) .

test: test-tier1 test-tier2 test-tier3
test: test-tiericpc test-tier1 test-tier2 test-tier3

test-tiericpc:
docker run --rm -v "`pwd`/test":/code --cap-add=SYS_PTRACE vnoj/runtimes-tiericpc

test-tier1:
docker run --rm -v "`pwd`/test":/code --cap-add=SYS_PTRACE vnoj/runtimes-tier1
Expand Down
44 changes: 44 additions & 0 deletions tiericpc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM ubuntu:jammy

RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl file gcc g++ python3-full python3-pip python3-dev python3-setuptools python3-wheel cython3 libseccomp-dev bzip2 unzip \
tini ca-certificates-java openjdk-17-jdk-headless openjdk-17-jre-headless \
$([ "$(arch)" = aarch64 ] && echo binutils-arm-linux-gnueabihf)

RUN if [ "$(arch)" = x86_64 ]; then DEB_ARCH=amd64; else DEB_ARCH=arm64; fi && \
if [ "$(arch)" = x86_64 ]; then OPENJDK_BUILD=24567508; else OPENJDK_BUILD=24567509; fi && \
OPENJDK_FILES_URL="https://launchpad.net/~openjdk-security/+archive/ubuntu/ppa/+build/$OPENJDK_BUILD/+files" && \
curl -L -O $OPENJDK_FILES_URL/openjdk-17-jdk-headless_17.0.5+8-2ubuntu1~22.04_$DEB_ARCH.deb && \
curl -L -O $OPENJDK_FILES_URL/openjdk-17-jre-headless_17.0.5+8-2ubuntu1~22.04_$DEB_ARCH.deb && \
dpkg -i *.deb && rm *.deb

RUN if [ "$(arch)" = x86_64 ]; then DEB_ARCH=amd64; else DEB_ARCH=arm64; fi && \
if [ "$(arch)" = x86_64 ]; then GCC_BUILD=23596444; else GCC_BUILD=23596445; fi && \
GCC_FILES_URL="https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/ppa/+build/$GCC_BUILD/+files" && \
curl -L -O $GCC_FILES_URL/cpp-11_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \
curl -L -O $GCC_FILES_URL/g++-11_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \
curl -L -O $GCC_FILES_URL/gcc-11_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \
curl -L -O $GCC_FILES_URL/gcc-11-base_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \
curl -L -O $GCC_FILES_URL/libgcc-11-dev_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \
curl -L -O $GCC_FILES_URL/libstdc++-11-dev_11.3.0-1ubuntu1~22.04_$DEB_ARCH.deb && \
dpkg -i *.deb && rm *.deb

RUN if [ "$(arch)" = x86_64 ]; then PYPY_ARCH=linux64; else PYPY_ARCH="$(arch)"; fi && \
mkdir /opt/pypy2 && curl -L "https://downloads.python.org/pypy/pypy2.7-v7.3.10-$PYPY_ARCH.tar.bz2" | \
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 "https://downloads.python.org/pypy/pypy3.9-v7.3.10-$PYPY_ARCH.tar.bz2" | \
tar xj -C /opt/pypy3 --strip-components=1 && /opt/pypy3/bin/pypy -mcompileall && \
rm -f /opt/pypy3/bin/python*

RUN curl -L -okotlin.zip https://github.com/JetBrains/kotlin/releases/download/v1.7.21/kotlin-compiler-1.7.21.zip && \
unzip kotlin.zip && mv kotlinc /opt/kotlin && rm kotlin.zip

RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \
useradd -m judge

ENV PATH="/opt/kotlin/bin:/opt/pypy3/bin:${PATH}"

ENTRYPOINT ["/usr/bin/tini", "/code/run"]
12 changes: 12 additions & 0 deletions tiericpc/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
image: vnoj/runtimes-tiericpc:latest
manifests:
-
image: vnoj/runtimes-tiericpc:amd64-latest
platform:
architecture: amd64
os: linux
-
image: vnoj/runtimes-tiericpc:aarch64-latest
platform:
architecture: arm64
os: linux

0 comments on commit 8b56266

Please sign in to comment.