From 9500820c2d1e0b26a72c279b3b39e552770b3b54 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Mon, 4 Sep 2023 16:51:59 +0200 Subject: [PATCH] HHH-17087 Update container images to the latest version --- Jenkinsfile | 122 ++----------------------------------------- docker_db.sh | 103 +++++++++++++++++++++++++++++++++--- edb/edb15.Dockerfile | 2 +- nightly.Jenkinsfile | 59 ++------------------- 4 files changed, 106 insertions(+), 180 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 766e606c06..263578bf31 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -46,9 +46,9 @@ stage('Configure') { // We want to enable preview features when testing newer builds of OpenJDK: // even if we don't use these features, just enabling them can cause side effects // and it's useful to test that. - new BuildEnvironment( testJdkVersion: '19', testJdkLauncherArgs: '--enable-preview' ), new BuildEnvironment( testJdkVersion: '20', testJdkLauncherArgs: '--enable-preview' ), - new BuildEnvironment( testJdkVersion: '21', testJdkLauncherArgs: '--enable-preview' ) + new BuildEnvironment( testJdkVersion: '21', testJdkLauncherArgs: '--enable-preview' ), + new BuildEnvironment( testJdkVersion: '22', testJdkLauncherArgs: '--enable-preview' ) ]; if ( env.CHANGE_ID ) { @@ -126,117 +126,11 @@ stage('Build') { try { stage('Start database') { switch (buildEnv.dbName) { - case "h2_1_4": - state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] + - " -Pgradle.libs.versions.h2=1.4.197 -Pgradle.libs.versions.h2gis=1.5.0" - break; - case "hsqldb_2_6": - state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] + - " -Pgradle.libs.versions.hsqldb=2.6.1" - break; - case "derby_10_14": - state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] + - " -Pgradle.libs.versions.derby=10.14.2.0" - break; - case "mysql": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('mysql:8.0.31').pull() - } - sh "./docker_db.sh mysql" - state[buildEnv.tag]['containerName'] = "mysql" - break; - case "mysql_5_7": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('mysql:5.7.40').pull() - } - sh "./docker_db.sh mysql_5_7" - state[buildEnv.tag]['containerName'] = "mysql" - break; - case "mariadb": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('mariadb:10.9.3').pull() - } - sh "./docker_db.sh mariadb" - state[buildEnv.tag]['containerName'] = "mariadb" - break; - case "mariadb_10_3": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('mariadb:10.3.36').pull() - } - sh "./docker_db.sh mariadb_10_3" - state[buildEnv.tag]['containerName'] = "mariadb" - break; - case "postgresql": - // use the postgis image to enable the PGSQL GIS (spatial) extension - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('postgis/postgis:15-3.3').pull() - } - sh "./docker_db.sh postgresql" - state[buildEnv.tag]['containerName'] = "postgres" - break; - case "postgresql_10": - // use the postgis image to enable the PGSQL GIS (spatial) extension - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('postgis/postgis:10-2.5').pull() - } - sh "./docker_db.sh postgresql_10" - state[buildEnv.tag]['containerName'] = "postgres" - break; case "edb": - docker.image('quay.io/enterprisedb/edb-postgres-advanced:15.2-3.3-postgis').pull() + docker.image('quay.io/enterprisedb/edb-postgres-advanced:15.4-3.3-postgis').pull() sh "./docker_db.sh edb" state[buildEnv.tag]['containerName'] = "edb" break; - case "edb_10": - docker.image('quay.io/enterprisedb/edb-postgres-advanced:10.22').pull() - sh "./docker_db.sh edb_10" - state[buildEnv.tag]['containerName'] = "edb" - break; - case "oracle": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('gvenzl/oracle-xe:21.3.0-full').pull() - } - sh "./docker_db.sh oracle" - state[buildEnv.tag]['containerName'] = "oracle" - break; - case "oracle_11_2": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('gvenzl/oracle-xe:11.2.0.2-full').pull() - } - sh "./docker_db.sh oracle_11" - state[buildEnv.tag]['containerName'] = "oracle" - break; - case "db2": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('ibmcom/db2:11.5.7.0').pull() - } - sh "./docker_db.sh db2" - state[buildEnv.tag]['containerName'] = "db2" - break; - case "db2_10_5": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('ibmoms/db2express-c@sha256:a499afd9709a1f69fb41703e88def9869955234c3525547e2efc3418d1f4ca2b').pull() - } - sh "./docker_db.sh db2_10_5" - state[buildEnv.tag]['containerName'] = "db2" - break; - case "mssql": - docker.image('mcr.microsoft.com/mssql/server@sha256:f54a84b8a802afdfa91a954e8ddfcec9973447ce8efec519adf593b54d49bedf').pull() - sh "./docker_db.sh mssql" - state[buildEnv.tag]['containerName'] = "mssql" - break; - case "mssql_2017": - docker.image('mcr.microsoft.com/mssql/server@sha256:7d194c54e34cb63bca083542369485c8f4141596805611e84d8c8bab2339eede').pull() - sh "./docker_db.sh mssql_2017" - state[buildEnv.tag]['containerName'] = "mssql" - break; - case "sybase": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('nguoianphu/docker-sybase').pull() - } - sh "./docker_db.sh sybase" - state[buildEnv.tag]['containerName'] = "sybase" - break; case "sybase_jconn": docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { docker.image('nguoianphu/docker-sybase').pull() @@ -246,18 +140,11 @@ stage('Build') { break; case "cockroachdb": docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('cockroachdb/cockroach:v22.2.2').pull() + docker.image('cockroachdb/cockroach:v23.1.8').pull() } sh "./docker_db.sh cockroachdb" state[buildEnv.tag]['containerName'] = "cockroach" break; - case "cockroachdb_21_2": - docker.withRegistry('https://index.docker.io/v1/', 'hibernateci.hub.docker.com') { - docker.image('cockroachdb/cockroach:v21.2.16').pull() - } - sh "./docker_db.sh cockroachdb_21_2" - state[buildEnv.tag]['containerName'] = "cockroach" - break; } } stage('Test') { @@ -322,6 +209,7 @@ class BuildEnvironment { String toString() { getTag() } String getTag() { "${node ? node + "_" : ''}${testJdkVersion ? 'jdk_' + testJdkVersion + '_' : '' }${dbName}" } + String getRdbms() { dbName.contains("_") ? dbName.substring(0, dbName.indexOf('_')) : dbName } } void runBuildOnNode(String label, Closure body) { diff --git a/docker_db.sh b/docker_db.sh index ce62270ce3..27e88fc933 100755 --- a/docker_db.sh +++ b/docker_db.sh @@ -16,12 +16,12 @@ else fi mysql() { - mysql_8_0 + mysql_8_1 } mysql_5_7() { $CONTAINER_CLI rm -f mysql || true - $CONTAINER_CLI run --name mysql -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mysql:5.7.40 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake --log-bin-trust-function-creators=1 + $CONTAINER_CLI run --name mysql -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mysql:5.7.43 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake --log-bin-trust-function-creators=1 # Give the container some time to start OUTPUT= n=0 @@ -67,13 +67,37 @@ mysql_8_0() { fi } +mysql_8_1() { + $CONTAINER_CLI rm -f mysql || true + $CONTAINER_CLI run --name mysql -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mysql:8.1.0 --character-set-server=utf8mb4 --collation-server=utf8mb4_0900_as_cs --skip-character-set-client-handshake --log-bin-trust-function-creators=1 + # Give the container some time to start + OUTPUT= + n=0 + until [ "$n" -ge 5 ] + do + # Need to access STDERR. Thanks for the snippet https://stackoverflow.com/a/56577569/412446 + { OUTPUT="$( { $CONTAINER_CLI logs mysql; } 2>&1 1>&3 3>&- )"; } 3>&1; + if [[ $OUTPUT == *"ready for connections"* ]]; then + break; + fi + n=$((n+1)) + echo "Waiting for MySQL to start..." + sleep 3 + done + if [ "$n" -ge 5 ]; then + echo "MySQL failed to start and configure after 15 seconds" + else + echo "MySQL successfully started" + fi +} + mariadb() { - mariadb_10_9 + mariadb_11_1 } mariadb_10_3() { $CONTAINER_CLI rm -f mariadb || true - $CONTAINER_CLI run --name mariadb -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mariadb:10.3.36 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake + $CONTAINER_CLI run --name mariadb -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mariadb:10.3.39 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake OUTPUT= n=0 until [ "$n" -ge 5 ] @@ -117,6 +141,29 @@ mariadb_10_9() { fi } +mariadb_11_1() { + $CONTAINER_CLI rm -f mariadb || true + $CONTAINER_CLI run --name mariadb -e MYSQL_USER=hibernate_orm_test -e MYSQL_PASSWORD=hibernate_orm_test -e MYSQL_DATABASE=hibernate_orm_test -e MYSQL_ROOT_PASSWORD=hibernate_orm_test -p3306:3306 -d docker.io/mariadb:11.1.2 --character-set-server=utf8mb4 --collation-server=utf8mb4_bin --skip-character-set-client-handshake + OUTPUT= + n=0 + until [ "$n" -ge 5 ] + do + # Need to access STDERR. Thanks for the snippet https://stackoverflow.com/a/56577569/412446 + { OUTPUT="$( { $CONTAINER_CLI logs mariadb; } 2>&1 1>&3 3>&- )"; } 3>&1; + if [[ $OUTPUT == *"ready for connections"* ]]; then + break; + fi + n=$((n+1)) + echo "Waiting for MariaDB to start..." + sleep 3 + done + if [ "$n" -ge 5 ]; then + echo "MariaDB failed to start and configure after 15 seconds" + else + echo "MariaDB successfully started" + fi +} + postgresql() { postgresql_15 } @@ -177,7 +224,7 @@ db2() { db2_11_5() { $PRIVILEGED_CLI $CONTAINER_CLI rm -f db2 || true - $PRIVILEGED_CLI $CONTAINER_CLI run --name db2 --privileged -e DB2INSTANCE=orm_test -e DB2INST1_PASSWORD=orm_test -e DBNAME=orm_test -e LICENSE=accept -e AUTOCONFIG=false -e ARCHIVE_LOGS=false -e TO_CREATE_SAMPLEDB=false -e REPODB=false -p 50000:50000 -d docker.io/ibmcom/db2:11.5.7.0 + $PRIVILEGED_CLI $CONTAINER_CLI run --name db2 --privileged -e DB2INSTANCE=orm_test -e DB2INST1_PASSWORD=orm_test -e DBNAME=orm_test -e LICENSE=accept -e AUTOCONFIG=false -e ARCHIVE_LOGS=false -e TO_CREATE_SAMPLEDB=false -e REPODB=false -p 50000:50000 -d docker.io/ibmcom/db2:11.5.8.0 # Give the container some time to start OUTPUT= while [[ $OUTPUT != *"INSTANCE"* ]]; do @@ -649,7 +696,47 @@ hana() { } cockroachdb() { - cockroachdb_22_2 + cockroachdb_23_1 +} + +cockroachdb_23_1() { + $CONTAINER_CLI rm -f cockroach || true + LOG_CONFIG=" +sinks: + stderr: + channels: all + filter: ERROR + redact: false + exit-on-error: true +" + $CONTAINER_CLI run -d --name=cockroach -m 6g -p 26257:26257 -p 8080:8080 cockroachdb/cockroach-unstable:v23.1.8 start-single-node \ + --insecure --store=type=mem,size=0.25 --advertise-addr=localhost --log="$LOG_CONFIG" + OUTPUT= + while [[ $OUTPUT != *"CockroachDB node starting"* ]]; do + echo "Waiting for CockroachDB to start..." + sleep 10 + # Note we need to redirect stderr to stdout to capture the logs + OUTPUT=$($CONTAINER_CLI logs cockroach 2>&1) + done + echo "Enabling experimental box2d operators and some optimized settings for running the tests" + #settings documented in https://www.cockroachlabs.com/docs/v22.1/local-testing.html#use-a-local-single-node-cluster-with-in-memory-storage + $CONTAINER_CLI exec cockroach bash -c "cat <