Skip to content

Commit

Permalink
SNOW-1490931: Preparation for Java 21 (#1796)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pbulawa authored Jun 25, 2024
1 parent ccee1b1 commit a4db309
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
fail-fast: false
matrix:
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}]
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}, {cloud: 'AWS', javaVersion: '21'}]
category: ['TestCategoryResultSet,TestCategoryOthers,TestCategoryLoader', 'TestCategoryConnection,TestCategoryStatement', 'TestCategoryArrow,TestCategoryCore', 'TestCategoryFips']
additionalMavenProfile: ['']
steps:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
strategy:
fail-fast: false
matrix:
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}]
runConfig: [ {cloud: 'AWS', javaVersion: '8'}, {cloud: 'GCP', javaVersion: '11'}, {cloud: 'AZURE', javaVersion: '17'}, {cloud: 'AWS', javaVersion: '21'}]
category: ['TestCategoryResultSet,TestCategoryOthers,TestCategoryLoader', 'TestCategoryConnection,TestCategoryStatement', 'TestCategoryArrow,TestCategoryCore', 'TestCategoryFips']
additionalMavenProfile: ['']
steps:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
strategy:
fail-fast: false
matrix:
image: [ 'jdbc-centos7-openjdk8', 'jdbc-centos7-openjdk11', 'jdbc-centos7-openjdk17' ]
image: [ 'jdbc-centos7-openjdk8', 'jdbc-centos7-openjdk11', 'jdbc-centos7-openjdk17', 'jdbc-centos7-openjdk21' ]
cloud: [ 'AWS', 'AZURE', 'GCP' ]
category: ['TestCategoryResultSet,TestCategoryOthers,TestCategoryLoader', 'TestCategoryConnection,TestCategoryStatement', 'TestCategoryArrow,TestCategoryCore', 'TestCategoryFips']
additionalMavenProfile: ['', '-Dthin-jar']
Expand Down
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ timestamps {
e.printStackTrace()
}

jdkToParams = ['openjdk8': 'jdbc-centos7-openjdk8', 'openjdk11': 'jdbc-centos7-openjdk11', 'openjdk17': 'jdbc-centos7-openjdk17'].collectEntries { jdk, image ->
jdkToParams = ['openjdk8': 'jdbc-centos7-openjdk8', 'openjdk11': 'jdbc-centos7-openjdk11', 'openjdk17': 'jdbc-centos7-openjdk17', 'openjdk21': 'jdbc-centos7-openjdk21'].collectEntries { jdk, image ->
return [(jdk): [
string(name: 'client_git_branch', value: scmInfo.GIT_BRANCH),
string(name: 'client_git_commit', value: scmInfo.GIT_COMMIT),
Expand Down
5 changes: 4 additions & 1 deletion ci/_init.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/local/bin/env bash
set -e

export PLATFORM=$(echo $(uname) | tr '[:upper:]' '[:lower:]')
Expand All @@ -23,18 +23,21 @@ declare -A TEST_IMAGE_NAMES=(
[$DRIVER_NAME-centos7-openjdk8]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-centos7-openjdk8-test:$TEST_IMAGE_VERSION
[$DRIVER_NAME-centos7-openjdk11]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-centos7-openjdk11-test:$TEST_IMAGE_VERSION
[$DRIVER_NAME-centos7-openjdk17]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-centos7-openjdk17-test:$TEST_IMAGE_VERSION
[$DRIVER_NAME-centos7-openjdk21]=$DOCKER_REGISTRY_NAME/client-$DRIVER_NAME-centos7-openjdk21-test:$TEST_IMAGE_VERSION
)
export TEST_IMAGE_NAMES

declare -A TEST_IMAGE_DOCKERFILES=(
[$DRIVER_NAME-centos7-openjdk8]=jdbc-centos7-openjdk-test
[$DRIVER_NAME-centos7-openjdk11]=jdbc-centos7-openjdk-test
[$DRIVER_NAME-centos7-openjdk17]=jdbc-centos7-openjdk-test
[$DRIVER_NAME-centos7-openjdk21]=jdbc-centos7-openjdk-test
)

declare -A TEST_IMAGE_BUILD_ARGS=(
[$DRIVER_NAME-centos7-openjdk8]="--target jdbc-centos7-openjdk-yum --build-arg=JDK_PACKAGE=java-1.8.0-openjdk-devel"
[$DRIVER_NAME-centos7-openjdk11]="--target jdbc-centos7-openjdk-yum --build-arg=JDK_PACKAGE=java-11-openjdk-devel" # pragma: allowlist secret
[$DRIVER_NAME-centos7-openjdk17]="--target jdbc-centos7-openjdk17"
[$DRIVER_NAME-centos7-openjdk21]="--target jdbc-centos7-openjdk21"
)

20 changes: 19 additions & 1 deletion ci/image/Dockerfile.jdbc-centos7-openjdk-test
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,22 @@ RUN export JAVA_HOME=/opt/jdk-17 && \
-Dnot-self-contained-jar \
--batch-mode --fail-never compile && \
mv $HOME/.m2 /home/user && \
chmod -R 777 /home/user/.m2
chmod -R 777 /home/user/.m2

###### OpenJDK 21 from archive (not available in yum)
FROM jdbc-centos7-openjdk-base AS jdbc-centos7-openjdk21

# Java
RUN curl -o - https://download.java.net/java/GA/jdk21.0.2/f2283984656d49d69e91c558476027ac/13/GPL/openjdk-21.0.2_linux-x64_bin.tar.gz | tar xfz - -C /opt && \
ln -s /opt/jdk-21.0.2 /opt/jdk-21

RUN sed -i /usr/local/bin/entrypoint.sh -e '/^exec/i export JAVA_HOME=/opt/jdk-21'
RUN sed -i /usr/local/bin/entrypoint.sh -e '/^exec/i export PATH=$JAVA_HOME/bin:$PATH'

RUN export JAVA_HOME=/opt/jdk-21 && \
cd /root && \
mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn \
-Dnot-self-contained-jar \
--batch-mode --fail-never compile && \
mv $HOME/.m2 /home/user && \
chmod -R 777 /home/user/.m2
7 changes: 7 additions & 0 deletions parent-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<bouncycastle.version>1.74</bouncycastle.version>
<bouncycastle.bcfips.version>1.0.2.4</bouncycastle.bcfips.version>
<bouncycastle.bcpkixfips.version>1.0.5</bouncycastle.bcpkixfips.version>
<bytebuddy.version>1.14.17</bytebuddy.version>
<classworlds.version>1.1</classworlds.version>
<checkerframework.version>3.33.0</checkerframework.version>
<commons.cli.version>1.2</commons.cli.version>
Expand Down Expand Up @@ -482,6 +483,12 @@
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>${bytebuddy.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
Expand Down

0 comments on commit a4db309

Please sign in to comment.