Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy release candidates to local maven repo for dependency check[skip ci] #10201

Merged
merged 5 commits into from
Jan 23, 2024

Conversation

NvTimLiu
Copy link
Collaborator

Deploy release candidates to local maven repo for dependency check

To fix : #10164

Deploy release candidates to local maven repo leveraging the release deploy script.

Instead of using internal snapshots maven repo(having all the intermediate artifacts),
we check dependencies for the release candidates using the local maven repo,
which only contains release candidates.

Signed-off-by: Tim Liu [email protected]

To fix : NVIDIA#10164

Deploy release candidates to local maven repo leveraging the release deploy script.

Instead of using internal snapshots maven repo(having all the intermediate artifacts),
    we check dependencies for the release candidates using the local maven repo,
    which only contains release candidates.

Signed-off-by: Tim Liu <[email protected]>
@NvTimLiu NvTimLiu added feature request New feature or request build Related to CI / CD or cleanly building labels Jan 15, 2024
@NvTimLiu NvTimLiu requested a review from gerashegalov January 15, 2024 15:48
@NvTimLiu NvTimLiu self-assigned this Jan 15, 2024
@NvTimLiu NvTimLiu changed the title Deploy release candidates to local maven repo for dependency check Deploy release candidates to local maven repo for dependency check[skip ci] Jan 15, 2024
CLASSLIST="$CLASSIFIERS,sources,javadoc"
CLASSLIST=(${CLASSLIST//','/' '})
for class in ${CLASSLIST[@]}; do
echo "$ART_GROUP_ID:$ART_ID:$ART_VER:jar:$class" >> $ARTIFACT_FILE
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The artifact file is like below, and our plugin nightly build CI will check all these artifacts dependencies.

com.nvidia:rapids-4-spark-parent_2.12:24.02.0-SNAPSHOT:pom
com.nvidia:rapids-4-spark-jdk-profiles_2.12:24.02.0-SNAPSHOT:pom
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:pom
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:cuda11
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:sources
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:javadoc

PARENT_ART_ID=$(mvnEval "./" project.artifactId)
echo "$ART_GROUP_ID:$PARENT_ART_ID:$ART_VER:pom" >> $ARTIFACT_FILE

###### Deploy the jdk-profile pom file ######
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Deploy pom.xml file of the module jdk-profiles here, to PASS the release artifact's dependency check

@@ -30,7 +30,7 @@ WORKSPACE=${WORKSPACE:-$(pwd)}
export M2DIR=${M2DIR:-"$WORKSPACE/.m2"}

## MVN_OPT : maven options environment, e.g. MVN_OPT='-Dspark-rapids-jni.version=xxx' to specify spark-rapids-jni dependency's version.
MVN="mvn -Dmaven.wagon.http.retryHandler.count=3 -DretryFailedDeploymentCount=3 ${MVN_OPT}"
MVN="mvn -Dmaven.wagon.http.retryHandler.count=3 -DretryFailedDeploymentCount=3 ${MVN_OPT} -Psource-javadoc"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sources.jar and javadoc.jar files are required by OSS release

Generate these 2 files to mimic OSS release in our nightly build CI

@NvTimLiu
Copy link
Collaborator Author

NvTimLiu commented Jan 15, 2024

After this change get merged, we'll enable the release candidates dependency checking in our nightly Build CI job

@gerashegalov @jlowe Can you help review? Thanks!


set -ex

ARTIFACT_FILE=${1:-"/tmp/artifacts-list"}
Copy link
Collaborator Author

@NvTimLiu NvTimLiu Jan 16, 2024

Choose a reason for hiding this comment

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

artifact list file created by deploy.sh, e.g.,

com.nvidia:rapids-4-spark-parent_2.12:24.02.0-SNAPSHOT:pom
com.nvidia:rapids-4-spark-jdk-profiles_2.12:24.02.0-SNAPSHOT:pom
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:pom
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:cuda11
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:sources
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:javadoc

Copy link
Collaborator

Choose a reason for hiding this comment

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

should

com.nvidia:rapids-4-spark-parent_2.12:24.02.0-SNAPSHOT:pom
com.nvidia:rapids-4-spark-jdk-profiles_2.12:24.02.0-SNAPSHOT:pom

be in this list?

When we do the test with mvn dependency:get for the documented artifacts such as com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:cuda11 and one of the pom-type artifacts above is missing we should see a failure anyways, correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@gerashegalov Yes, you're right, jar's dependency contain the pom files!

My original thought was to check anything we deployed, though pom check would be duplicated.

Let me remove pom from the check list.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated, artifact list will be like

com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:cuda11
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:cuda12
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:sources
com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:javadoc

similar list for scala-2.13 jars, and for arm64 jars

@@ -96,6 +102,14 @@ echo "Deploy CMD: $DEPLOY_CMD"

###### Deploy the parent pom file ######
$DEPLOY_CMD -Dfile=./pom.xml -DpomFile=./pom.xml
PARENT_ART_ID=$(mvnEval "./" project.artifactId)
echo "$ART_GROUP_ID:$PARENT_ART_ID:$ART_VER:pom" >> $ARTIFACT_FILE
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

save artifact like com.nvidia:rapids-4-spark-parent_2.12:24.02.0-SNAPSHOT:pom into $ARTIFACT_FILE

Copy link
Collaborator

Choose a reason for hiding this comment

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

To elaborate on the previous comment, we don't have to register intermediate pom for an explicit check via an $ARTIFACT_FILE line.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

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

Looks good already, just need to double-check if the test fails if we omit deploy-file of jdk-profiles


set -ex

ARTIFACT_FILE=${1:-"/tmp/artifacts-list"}
Copy link
Collaborator

Choose a reason for hiding this comment

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

should

com.nvidia:rapids-4-spark-parent_2.12:24.02.0-SNAPSHOT:pom
com.nvidia:rapids-4-spark-jdk-profiles_2.12:24.02.0-SNAPSHOT:pom

be in this list?

When we do the test with mvn dependency:get for the documented artifacts such as com.nvidia:rapids-4-spark_2.12:24.02.0-SNAPSHOT:jar:cuda11 and one of the pom-type artifacts above is missing we should see a failure anyways, correct?

@@ -96,6 +102,14 @@ echo "Deploy CMD: $DEPLOY_CMD"

###### Deploy the parent pom file ######
$DEPLOY_CMD -Dfile=./pom.xml -DpomFile=./pom.xml
PARENT_ART_ID=$(mvnEval "./" project.artifactId)
echo "$ART_GROUP_ID:$PARENT_ART_ID:$ART_VER:pom" >> $ARTIFACT_FILE
Copy link
Collaborator

Choose a reason for hiding this comment

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

To elaborate on the previous comment, we don't have to register intermediate pom for an explicit check via an $ARTIFACT_FILE line.

@NvTimLiu
Copy link
Collaborator Author

Looks good already, just need to double-check if the test fails if we omit deploy-file of jdk-profiles

I ran the jenkins/dependency-check.sh script in CI the job, it would FAIL unless all the dependency jar/pom are available in the local-remote maven repo

@NvTimLiu
Copy link
Collaborator Author

build

Copy link
Collaborator

@gerashegalov gerashegalov left a comment

Choose a reason for hiding this comment

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

LGTM

Is there a reason not to call dependency-check.sh from spark-nightly-build.sh so we do not have to guess how these two scripts are related? Are you going to add the Jenkins pipeline step for it in this repo?

@NvTimLiu
Copy link
Collaborator Author

LGTM

Is there a reason not to call dependency-check.sh from spark-nightly-build.sh so we do not have to guess how these two scripts are related? Are you going to add the Jenkins pipeline step for it in this repo?

Yes, I will add the dependency check into the Jenkins pipeline into another stage(dependency check).

The reason why not calling from spark-nightly-build.sh is that:

spark-nightly-build.sh has script to deploy anything into maven internal repo, if we add this check into nightly build script, there is another deploy call (deploy.sh[only for public artifacts]) plus dependency-check.sh, making nightly build script odd and complexed

@NvTimLiu
Copy link
Collaborator Author

build

@NvTimLiu NvTimLiu merged commit e51481e into NVIDIA:branch-24.02 Jan 23, 2024
40 checks passed
@NvTimLiu
Copy link
Collaborator Author

I'll enable the dependency check in our internal nightly build CI, it will run in tonight's plugin nightly job @gerashegalov @sameerz

fi
while read line; do
artifact=$line # artifact=groupId:artifactId:version:[[packaging]:classifier]
mvn dependency:get -DremoteRepositories=$remote_maven_repo -Dmaven.repo.local=$M2_CACHE -Dartifact=$artifact
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missed in the original review: we should rm -r $M2_CACHE/com/nvidia before this line or even the whole $M2_CACHE to avoid side-effect of previous dependency:get

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, filed a follow-up PR for it #10278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to CI / CD or cleanly building
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Create a nightly/weekly test for release deploy script
5 participants