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

Remove aggregator dependency before deploying dist artifact #4265

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 25 additions & 0 deletions dist/maven-antrun/build-parallel-worlds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,30 @@
</concat>
<exec executable="${project.basedir}/scripts/binary-dedupe.sh" failonerror="true"
dir="${project.build.directory}"/>


<echo level="info">Generating dependency-reduced-pom.xml</echo>
<resources id="aggregatorDependencyRegexWithoutWhitespace">
<string>&lt;dependency&gt;</string>
<string>&lt;groupId&gt;com.nvidia&lt;/groupId&gt;</string>
<string>&lt;artifactId&gt;rapids-4-spark-aggregator_\S+?&lt;/artifactId&gt;</string>
<string>&lt;version&gt;\S+?&lt;/version&gt;</string>
<string>&lt;classifier&gt;\S+?&lt;/classifier&gt;</string>
<string>&lt;scope&gt;\S+?&lt;/scope&gt;</string>
<string>&lt;/dependency&gt;</string>
</resources>
<pathconvert property="aggregatorDependencyRegex" refid="aggregatorDependencyRegexWithoutWhitespace" pathsep="\s+?"/>

<echo level="info">Generated regex to remove aggregator dependencies:
${aggregatorDependencyRegex}
</echo>
<copy file="${project.basedir}/pom.xml"
tofile="${project.build.directory}/extra-resources/META-INF/maven/${project.groupId}/${project.artifactId}/pom.xml"
overwrite="true">
<filterchain>
<replaceregex flags="gs" byline="false" replace=""
pattern="${aggregatorDependencyRegex}"/>
</filterchain>
</copy>
</target>
</project>
23 changes: 18 additions & 5 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@
<artifactId>rapids-4-spark-aggregator_${scala.binary.version}</artifactId>
<version>${project.version}</version>
<classifier>${spark.version.classifier}</classifier>
<!--
provided such that the 3rd party project depending on this will drop it
https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope
-->
<scope>provided</scope>
<scope>compile</scope>
</dependency>

<!--
Expand Down Expand Up @@ -248,6 +244,10 @@
</goals>
<configuration>
<classesDirectory>${project.build.directory}/parallel-world</classesDirectory>
<excludes>
<!-- get rid of all maven poms from shim builds -->
<exclude>META-INF/maven/**</exclude>
</excludes>
</configuration>
</execution>
<execution>
Expand Down Expand Up @@ -299,6 +299,19 @@
</target>
</configuration>
</execution>
<execution>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
<id>reduce-pom-deps-in-the-jar</id>
<configuration>
<target>
<zip update="true" basedir="${project.build.directory}/extra-resources"
destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"/>
</target>
</configuration>
</execution>
<execution>
<id>update_config_docs</id>
<phase>verify</phase>
Expand Down
4 changes: 3 additions & 1 deletion jenkins/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ ART_ID=`mvn help:evaluate -q -pl $DIST_PL -Dexpression=project.artifactId -Dforc
ART_VER=`mvn help:evaluate -q -pl $DIST_PL -Dexpression=project.version -DforceStdout`

FPATH="$DIST_PL/target/$ART_ID-$ART_VER"
POM_FPATH="$DIST_PL/target/extra-resources/META-INF/maven/com.nvidia/$ART_ID/pom.xml"

echo "Plan to deploy ${FPATH}.jar to $SERVER_URL (ID:$SERVER_ID)"

Expand Down Expand Up @@ -83,7 +84,8 @@ $DEPLOY_CMD -Durl=$SERVER_URL -DrepositoryId=$SERVER_ID \
# Distribution jar is a shaded artifact so use the reduced dependency pom.
$DEPLOY_CMD -Durl=$SERVER_URL -DrepositoryId=$SERVER_ID \
$SRC_DOC_JARS \
-Dfile=$FPATH.jar -DgroupId=com.nvidia -DartifactId=$ART_ID -Dversion=$ART_VER -DpomFile=./dist/pom.xml
-Dfile=$FPATH.jar -DgroupId=com.nvidia -DartifactId=$ART_ID -Dversion=$ART_VER \
-DpomFile="$POM_FPATH"

###### Deploy integration tests jar(s) ######
TESTS_ART_ID=`mvn help:evaluate -q -pl $TESTS_PL -Dexpression=project.artifactId -DforceStdout`
Expand Down
2 changes: 1 addition & 1 deletion jenkins/version-def.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -e
# $OVERWRITE_PARAMS patten 'abc=123;def=456;'
PRE_IFS=$IFS
IFS=";"
for VAR in $OVERWRITE_PARAMS;do
for VAR in $OVERWRITE_PARAMS; do
echo $VAR && export $VAR
done
IFS=$PRE_IFS
Expand Down