From e15177297b195cb01ccaf63b294a41067cf7e88f Mon Sep 17 00:00:00 2001 From: Aosen Xiong <82676488+Ao-senXiong@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:17:08 -0800 Subject: [PATCH] Update Docker images (#939) Co-authored-by: Werner Dietl --- build.gradle | 53 +++++++++---------- .../bin-devel/Dockerfile-ubuntu-jdk-latest | 36 +++++++++---- .../Dockerfile-ubuntu-jdk-latest-plus | 25 +++++---- checker/bin-devel/Dockerfile-ubuntu-jdk-next | 36 +++++++++---- .../bin-devel/Dockerfile-ubuntu-jdk-next-plus | 25 +++++---- checker/bin-devel/Dockerfile-ubuntu-jdk11 | 34 ++++++++++-- .../bin-devel/Dockerfile-ubuntu-jdk11-plus | 37 +++++++++++-- checker/bin-devel/Dockerfile-ubuntu-jdk17 | 35 +++++++++--- .../bin-devel/Dockerfile-ubuntu-jdk17-plus | 38 ++++++++++--- checker/bin-devel/Dockerfile-ubuntu-jdk20 | 9 +++- .../bin-devel/Dockerfile-ubuntu-jdk20-plus | 9 +++- checker/bin-devel/Dockerfile-ubuntu-jdk21 | 37 ++++++++----- .../bin-devel/Dockerfile-ubuntu-jdk21-plus | 26 +++++---- checker/bin-devel/Dockerfile-ubuntu-jdk8 | 34 ++++++++++-- checker/bin-devel/Dockerfile-ubuntu-jdk8-plus | 37 +++++++++++-- 15 files changed, 345 insertions(+), 126 deletions(-) diff --git a/build.gradle b/build.gradle index 1648d452ef4..92e422f4444 100644 --- a/build.gradle +++ b/build.gradle @@ -756,7 +756,7 @@ task downloadJtreg(type: Download) { // src 'https://checkerframework.org/jtreg-4.2.0-tip.tar.gz' // dest new File(buildDir, 'jtreg-4.2.0-tip.tar.gz') // src 'https://builds.shipilev.net/jtreg/jtreg4.2-b16.zip' - src 'https://builds.shipilev.net/jtreg/jtreg-6.2%2B1.zip' + src 'https://builds.shipilev.net/jtreg/jtreg-7.5+1.zip' dest new File(buildDir, 'jtreg.zip') overwrite true retries 3 @@ -1019,8 +1019,15 @@ subprojects { // Add jtregTests to framework and checker modules if (project.name.is('framework') || project.name.is('checker')) { - tasks.create(name: 'jtregTests', dependsOn: ':downloadJtreg', group: 'Verification') { + tasks.create(name: 'jtregTests', group: 'Verification') { description 'Run the jtreg tests.' + + if (currentRuntimeJavaVersion < 11) { + // jtreg only works on JDK 11+ + return + } + + dependsOn(':downloadJtreg') dependsOn('compileJava') dependsOn('compileTestJava') dependsOn('shadowJar') @@ -1045,32 +1052,22 @@ subprojects { // Required for checker/jtreg/nullness/PersistUtil.java and other tests "-vmoptions:-classpath ${tasks.shadowJar.archiveFile.get()}:${sourceSets.test.output.asPath}", ] - if (isJava8) { - // Use Error Prone javac and source/target 8 - args += [ - "-vmoptions:-Xbootclasspath/p:${configurations.javacJar.asPath}", - "-javacoptions:-Xbootclasspath/p:${configurations.javacJar.asPath}", - '-javacoptions:-source 8', - '-javacoptions:-target 8' - ] - } else { - args += [ - // checker/jtreg/nullness/defaultsPersist/ReferenceInfoUtil.java - // uses the jdk.jdeps module. - '-javacoptions:--add-modules jdk.jdeps', - '-javacoptions:--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED', - '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED', - ] - } + args += [ + // checker/jtreg/nullness/defaultsPersist/ReferenceInfoUtil.java + // uses the jdk.jdeps module. + '-javacoptions:--add-modules jdk.jdeps', + '-javacoptions:--add-exports=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.jdeps/com.sun.tools.classfile=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED', + '-vmoptions:--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED', + ] if (project.name.is('framework')) { // Do not check for the annotated JDK args += [ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk-latest b/checker/bin-devel/Dockerfile-ubuntu-jdk-latest index 2df43c21e3a..f1cfb6f5460 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk-latest +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk-latest @@ -5,7 +5,7 @@ # See releases at https://hub.docker.com/_/ubuntu for available images. # See https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=openjdk-21-jdk&searchon=names # to see what Ubuntu versions support a particular OpenJDK version. -FROM ubuntu:23.10 +FROM ubuntu:rolling MAINTAINER Werner Dietl # According to @@ -25,6 +25,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ openjdk-21-jdk +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -37,21 +39,33 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - pipx \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 -# Maven 3.8.7 is the default on Ubuntu 23.04, so the below is not needed. +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. # (Don't try to use a variable here for the Maven version.) -# RUN export DEBIAN_FRONTEND=noninteractive \ -# && wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.tar.gz \ -# && tar xzvf apache-maven-3.9.2-bin.tar.gz -# ENV PATH="/apache-maven-3.9.2/bin:$PATH" +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" -ENV PATH="/root/.local/bin:$PATH" -RUN pipx install --pip-args="--no-cache-dir" lithium-reducer +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer RUN mkdir /python-env \ && python3 -m venv /python-env \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk-latest-plus b/checker/bin-devel/Dockerfile-ubuntu-jdk-latest-plus index 4a7303b8bac..ea4f941387a 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk-latest-plus +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk-latest-plus @@ -6,7 +6,7 @@ # See releases at https://hub.docker.com/_/ubuntu for available images. # See https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=openjdk-20-jdk&searchon=names # to see what Ubuntu versions support a particular OpenJDK version. -FROM ubuntu:23.10 +FROM ubuntu:rolling MAINTAINER Werner Dietl # According to @@ -26,6 +26,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ openjdk-21-jdk +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -38,18 +40,23 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - pipx \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 -# Maven 3.8.7 is the default on Ubuntu 23.04, so the below is not needed. +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. # (Don't try to use a variable here for the Maven version.) -# RUN export DEBIAN_FRONTEND=noninteractive \ -# && wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.tar.gz \ -# && tar xzvf apache-maven-3.9.2-bin.tar.gz -# ENV PATH="/apache-maven-3.9.2/bin:$PATH" +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk-next b/checker/bin-devel/Dockerfile-ubuntu-jdk-next index 8c88e3d29eb..bf7d701254d 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk-next +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk-next @@ -5,7 +5,7 @@ # See releases at https://hub.docker.com/_/ubuntu for available images. # See https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=openjdk-22-jdk&searchon=names # to see what Ubuntu versions support a particular OpenJDK version. -FROM ubuntu:mantic +FROM ubuntu:rolling MAINTAINER Werner Dietl # According to @@ -25,6 +25,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ openjdk-22-jdk +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -37,21 +39,33 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - pipx \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 -# Maven 3.8.7 is the default on Ubuntu 23.04, so the below is not needed. +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. # (Don't try to use a variable here for the Maven version.) -# RUN export DEBIAN_FRONTEND=noninteractive \ -# && wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.tar.gz \ -# && tar xzvf apache-maven-3.9.2-bin.tar.gz -# ENV PATH="/apache-maven-3.9.2/bin:$PATH" +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" -ENV PATH="/root/.local/bin:$PATH" -RUN pipx install --pip-args="--no-cache-dir" lithium-reducer +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer RUN mkdir /python-env \ && python3 -m venv /python-env \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk-next-plus b/checker/bin-devel/Dockerfile-ubuntu-jdk-next-plus index 8077ff69948..b2fb0dd3744 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk-next-plus +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk-next-plus @@ -6,7 +6,7 @@ # See releases at https://hub.docker.com/_/ubuntu for available images. # See https://packages.ubuntu.com/search?suite=default§ion=all&arch=any&keywords=openjdk-20-jdk&searchon=names # to see what Ubuntu versions support a particular OpenJDK version. -FROM ubuntu:mantic +FROM ubuntu:rolling MAINTAINER Werner Dietl # According to @@ -26,6 +26,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ openjdk-22-jdk +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -38,18 +40,23 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - pipx \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 -# Maven 3.8.7 is the default on Ubuntu 23.04, so the below is not needed. +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. # (Don't try to use a variable here for the Maven version.) -# RUN export DEBIAN_FRONTEND=noninteractive \ -# && wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.2/binaries/apache-maven-3.9.2-bin.tar.gz \ -# && tar xzvf apache-maven-3.9.2-bin.tar.gz -# ENV PATH="/apache-maven-3.9.2/bin:$PATH" +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk11 b/checker/bin-devel/Dockerfile-ubuntu-jdk11 index af90925a8b1..77c98d65f3d 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk11 +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk11 @@ -26,6 +26,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ && update-java-alternatives -s java-1.11.0-openjdk-amd64 +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -38,13 +40,37 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - python3-pip \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 + +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. +# (Don't try to use a variable here for the Maven version.) +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" + +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer -RUN pip3 install --no-cache-dir lithium-reducer PyGithub pyyaml +RUN mkdir /python-env \ +&& python3 -m venv /python-env \ +&& /python-env/bin/pip install --no-cache-dir lithium-reducer PyGithub pyyaml RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get autoremove \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk11-plus b/checker/bin-devel/Dockerfile-ubuntu-jdk11-plus index 2d39223c21e..c09b0dce140 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk11-plus +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk11-plus @@ -26,6 +26,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ && update-java-alternatives -s java-1.11.0-openjdk-amd64 +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -38,11 +40,23 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - python3-pip \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 + +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. +# (Don't try to use a variable here for the Maven version.) +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ @@ -73,7 +87,22 @@ RUN export DEBIAN_FRONTEND=noninteractive \ texlive-latex-extra \ texlive-latex-recommended -RUN pip3 install --no-cache-dir black flake8 html5validator lithium-reducer PyGithub pyyaml +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install black \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install flake8 \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install html5validator \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer + +RUN mkdir /python-env \ +&& python3 -m venv /python-env \ +&& /python-env/bin/pip install --no-cache-dir lithium-reducer PyGithub pyyaml RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get autoremove \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk17 b/checker/bin-devel/Dockerfile-ubuntu-jdk17 index b87f044e3f1..855d910abf5 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk17 +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk17 @@ -24,6 +24,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ && aptitude -y install \ openjdk-17-jdk +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -36,20 +38,37 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - python3-pip \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 -# Maven 3.6.3 (the default on Ubuntu 22.10) does not run under JDK 17. +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. # (Don't try to use a variable here for the Maven version.) RUN export DEBIAN_FRONTEND=noninteractive \ -&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz \ -&& tar xzvf apache-maven-3.9.5-bin.tar.gz -ENV PATH="/apache-maven-3.9.5/bin:$PATH" +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" + +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer -RUN pip3 install --no-cache-dir lithium-reducer PyGithub pyyaml +RUN mkdir /python-env \ +&& python3 -m venv /python-env \ +&& /python-env/bin/pip install --no-cache-dir lithium-reducer PyGithub pyyaml RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get autoremove \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk17-plus b/checker/bin-devel/Dockerfile-ubuntu-jdk17-plus index 33c09dc6641..073680c1e53 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk17-plus +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk17-plus @@ -24,6 +24,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ && aptitude -y install \ openjdk-17-jdk +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -36,18 +38,23 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - python3-pip \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 -# Maven 3.6.3 (the default on Ubuntu 22.10) does not run under JDK 17. +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. # (Don't try to use a variable here for the Maven version.) RUN export DEBIAN_FRONTEND=noninteractive \ -&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz \ -&& tar xzvf apache-maven-3.9.5-bin.tar.gz -ENV PATH="/apache-maven-3.9.5/bin:$PATH" +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ @@ -78,7 +85,22 @@ RUN export DEBIAN_FRONTEND=noninteractive \ texlive-latex-extra \ texlive-latex-recommended -RUN pip3 install --no-cache-dir black flake8 html5validator lithium-reducer PyGithub pyyaml +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install black \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install flake8 \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install html5validator \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer + +RUN mkdir /python-env \ +&& python3 -m venv /python-env \ +&& /python-env/bin/pip install --no-cache-dir lithium-reducer PyGithub pyyaml RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get autoremove \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk20 b/checker/bin-devel/Dockerfile-ubuntu-jdk20 index 62787e9a591..79d622d2117 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk20 +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk20 @@ -43,12 +43,17 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - python3-distutils \ + python3-pip \ python3-requests \ + python3-setuptools \ unzip \ wget \ && aptitude -y install \ - jtreg6 + jtreg7 + +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk # Maven 3.8.7 is the default on Ubuntu 23.04, so the below is not needed. # (Don't try to use a variable here for the Maven version.) diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk20-plus b/checker/bin-devel/Dockerfile-ubuntu-jdk20-plus index 65b10c14888..ea5514cf2e0 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk20-plus +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk20-plus @@ -43,12 +43,17 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - python3-distutils \ + python3-pip \ python3-requests \ + python3-setuptools \ unzip \ wget \ && aptitude -y install \ - jtreg6 + jtreg7 + +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk # Maven 3.8.7 is the default on Ubuntu 23.04, so the below is not needed. # (Don't try to use a variable here for the Maven version.) diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk21 b/checker/bin-devel/Dockerfile-ubuntu-jdk21 index 7dfa3f23d5d..b2ba6dd9564 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk21 +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk21 @@ -4,8 +4,7 @@ # Checker Framework and Annotation Tools repositories) for: (java|jdk).?21\b # "ubuntu" is the latest LTS release. "ubuntu:rolling" is the latest release. -# As of 2023-11-15, "ubuntu:rolling" is still 23.04. -FROM ubuntu:23.10 +FROM ubuntu:rolling MAINTAINER Werner Dietl # According to @@ -25,6 +24,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ openjdk-21-jdk +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -37,21 +38,33 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - pipx \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 -# Maven 3.8.7 is the default on Ubuntu 23.04, so the below is not needed. +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. # (Don't try to use a variable here for the Maven version.) -# RUN export DEBIAN_FRONTEND=noninteractive \ -# && wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz \ -# && tar xzvf apache-maven-3.9.5-bin.tar.gz -# ENV PATH="/apache-maven-3.9.5/bin:$PATH" +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" -ENV PATH="/root/.local/bin:$PATH" -RUN pipx install --pip-args="--no-cache-dir" lithium-reducer +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer RUN mkdir /python-env \ && python3 -m venv /python-env \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk21-plus b/checker/bin-devel/Dockerfile-ubuntu-jdk21-plus index 80ac2607f85..54f7a4a334d 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk21-plus +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk21-plus @@ -4,8 +4,7 @@ # Checker Framework and Annotation Tools repositories) for: (java|jdk).?21\b # "ubuntu" is the latest LTS release. "ubuntu:rolling" is the latest release. -# As of 2023-11-15, "ubuntu:rolling" is still 23.04. -FROM ubuntu:23.10 +FROM ubuntu:rolling MAINTAINER Werner Dietl ## Keep this file in sync with ../../docs/manual/troubleshooting.tex @@ -27,6 +26,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ openjdk-21-jdk +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -39,18 +40,23 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - pipx \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 -# Maven 3.8.7 is the default on Ubuntu 23.04, so the below is not needed. +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. # (Don't try to use a variable here for the Maven version.) -# RUN export DEBIAN_FRONTEND=noninteractive \ -# && wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.5/binaries/apache-maven-3.9.5-bin.tar.gz \ -# && tar xzvf apache-maven-3.9.5-bin.tar.gz -# ENV PATH="/apache-maven-3.9.5/bin:$PATH" +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk8 b/checker/bin-devel/Dockerfile-ubuntu-jdk8 index 0d31181e970..49e10e908bd 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk8 +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk8 @@ -26,6 +26,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ && update-java-alternatives -s java-1.8.0-openjdk-amd64 +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -38,13 +40,37 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - python3-pip \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 + +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. +# (Don't try to use a variable here for the Maven version.) +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" + +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer -RUN pip3 install --no-cache-dir lithium-reducer PyGithub pyyaml +RUN mkdir /python-env \ +&& python3 -m venv /python-env \ +&& /python-env/bin/pip install --no-cache-dir lithium-reducer PyGithub pyyaml RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get autoremove \ diff --git a/checker/bin-devel/Dockerfile-ubuntu-jdk8-plus b/checker/bin-devel/Dockerfile-ubuntu-jdk8-plus index f1b06017753..ffcd99558ef 100644 --- a/checker/bin-devel/Dockerfile-ubuntu-jdk8-plus +++ b/checker/bin-devel/Dockerfile-ubuntu-jdk8-plus @@ -26,6 +26,8 @@ RUN export DEBIAN_FRONTEND=noninteractive \ openjdk-17-jdk \ && update-java-alternatives -s java-1.8.0-openjdk-amd64 +# Known good combinations of JTReg and the JDK appear at https://builds.shipilev.net/jtreg/ . + RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ && aptitude -y install \ @@ -38,11 +40,23 @@ RUN export DEBIAN_FRONTEND=noninteractive \ libcurl3-gnutls \ make \ maven \ - python3-pip \ - python3-distutils \ python3-requests \ + python3-setuptools \ unzip \ - wget + wget \ +&& aptitude -y install \ + jtreg7 + +RUN wget https://github.com/bazelbuild/bazelisk/releases/download/v1.23.0/bazelisk-linux-amd64 \ + && chmod +x bazelisk-linux-amd64 \ + && mv bazelisk-linux-amd64 /usr/local/bin/bazelisk + +# Use the same Maven version in all images. +# (Don't try to use a variable here for the Maven version.) +RUN export DEBIAN_FRONTEND=noninteractive \ +&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz \ +&& tar xzvf apache-maven-3.9.9-bin.tar.gz +ENV PATH="/apache-maven-3.9.9/bin:$PATH" RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get -qqy update \ @@ -73,7 +87,22 @@ RUN export DEBIAN_FRONTEND=noninteractive \ texlive-latex-extra \ texlive-latex-recommended -RUN pip3 install --no-cache-dir black flake8 html5validator lithium-reducer PyGithub pyyaml +# `pipx ensurepath` only adds to the path in newly-started shells. +# BUT, setting the path for the current user is not enough. +# Azure creates a new user and runs jobs as it. +# So, install into /usr/local/bin which is already on every user's path. +RUN export DEBIAN_FRONTEND=noninteractive \ +&& apt-get -qqy update \ +&& aptitude -y install \ + pipx \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install black \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install flake8 \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install html5validator \ +&& PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin pipx install lithium-reducer + +RUN mkdir /python-env \ +&& python3 -m venv /python-env \ +&& /python-env/bin/pip install --no-cache-dir lithium-reducer PyGithub pyyaml RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get autoremove \