Skip to content

Commit

Permalink
Update Docker images (#939)
Browse files Browse the repository at this point in the history
Co-authored-by: Werner Dietl <[email protected]>
  • Loading branch information
Ao-senXiong and wmdietl authored Nov 13, 2024
1 parent 93f44a2 commit e151772
Show file tree
Hide file tree
Showing 15 changed files with 345 additions and 126 deletions.
53 changes: 25 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -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 += [
Expand Down
36 changes: 25 additions & 11 deletions checker/bin-devel/Dockerfile-ubuntu-jdk-latest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# See releases at https://hub.docker.com/_/ubuntu for available images.
# See https://packages.ubuntu.com/search?suite=default&section=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 <[email protected]>

# According to
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down
25 changes: 16 additions & 9 deletions checker/bin-devel/Dockerfile-ubuntu-jdk-latest-plus
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# See releases at https://hub.docker.com/_/ubuntu for available images.
# See https://packages.ubuntu.com/search?suite=default&section=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 <[email protected]>

# According to
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down
36 changes: 25 additions & 11 deletions checker/bin-devel/Dockerfile-ubuntu-jdk-next
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# See releases at https://hub.docker.com/_/ubuntu for available images.
# See https://packages.ubuntu.com/search?suite=default&section=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 <[email protected]>

# According to
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down
25 changes: 16 additions & 9 deletions checker/bin-devel/Dockerfile-ubuntu-jdk-next-plus
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# See releases at https://hub.docker.com/_/ubuntu for available images.
# See https://packages.ubuntu.com/search?suite=default&section=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 <[email protected]>

# According to
Expand All @@ -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 \
Expand All @@ -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 \
Expand Down
34 changes: 30 additions & 4 deletions checker/bin-devel/Dockerfile-ubuntu-jdk11
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down
Loading

0 comments on commit e151772

Please sign in to comment.