Skip to content

HDDS-17856. Add more dependencies to cache - #12101

Merged
adoroszlai merged 23 commits into
apache:masterfrom
adoroszlai:HDDS-17856
Nov 22, 2026
Merged

adoroszlai merged 23 commits into
apache:masterfrom
adoroszlai:HDDS-17856

Conversation

@adoroszlai

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Run more steps in populate-cache to collect more artifacts.

  1. Run test-s3a in build-only mode to get Hadoop AWS dependencies.
  2. Run errorprone and repro checks on 1 module to get the plugins and their dependencies.
  3. Run pmd on 2 modules to get maven-fluido-skin.
  4. Install pnpm: [INFO] Downloading https://registry.npmjs.org/pnpm/-/pnpm-10.28.2.tgz to /home/runner/.m2/repository/com/github/eirslett/pnpm/10.28.2/pnpm-10.28.2.tar.gz

Reduce time by breaking the initial build into two steps:

  • full build everything except ozonefs-shaded and ozonefs-hadoop[23]
  • only compile ozonefs-shaded and ozonefs-hadoop2 (ozonefs-hadoop3 is not needed, because Hadoop 3 is also a dependency in several other modules)

Create a standalone shell script to make it easier to test locally.

https://issues.apache.org/jira/browse/HDDS-17856

How was this patch tested?

populate-cache: https://github.com/adoroszlai/ozone/actions/runs/44494620896
CI: https://github.com/adoroszlai/ozone/actions/runs/44513283691

@adoroszlai adoroszlai added the CI label Nov 19, 2026
@adoroszlai adoroszlai self-assigned this Nov 19, 2026
@github-actions github-actions Bot added the ofs label Nov 19, 2026

@chihsuan chihsuan left a comment

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 working on this! @adoroszlai The cache looks much more complete now. Just left a few inline comments.

Comment thread dev-support/ci/populate-cache.sh Outdated

#checks:basic

set -u -o pipefail

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.

Should we add -e here so that a failed install or compile doesn't save a partial cache?

Suggested change
set -u -o pipefail
set -e -u -o pipefail

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.

Addressed in ea2bb73.

run: |
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.

Comment thread dev-support/ci/populate-cache.sh Outdated
mkdir -p "${REPORT_DIR}"

REPORT_FILE="${REPORT_DIR}/summary.txt"
BASE_DIR="$(pwd -P)"

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.

nit: BASE_DIR seems unused?

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.

Addressed in aacfd3e.

Comment thread pom.xml
<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?

@adoroszlai

Copy link
Copy Markdown
Contributor Author

Also added a step to fetch Java 21-specific dependencies (aspectj*-1.9.24).

@adoroszlai
adoroszlai requested a review from chihsuan November 20, 2026 18:54
Comment thread .github/workflows/check.yml Outdated
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"

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.

GITHUB_ENV makes the custom repo apply to the whole job, including get_version in acceptance.sh. That may re-download its Maven extensions and plugins on each run, since they aren't in the stash. Could we limit it to the hadoop-aws mvn calls?

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.

Nice catch.

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.

Fixed in d8862e2.

@adoroszlai

adoroszlai commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

Testing further changes in another branch. If they work, I'll push them to this PR, too.

  • trigger cache rebuild on change of populate-cache.sh
  • makeBom for ozone-filesystem-hadoop2 (download)
  • run one S3A test to fetch surefire junit artifacts (download)
  • run mvn --offline for get_versions (download)

adoroszlai/ozone@d8862e2...HDDS-17856-2

'**/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.

Comment thread hadoop-ozone/dev-support/checks/_lib.sh Outdated
# 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 \

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.

Good call on --offline. Could we retry online if offline resolution fails? local or older CI caches may lack required dependencies.

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.

Sure, addressed in 0cca77a.

@chihsuan chihsuan left a comment

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 @adoroszlai The cache looks complete now. LGTM

Comment thread dev-support/ci/populate-cache.sh Outdated
cd "$DIR/../.." || exit 1

# fetch plugins, even if not part of normal build
./mvnw --batch-mode --show-version dependency:resolve-plugins help:help

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.

nit: Should we pass $@ here too, like the other commands below?

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.

Thanks, added. It's useful for local testing (pass -Dmaven.repo.local), but not used in CI, so pushed with [skip ci] commit message.

@adoroszlai
adoroszlai merged commit 33435fc into apache:master Nov 22, 2026
1 check passed
@adoroszlai

Copy link
Copy Markdown
Contributor Author

Thanks @chihsuan for the reviews.

@adoroszlai
adoroszlai deleted the HDDS-17856 branch November 22, 2026 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants