From 33f508d610f4e915aa1abc9911dd7bde94b05e85 Mon Sep 17 00:00:00 2001 From: Maarten Sijm <9739541+mpsijm@users.noreply.github.com> Date: Thu, 28 Apr 2022 21:12:53 +0200 Subject: [PATCH] Judgehost: Use ICPC mirror for kotlinc --- .gitignore | 2 -- judgehost/Dockerfile | 2 -- judgehost/build.sh | 8 -------- judgehost/install_languages.sh | 31 ++++++++++++++++--------------- 4 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.gitignore b/.gitignore index 04e43b5..4378590 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ *.env cds/ db_data -kotlin-compiler.zip -kotlinc/ diff --git a/judgehost/Dockerfile b/judgehost/Dockerfile index f266c81..65bbf1c 100644 --- a/judgehost/Dockerfile +++ b/judgehost/Dockerfile @@ -8,5 +8,3 @@ ENV LANG_CSHARP=yes ENV LANG_PYPY3=yes ENV CHROOT=/chroot/domjudge COPY install_languages.sh / -ARG KOTLIN_VERSION=1.5.31 -COPY --chown=domjudge:domjudge kotlinc /usr/local/lib/kotlinc diff --git a/judgehost/build.sh b/judgehost/build.sh index 78f1820..9ac1de6 100755 --- a/judgehost/build.sh +++ b/judgehost/build.sh @@ -3,7 +3,6 @@ set -e DEFAULT_VERSION=8.0.0 -KOTLIN_VERSION=1.5.31 VERSION=$1 if [ -z ${VERSION} ] then @@ -13,13 +12,6 @@ then VERSION=${DEFAULT_VERSION} fi -if [ ! -d kotlinc ]; then - # cheat so there is no need to install curl and unzip the image and faster when fine tuning - echo "Downloading kotlin distribution" - curl -o kotlin-compiler.zip -L https://github.com/JetBrains/kotlin/releases/download/v${KOTLIN_VERSION}/kotlin-compiler-${KOTLIN_VERSION}.zip - unzip kotlin-compiler.zip -fi - # To add packages in chroot we need to run in privileged mode and this can't be done in a docker file. docker build -t domjudge/judgehost-extended:${VERSION}-build -f Dockerfile --build-arg VERSION=${VERSION} . docker rm -f domjudge-judgehost-extended-${VERSION}-build 2>&1 || true diff --git a/judgehost/install_languages.sh b/judgehost/install_languages.sh index de2c5ca..8486e18 100755 --- a/judgehost/install_languages.sh +++ b/judgehost/install_languages.sh @@ -32,21 +32,22 @@ install_pypy3() { install_kotlin() { - # Package is downloaded and unzipped by docker file, just create links for path - # Directory matters, e.g. installing in /opt fails - ln -s /usr/local/lib/kotlinc/bin/kotlinc /usr/bin/kotlinc - ln -s /usr/local/lib/kotlinc/bin/kotlin /usr/bin/kotlin - # copy full kotlin distribution - cp -r usr/local/lib/kotlinc ${CHROOT}/usr/local/lib/ - # remove kotlinx jars since they are not allowed during contest - rm ${CHROOT}/usr/local/lib/kotlinc/lib/kotlinx*.jar - # remove unessecary jars - rm ${CHROOT}/usr/local/lib/kotlinc/lib/kotlin-test*.jar - rm ${CHROOT}/usr/local/lib/kotlinc/lib/kotlin-annotation*.jar - rm ${CHROOT}/usr/local/lib/kotlinc/lib/android*.jar - rm ${CHROOT}/usr/local/lib/kotlinc/lib/*compiler*.jar - rm ${CHROOT}/usr/local/lib/kotlinc/lib/js*.jar - /opt/domjudge/judgehost/bin/dj_run_chroot "ln -s /usr/local/lib/kotlinc/bin/kotlin /usr/bin/kotlin && ln -s /usr/local/lib/kotlinc/bin/kotlinc /usr/bin/kotlinc" + echo "deb [trusted=yes] https://pc2.ecs.baylor.edu/apt focal main" >> /etc/apt/sources.list + echo 'Acquire::https::pc2.ecs.baylor.edu::Verify-Peer "false"; +Acquire::https::pc2.ecs.baylor.edu::Verify-Host "false";' >> /etc/apt/apt.conf.d/80trust-baylor-mirror + + echo "deb [trusted=yes] https://pc2.ecs.baylor.edu/apt focal main" >> ${CHROOT}/etc/apt/sources.list + echo 'Acquire::https::pc2.ecs.baylor.edu::Verify-Peer "false"; +Acquire::https::pc2.ecs.baylor.edu::Verify-Host "false";' >> ${CHROOT}/etc/apt/apt.conf.d/80trust-baylor-mirror + + ln -s /usr/lib/kotlinc/bin/kotlinc /usr/bin/kotlinc + ln -s /usr/lib/kotlinc/bin/kotlin /usr/bin/kotlin + + ln -s ${CHROOT}/usr/lib/kotlinc/bin/kotlinc ${CHROOT}/usr/bin/kotlinc + ln -s ${CHROOT}/usr/lib/kotlinc/bin/kotlin ${CHROOT}/usr/bin/kotlin + + DEB_PACKAGES="icpc-kotlinc $DEB_PACKAGES" + CHROOT_PACKAGES="icpc-kotlinc $CHROOT_PACKAGES" } install_csharp() {