From 90f9fc11c249e6d84e418021a615d18d5bfa6696 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Thu, 19 Nov 2026 09:04:13 +0100 Subject: [PATCH 01/21] HDDS-17856. Add more dependencies to cache --- .github/workflows/populate-cache.yml | 10 +++++- dev-support/ci/populate-cache.sh | 36 +++++++++++++++++++ .../dist/src/main/compose/common/s3a-test.sh | 7 ++++ hadoop-ozone/ozonefs-hadoop2/pom.xml | 1 + hadoop-ozone/pom.xml | 7 ---- pom.xml | 3 +- 6 files changed, 54 insertions(+), 10 deletions(-) create mode 100755 dev-support/ci/populate-cache.sh diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 4238d26353ec..350a55d856c6 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -103,6 +103,13 @@ jobs: key: hadoop-${{ env.HADOOP_VERSION }} retention-days: 90 + - name: Fetch Hadoop AWS dependencies + if: steps.restore-cache.outputs.cache-hit != 'true' + run: | + bash hadoop-ozone/dist/src/main/compose/ozone/test-s3a.sh + env: + BUILD_ONLY: true + - name: Restore Ranger id: restore-ranger uses: apache/infrastructure-actions/stash/restore@restore/v1 @@ -142,7 +149,8 @@ jobs: - name: Fetch dependencies if: steps.restore-cache.outputs.cache-hit != 'true' - run: ./mvnw $BUILD_ARGS $MAVEN_ARGS --no-transfer-progress --show-version -Pgo-offline clean verify + run: | + dev-support/ci/populate-cache.sh - name: Delete Ozone jars from repo if: steps.restore-cache.outputs.cache-hit != 'true' diff --git a/dev-support/ci/populate-cache.sh b/dev-support/ci/populate-cache.sh new file mode 100755 index 000000000000..2c733cd10beb --- /dev/null +++ b/dev-support/ci/populate-cache.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -u -o pipefail + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +cd "$DIR/../.." || exit 1 + +BASE_DIR="$(pwd -P)" + +# install, but skip shaded modules +./mvnw --batch-mode --show-version clean install \ + -DskipShade -Pgo-offline ${BUILD_ARGS:-} "$@" + +# only compile, no shade +hadoop-ozone/dev-support/checks/_build.sh compile \ + -pl :ozone-filesystem-shaded,:ozone-filesystem-hadoop2 \ + -Dmaven-replacer-plugin.skip "$@" + +# exercise some checks on limited modules +hadoop-ozone/dev-support/checks/errorprone.sh -pl :ozone-main "$@" || true +hadoop-ozone/dev-support/checks/pmd.sh -am -pl :ozone-dev-support "$@" || true +hadoop-ozone/dev-support/checks/repro.sh -pl :ozone-main "$@" || true diff --git a/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh b/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh index bf29e0f0cf1e..734d06bdf8f3 100644 --- a/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh +++ b/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh @@ -48,6 +48,13 @@ if ! download_hadoop_aws; then exit 1 fi +if [[ "${BUILD_ONLY:-}" == "true" ]]; then + cd "${HADOOP_AWS_DIR}" + mvn ${MAVEN_ARGS:-} --show-version -Dtest=void clean test + echo "[INFO] Skip S3A tests" + exit 0 +fi + ## @description Run S3A contract tests against Ozone. ## @param Ozone S3 bucket execute_s3a_tests() { diff --git a/hadoop-ozone/ozonefs-hadoop2/pom.xml b/hadoop-ozone/ozonefs-hadoop2/pom.xml index f454664c6d18..c62eada2b597 100644 --- a/hadoop-ozone/ozonefs-hadoop2/pom.xml +++ b/hadoop-ozone/ozonefs-hadoop2/pom.xml @@ -195,6 +195,7 @@ process-sources + ${maven-replacer-plugin.skip} ${project.basedir}/target/generated-sources **/*.java diff --git a/hadoop-ozone/pom.xml b/hadoop-ozone/pom.xml index 0109eee20d14..17d81189e6b6 100644 --- a/hadoop-ozone/pom.xml +++ b/hadoop-ozone/pom.xml @@ -125,13 +125,6 @@ ozonefs-shaded - - go-offline - - ozonefs-hadoop2 - ozonefs-shaded - - CI diff --git a/pom.xml b/pom.xml index 55147acdf31a..d9098e139a2b 100644 --- a/pom.xml +++ b/pom.xml @@ -146,6 +146,7 @@ 3.12.0 1.3 3.3.0 + false 1.5.3 3.5.0 3.6.2 @@ -3053,12 +3054,10 @@ go-offline - true true true true true - true true void From ea2bb7303807885a0bd659d7a7c9b71e5f86a116 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 20 Nov 2026 16:30:37 +0100 Subject: [PATCH 02/21] populate-cache.sh: add -e --- dev-support/ci/populate-cache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-support/ci/populate-cache.sh b/dev-support/ci/populate-cache.sh index 2c733cd10beb..cf38f7ab0346 100755 --- a/dev-support/ci/populate-cache.sh +++ b/dev-support/ci/populate-cache.sh @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -u -o pipefail +set -e -u -o pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR/../.." || exit 1 From aacfd3e2565742a33e44c1e07b898e7fb6189122 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 20 Nov 2026 16:30:58 +0100 Subject: [PATCH 03/21] populate-cache.sh: remove unused BASE_DIR --- dev-support/ci/populate-cache.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/dev-support/ci/populate-cache.sh b/dev-support/ci/populate-cache.sh index cf38f7ab0346..e703f649d0ec 100755 --- a/dev-support/ci/populate-cache.sh +++ b/dev-support/ci/populate-cache.sh @@ -19,8 +19,6 @@ set -e -u -o pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR/../.." || exit 1 -BASE_DIR="$(pwd -P)" - # install, but skip shaded modules ./mvnw --batch-mode --show-version clean install \ -DskipShade -Pgo-offline ${BUILD_ARGS:-} "$@" From c7a49c540163c7fdd5ba76c3890555432e80ded0 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 20 Nov 2026 16:57:42 +0100 Subject: [PATCH 04/21] use separate maven repo and stash for Hadoop AWS dependencies --- .github/workflows/check.yml | 17 +++++++++++++++++ .github/workflows/populate-cache.yml | 19 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 6e05b867949e..777615a29e03 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -247,6 +247,23 @@ jobs: path: ~/.cache/ozone key: hadoop-${{ env.HADOOP_VERSION }} + - name: Restore Hadoop AWS dependencies + id: restore-hadoop-deps + # TODO reduce hard-code in HDDS-17509 + if: ${{ inputs.script == 'acceptance' && contains(inputs.split, 'test-s3a.sh') }} + uses: apache/infrastructure-actions/stash/restore@restore/v1 + with: + path: ~/.cache/ozone/maven-repo + key: hadoop-${{ env.HADOOP_VERSION }}-deps + + - name: Set custom local repo + # TODO reduce hard-code in HDDS-17509 + if: ${{ inputs.script == 'acceptance' && contains(inputs.split, 'test-s3a.sh') && steps.restore-hadoop-deps.outputs.stash-hit == 'true' }} + run: | + # use custom local repo for Hadoop AWS dependencies, included in stash + MAVEN_ARGS="$MAVEN_ARGS -Dmaven.repo.local="${HOME}/.cache/ozone/maven-repo" + echo "MAVEN_ARGS=$MAVEN_ARGS" >> "$GITHUB_ENV" + - name: Restore Ranger id: restore-ranger # TODO reduce hard-code in HDDS-17509 diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 350a55d856c6..3e588a605a38 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -103,13 +103,30 @@ jobs: key: hadoop-${{ env.HADOOP_VERSION }} retention-days: 90 + - name: Restore Hadoop AWS dependencies + id: restore-hadoop-deps + uses: apache/infrastructure-actions/stash/restore@restore/v1 + with: + path: ~/.cache/ozone/maven-repo + key: hadoop-${{ env.HADOOP_VERSION }}-deps + - name: Fetch Hadoop AWS dependencies - if: steps.restore-cache.outputs.cache-hit != 'true' + if: steps.restore-hadoop-deps.outputs.stash-hit != 'true' run: | + # populate custom local repo for Hadoop AWS dependencies + export MAVEN_ARGS="$MAVEN_ARGS -Dmaven.repo.local=${HOME}/.cache/ozone/maven-repo" bash hadoop-ozone/dist/src/main/compose/ozone/test-s3a.sh env: BUILD_ONLY: true + - name: Stash Hadoop AWS dependencies + if: steps.restore-hadoop-deps.outputs.stash-hit != 'true' + uses: apache/infrastructure-actions/stash/save@save/v1 + with: + path: ~/.cache/ozone/maven-repo + key: hadoop-${{ env.HADOOP_VERSION }}-deps + retention-days: 90 + - name: Restore Ranger id: restore-ranger uses: apache/infrastructure-actions/stash/restore@restore/v1 From 385e2bdb9248a54be4f318fc00fa73c2d84bf643 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 20 Nov 2026 17:42:54 +0100 Subject: [PATCH 05/21] fixup --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 777615a29e03..8d089d2b5243 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -261,7 +261,7 @@ jobs: if: ${{ inputs.script == 'acceptance' && contains(inputs.split, 'test-s3a.sh') && steps.restore-hadoop-deps.outputs.stash-hit == 'true' }} run: | # use custom local repo for Hadoop AWS dependencies, included in stash - MAVEN_ARGS="$MAVEN_ARGS -Dmaven.repo.local="${HOME}/.cache/ozone/maven-repo" + MAVEN_ARGS="$MAVEN_ARGS -Dmaven.repo.local=${HOME}/.cache/ozone/maven-repo" echo "MAVEN_ARGS=$MAVEN_ARGS" >> "$GITHUB_ENV" - name: Restore Ranger From df977e53457ec324f3eb3403f7726facddfd1bb9 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 20 Nov 2026 17:46:27 +0100 Subject: [PATCH 06/21] fetch Java 21 dependencies --- .github/workflows/populate-cache.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 3e588a605a38..2e9b6a63e6b7 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -169,6 +169,17 @@ jobs: run: | dev-support/ci/populate-cache.sh + - name: Setup Java 21 + if: steps.restore-cache.outputs.cache-hit != 'true' + uses: $/.github/actions/setup-java + with: + java-version: 21 + + - name: Fetch Java 21 dependencies + if: steps.restore-cache.outputs.cache-hit != 'true' + run: | + hadoop-ozone/dev-support/checks/compile.sh -pl :ozone-manager -Dozone.java.version.server=21 + - name: Delete Ozone jars from repo if: steps.restore-cache.outputs.cache-hit != 'true' run: rm -fr ~/.m2/repository/org/apache/ozone From 0a02c5694fcaa33b5b34fdda0e7ba9de1034674a Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 20 Nov 2026 17:52:14 +0100 Subject: [PATCH 07/21] fixup for df977e53457ec324f3eb3403f7726facddfd1bb9 --- .github/workflows/populate-cache.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 2e9b6a63e6b7..8f567faa0bdd 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -171,8 +171,9 @@ jobs: - name: Setup Java 21 if: steps.restore-cache.outputs.cache-hit != 'true' - uses: $/.github/actions/setup-java + uses: actions/setup-java@v6 with: + distribution: 'temurin' java-version: 21 - name: Fetch Java 21 dependencies From d076500c3f61c017a1498ebdfc32dbf8fa33b8de Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Fri, 20 Nov 2026 18:27:54 +0100 Subject: [PATCH 08/21] trigger CI --- dev-support/ci/populate-cache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-support/ci/populate-cache.sh b/dev-support/ci/populate-cache.sh index e703f649d0ec..72140178cd4a 100755 --- a/dev-support/ci/populate-cache.sh +++ b/dev-support/ci/populate-cache.sh @@ -28,7 +28,7 @@ hadoop-ozone/dev-support/checks/_build.sh compile \ -pl :ozone-filesystem-shaded,:ozone-filesystem-hadoop2 \ -Dmaven-replacer-plugin.skip "$@" -# exercise some checks on limited modules +# exercise some checks on limited modules to get more dependencies hadoop-ozone/dev-support/checks/errorprone.sh -pl :ozone-main "$@" || true hadoop-ozone/dev-support/checks/pmd.sh -am -pl :ozone-dev-support "$@" || true hadoop-ozone/dev-support/checks/repro.sh -pl :ozone-main "$@" || true From d8862e2000ff3e6a61a128b87f63fed11ea2d59e Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 10:00:21 +0100 Subject: [PATCH 09/21] use custom local repo only for s3a-test.sh, not acceptance.sh --- .github/workflows/check.yml | 8 -------- .github/workflows/populate-cache.yml | 4 ++-- hadoop-ozone/dist/src/main/compose/common/s3a-test.sh | 5 +++++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8d089d2b5243..6f3b0cf2b213 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -256,14 +256,6 @@ jobs: path: ~/.cache/ozone/maven-repo key: hadoop-${{ env.HADOOP_VERSION }}-deps - - name: Set custom local repo - # TODO reduce hard-code in HDDS-17509 - if: ${{ inputs.script == 'acceptance' && contains(inputs.split, 'test-s3a.sh') && steps.restore-hadoop-deps.outputs.stash-hit == 'true' }} - run: | - # use custom local repo for Hadoop AWS dependencies, included in stash - MAVEN_ARGS="$MAVEN_ARGS -Dmaven.repo.local=${HOME}/.cache/ozone/maven-repo" - echo "MAVEN_ARGS=$MAVEN_ARGS" >> "$GITHUB_ENV" - - name: Restore Ranger id: restore-ranger # TODO reduce hard-code in HDDS-17509 diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 8594d9f06a53..ede5ddeb4007 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -111,8 +111,8 @@ jobs: - name: Fetch Hadoop AWS dependencies if: steps.restore-hadoop-deps.outputs.stash-hit != 'true' run: | - # populate custom local repo for Hadoop AWS dependencies - export MAVEN_ARGS="$MAVEN_ARGS -Dmaven.repo.local=${HOME}/.cache/ozone/maven-repo" + # create custom local repo dir for Hadoop AWS dependencies + mkdir -p ~/.cache/ozone/maven-repo bash hadoop-ozone/dist/src/main/compose/ozone/test-s3a.sh env: BUILD_ONLY: true diff --git a/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh b/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh index 734d06bdf8f3..a8f3faae0338 100644 --- a/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh +++ b/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh @@ -48,6 +48,11 @@ if ! download_hadoop_aws; then exit 1 fi +if [[ "${CI:-}" == "true" ]] && [[ -d "${DOWNLOAD_DIR}/maven-repo" ]]; then + # custom local repo for Hadoop AWS dependencies + MAVEN_ARGS="${MAVEN_ARGS:-} -Dmaven.repo.local=${DOWNLOAD_DIR}/maven-repo" +fi + if [[ "${BUILD_ONLY:-}" == "true" ]]; then cd "${HADOOP_AWS_DIR}" mvn ${MAVEN_ARGS:-} --show-version -Dtest=void clean test From 21dfe5802f862dfc756c264ca79c8d377e9ebb46 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 11:15:25 +0100 Subject: [PATCH 10/21] trigger cache rebuild on change of populate-cache.sh --- .github/actions/setup-java-with-cache/action.yml | 9 +++++++-- .github/workflows/populate-cache.yml | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-java-with-cache/action.yml b/.github/actions/setup-java-with-cache/action.yml index 39d119bc81d3..f5bf69d243ec 100644 --- a/.github/actions/setup-java-with-cache/action.yml +++ b/.github/actions/setup-java-with-cache/action.yml @@ -58,8 +58,13 @@ runs: - name: Calculate cache key id: cache-key shell: bash - run: | - echo "value=maven-repo-${{ hashFiles('**/pom.xml', '.mvn/extensions.xml', '.mvn/wrapper/maven-wrapper.properties') }}" >> "$GITHUB_OUTPUT" + run: > + echo "value=maven-repo-${{ hashFiles( + '**/pom.xml', + '.mvn/extensions.xml', + '.mvn/wrapper/maven-wrapper.properties', + 'dev-support/ci/populate-cache.sh' + ) }}" >> "$GITHUB_OUTPUT" - name: Remove any leftover Maven repo id: cleanup diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index ede5ddeb4007..5d0214a1dacc 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -24,6 +24,7 @@ on: paths: - 'pom.xml' - '**/pom.xml' + - 'dev-support/ci/populate-cache.sh' - '.github/actions/setup-java-with-cache/action.yml' - '.github/workflows/populate-cache.yml' - '.mvn/extensions.xml' From 69b1253217eb494005560544b7d22afbd3808b7a Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 11:16:57 +0100 Subject: [PATCH 11/21] makeBom for ozone-filesystem-hadoop2 --- dev-support/ci/populate-cache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-support/ci/populate-cache.sh b/dev-support/ci/populate-cache.sh index 72140178cd4a..82536c142712 100755 --- a/dev-support/ci/populate-cache.sh +++ b/dev-support/ci/populate-cache.sh @@ -24,7 +24,7 @@ cd "$DIR/../.." || exit 1 -DskipShade -Pgo-offline ${BUILD_ARGS:-} "$@" # only compile, no shade -hadoop-ozone/dev-support/checks/_build.sh compile \ +hadoop-ozone/dev-support/checks/_build.sh compile cyclonedx:makeBom \ -pl :ozone-filesystem-shaded,:ozone-filesystem-hadoop2 \ -Dmaven-replacer-plugin.skip "$@" From d75acd69126c49fcbf7cc3092671af7d4b730a41 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 11:32:57 +0100 Subject: [PATCH 12/21] run one S3A test to fetch surefire junit artifacts --- hadoop-ozone/dist/src/main/compose/common/s3a-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh b/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh index a8f3faae0338..294323713c92 100644 --- a/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh +++ b/hadoop-ozone/dist/src/main/compose/common/s3a-test.sh @@ -55,7 +55,7 @@ fi if [[ "${BUILD_ONLY:-}" == "true" ]]; then cd "${HADOOP_AWS_DIR}" - mvn ${MAVEN_ARGS:-} --show-version -Dtest=void clean test + mvn ${MAVEN_ARGS:-} --show-version -Dtest=ITestS3AContractContentSummary clean test echo "[INFO] Skip S3A tests" exit 0 fi From 90cfdffdf82aec168b6ff82e4f4b97cd4de51077 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 11:35:37 +0100 Subject: [PATCH 13/21] get_versions --offline --- hadoop-ozone/dev-support/checks/_lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hadoop-ozone/dev-support/checks/_lib.sh b/hadoop-ozone/dev-support/checks/_lib.sh index 00078b35f7c6..8c8f14f837ad 100644 --- a/hadoop-ozone/dev-support/checks/_lib.sh +++ b/hadoop-ozone/dev-support/checks/_lib.sh @@ -103,8 +103,8 @@ get_version() { local tempfile=$(mktemp) local -i rc=0 - # output version/transfer etc. to stderr first - ./mvnw --batch-mode --non-recursive --show-version \ + # redirect output to stderr + ./mvnw --batch-mode --non-recursive --offline --show-version \ help:evaluate -Dexpression="${dep}.version" -Doutput="${tempfile}" \ -Dscan=false "$@" >&2 \ && cat "${tempfile}" \ From 08585e9841dd62e22fcaec5b8634d6732cfbf9fc Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 11:46:17 +0100 Subject: [PATCH 14/21] fetch help plugin --- .github/workflows/populate-cache.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 5d0214a1dacc..033e16759b02 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -65,7 +65,7 @@ jobs: - name: Fetch plugin dependencies if: steps.restore-cache.outputs.cache-hit != 'true' - run: ./mvnw $MAVEN_ARGS --no-transfer-progress --show-version dependency:resolve-plugins + run: ./mvnw $MAVEN_ARGS --show-version dependency:resolve-plugins help:help - name: Get versions id: versions From 0cca77a5997c69208478bc6909619da48a8f8b56 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 15:33:24 +0100 Subject: [PATCH 15/21] retry get_version online --- hadoop-ozone/dev-support/checks/_lib.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hadoop-ozone/dev-support/checks/_lib.sh b/hadoop-ozone/dev-support/checks/_lib.sh index 8c8f14f837ad..329af20184fb 100644 --- a/hadoop-ozone/dev-support/checks/_lib.sh +++ b/hadoop-ozone/dev-support/checks/_lib.sh @@ -103,12 +103,14 @@ get_version() { local tempfile=$(mktemp) local -i rc=0 - # redirect output to stderr - ./mvnw --batch-mode --non-recursive --offline --show-version \ - help:evaluate -Dexpression="${dep}.version" -Doutput="${tempfile}" \ - -Dscan=false "$@" >&2 \ - && cat "${tempfile}" \ - || rc=$? + local opts="--batch-mode --non-recursive --show-version -Dscan=false help:evaluate" + + if ./mvnw --offline $opts -Dexpression="${dep}.version" -Doutput="${tempfile}" "$@" >&2 \ + || ./mvnw $opts -Dexpression="${dep}.version" -Doutput="${tempfile}" "$@" >&2; then + cat "${tempfile}" + else + rc=1 + fi rm -f "${tempfile}" return ${rc} From b20ca1c007beebfd4c66947f0ed5017876360365 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 16:40:27 +0100 Subject: [PATCH 16/21] Revert "fixup for df977e53457ec324f3eb3403f7726facddfd1bb9" This reverts commit 0a02c5694fcaa33b5b34fdda0e7ba9de1034674a. --- .github/workflows/populate-cache.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 033e16759b02..c7197d82bebc 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -170,9 +170,8 @@ jobs: - name: Setup Java 21 if: steps.restore-cache.outputs.cache-hit != 'true' - uses: actions/setup-java@v6 + uses: $/.github/actions/setup-java with: - distribution: 'temurin' java-version: 21 - name: Fetch Java 21 dependencies From e9f1d33fdb5c5ea2102cd172b396781e752ca7f8 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 16:40:27 +0100 Subject: [PATCH 17/21] Revert "fetch Java 21 dependencies" This reverts commit df977e53457ec324f3eb3403f7726facddfd1bb9. --- .github/workflows/populate-cache.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index c7197d82bebc..1ec2bcdc1f67 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -168,17 +168,6 @@ jobs: run: | dev-support/ci/populate-cache.sh - - name: Setup Java 21 - if: steps.restore-cache.outputs.cache-hit != 'true' - uses: $/.github/actions/setup-java - with: - java-version: 21 - - - name: Fetch Java 21 dependencies - if: steps.restore-cache.outputs.cache-hit != 'true' - run: | - hadoop-ozone/dev-support/checks/compile.sh -pl :ozone-manager -Dozone.java.version.server=21 - - name: Delete Ozone jars from repo if: steps.restore-cache.outputs.cache-hit != 'true' run: rm -fr ~/.m2/repository/org/apache/ozone From 9245b8465bf78dc6b6ab0bce7654d2f8b505a555 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 16:49:15 +0100 Subject: [PATCH 18/21] fetch all Ozone dependencies in populate-cache.sh, add java version to cache key --- .github/actions/setup-java-with-cache/action.yml | 2 +- .github/workflows/populate-cache.yml | 10 +++------- dev-support/ci/populate-cache.sh | 7 ++++++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/actions/setup-java-with-cache/action.yml b/.github/actions/setup-java-with-cache/action.yml index f5bf69d243ec..01fdaab680ac 100644 --- a/.github/actions/setup-java-with-cache/action.yml +++ b/.github/actions/setup-java-with-cache/action.yml @@ -64,7 +64,7 @@ runs: '.mvn/extensions.xml', '.mvn/wrapper/maven-wrapper.properties', 'dev-support/ci/populate-cache.sh' - ) }}" >> "$GITHUB_OUTPUT" + ) }}-${{ inputs.java-version }}" >> "$GITHUB_OUTPUT" - name: Remove any leftover Maven repo id: cleanup diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index 1ec2bcdc1f67..a630f247226f 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -63,9 +63,10 @@ jobs: java-version: ${{ env.TEST_JAVA_VERSION }} only-exact-hit: true - - name: Fetch plugin dependencies + - name: Fetch dependencies if: steps.restore-cache.outputs.cache-hit != 'true' - run: ./mvnw $MAVEN_ARGS --show-version dependency:resolve-plugins help:help + run: | + dev-support/ci/populate-cache.sh - name: Get versions id: versions @@ -163,11 +164,6 @@ jobs: if: steps.restore-cache.outputs.cache-hit != 'true' && steps.restore-nodejs.outputs.cache-hit != 'true' run: dev-support/ci/download-nodejs.sh - - name: Fetch dependencies - if: steps.restore-cache.outputs.cache-hit != 'true' - run: | - dev-support/ci/populate-cache.sh - - name: Delete Ozone jars from repo if: steps.restore-cache.outputs.cache-hit != 'true' run: rm -fr ~/.m2/repository/org/apache/ozone diff --git a/dev-support/ci/populate-cache.sh b/dev-support/ci/populate-cache.sh index 82536c142712..12723f10858f 100755 --- a/dev-support/ci/populate-cache.sh +++ b/dev-support/ci/populate-cache.sh @@ -14,16 +14,21 @@ # See the License for the specific language governing permissions and # limitations under the License. +# Fetches Ozone build and runtime dependencies. + set -e -u -o pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR/../.." || exit 1 +# fetch plugins, even if not part of normal build +./mvnw --batch-mode --show-version dependency:resolve-plugins help:help + # install, but skip shaded modules ./mvnw --batch-mode --show-version clean install \ -DskipShade -Pgo-offline ${BUILD_ARGS:-} "$@" -# only compile, no shade +# no shading hadoop-ozone/dev-support/checks/_build.sh compile cyclonedx:makeBom \ -pl :ozone-filesystem-shaded,:ozone-filesystem-hadoop2 \ -Dmaven-replacer-plugin.skip "$@" From 51b6ba3556c3b19cc43a415bc8290152081c8229 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 16:49:34 +0100 Subject: [PATCH 19/21] drop separate nodejs cache --- .github/workflows/populate-cache.yml | 14 ------ dev-support/ci/download-nodejs.sh | 64 ---------------------------- 2 files changed, 78 deletions(-) delete mode 100755 dev-support/ci/download-nodejs.sh diff --git a/.github/workflows/populate-cache.yml b/.github/workflows/populate-cache.yml index a630f247226f..46103836ab8a 100644 --- a/.github/workflows/populate-cache.yml +++ b/.github/workflows/populate-cache.yml @@ -72,8 +72,6 @@ jobs: id: versions run: | source hadoop-ozone/dev-support/checks/_lib.sh - NODEJS_VERSION=$(get_version nodejs) - echo "NODEJS_VERSION=$NODEJS_VERSION" >> $GITHUB_ENV HADOOP_VERSION=$(get_version hadoop) echo "HADOOP_VERSION=$HADOOP_VERSION" >> $GITHUB_ENV RANGER_VERSION=$(get_version ranger) @@ -152,18 +150,6 @@ jobs: key: ranger-${{ env.RANGER_VERSION }} retention-days: 90 - - name: Restore NodeJS tarballs - id: restore-nodejs - if: steps.restore-cache.outputs.cache-hit != 'true' - uses: actions/cache@v6 - with: - path: ~/.m2/repository/com/github/eirslett/node - key: nodejs-${{ env.NODEJS_VERSION }} - - - name: Download NodeJS - if: steps.restore-cache.outputs.cache-hit != 'true' && steps.restore-nodejs.outputs.cache-hit != 'true' - run: dev-support/ci/download-nodejs.sh - - name: Delete Ozone jars from repo if: steps.restore-cache.outputs.cache-hit != 'true' run: rm -fr ~/.m2/repository/org/apache/ozone diff --git a/dev-support/ci/download-nodejs.sh b/dev-support/ci/download-nodejs.sh deleted file mode 100755 index 53561f87ba7a..000000000000 --- a/dev-support/ci/download-nodejs.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# This script gets a list of the changed files from git, and matches -# that list against a set of regexes, each of which corresponds to a -# test group. For each set of matches, a flag is set to let github -# actions know to run that test group. - -# Downloads Node.js for multiple platforms (Linux, Mac) - -set -u -o pipefail - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -cd "${DIR}/../.." || exit 1 - -: ${REPO_DIR:="${HOME}/.m2/repository"} - -mkdir -p "${REPO_DIR}" - -declare -i rc=1 - -if [[ -z "${NODEJS_VERSION:-}" ]]; then - source hadoop-ozone/dev-support/checks/_lib.sh - NODEJS_VERSION=$(get_version nodejs) -fi - -if [[ -n "${NODEJS_VERSION}" ]]; then - rc=0 - for platform in darwin-x64 linux-x64; do - url="https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-${platform}.tar.gz" - output="${REPO_DIR}/com/github/eirslett/node/${NODEJS_VERSION}/node-${NODEJS_VERSION}-${platform}.tar.gz" - mkdir -pv "$(dirname "${output}")" - - irc=1 - for i in 1 2 3; do - echo "Downloading ${url}, attempt ${i}" - if curl --location --continue-at - -o "${output}" "${url}"; then - irc=0 - break - fi - sleep 2 - done - - if [[ ${rc} -eq 0 ]]; then - rc=${irc} - fi - done -fi - -exit ${rc} From 1d35dfeb26b3934c681a8ef7f3aa9eb9278bb0a9 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sat, 21 Nov 2026 17:01:14 +0100 Subject: [PATCH 20/21] fix zizmor --- .github/actions/setup-java-with-cache/action.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/actions/setup-java-with-cache/action.yml b/.github/actions/setup-java-with-cache/action.yml index 01fdaab680ac..4598b1c728e3 100644 --- a/.github/actions/setup-java-with-cache/action.yml +++ b/.github/actions/setup-java-with-cache/action.yml @@ -64,7 +64,9 @@ runs: '.mvn/extensions.xml', '.mvn/wrapper/maven-wrapper.properties', 'dev-support/ci/populate-cache.sh' - ) }}-${{ inputs.java-version }}" >> "$GITHUB_OUTPUT" + ) }}-$JAVA_VERSION" >> "$GITHUB_OUTPUT" + env: + JAVA_VERSION: ${{ inputs.java-version }} - name: Remove any leftover Maven repo id: cleanup From fb80d8dc7da4f3642e16d1ab299199016c07de76 Mon Sep 17 00:00:00 2001 From: "Doroszlai, Attila" Date: Sun, 22 Nov 2026 09:02:30 +0100 Subject: [PATCH 21/21] [skip ci] add `$@` for plugin resolution, too --- dev-support/ci/populate-cache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-support/ci/populate-cache.sh b/dev-support/ci/populate-cache.sh index 12723f10858f..5a4a85c39565 100755 --- a/dev-support/ci/populate-cache.sh +++ b/dev-support/ci/populate-cache.sh @@ -22,7 +22,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" cd "$DIR/../.." || exit 1 # fetch plugins, even if not part of normal build -./mvnw --batch-mode --show-version dependency:resolve-plugins help:help +./mvnw --batch-mode --show-version dependency:resolve-plugins help:help "$@" # install, but skip shaded modules ./mvnw --batch-mode --show-version clean install \