Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
90f9fc1
HDDS-17856. Add more dependencies to cache
adoroszlai Nov 19, 2026
d8fb8bc
Merge commit '81aa78600e' into HDDS-17856
adoroszlai Nov 20, 2026
ea2bb73
populate-cache.sh: add -e
adoroszlai Nov 20, 2026
aacfd3e
populate-cache.sh: remove unused BASE_DIR
adoroszlai Nov 20, 2026
c7a49c5
use separate maven repo and stash for Hadoop AWS dependencies
adoroszlai Nov 20, 2026
385e2bd
fixup
adoroszlai Nov 20, 2026
df977e5
fetch Java 21 dependencies
adoroszlai Nov 20, 2026
0a02c56
fixup for df977e53457ec324f3eb3403f7726facddfd1bb9
adoroszlai Nov 20, 2026
d076500
trigger CI
adoroszlai Nov 20, 2026
adc7fda
Merge commit '6862ab51ab8546fb934697ce9956a1b1e78a6773' into HDDS-17856
adoroszlai Nov 21, 2026
d8862e2
use custom local repo only for s3a-test.sh, not acceptance.sh
adoroszlai Nov 21, 2026
21dfe58
trigger cache rebuild on change of populate-cache.sh
adoroszlai Nov 21, 2026
69b1253
makeBom for ozone-filesystem-hadoop2
adoroszlai Nov 21, 2026
d75acd6
run one S3A test to fetch surefire junit artifacts
adoroszlai Nov 21, 2026
90cfdff
get_versions --offline
adoroszlai Nov 21, 2026
08585e9
fetch help plugin
adoroszlai Nov 21, 2026
0cca77a
retry get_version online
adoroszlai Nov 21, 2026
b20ca1c
Revert "fixup for df977e53457ec324f3eb3403f7726facddfd1bb9"
adoroszlai Nov 21, 2026
e9f1d33
Revert "fetch Java 21 dependencies"
adoroszlai Nov 21, 2026
9245b84
fetch all Ozone dependencies in populate-cache.sh, add java version t…
adoroszlai Nov 21, 2026
51b6ba3
drop separate nodejs cache
adoroszlai Nov 21, 2026
1d35dfe
fix zizmor
adoroszlai Nov 21, 2026
fb80d8d
[skip ci] add `$@` for plugin resolution, too
adoroszlai Nov 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/actions/setup-java-with-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,15 @@ 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'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this! Should we also include populate-cache.yml?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Ozone-specific Maven cache does not depend on (most of) the rest of the workflow, like the 3rd-party component stashes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it depends on:

  • $TEST_JAVA_VERSION
  • the command to fetch plugin dependencies
  • the command to get Java 21-specific dependencies

We could:

  • add $TEST_JAVA_VERSION to the cache key
  • move the plugin dependencies command into populate-cache.sh (and 3rd-party stashes after the Ozone cache)

I'll try if we can remove the Java 21 part.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

populate-cache changes done in 9245b84, 51b6ba3, 1d35dfe.

Java 21 stuff removed (b20ca1c, e9f1d33), profiles being removed in #12120.

) }}-$JAVA_VERSION" >> "$GITHUB_OUTPUT"
env:
JAVA_VERSION: ${{ inputs.java-version }}

- name: Remove any leftover Maven repo
id: cleanup
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,15 @@ 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: Restore Ranger
id: restore-ranger
# TODO reduce hard-code in HDDS-17509
Expand Down
48 changes: 28 additions & 20 deletions .github/workflows/populate-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -62,16 +63,15 @@ 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 --no-transfer-progress --show-version dependency:resolve-plugins
run: |
dev-support/ci/populate-cache.sh

- name: Get versions
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)
Expand Down Expand Up @@ -101,6 +101,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-hadoop-deps.outputs.stash-hit != 'true'
run: |
# 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see AWS SDK bundle is a big one, and only test-s3a.sh needs it. Would a separate stash make sense, like the Hadoop tarball?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, especially since it depends on Hadoop version, does not need to be rebuilt for each Ozone POM change.

@adoroszlai adoroszlai Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- 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
Expand All @@ -126,22 +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: 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

- name: Delete Ozone jars from repo
if: steps.restore-cache.outputs.cache-hit != 'true'
run: rm -fr ~/.m2/repository/org/apache/ozone
Expand Down
64 changes: 0 additions & 64 deletions dev-support/ci/download-nodejs.sh

This file was deleted.

39 changes: 39 additions & 0 deletions dev-support/ci/populate-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/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.

# 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:-} "$@"

# no shading
hadoop-ozone/dev-support/checks/_build.sh compile cyclonedx:makeBom \
-pl :ozone-filesystem-shaded,:ozone-filesystem-hadoop2 \
-Dmaven-replacer-plugin.skip "$@"

# 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
14 changes: 8 additions & 6 deletions hadoop-ozone/dev-support/checks/_lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ get_version() {
local tempfile=$(mktemp)
local -i rc=0

# output version/transfer etc. to stderr first
./mvnw --batch-mode --non-recursive --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}
Expand Down
12 changes: 12 additions & 0 deletions hadoop-ozone/dist/src/main/compose/common/s3a-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ 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=ITestS3AContractContentSummary clean test
echo "[INFO] Skip S3A tests"
exit 0
fi

## @description Run S3A contract tests against Ozone.
## @param Ozone S3 bucket
execute_s3a_tests() {
Expand Down
1 change: 1 addition & 0 deletions hadoop-ozone/ozonefs-hadoop2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
</goals>
<phase>process-sources</phase>
<configuration>
<skip>${maven-replacer-plugin.skip}</skip>
<basedir>${project.basedir}/target/generated-sources</basedir>
<includes>
<include>**/*.java</include>
Expand Down
7 changes: 0 additions & 7 deletions hadoop-ozone/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@
<module>ozonefs-shaded</module>
</modules>
</profile>
<profile>
<id>go-offline</id>
<modules>
<module>ozonefs-hadoop2</module>
<module>ozonefs-shaded</module>
</modules>
</profile>
<profile>
<id>CI</id>
<modules>
Expand Down
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
<maven-patch-plugin.version>1.3</maven-patch-plugin.version>
<maven-remote-resources-plugin.version>3.3.0</maven-remote-resources-plugin.version>
<maven-replacer-plugin.skip>false</maven-replacer-plugin.skip>
<maven-replacer-plugin.version>1.5.3</maven-replacer-plugin.version>
<maven-resources-plugin.version>3.5.0</maven-resources-plugin.version>
<maven-shade-plugin.version>3.6.2</maven-shade-plugin.version>
Expand Down Expand Up @@ -3053,12 +3054,10 @@
<profile>
<id>go-offline</id>
<properties>
<cyclonedx.skip>true</cyclonedx.skip>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems re-enables makeBom in populate-cache, but didn't see it in the PR description. Is that intended?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed cyclonedx.skip, because in #12086 I noticed some dependencies were fetched by cyclonedx execution. Example (search for Downloading in the same log for few more):

[INFO] --- cyclonedx:2.9.3:makeBom (default) @ hdds-common ---
[INFO] CycloneDX: Resolving Dependencies
[INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/woodstox/stax2-api/4.2/stax2-api-4.2.jar

Could be a bug in cyclonedx-plugin or the underlying implementation of dependency resolution?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks! Just to confirm, is the SBOM only needed for releases? If so, I noticed that makeBom takes about 100s in the CI build job. Maybe we can consider skipping it in CI?

<enforcer.skip>true</enforcer.skip>
<jacoco.skip>true</jacoco.skip>
<maven.javadoc.skip>true</maven.javadoc.skip>
<mdep.analyze.skip>true</mdep.analyze.skip>
<skip.installnodepnpm>true</skip.installnodepnpm>
<skip.pnpm>true</skip.pnpm>
<test>void</test>
</properties>
Expand Down