Skip to content

Commit 96edc1a

Browse files
committed
Bump java to 21 and base images to ubi9 (kserve#155)
chore: Bump java version to 21 and base images from UBI8 to UBI9 Signed-off-by: Spolti <[email protected]>
1 parent 9ba0370 commit 96edc1a

File tree

4 files changed

+28
-29
lines changed

4 files changed

+28
-29
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ jobs:
2828
- name: Checkout
2929
uses: actions/checkout@v3
3030

31-
- name: Set up Java 17
31+
- name: Set up Java 21
3232
uses: actions/[email protected]
3333
with:
34-
java-version: '17'
34+
java-version: '21'
3535
distribution: 'temurin'
3636

3737
- name: Install etcd

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848
- name: Checkout repository
4949
uses: actions/checkout@v3
5050

51-
- name: Set up Java 17
51+
- name: Set up Java 21
5252
uses: actions/setup-java@v3
5353
with:
54-
java-version: '17'
54+
java-version: '21'
5555
distribution: 'temurin'
5656

5757
# Initializes the CodeQL tools for scanning.

Dockerfile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as build_base
15+
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest as build_base
1616

1717
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
1818
# don't provide "default" values (e.g. 'ARG TARGETARCH=amd64') for non-buildx environments,
@@ -26,20 +26,20 @@ LABEL image="build_base"
2626

2727
USER root
2828

29-
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk
29+
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk
3030

3131
RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
32-
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install \
33-
java-17-openjdk-devel \
32+
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install -y \
33+
java-21-openjdk-devel \
3434
nss \
3535
&& microdnf update --nodocs \
36-
&& sed -i 's:security.provider.12=SunPKCS11:#security.provider.12=SunPKCS11:g' /usr/lib/jvm/java-17-openjdk-*/conf/security/java.security \
37-
&& sed -i 's:#security.provider.1=SunPKCS11 ${java.home}/lib/security/nss.cfg:security.provider.12=SunPKCS11 ${java.home}/lib/security/nss.cfg:g' /usr/lib/jvm/java-17-openjdk-*/conf/security/java.security \
36+
&& sed -i 's:security.provider.12=SunPKCS11:#security.provider.12=SunPKCS11:g' /usr/lib/jvm/java-21-openjdk-*/conf/security/java.security \
37+
&& sed -i 's:#security.provider.1=SunPKCS11 ${java.home}/lib/security/nss.cfg:security.provider.12=SunPKCS11 ${java.home}/lib/security/nss.cfg:g' /usr/lib/jvm/java-21-openjdk-*/conf/security/java.security \
3838
&& java -version \
3939
&& true
4040

4141
RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
42-
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install \
42+
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install -y \
4343
wget \
4444
tar \
4545
gzip \
@@ -82,23 +82,23 @@ RUN echo "$(date '+%Y%m%d')-$(git rev-parse HEAD | cut -c -5)" > target/dockerho
8282

8383

8484
###############################################################################
85-
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest AS runtime
85+
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest AS runtime
8686

8787
# TODO: FROM registry.access.redhat.com/ubi8/openjdk-17-runtime:1.15
8888

8989
ARG USER=2000
9090

9191
USER root
9292

93-
ENV JAVA_HOME=/usr/lib/jvm/jre-17-openjdk
93+
ENV JAVA_HOME=/usr/lib/jvm/jre-21-openjdk
9494

9595
RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
96-
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install \
97-
java-17-openjdk-headless \
96+
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install -y \
97+
java-21-openjdk-headless \
9898
nss \
9999
&& microdnf update --nodocs \
100-
&& sed -i 's:security.provider.12=SunPKCS11:#security.provider.12=SunPKCS11:g' /usr/lib/jvm/java-17-openjdk-*/conf/security/java.security \
101-
&& sed -i 's:#security.provider.1=SunPKCS11 ${java.home}/lib/security/nss.cfg:security.provider.12=SunPKCS11 ${java.home}/lib/security/nss.cfg:g' /usr/lib/jvm/java-17-openjdk-*/conf/security/java.security \
100+
&& sed -i 's:security.provider.12=SunPKCS11:#security.provider.12=SunPKCS11:g' /usr/lib/jvm/java-21-openjdk-*/conf/security/java.security \
101+
&& sed -i 's:#security.provider.1=SunPKCS11 ${java.home}/lib/security/nss.cfg:security.provider.12=SunPKCS11 ${java.home}/lib/security/nss.cfg:g' /usr/lib/jvm/java-21-openjdk-*/conf/security/java.security \
102102
&& java -version \
103103
&& true
104104

@@ -109,7 +109,7 @@ COPY version /etc/modelmesh-version
109109
WORKDIR /opt/kserve/mmesh
110110

111111
RUN --mount=type=cache,target=/root/.cache/microdnf:rw \
112-
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install \
112+
microdnf --setopt=cachedir=/root/.cache/microdnf --nodocs install -y \
113113
shadow-utils \
114114
hostname \
115115
# Create app user

pom.xml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@
7171
<eclipse-collections-version>11.1.0</eclipse-collections-version>
7272
<log4j2-version>2.23.1</log4j2-version>
7373
<slf4j-version>1.7.36</slf4j-version>
74+
<javax-json-version>1.1.4</javax-json-version>
75+
<datadoghq-version>2.7</datadoghq-version>
76+
<googlecode-concurrentlinkedhashmap-lru-version>1.4.2</googlecode-concurrentlinkedhashmap-lru-version>
77+
<googlecode-findbugs-jsr305-version>3.0.2</googlecode-findbugs-jsr305-version>
7478
<!-- Care must be taken when updating the prometheus client lib version
7579
since we have some custom optimized extensions to this -->
7680
<prometheus-version>0.9.0</prometheus-version>
@@ -130,9 +134,9 @@
130134
<plugin>
131135
<groupId>org.apache.maven.plugins</groupId>
132136
<artifactId>maven-compiler-plugin</artifactId>
133-
<version>3.8.1</version>
137+
<version>3.11.0</version>
134138
<configuration>
135-
<release>17</release>
139+
<release>21</release>
136140
</configuration>
137141
</plugin>
138142

@@ -311,20 +315,15 @@
311315
<version>${litelinks-version}</version>
312316
</dependency>
313317

314-
<!-- <dependency>
315-
<groupId>com.github.ben-manes.caffeine</groupId>
316-
<artifactId>caffeine</artifactId>
317-
<version>2.3.1</version>
318-
</dependency> -->
319318
<dependency>
320319
<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
321320
<artifactId>concurrentlinkedhashmap-lru</artifactId>
322-
<version>1.4.2</version>
321+
<version>${googlecode-concurrentlinkedhashmap-lru-version}</version>
323322
</dependency>
324323
<dependency>
325324
<groupId>com.google.code.findbugs</groupId>
326325
<artifactId>jsr305</artifactId>
327-
<version>3.0.2</version>
326+
<version>${googlecode-findbugs-jsr305-version}</version>
328327
<scope>provided</scope>
329328
</dependency>
330329

@@ -393,7 +392,7 @@
393392
<dependency>
394393
<groupId>javax.json</groupId>
395394
<artifactId>javax.json-api</artifactId>
396-
<version>1.1.4</version>
395+
<version>${javax-json-version}</version>
397396
<scope>runtime</scope>
398397
</dependency>
399398
<!-- it also uses jackson-databind, declared above -->
@@ -403,7 +402,7 @@
403402
<dependency>
404403
<groupId>com.datadoghq</groupId>
405404
<artifactId>java-dogstatsd-client</artifactId>
406-
<version>2.7</version>
405+
<version>${datadoghq-version}</version>
407406
<exclusions>
408407
<!-- This is only needed for UDS channels,
409408
and brings in a bunch of transitive deps -->

0 commit comments

Comments
 (0)