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

Print meaningful message when calling scripts in maven #4327

Merged
merged 5 commits into from
Dec 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
31 changes: 25 additions & 6 deletions dist/maven-antrun/build-parallel-worlds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,33 @@
</concat>

<!-- check shims revisions -->
<exec executable="${project.basedir}/scripts/check-shims-revisions.sh" failonerror="true"
dir="${project.build.directory}">
<exec executable="${project.basedir}/scripts/check-shims-revisions.sh"
dir="${project.build.directory}"
resultproperty="build-parallel-worlds.checkRevisionsExitCode"
errorproperty="build-parallel-worlds.checkRevisionsErrorMsg"
failonerror="false">
<arg value="${included_buildvers}"/>
</exec>

<exec executable="${project.basedir}/scripts/binary-dedupe.sh" failonerror="true"
dir="${project.build.directory}"/>

<fail message="exec check-shims-revisions.sh failed ${build-parallel-worlds.checkRevisionsErrorMsg}">
res-life marked this conversation as resolved.
Show resolved Hide resolved
<condition>
<not>
<equals arg1="${build-parallel-worlds.checkRevisionsExitCode}" arg2="0"/>
</not>
</condition>
</fail>

<exec executable="${project.basedir}/scripts/binary-dedupe.sh"
dir="${project.build.directory}"
resultproperty="build-parallel-worlds.dedupeExitCode"
errorproperty="build-parallel-worlds.dedupeErrorMsg"
failonerror="false"/>
<fail message="exec binary-dedupe.sh failed ${build-parallel-worlds.dedupeErrorMsg}">
<condition>
<not>
<equals arg1="${build-parallel-worlds.dedupeExitCode}" arg2="0"/>
</not>
</condition>
</fail>

<echo level="info">Generating dependency-reduced-pom.xml</echo>
<resources id="aggregatorDependencyRegexWithoutWhitespace">
Expand Down
20 changes: 10 additions & 10 deletions dist/scripts/binary-dedupe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,27 @@ echo "$((++STEP))/ SHA1 of all classes > tmp-sha1-class.txt"
time (
find ./parallel-world/spark3* -type f -name '*.class' | \
xargs $SHASUM > tmp-sha1-class.txt
) 2>&1
)

echo "$((++STEP))/ make shim column 1 > tmp-shim-sha-package-class.txt"
time (
< tmp-sha1-class.txt awk -F/ '$1=$1' | \
awk '{checksum=$1; shim=$4; $1=shim; $2=$3=""; $4=checksum; print $0}' | \
tr -s ' ' > tmp-shim-sha-package-class.txt
) 2>&1
)

echo "$((++STEP))/ sort by path, sha1; output first from each group > tmp-count-shim-sha-package-class.txt"
time (
sort -k3 -k2,2 -u tmp-shim-sha-package-class.txt | \
uniq -f 2 -c > tmp-count-shim-sha-package-class.txt
) 2>&1
)

echo "$((++STEP))/ class files with unique sha1 > $SPARK3XX_COMMON_TXT"
time (
grep '^\s\+1 .*' tmp-count-shim-sha-package-class.txt | \
awk '{$1=""; $3=""; print $0 }' | \
tr -s ' ' | sed 's/\ /\//g' > "$SPARK3XX_COMMON_TXT"
) 2>&1
)

function retain_single_copy() {
set -e
Expand Down Expand Up @@ -123,7 +123,7 @@ time (
while read spark_common_class; do
retain_single_copy "$spark_common_class"
done < "$SPARK3XX_COMMON_TXT"
) 2>&1
)

echo "$((++STEP))/ rsyncing common classes to $SPARK3XX_COMMON_DIR"
time (
Expand All @@ -135,7 +135,7 @@ time (
# use rsync to reduce process forking
rsync --files-from="$copy_list" ./parallel-world/"$shim" "$SPARK3XX_COMMON_DIR"
done
) 2>&1
)

mv "$SPARK3XX_COMMON_DIR" parallel-world/

Expand Down Expand Up @@ -172,7 +172,7 @@ echo "$((++STEP))/ creating sorted list of unshimmed classes > $UNSHIMMED_LIST_T
time (
find . -name '*.class' -not -path './parallel-world/spark3*' | \
cut -d/ -f 3- | sort > "$UNSHIMMED_LIST_TXT"
) 2>&1
)


function verify_same_sha_for_unshimmed() {
Expand Down Expand Up @@ -202,7 +202,7 @@ time (
while read unshimmed_class; do
verify_same_sha_for_unshimmed "$unshimmed_class"
done < "$UNSHIMMED_LIST_TXT"
) 2>&1
)

# Remove unshimmed classes from parallel worlds
# TODO rework with low priority, only a few classes.
Expand All @@ -215,10 +215,10 @@ time (
[[ -f "$unshimmed_path" ]] && echo "$unshimmed_path" || true
done >> "$DELETE_DUPLICATES_TXT"
done < "$UNSHIMMED_LIST_TXT"
) 2>&1
)

echo "$((++STEP))/ deleting all class files listed in $DELETE_DUPLICATES_TXT"
time (< "$DELETE_DUPLICATES_TXT" sort -u | xargs rm) 2>&1
time (< "$DELETE_DUPLICATES_TXT" sort -u | xargs rm)

end_time=$(date +%s)
echo "binary-dedupe completed in $((end_time - start_time)) seconds"
16 changes: 14 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -970,16 +970,28 @@
<phase>generate-resources</phase>
<configuration>
<!-- Execute the shell script to generate the plugin build information. -->
<target>
<target name="build-info">
<mkdir dir="${project.build.directory}/extra-resources"/>
<mkdir dir="${project.build.directory}/tmp"/>
<exec executable="bash" failonerror="true" output="${project.build.directory}/extra-resources/rapids4spark-version-info.properties">
<exec executable="bash"
output="${project.build.directory}/extra-resources/rapids4spark-version-info.properties"
resultproperty="build-info.exitCode"
errorproperty="build-info.errorMsg"
failonerror="false">
<arg value="${spark.rapids.source.basedir}/build/build-info"/>
<arg value="${project.version}"/>
<arg value="${cudf.version}"/>
</exec>
<fail message="exec build-info.sh failed ${build-info.errorMsg}">
<condition>
<not>
<equals arg1="${build-info.exitCode}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</configuration>

<goals>
<goal>run</goal>
</goals>
Expand Down
15 changes: 13 additions & 2 deletions shims/spark301/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@
<id>dependency</id>
<phase>generate-resources</phase>
<configuration>
<target>
<target name="dependency-info">
<mkdir dir="${project.build.directory}/extra-resources"/>
<exec executable="bash" failonerror="true" output="${project.build.directory}/extra-resources/spark-${spark301.version}-info.properties">
<exec executable="bash"
output="${project.build.directory}/extra-resources/spark-${spark301.version}-info.properties"
resultproperty="dependency-info.exitCode"
errorproperty="dependency-info.errorMsg"
failonerror="false">
<arg value="${spark.rapids.source.basedir}/build/dependency-info.sh"/>
<arg value="${cudf.version}"/>
<arg value="${cuda.version}"/>
<arg value="${spark301.version}"/>
</exec>
<fail message="exec dependency-info.sh failed ${dependency-info.errorMsg}">
<condition>
<not>
<equals arg1="${dependency-info.exitCode}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</configuration>
<goals>
Expand Down
15 changes: 13 additions & 2 deletions shims/spark301db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@
<id>dependency</id>
<phase>generate-resources</phase>
<configuration>
<target>
<target name="dependency-info">
<mkdir dir="${project.build.directory}/extra-resources"/>
<exec executable="bash" failonerror="true" output="${project.build.directory}/extra-resources/spark-${spark301db.version}-info.properties">
<exec executable="bash"
output="${project.build.directory}/extra-resources/spark-${spark301db.version}-info.properties"
resultproperty="dependency-info.exitCode"
errorproperty="dependency-info.errorMsg"
failonerror="false">
<arg value="${spark.rapids.source.basedir}/build/dependency-info.sh"/>
<arg value="${cudf.version}"/>
<arg value="${cuda.version}"/>
<arg value="${spark301db.version}"/>
</exec>
<fail message="exec dependency-info.sh failed ${dependency-info.errorMsg}">
<condition>
<not>
<equals arg1="${dependency-info.exitCode}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</configuration>
<goals>
Expand Down
15 changes: 13 additions & 2 deletions shims/spark302/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@
<id>dependency</id>
<phase>generate-resources</phase>
<configuration>
<target>
<target name="dependency-info">
<mkdir dir="${project.build.directory}/extra-resources"/>
<exec executable="bash" failonerror="true" output="${project.build.directory}/extra-resources/spark-${spark302.version}-info.properties">
<exec executable="bash"
output="${project.build.directory}/extra-resources/spark-${spark302.version}-info.properties"
resultproperty="dependency-info.exitCode"
errorproperty="dependency-info.errorMsg"
failonerror="false">
<arg value="${spark.rapids.source.basedir}/build/dependency-info.sh"/>
<arg value="${cudf.version}"/>
<arg value="${cuda.version}"/>
<arg value="${spark302.version}"/>
</exec>
<fail message="exec dependency-info.sh failed ${dependency-info.errorMsg}">
<condition>
<not>
<equals arg1="${dependency-info.exitCode}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</configuration>
<goals>
Expand Down
15 changes: 13 additions & 2 deletions shims/spark303/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@
<id>dependency</id>
<phase>generate-resources</phase>
<configuration>
<target>
<target name="dependency-info">
<mkdir dir="${project.build.directory}/extra-resources"/>
<exec executable="bash" failonerror="true" output="${project.build.directory}/extra-resources/spark-${spark303.version}-info.properties">
<exec executable="bash"
output="${project.build.directory}/extra-resources/spark-${spark303.version}-info.properties"
resultproperty="dependency-info.exitCode"
errorproperty="dependency-info.errorMsg"
failonerror="false">
<arg value="${spark.rapids.source.basedir}/build/dependency-info.sh"/>
<arg value="${cudf.version}"/>
<arg value="${cuda.version}"/>
<arg value="${spark303.version}"/>
</exec>
<fail message="exec dependency-info.sh failed ${dependency-info.errorMsg}">
<condition>
<not>
<equals arg1="${dependency-info.exitCode}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</configuration>
<goals>
Expand Down
15 changes: 13 additions & 2 deletions shims/spark304/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@
<id>dependency</id>
<phase>generate-resources</phase>
<configuration>
<target>
<target name="dependency-info">
<mkdir dir="${project.build.directory}/extra-resources"/>
<exec executable="bash" failonerror="true" output="${project.build.directory}/extra-resources/spark-${spark304.version}-info.properties">
<exec executable="bash"
output="${project.build.directory}/extra-resources/spark-${spark304.version}-info.properties"
resultproperty="dependency-info.exitCode"
errorproperty="dependency-info.errorMsg"
failonerror="false">
<arg value="${spark.rapids.source.basedir}/build/dependency-info.sh"/>
<arg value="${cudf.version}"/>
<arg value="${cuda.version}"/>
<arg value="${spark304.version}"/>
</exec>
<fail message="exec dependency-info.sh failed ${dependency-info.errorMsg}">
<condition>
<not>
<equals arg1="${dependency-info.exitCode}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</configuration>
<goals>
Expand Down
15 changes: 13 additions & 2 deletions shims/spark311/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,25 @@
<id>dependency</id>
<phase>generate-resources</phase>
<configuration>
<target>
<target name="dependency-info">
<mkdir dir="${project.build.directory}/extra-resources"/>
<exec executable="bash" failonerror="true" output="${project.build.directory}/extra-resources/spark-${spark311.version}-info.properties">
<exec executable="bash"
output="${project.build.directory}/extra-resources/spark-${spark311.version}-info.properties"
resultproperty="dependency-info.exitCode"
errorproperty="dependency-info.errorMsg"
failonerror="false">
<arg value="${spark.rapids.source.basedir}/build/dependency-info.sh"/>
<arg value="${cudf.version}"/>
<arg value="${cuda.version}"/>
<arg value="${spark311.version}"/>
</exec>
<fail message="exec dependency-info.sh failed ${dependency-info.errorMsg}">
<condition>
<not>
<equals arg1="${dependency-info.exitCode}" arg2="0"/>
</not>
</condition>
</fail>
</target>
</configuration>
<goals>
Expand Down
15 changes: 13 additions & 2 deletions shims/spark311cdh/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,26 @@
<id>dependency</id>
<phase>generate-resources</phase>
<configuration>
<target>
<target name="dependency-info">
<mkdir dir="${project.build.directory}/extra-resources"/>
<exec executable="bash" failonerror="true" output="${project.build.directory}/extra-resources/spark-${spark311cdh.version}-info.properties">
<exec executable="bash"
output="${project.build.directory}/extra-resources/spark-${spark311cdh.version}-info.properties"
resultproperty="dependency-info.exitCode"
errorproperty="dependency-info.errorMsg"
failonerror="false">
<arg value="${spark.rapids.source.basedir}/build/dependency-info.sh"/>
<arg value="${cudf.version}"/>
<arg value="${cuda.version}"/>
<arg value="${spark311cdh.version}"/>
</exec>
</target>
<fail message="exec dependency-info.sh failed ${dependency-info.errorMsg}">
<condition>
<not>
<equals arg1="${dependency-info.exitCode}" arg2="0"/>
</not>
</condition>
</fail>
</configuration>
<goals>
<goal>run</goal>
Expand Down
Loading