Skip to content

Commit

Permalink
Customize for VNOJ
Browse files Browse the repository at this point in the history
  • Loading branch information
hieplpvip committed Aug 17, 2023
1 parent 8cf47fe commit 1bd1956
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 82 deletions.
54 changes: 3 additions & 51 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
jobs:
amd64:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- name: Build tier 1 Docker image
Expand All @@ -27,9 +25,9 @@ jobs:
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:amd64-latest
docker push dmoj/runtimes-tier2:amd64-latest
docker push dmoj/runtimes-tier3:amd64-latest
docker push vnoj/runtimes-tier1:amd64-latest
docker push vnoj/runtimes-tier2:amd64-latest
docker push vnoj/runtimes-tier3: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 @@ -42,49 +40,3 @@ jobs:
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Push images to GitHub Containers
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master'
run: |
echo "$GITHUB_TOKEN" | docker login ghcr.io -u $ --password-stdin
docker push ghcr.io/dmoj/runtimes-tier1:amd64-latest
docker push ghcr.io/dmoj/runtimes-tier2:amd64-latest
docker push ghcr.io/dmoj/runtimes-tier3:amd64-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
arm64:
runs-on: [self-hosted, Linux, ARM64]
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- name: Build tier 1 Docker image
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 }}
- name: Push images to GitHub Containers
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref == 'refs/heads/master'
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 }}
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ TAG ?= latest
all: image-tier1 image-tier2 image-tier3

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

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

image-tier3: image-tier2
cd tier3 && docker build -t dmoj/runtimes-tier3 -t dmoj/runtimes-tier3:$(TAG) -t ghcr.io/dmoj/runtimes-tier3:$(TAG) .
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-tier1:
docker run --rm -v "`pwd`/test":/code --cap-add=SYS_PTRACE dmoj/runtimes-tier1
docker run --rm -v "`pwd`/test":/code --cap-add=SYS_PTRACE vnoj/runtimes-tier1

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

test-tier3:
docker run --rm -v "`pwd`/test-tier3":/code --cap-add=SYS_PTRACE dmoj/runtimes-tier3
docker run --rm -v "`pwd`/test-tier3":/code --cap-add=SYS_PTRACE vnoj/runtimes-tier3
2 changes: 1 addition & 1 deletion test-tier3/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
mkdir /judge
cd /judge || exit
curl -L https://github.com/DMOJ/judge/archive/master.tar.gz | tar -xz --strip-components=1
curl -L https://github.com/VNOI-Admin/judge-server/archive/master.tar.gz | tar -xz --strip-components=1
python3 -m venv --prompt=DMOJ env
env/bin/pip3 install -e .
runuser -u judge -w PATH -- bash -c '. ~/.profile; /judge/env/bin/python3 -u .docker.test.py'
2 changes: 1 addition & 1 deletion test/run
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
mkdir /judge
cd /judge || exit
curl -L https://github.com/DMOJ/judge/archive/master.tar.gz | tar -xz --strip-components=1
curl -L https://github.com/VNOI-Admin/judge-server/archive/master.tar.gz | tar -xz --strip-components=1
python3 -m venv --prompt=DMOJ env
env/bin/pip3 install -e .
runuser -u judge -w PATH -- bash -c '. ~/.profile; /judge/env/bin/dmoj-autoconf -V'
9 changes: 2 additions & 7 deletions tier1/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
image: dmoj/runtimes-tier1:latest
image: vnoj/runtimes-tier1:latest
manifests:
-
image: dmoj/runtimes-tier1:amd64-latest
image: vnoj/runtimes-tier1:amd64-latest
platform:
architecture: amd64
os: linux
-
image: dmoj/runtimes-tier1:aarch64-latest
platform:
architecture: arm64
os: linux
2 changes: 1 addition & 1 deletion tier2/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dmoj/runtimes-tier1
FROM vnoj/runtimes-tier1

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand Down
9 changes: 2 additions & 7 deletions tier2/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
image: dmoj/runtimes-tier2:latest
image: vnoj/runtimes-tier2:latest
manifests:
-
image: dmoj/runtimes-tier2:amd64-latest
image: vnoj/runtimes-tier2:amd64-latest
platform:
architecture: amd64
os: linux
-
image: dmoj/runtimes-tier2:aarch64-latest
platform:
architecture: arm64
os: linux
2 changes: 1 addition & 1 deletion tier3/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dmoj/runtimes-tier2
FROM vnoj/runtimes-tier2

RUN (cd /opt && \
case "$(arch)" in x86_64) DART_ARCH=x64;; aarch64) DART_ARCH=arm64;; *) false;; esac && \
Expand Down
9 changes: 2 additions & 7 deletions tier3/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
image: dmoj/runtimes-tier3:latest
image: vnoj/runtimes-tier3:latest
manifests:
-
image: dmoj/runtimes-tier3:amd64-latest
image: vnoj/runtimes-tier3:amd64-latest
platform:
architecture: amd64
os: linux
-
image: dmoj/runtimes-tier3:aarch64-latest
platform:
architecture: arm64
os: linux

0 comments on commit 1bd1956

Please sign in to comment.