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

Use dist/pom file as source of truth for spark versions #6437

Merged
merged 30 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bb5d736
get spark shim version from pom
YanxuanLiu Aug 28, 2022
dfc4c0d
correct comments
YanxuanLiu Aug 29, 2022
0f10dab
Merge remote-tracking branch 'upstream/branch-22.10' into fix_issue_5086
YanxuanLiu Aug 30, 2022
fec83c1
Merge remote-tracking branch 'upstream/branch-22.10' into fix_issue_5086
YanxuanLiu Sep 5, 2022
0fd775e
added switch control for version-def
YanxuanLiu Sep 5, 2022
a027cd3
replace mvn command with profile var
YanxuanLiu Sep 5, 2022
71bdb82
fix some its
YanxuanLiu Sep 7, 2022
9c236aa
add func to get versions from pom
YanxuanLiu Sep 7, 2022
835a820
get version in version-def
YanxuanLiu Sep 8, 2022
f04c1ef
get versioon from version-def in yml
YanxuanLiu Sep 8, 2022
0402c4c
Update .github/workflows/mvn-verify-check.yml
YanxuanLiu Sep 9, 2022
66d1ae3
add premergeUT to pom
YanxuanLiu Sep 9, 2022
ef56b36
Merge branch 'branch-22.10' of https://github.com/NVIDIA/spark-rapids…
YanxuanLiu Sep 9, 2022
6f12667
Merge branch 'fix_issue_5086' of https://github.com/YanxuanLiu/spark-…
YanxuanLiu Sep 9, 2022
8a84ce6
fix nits
YanxuanLiu Sep 9, 2022
61f10fc
fix bug: call version-def in yml
YanxuanLiu Sep 9, 2022
fba5447
fix bug
YanxuanLiu Sep 9, 2022
f0c717f
fix nits and optimize env var names
YanxuanLiu Sep 13, 2022
42b2dcc
set headVersion with env
YanxuanLiu Sep 13, 2022
aa35275
fix yml bug
YanxuanLiu Sep 13, 2022
c9be954
add echo for debug
YanxuanLiu Sep 13, 2022
1d940d1
add echo in yml for testing
YanxuanLiu Sep 13, 2022
0fb874b
fix bug
YanxuanLiu Sep 13, 2022
6d96fdd
add SCRIPT_PATH for wrapper call
YanxuanLiu Sep 13, 2022
ce25240
add comment
YanxuanLiu Sep 13, 2022
aa8a015
add comment
YanxuanLiu Sep 13, 2022
f63e2e7
remove common and seperate ut versions to two parts
YanxuanLiu Sep 14, 2022
1d265ee
skip base version
YanxuanLiu Sep 14, 2022
2687f44
add comment
YanxuanLiu Sep 14, 2022
9ac31b1
added property for utf-8 cases
YanxuanLiu Sep 19, 2022
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
38 changes: 26 additions & 12 deletions jenkins/spark-premerge-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,41 @@ mvn_verify() {
# file size check for pull request. The size of a committed file should be less than 1.5MiB
pre-commit run check-added-large-files --from-ref $BASE_REF --to-ref HEAD

# Get Spark versions
SPARK_VERSIONS_SNAPSHOTS_STR=$(mvn -B help:evaluate -q -pl dist -Psnapshots -Dexpression=included_buildvers -DforceStdout)
SPARK_VERSIONS_NOSNAPSHOTS_STR=$(mvn -B help:evaluate -q -pl dist -PnoSnapshots -Dexpression=included_buildvers -DforceStdout)
SPARK_VERSIONS_SNAPSHOTS_STR=$(echo $SPARK_VERSIONS_SNAPSHOTS_STR)
SPARK_VERSIONS_NOSNAPSHOTS_STR=$(echo $SPARK_VERSIONS_NOSNAPSHOTS_STR)
oldIFS=$IFS
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
IFS=$', ' <<< $SPARK_VERSIONS_SNAPSHOTS_STR read -r -a SPARK_SHIM_VERSIONS
IFS=$', ' <<< $SPARK_VERSIONS_NOSNAPSHOTS_STR read -r -a SPARK_SHIM_VERSIONS_NOSNAPSHOTS
IFS=$oldIFS
SPARK_SHIM_VERSIONS_TEST=("311" "320" "330")
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved

# build the Spark 2.x explain jar
env -u SPARK_HOME $MVN_CMD -B $MVN_URM_MIRROR -Dbuildver=24X clean install -DskipTests

MVN_INSTALL_CMD="env -u SPARK_HOME $MVN_CMD -U -B $MVN_URM_MIRROR clean install $MVN_BUILD_ARGS -DskipTests -pl aggregator -am"
# build all the versions but only run unit tests on one 3.1.X version (base version covers this), one 3.2.X and one 3.3.X version.
# All others shims test should be covered in nightly pipelines
$MVN_INSTALL_CMD -DskipTests -Dbuildver=321cdh
$MVN_INSTALL_CMD -DskipTests -Dbuildver=312
$MVN_INSTALL_CMD -DskipTests -Dbuildver=313
[[ $BUILD_MAINTENANCE_VERSION_SNAPSHOTS == "true" ]] && $MVN_INSTALL_CMD -Dbuildver=314

$MVN_INSTALL_CMD -DskipTests -Dbuildver=320
for version in ${SPARK_SHIM_VERSIONS[*]}
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
do
echo "spark version: $version"
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
# build and run unit tests on one 3.1.X version (base version covers this), one 3.2.X and one 3.3.X version
if [[ "${TEST_SPARK_SHIM_VERSIONS[*]}" =~ "$version" ]]; then
env -u SPARK_HOME $MVN_CMD -U -B $MVN_URM_MIRROR -Dbuildver=$version clean install $MVN_BUILD_ARGS \
-Dpytest.TEST_TAGS='' -pl '!tools'
# build nosnapshot versions
elif [[ "${SPARK_SHIM_VERSIONS_NOSNAPSHOTS}" =~ "$verions" ]]; then
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
$MVN_INSTALL_CMD -DskipTests -Dbuildver=$version
# build snapshot versions
else
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
[[ $BUILD_MAINTENANCE_VERSION_SNAPSHOTS == "true" ]] && $MVN_INSTALL_CMD -Dbuildver=$version
fi
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
done
# enable UTF-8 for regular expression tests
env -u SPARK_HOME LC_ALL="en_US.UTF-8" $MVN_CMD $MVN_URM_MIRROR -Dbuildver=320 test $MVN_BUILD_ARGS \
Copy link
Collaborator

@gerashegalov gerashegalov Sep 14, 2022

Choose a reason for hiding this comment

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

another hardcoding overlooked: Should it be $SPARK_SHIM_VERSIONS_PREMERGE_UT_1 or some dedicated variable. Would be good if didn't have to come back to this file when we are going to update versions in dist/pom.

-Dpytest.TEST_TAGS='' -pl '!tools' \
-DwildcardSuites=com.nvidia.spark.rapids.ConditionalsSuite,com.nvidia.spark.rapids.RegularExpressionSuite,com.nvidia.spark.rapids.RegularExpressionTranspilerSuite
$MVN_INSTALL_CMD -DskipTests -Dbuildver=321
$MVN_INSTALL_CMD -DskipTests -Dbuildver=322
env -u SPARK_HOME $MVN_CMD -U -B $MVN_URM_MIRROR -Dbuildver=330 clean install $MVN_BUILD_ARGS \
-Dpytest.TEST_TAGS='' -pl '!tools'
[[ $BUILD_MAINTENANCE_VERSION_SNAPSHOTS == "true" ]] && $MVN_INSTALL_CMD -DskipTests -Dbuildver=331
# TODO: move it to BUILD_MAINTENANCE_VERSION_SNAPSHOTS when we resolve all spark340 build issues
[[ $BUILD_FEATURE_VERSION_SNAPSHOTS == "true" ]] && $MVN_INSTALL_CMD -DskipTests -Dbuildver=340

Expand Down
26 changes: 23 additions & 3 deletions jenkins/version-def.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@

set -e

PHASE_TYPE=regular
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved

if [[ $# -eq 1 ]]; then
PHASE_TYPE=$1
elif [[ $# -gt 1 ]]; then
echo "ERROR: too many parameters are provided"
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
exit 1
fi

# Split abc=123 from $OVERWRITE_PARAMS
# $OVERWRITE_PARAMS patten 'abc=123;def=456;'
PRE_IFS=$IFS
Expand Down Expand Up @@ -48,9 +57,20 @@ SPARK_REPO=${SPARK_REPO:-"$URM_URL"}
echo "CUDF_VER: $CUDF_VER, CUDA_CLASSIFIER: $CUDA_CLASSIFIER, PROJECT_VER: $PROJECT_VER \
SPARK_VER: $SPARK_VER, SCALA_BINARY_VER: $SCALA_BINARY_VER"

case $PHASE_TYPE in

SPARK_SHIM_VERSIONS_STR=${SPARK_SHIM_VERSIONS_STR:-"311 321cdh 312 313 314 320 321 322 330 331"}
pre-release)
PROFILE_OPT="-Psnapshots"
;;

IFS=" " <<< $SPARK_SHIM_VERSIONS_STR read -r -a SPARK_SHIM_VERSIONS
*)
PROFILE_OPT="-PnoSnapshots"
;;
esac

SPARK_BASE_SHIM_VERSION=${SPARK_SHIM_VERSIONS[0]}
SPARK_SHIM_VERSIONS_STR=$(mvn -B help:evaluate -q -pl dist $PROFILE_OPT -Dexpression=included_buildvers -DforceStdout)
SPARK_SHIM_VERSIONS_STR=$(echo $SPARK_SHIM_VERSIONS_STR)
PRE_IFS=$IFS
IFS=", " <<< $SPARK_SHIM_VERSIONS_STR read -r -a SPARK_SHIM_VERSIONS
IFS=$PRE_IFS
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
SPARK_BASE_SHIM_VERSION=${SPARK_SHIM_VERSIONS[0]}