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 8 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
25 changes: 25 additions & 0 deletions jenkins/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#
# Copyright (c) 2020-2022, NVIDIA CORPORATION. All rights reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

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

license: # Copyright (c) 2022

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

function get_spark_shim_versions() {
PROFILE_OPT=$1
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
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
IFS=", " <<< $SPARK_SHIM_VERSIONS_STR read -r -a SPARK_SHIM_VERSIONS
IFS=$PRE_IFS
}
41 changes: 28 additions & 13 deletions jenkins/spark-premerge-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if [[ $# -eq 1 ]]; then
BUILD_TYPE=$1

elif [[ $# -gt 1 ]]; then
echo "ERROR: too many parameters are provided"
>&2 echo "ERROR: too many parameters are provided"
exit 1
fi

Expand All @@ -37,27 +37,42 @@ 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 shim versions
. $(dirname "$0")/common.sh
# snapshots + noSnapshots
get_spark_shim_versions -Psnapshots
SPARK_SHIM_VERSIONS_ALL=("${SPARK_SHIM_VERSIONS[@]}")
# noSnapshots only
get_spark_shim_versions -PnoSnapshots
SPARK_SHIM_VERSIONS_NOSNAPSHOTS=("${SPARK_SHIM_VERSIONS[@]}")

# 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
SPARK_SHIM_VERSIONS_TEST=($(for version in ${SPARK_SHIM_VERSIONS_ALL[@]}; do [[ $version != 31* ]] && echo $version; done | sort -n -k1.1,1.2 -u -s))
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_ALL[@]}"
do
echo "Spark version: $version"
# build and run unit test
if [[ "${SPARK_SHIM_VERSIONS_TEST[@]}" =~ "$version" ]]; then
Copy link
Collaborator

@pxLi pxLi Sep 14, 2022

Choose a reason for hiding this comment

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

another thing to mention is that we separate some UT to ci_2 stage for balancing the duration of different stages, I think we could still have some hardcode exception here to put a heads-up of versions moved to other paralleled stages
https://github.com/NVIDIA/spark-rapids/blob/branch-22.10/jenkins/spark-premerge-build.sh#L136-L139

would be better to have premergeUT1 and premergeUT2

env -u SPARK_HOME $MVN_CMD -U -B $MVN_URM_MIRROR -Dbuildver=$version clean install $MVN_BUILD_ARGS \
-Dpytest.TEST_TAGS='' -pl '!tools'
# build only for nosnapshot versions
elif [[ "${SPARK_SHIM_VERSIONS_NOSNAPSHOTS[@]}" =~ "$version" ]]; then
$MVN_INSTALL_CMD -DskipTests -Dbuildver=$version
# build only for snapshot versions
elif [[ $BUILD_MAINTENANCE_VERSION_SNAPSHOTS == "true" ]]; then
$MVN_INSTALL_CMD -Dbuildver=$version
fi
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,18 @@

set -e

# PHASE_TYPE: CICD phase at which the script is called, to specify Spark shim versions.
# regular: noSnapshots + snapshots
# pre-release: noSnapshots only
PHASE_TYPE=regular
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved

if [[ $# -eq 1 ]]; then
PHASE_TYPE=$1
elif [[ $# -gt 1 ]]; then
>&2 echo "ERROR: too many parameters are provided"
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 +60,17 @@ 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]}
. $(dirname "$0")/common.sh
get_spark_shim_versions $PROFILE_OPT
YanxuanLiu marked this conversation as resolved.
Show resolved Hide resolved
SPARK_BASE_SHIM_VERSION=${SPARK_SHIM_VERSIONS[0]}