Repository navigation
HDDS-17856. Add more dependencies to cache - #12101
Conversation
chihsuan
left a comment
There was a problem hiding this comment.
Thanks for working on this! @adoroszlai The cache looks much more complete now. Just left a few inline comments.
|
|
||
| #checks:basic | ||
|
|
||
| set -u -o pipefail |
There was a problem hiding this comment.
Should we add -e here so that a failed install or compile doesn't save a partial cache?
| set -u -o pipefail | |
| set -e -u -o pipefail |
| run: | | ||
| bash hadoop-ozone/dist/src/main/compose/ozone/test-s3a.sh | ||
| env: | ||
| BUILD_ONLY: true |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Yes, especially since it depends on Hadoop version, does not need to be rebuilt for each Ozone POM change.
There was a problem hiding this comment.
Addressed in c7a49c5 + 385e2bd. Cache is now back to 720MB:
https://github.com/adoroszlai/ozone/actions/runs/44781106817/job/136443699067#step:22:26
and there is a separate stash for Hadoop AWS Maven dependencies:
https://github.com/adoroszlai/ozone/actions/runs/44770754325/job/136407450271#step:11:3
which is used in test-s3a check:
https://github.com/adoroszlai/ozone/actions/runs/44783549819/job/136459595521#step:18:6
| mkdir -p "${REPORT_DIR}" | ||
|
|
||
| REPORT_FILE="${REPORT_DIR}/summary.txt" | ||
| BASE_DIR="$(pwd -P)" |
| <profile> | ||
| <id>go-offline</id> | ||
| <properties> | ||
| <cyclonedx.skip>true</cyclonedx.skip> |
There was a problem hiding this comment.
This seems re-enables makeBom in populate-cache, but didn't see it in the PR description. Is that intended?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
|
Also added a step to fetch Java 21-specific dependencies ( |
| 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" |
There was a problem hiding this comment.
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?
| '**/pom.xml', | ||
| '.mvn/extensions.xml', | ||
| '.mvn/wrapper/maven-wrapper.properties', | ||
| 'dev-support/ci/populate-cache.sh' |
There was a problem hiding this comment.
Thanks for adding this! Should we also include populate-cache.yml?
There was a problem hiding this comment.
The Ozone-specific Maven cache does not depend on (most of) the rest of the workflow, like the 3rd-party component stashes.
There was a problem hiding this comment.
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.
| # 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 \ |
There was a problem hiding this comment.
Good call on --offline. Could we retry online if offline resolution fails? local or older CI caches may lack required dependencies.
This reverts commit 0a02c56.
chihsuan
left a comment
There was a problem hiding this comment.
Thanks @adoroszlai The cache looks complete now. LGTM
| cd "$DIR/../.." || exit 1 | ||
|
|
||
| # fetch plugins, even if not part of normal build | ||
| ./mvnw --batch-mode --show-version dependency:resolve-plugins help:help |
There was a problem hiding this comment.
nit: Should we pass $@ here too, like the other commands below?
There was a problem hiding this comment.
Thanks, added. It's useful for local testing (pass -Dmaven.repo.local), but not used in CI, so pushed with [skip ci] commit message.
|
Thanks @chihsuan for the reviews. |
What changes were proposed in this pull request?
Run more steps in
populate-cacheto collect more artifacts.test-s3ain build-only mode to get Hadoop AWS dependencies.errorproneandreprochecks on 1 module to get the plugins and their dependencies.pmdon 2 modules to getmaven-fluido-skin.[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.gzReduce time by breaking the initial build into two steps:
ozonefs-shadedandozonefs-hadoop[23]ozonefs-shadedandozonefs-hadoop2(ozonefs-hadoop3is 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