From 239835b47fccd05d0bed7b6b67c9facc655d8937 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Mon, 21 Jul 2025 13:58:29 +0200 Subject: [PATCH 1/7] fix(ct): ensure new "r0" base image builds for released versions without existing images #11659 --- .github/workflows/scripts/containers/maintain-base.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/containers/maintain-base.sh b/.github/workflows/scripts/containers/maintain-base.sh index 5b9ae738b98..1693176cc62 100755 --- a/.github/workflows/scripts/containers/maintain-base.sh +++ b/.github/workflows/scripts/containers/maintain-base.sh @@ -120,6 +120,13 @@ for BRANCH in "$@"; do CURRENT_REV_TAG="${BASE_IMAGE_REF#*:}-r$REV" NEXT_REV_TAG="${BASE_IMAGE_REF#*:}-r$(( REV + 1 ))" + # 6a. Determine if we must newly release an "r0" because a rolling tag from development is now released. + IS_NEW_RELEASE=0 + if ! (( IS_DEV )) && [ "$REV" = "-1" ]; then + echo "This is a newly released version of Dataverse - forcing build, as no r0 image is present on Docker Hub" + IS_NEW_RELEASE=1 + fi + # 7. Let's put together what tags we want added to this build run TAG_OPTIONS="" if ! (( IS_DEV )); then @@ -139,7 +146,7 @@ for BRANCH in "$@"; do # 8. Let's build the base image if necessary NEWER_IMAGE=0 - if (( NEWER_JAVA_IMAGE + NEWER_PKGS + FORCE_BUILD > 0 )); then + if (( NEWER_JAVA_IMAGE + NEWER_PKGS + IS_NEW_RELEASE + FORCE_BUILD > 0 )); then if ! (( DRY_RUN )); then # shellcheck disable=SC2046 mvn -Pct -f modules/container-base deploy -Ddocker.noCache -Ddocker.platforms="${PLATFORMS}" \ From b94b4866856a3aca2ccc5060c337fae2c564b91b Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 1 Aug 2025 16:51:20 +0200 Subject: [PATCH 2/7] refactor(ct): remove unused "-Ddocker.skip.tag" option from maintenance scripts --- .github/workflows/scripts/containers/maintain-application.sh | 2 +- .github/workflows/scripts/containers/maintain-base.sh | 2 +- .github/workflows/scripts/containers/maintain-configbaker.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/scripts/containers/maintain-application.sh b/.github/workflows/scripts/containers/maintain-application.sh index b68c2a53d96..2266cc11ae0 100755 --- a/.github/workflows/scripts/containers/maintain-application.sh +++ b/.github/workflows/scripts/containers/maintain-application.sh @@ -150,7 +150,7 @@ for BRANCH in "$@"; do mvn -Pct -f . deploy -Ddocker.noCache -Ddocker.platforms="${PLATFORMS}" \ -Dconf.skipBuild -Dbase.image="${BASE_IMAGE_REF}" \ -Ddocker.imagePropertyConfiguration=override $TAG_OPTIONS \ - $( if (( DAMP_RUN )); then echo "-Ddocker.skip.push -Ddocker.skip.tag"; fi ) + $( if (( DAMP_RUN )); then echo "-Ddocker.skip.push"; fi ) else echo "Skipping Maven build as requested by DRY_RUN=1" fi diff --git a/.github/workflows/scripts/containers/maintain-base.sh b/.github/workflows/scripts/containers/maintain-base.sh index 1693176cc62..ace76d7f3cd 100755 --- a/.github/workflows/scripts/containers/maintain-base.sh +++ b/.github/workflows/scripts/containers/maintain-base.sh @@ -151,7 +151,7 @@ for BRANCH in "$@"; do # shellcheck disable=SC2046 mvn -Pct -f modules/container-base deploy -Ddocker.noCache -Ddocker.platforms="${PLATFORMS}" \ -Ddocker.imagePropertyConfiguration=override $TAG_OPTIONS \ - $( if (( DAMP_RUN )); then echo "-Ddocker.skip.push -Ddocker.skip.tag"; fi ) + $( if (( DAMP_RUN )); then echo "-Ddocker.skip.push"; fi ) else echo "Skipping Maven build as requested by DRY_RUN=1" fi diff --git a/.github/workflows/scripts/containers/maintain-configbaker.sh b/.github/workflows/scripts/containers/maintain-configbaker.sh index 0b5b60b459c..2724ee4fa15 100755 --- a/.github/workflows/scripts/containers/maintain-configbaker.sh +++ b/.github/workflows/scripts/containers/maintain-configbaker.sh @@ -147,7 +147,7 @@ for BRANCH in "$@"; do -Dapp.skipBuild -Dconf.image.base="${BASE_IMAGE_REF}" \ -Dmaven.main.skip -Dmaven.test.skip -Dmaven.war.skip \ -Ddocker.imagePropertyConfiguration=override $TAG_OPTIONS \ - $( if (( DAMP_RUN )); then echo "-Ddocker.skip.push -Ddocker.skip.tag"; fi ) + $( if (( DAMP_RUN )); then echo "-Ddocker.skip.push"; fi ) else echo "Skipping Maven build as requested by DRY_RUN=1" fi From 2b09459ba8b0ebfb35bee0579e8dd005b85a9bb6 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Fri, 1 Aug 2025 16:51:54 +0200 Subject: [PATCH 3/7] fix(ci): update container repository reference in maintenance workflow #11662 --- .github/workflows/container_maintenance.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/container_maintenance.yml b/.github/workflows/container_maintenance.yml index 8abe33bdefc..ceb00053360 100644 --- a/.github/workflows/container_maintenance.yml +++ b/.github/workflows/container_maintenance.yml @@ -272,6 +272,6 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - repository: gdcc/base + repository: gdcc/configbaker short-description: "Dataverse Config Baker Container Image providing setup tooling and more" readme-filepath: ./modules/container-configbaker/README.md From aa945086b74274cd05af2a0f0aa0301174cfb842 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 9 Sep 2025 17:14:43 +0200 Subject: [PATCH 4/7] fix(ci): update tag definitions in container maintenance workflows #11661 Adjusted tag parameter names for both `app` and `configbaker` images to follow a consistent schema (`.tag.1`, `.tag.2`). Updated `pom.xml` to define and include additional tags under new parameters. See also: https://github.com/fabric8io/docker-maven-plugin/issues/1865 --- .../scripts/containers/maintain-application.sh | 6 +++--- .../scripts/containers/maintain-configbaker.sh | 6 +++--- pom.xml | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/scripts/containers/maintain-application.sh b/.github/workflows/scripts/containers/maintain-application.sh index 2266cc11ae0..c626ddca608 100755 --- a/.github/workflows/scripts/containers/maintain-application.sh +++ b/.github/workflows/scripts/containers/maintain-application.sh @@ -126,15 +126,15 @@ for BRANCH in "$@"; do # 6. Let's put together what tags we want added to this build run TAG_OPTIONS="" if ! (( IS_DEV )); then - TAG_OPTIONS="-Dapp.image=$APP_IMAGE_REF -Ddocker.tags.revision=$NEXT_REV_TAG" + TAG_OPTIONS="-Dapp.image=$APP_IMAGE_REF -Dapp.image.tag.1=$NEXT_REV_TAG" # In case of the current release, add the "latest" tag as well. if (( IS_CURRENT_RELEASE )); then - TAG_OPTIONS="$TAG_OPTIONS -Ddocker.tags.latest=latest" + TAG_OPTIONS="$TAG_OPTIONS -Dapp.image.tag.2=latest" fi else # shellcheck disable=SC2016 UPCOMING_TAG=$( mvn initialize help:evaluate -Pct -f . -Dexpression=app.image.tag -Dapp.image.tag='${app.image.version}-${base.image.flavor}' -q -DforceStdout ) - TAG_OPTIONS="-Ddocker.tags.upcoming=$UPCOMING_TAG" + TAG_OPTIONS="-Dapp.image.tag.1=$UPCOMING_TAG" # For the dev branch we only have rolling tags and can add them now already SUPPORTED_ROLLING_TAGS+=("[\"unstable\", \"$UPCOMING_TAG\"]") diff --git a/.github/workflows/scripts/containers/maintain-configbaker.sh b/.github/workflows/scripts/containers/maintain-configbaker.sh index 2724ee4fa15..5b3c3d7c658 100755 --- a/.github/workflows/scripts/containers/maintain-configbaker.sh +++ b/.github/workflows/scripts/containers/maintain-configbaker.sh @@ -122,15 +122,15 @@ for BRANCH in "$@"; do # 6. Let's put together what tags we want added to this build run TAG_OPTIONS="" if ! (( IS_DEV )); then - TAG_OPTIONS="-Dconf.image=$CONFIG_IMAGE_REF -Ddocker.tags.revision=$NEXT_REV_TAG" + TAG_OPTIONS="-Dconf.image=$CONFIG_IMAGE_REF -Dconf.image.tag.1=$NEXT_REV_TAG" # In case of the current release, add the "latest" tag as well. if (( IS_CURRENT_RELEASE )); then - TAG_OPTIONS="$TAG_OPTIONS -Ddocker.tags.latest=latest" + TAG_OPTIONS="$TAG_OPTIONS -Dconf.image.tag.2=latest" fi else # shellcheck disable=SC2016 UPCOMING_TAG=$( mvn initialize help:evaluate -Pct -f . -Dexpression=conf.image.tag -Dconf.image.tag='${app.image.version}-${conf.image.flavor}' -q -DforceStdout ) - TAG_OPTIONS="-Ddocker.tags.upcoming=$UPCOMING_TAG" + TAG_OPTIONS="-Dconf.image.tag.1=$UPCOMING_TAG" # For the dev branch we only have rolling tags and can add them now already SUPPORTED_ROLLING_TAGS+=("[\"unstable\", \"$UPCOMING_TAG\"]") diff --git a/pom.xml b/pom.xml index c8971fb6587..b7a621697a9 100644 --- a/pom.xml +++ b/pom.xml @@ -1119,6 +1119,9 @@ Note: During maintenance we will use the app.image.version setting from the DV parent POM. --> unstable + + + false false @@ -1133,6 +1136,9 @@ gdcc/configbaker:${conf.image.tag} ${app.image.tag} + + + noble ubuntu:${conf.image.flavor} false @@ -1191,6 +1197,10 @@ ${app.image.version} + + ${app.image.tag.1} + ${app.image.tag.2} + @ assembly.xml @@ -1226,6 +1236,10 @@ ${app.image.version} + + ${conf.image.tag.1} + ${conf.image.tag.2} + @ ${project.basedir}/modules/container-configbaker/assembly.xml From 485e08827ec95b26c1e6c59b6f92649f972fc42f Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 9 Sep 2025 17:17:42 +0200 Subject: [PATCH 5/7] refactor(ci): remove unused image property configuration in maintenance scripts We cannot use the Maven property external configuration bits (which is enabled implicitly by default), as we are using `` with a Compose file. So using this option has no effect on the build! (Same as we cannot add tags this way...) --- .github/workflows/scripts/containers/maintain-application.sh | 3 +-- .github/workflows/scripts/containers/maintain-configbaker.sh | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/scripts/containers/maintain-application.sh b/.github/workflows/scripts/containers/maintain-application.sh index c626ddca608..e34c609b0ad 100755 --- a/.github/workflows/scripts/containers/maintain-application.sh +++ b/.github/workflows/scripts/containers/maintain-application.sh @@ -148,8 +148,7 @@ for BRANCH in "$@"; do # Build the application image, but skip the configbaker image (that's a different job)! # shellcheck disable=SC2046 mvn -Pct -f . deploy -Ddocker.noCache -Ddocker.platforms="${PLATFORMS}" \ - -Dconf.skipBuild -Dbase.image="${BASE_IMAGE_REF}" \ - -Ddocker.imagePropertyConfiguration=override $TAG_OPTIONS \ + -Dconf.skipBuild -Dbase.image="${BASE_IMAGE_REF}" $TAG_OPTIONS \ $( if (( DAMP_RUN )); then echo "-Ddocker.skip.push"; fi ) else echo "Skipping Maven build as requested by DRY_RUN=1" diff --git a/.github/workflows/scripts/containers/maintain-configbaker.sh b/.github/workflows/scripts/containers/maintain-configbaker.sh index 5b3c3d7c658..2cd89efaeb6 100755 --- a/.github/workflows/scripts/containers/maintain-configbaker.sh +++ b/.github/workflows/scripts/containers/maintain-configbaker.sh @@ -145,8 +145,7 @@ for BRANCH in "$@"; do # shellcheck disable=SC2046 mvn -Pct -f . deploy -Ddocker.noCache -Ddocker.platforms="${PLATFORMS}" \ -Dapp.skipBuild -Dconf.image.base="${BASE_IMAGE_REF}" \ - -Dmaven.main.skip -Dmaven.test.skip -Dmaven.war.skip \ - -Ddocker.imagePropertyConfiguration=override $TAG_OPTIONS \ + -Dmaven.main.skip -Dmaven.test.skip -Dmaven.war.skip $TAG_OPTIONS \ $( if (( DAMP_RUN )); then echo "-Ddocker.skip.push"; fi ) else echo "Skipping Maven build as requested by DRY_RUN=1" From 19efa63a00110dc1c3f154b1205af321e7119ec9 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 9 Sep 2025 17:18:48 +0200 Subject: [PATCH 6/7] style(ct): add missing BASE_IMAGE arg and clarify workaround labeling Updated Dockerfile to include the BASE_IMAGE argument. The ARG value is not available anymore _after_ the FROM statement, so we need to repeat it for the workaround to work in full. --- src/main/docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile index beb1de53cd5..e6dbb2f8679 100644 --- a/src/main/docker/Dockerfile +++ b/src/main/docker/Dockerfile @@ -46,8 +46,9 @@ RUN ln -s "${DEPLOY_DIR}/dataverse/supplements/jhove.conf" "${PAYARA_DIR}/glassf ln -s "${DEPLOY_DIR}/dataverse/supplements/jhoveConfig.xsd" "${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhoveConfig.xsd" && \ sed -i "${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}/config/jhove.conf" -e "s:/usr/local/payara./glassfish/domains/domain1:${PAYARA_DIR}/glassfish/domains/${DOMAIN_NAME}:g" -# Workaround for fabric8io/docker-maven-plugin#1865 +# Workaround for fabric8io/docker-maven-plugin#1865 (both arg lines) ARG APP_IMAGE_VERSION +ARG BASE_IMAGE LABEL org.opencontainers.image.created="@git.build.time@" \ org.opencontainers.image.authors="Research Data Management at FZJ " \ org.opencontainers.image.url="https://guides.dataverse.org/en/latest/container/" \ From af9d0968914cdcb86040e6fad30071c2c00bb010 Mon Sep 17 00:00:00 2001 From: Oliver Bertuch Date: Tue, 9 Sep 2025 17:49:32 +0200 Subject: [PATCH 7/7] fix(ct): backport fixes for additional tags on app and config image #11661 Updated `pom.xml` across backports to include new parameters (`.tag.1`, `.tag.2`) for both `app` and `configbaker` images. Configured additional tags for usage in container maintenance builds and external Compose workflows. Backports target the last three releases, v6.6, v6.7, and v6.7.1. --- src/backports/v6.6/002-pom.xml.patch | 102 +++++++++++++++++++++++-- src/backports/v6.7.1/001-pom.xml.patch | 44 +++++++++++ src/backports/v6.7/001-pom.xml.patch | 44 +++++++++++ 3 files changed, 183 insertions(+), 7 deletions(-) create mode 100644 src/backports/v6.7.1/001-pom.xml.patch create mode 100644 src/backports/v6.7/001-pom.xml.patch diff --git a/src/backports/v6.6/002-pom.xml.patch b/src/backports/v6.6/002-pom.xml.patch index 9d1edeba1c7..a65880a2ed1 100644 --- a/src/backports/v6.6/002-pom.xml.patch +++ b/src/backports/v6.6/002-pom.xml.patch @@ -1,11 +1,21 @@ ---- a/pom.xml (revision 906f874f9fd56241c41e6c2c2f6989c4406f5909) -+++ b/pom.xml (date 1746655334773) -@@ -997,14 +997,18 @@ +--- a/pom.xml ++++ b/pom.xml +@@ -1069,18 +1069,38 @@ + 17 gdcc/dataverse:${app.image.tag} ++ unstable ++ ++ ++ + false false ++ gdcc/base:${base.image.tag} noble @@ -14,13 +24,43 @@ + ${base.image.version}-${base.image.flavor}${base.image.tag.suffix} + + -p${payara.version}-j${target.java.version} ++ gdcc/configbaker:${conf.image.tag} ++ ${app.image.tag} +- ++ ++ ++ ++ alpine ++ alpine:3.18 + false - ++ - -@@ -1046,6 +1050,9 @@ +- ++ + + ${app.image} + ${postgresql.server.version} +@@ -1088,7 +1108,7 @@ + dataverse + ${app.skipDeploy} + +- ++ + + + +@@ -1106,7 +1126,7 @@ + + + +- ++ + + + io.fabric8 +@@ -1119,6 +1139,9 @@ dev_dataverse ${app.image} @@ -30,7 +70,34 @@ ${docker.platforms} -@@ -1075,6 +1082,9 @@ +@@ -1128,26 +1151,33 @@ + + ${base.image} + ++ ++ ${app.image.tag.1} ++ ${app.image.tag.2} ++ + @ + + assembly.xml + + +- ++ + + +- ++ + + compose + ${project.basedir} + docker-compose-dev.yml + + +- ++ + dev_bootstrap ${conf.image} @@ -40,3 +107,24 @@ ${docker.platforms} +@@ -1155,14 +1185,19 @@ + + ${project.basedir}/modules/container-configbaker/Dockerfile + ++ ${conf.image.base} + ${SOLR_VERSION} + ++ ++ ${conf.image.tag.1} ++ ${conf.image.tag.2} ++ + @ + + ${project.basedir}/modules/container-configbaker/assembly.xml + + +- ++ + + unstable ++ ++ ++ + false + false + +@@ -1133,6 +1136,9 @@ + gdcc/configbaker:${conf.image.tag} + + ${app.image.tag} ++ ++ ++ + noble + ubuntu:${conf.image.flavor} + false +@@ -1191,6 +1197,10 @@ + + ${app.image.version} + ++ ++ ${app.image.tag.1} ++ ${app.image.tag.2} ++ + @ + + assembly.xml +@@ -1226,6 +1236,10 @@ + + ${app.image.version} + ++ ++ ${conf.image.tag.1} ++ ${conf.image.tag.2} ++ + @ + + ${project.basedir}/modules/container-configbaker/assembly.xml diff --git a/src/backports/v6.7/001-pom.xml.patch b/src/backports/v6.7/001-pom.xml.patch new file mode 100644 index 00000000000..1b2001d5546 --- /dev/null +++ b/src/backports/v6.7/001-pom.xml.patch @@ -0,0 +1,44 @@ +--- a/pom.xml ++++ b/pom.xml +@@ -1119,6 +1119,9 @@ + Note: During maintenance we will use the app.image.version setting from the DV parent POM. + --> + unstable ++ ++ ++ + false + false + +@@ -1133,6 +1136,9 @@ + gdcc/configbaker:${conf.image.tag} + + ${app.image.tag} ++ ++ ++ + noble + ubuntu:${conf.image.flavor} + false +@@ -1191,6 +1197,10 @@ + + ${app.image.version} + ++ ++ ${app.image.tag.1} ++ ${app.image.tag.2} ++ + @ + + assembly.xml +@@ -1226,6 +1236,10 @@ + + ${app.image.version} + ++ ++ ${conf.image.tag.1} ++ ${conf.image.tag.2} ++ + @ + + ${project.basedir}/modules/container-configbaker/assembly.xml