From aa17a2d813b8674db6f46d149711f3775b5c0ac0 Mon Sep 17 00:00:00 2001 From: dodona-server Date: Tue, 5 Nov 2024 14:22:04 +0000 Subject: [PATCH 1/9] Chore: update dodona-tested dockerfile --- dodona-tested.dockerfile | 170 +++++++++++++++++++++++++-------------- 1 file changed, 108 insertions(+), 62 deletions(-) diff --git a/dodona-tested.dockerfile b/dodona-tested.dockerfile index d165ca8..f0ceeb8 100644 --- a/dodona-tested.dockerfile +++ b/dodona-tested.dockerfile @@ -1,73 +1,119 @@ +# This file is autogenerated by the dodona-edu/universal-judge repository +# Any changes will be overwritten by the CI + +# This is the Dockerfile for the tested judge. +# It can be downloaded using docker pull dodona/dodona-tested. + +# This docker image is run in our production environment. +# It should not contain any development tools or dependencies. +# Add those to dev-dependencies.sh instead. + FROM python:3.12.4-slim-bullseye -# Environment Kotlin +# Set up the environment + +# Kotlin ENV SDKMAN_DIR /usr/local/sdkman -ENV HASKELL_DIR /usr/local/ghcupdir ENV PATH $SDKMAN_DIR/candidates/kotlin/current/bin:$PATH ENV PATH $SDKMAN_DIR/candidates/java/current/bin:$PATH +# Haskell +ENV HASKELL_DIR /usr/local/ghcupdir ENV PATH $HASKELL_DIR/ghc/bin:$PATH ENV PATH $HASKELL_DIR/cabal:$PATH +# Node ENV NODE_PATH /usr/lib/node_modules -# Add manual directory for default-jdk -RUN mkdir -p /usr/share/man/man1mkdir -p /usr/share/man/man1 \ - && apt-get update \ - # Install additional dependencies - && apt-get install -y --no-install-recommends \ - procps \ - dos2unix \ - curl \ - zip \ - unzip \ - # Bash language dependencies - bc binutils bsdmainutils cowsay ed figlet file toilet tree vim xxd \ - # Dependencies for GHCup - autoconf build-essential zlib1g-dev libgmp-dev \ - && curl https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb --output packages-microsoft-prod.deb \ - && dpkg -i packages-microsoft-prod.deb \ - && rm packages-microsoft-prod.deb \ - # JavaScript dependencies - && bash -c 'set -o pipefail && curl -fsSL https://deb.nodesource.com/setup_22.x | bash -' \ - # Haskell dependencies - && bash -c "set -o pipefail && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh" \ - && bash -c "source /root/.ghcup/env && ghcup install ghc 9.6 --isolate $HASKELL_DIR/ghc" \ - && bash -c "source /root/.ghcup/env && ghcup install cabal --isolate $HASKELL_DIR/cabal" \ - # Install programming languages \ - && apt-get install -y --no-install-recommends \ - # Checkstyle, other Java stuff uses SDKMAN! below - checkstyle \ - hlint \ - # TESTed C judge dependency - gcc \ - cppcheck \ - # TESTed Javascript judge dependency - nodejs \ - # TESTed bash judge dependency - shellcheck \ - # C# dependency - dotnet-sdk-8.0 \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - # TESTed Judge depencencies - && pip install --no-cache-dir --upgrade psutil==5.9.8 attrs==23.2.0 cattrs==23.2.3 jsonschema==4.22.0 typing_inspect==0.9.0 pyyaml==6.0.1 Pygments==2.18.0 python-i18n==0.3.9 pylint==3.0.1 \ - # TESTed Kotlin judge dependencies - && bash -c 'set -o pipefail && curl -s "https://get.sdkman.io?rcupdate=false" | bash' \ - && chmod a+x "$SDKMAN_DIR/bin/sdkman-init.sh" \ - && bash -c "source \"$SDKMAN_DIR/bin/sdkman-init.sh\" && sdk install java 21.0.3-tem && sdk install kotlin" \ - && curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.2.1/ktlint \ - && chmod a+x ktlint \ - && mv ktlint /usr/local/bin \ - # JavaScript dependencies - && npm install -g eslint@8.57 abstract-syntax-tree@2.22 \ - # Haskell dependencies - && cabal update \ - && cabal v1-install --global aeson \ - # Make sure the students can't find our secret path, which is mounted in - # /mnt with a secure random name. - && chmod 711 /mnt \ - # Add the user which will run the student's code and the judge. - && useradd -m runner \ - && mkdir /home/runner/workdir \ - && chown -R runner:runner /home/runner/workdir + +# Install dependencies +RUN < Date: Tue, 12 Nov 2024 10:38:31 +0100 Subject: [PATCH 2/9] Update hadolint --- .github/workflows/lint.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 365e992..a966f56 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,9 +10,8 @@ jobs: matrix: image: [assembly, bash, c, compilers, csharp, docker, haskell, html, java, java21, nodejs, postgres, prolog, python, r, scheme, sqlite, tested] runs-on: ubuntu-latest + container: + image: hadolint/hadolint:latest steps: - uses: actions/checkout@v4 - - uses: brpaz/hadolint-action@master - with: - dockerfile: dodona-${{ matrix.image }}.dockerfile - ignore: DL3008 + - run: hadolint --ignore DL3008 dodona-${{ matrix.image }}.dockerfile From c473cb40287b2fb5ee59ee5859d01199e8eaf71a Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Tue, 12 Nov 2024 10:58:36 +0100 Subject: [PATCH 3/9] Try other hadolint action --- .github/workflows/lint.yml | 6 +++--- hadolint.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 hadolint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a966f56..b946a7b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,8 +10,8 @@ jobs: matrix: image: [assembly, bash, c, compilers, csharp, docker, haskell, html, java, java21, nodejs, postgres, prolog, python, r, scheme, sqlite, tested] runs-on: ubuntu-latest - container: - image: hadolint/hadolint:latest steps: - uses: actions/checkout@v4 - - run: hadolint --ignore DL3008 dodona-${{ matrix.image }}.dockerfile + - uses: jbergstroem/hadolint-gh-action@v1 + with: + dockerfile: dodona-${{ matrix.image }}.dockerfile \ No newline at end of file diff --git a/hadolint.yml b/hadolint.yml new file mode 100644 index 0000000..0aa5f7c --- /dev/null +++ b/hadolint.yml @@ -0,0 +1,2 @@ +ignored: + - DL3008 \ No newline at end of file From 4e01732284732f7b3cf5fa629a0faa39630529d0 Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Tue, 12 Nov 2024 11:00:22 +0100 Subject: [PATCH 4/9] Check if linting can also fail --- hadolint.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/hadolint.yml b/hadolint.yml index 0aa5f7c..e69de29 100644 --- a/hadolint.yml +++ b/hadolint.yml @@ -1,2 +0,0 @@ -ignored: - - DL3008 \ No newline at end of file From d107c9d713cbd751f47c2274c06a97d63a790be6 Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Tue, 12 Nov 2024 11:03:25 +0100 Subject: [PATCH 5/9] Fail on info --- .github/workflows/lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b946a7b..9f1eb78 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,4 +14,5 @@ jobs: - uses: actions/checkout@v4 - uses: jbergstroem/hadolint-gh-action@v1 with: - dockerfile: dodona-${{ matrix.image }}.dockerfile \ No newline at end of file + dockerfile: dodona-${{ matrix.image }}.dockerfile + error_level: 2 \ No newline at end of file From c932dd89a6df79fb6b549fd625c6487fe51e7edd Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Tue, 12 Nov 2024 11:06:49 +0100 Subject: [PATCH 6/9] Add hadolint config file --- .github/workflows/lint.yml | 3 ++- hadolint.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9f1eb78..8fe98c7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,4 +15,5 @@ jobs: - uses: jbergstroem/hadolint-gh-action@v1 with: dockerfile: dodona-${{ matrix.image }}.dockerfile - error_level: 2 \ No newline at end of file + error_level: 2 + config_file: ../../hadolint.yaml \ No newline at end of file diff --git a/hadolint.yml b/hadolint.yml index e69de29..0aa5f7c 100644 --- a/hadolint.yml +++ b/hadolint.yml @@ -0,0 +1,2 @@ +ignored: + - DL3008 \ No newline at end of file From 14bc3dcfd91631d5529f80544c365e779a9bff00 Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Tue, 12 Nov 2024 11:15:13 +0100 Subject: [PATCH 7/9] update config file path --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8fe98c7..5f500c3 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,4 +16,4 @@ jobs: with: dockerfile: dodona-${{ matrix.image }}.dockerfile error_level: 2 - config_file: ../../hadolint.yaml \ No newline at end of file + config_file: ./hadolint.yaml \ No newline at end of file From 4179b3351ac8c12e450b83c5b2511a6486d2eed6 Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Tue, 12 Nov 2024 11:18:10 +0100 Subject: [PATCH 8/9] update config file path --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5f500c3..7c8fcee 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,4 +16,4 @@ jobs: with: dockerfile: dodona-${{ matrix.image }}.dockerfile error_level: 2 - config_file: ./hadolint.yaml \ No newline at end of file + config_file: hadolint.yml \ No newline at end of file From eaa468c21fb47d44b59db16af1e2afa479fce9a4 Mon Sep 17 00:00:00 2001 From: "jorg.vr" Date: Tue, 12 Nov 2024 11:19:29 +0100 Subject: [PATCH 9/9] Raise error level --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 7c8fcee..bb35d77 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,5 +15,5 @@ jobs: - uses: jbergstroem/hadolint-gh-action@v1 with: dockerfile: dodona-${{ matrix.image }}.dockerfile - error_level: 2 + error_level: 1 config_file: hadolint.yml \ No newline at end of file