-
Notifications
You must be signed in to change notification settings - Fork 245
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
Scala 2.13 Support #8592
Scala 2.13 Support #8592
Changes from 123 commits
77e83c3
7c9a930
5b41add
02ef278
8adb72e
ef6a97d
a359bec
65e3601
bc5d337
ce9054e
272725e
cd7a132
ac75ac6
c5f7bff
4b69ec9
4714ca6
85c0af9
144e442
a38a91a
a9bd68e
8db9a16
69d7b44
fec9f0c
abf994f
577e5a4
130e52c
bf24baa
220e0d3
742e043
6d50c1e
d993ec9
22e0354
cfb4535
7e2cde2
8c07562
ef58914
3d95050
c3467b7
df0d646
7f2fe5d
e4868bb
b041889
4aecd9a
aecfa13
8b794ae
66162df
282f8d3
2a6b6c6
ef7e49b
5bd1619
33d3370
9363438
7123930
581f022
b1ec78a
2c62f49
5b7fe19
5fa0c4c
6d2021c
67e52e9
4c4cc23
0973c52
2499e45
e2901c0
8d42334
4c0e448
870d19d
f8866f9
85c8fa4
6aab915
06a558f
46c414d
d49619e
5c6f672
44669c9
3cec238
9f41a3a
a3ef04d
919ac68
58a9632
865d6b8
95171ec
53cc51c
9bcb289
0b93bba
7e34de0
1ae14cb
924fe93
4319799
fd3407e
fbe7838
6c1c724
83680b3
56accae
f467272
f17743a
9c90e17
6d671bd
1f3c5ad
1457ad9
fcde3eb
046e9b5
7011a5a
6279a06
0892562
82456ae
096d775
ab25ace
835e29b
be09252
b8b6463
6277529
e7301f6
4c359e7
c138485
92dbb00
f52907c
9fe0e49
db33a80
ffb45ba
4ed4815
c88320b
5db5520
eb2dbd3
b375ba3
e6409c8
b1e774c
bbb6750
4a41342
e0ff07c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,6 +60,9 @@ You can find all available build versions in the top level pom.xml file. If you | |
for Databricks then you should use the `jenkins/databricks/build.sh` script and modify it for | ||
the version you want. | ||
|
||
See the [scala2.13](scala2.13) directory for instructions on how to build against | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might also be nice to state that the code must compile against both versions so when developing keep that in mind. Not sure if its useful to mention a few common things that arise. Also might point to the 2.13/2.12 source subdirectories There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added some documentation updates, please let me know if those make sense. |
||
Scala 2.13. | ||
|
||
To get an uber jar with more than 1 version you have to `mvn package` each version | ||
and then use one of the defined profiles in the dist module, or a comma-separated list of | ||
build versions. See the next section for more details. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,17 @@ | |
|
||
<parent> | ||
<groupId>com.nvidia</groupId> | ||
<artifactId>rapids-4-spark-parent</artifactId> | ||
<artifactId>rapids-4-spark-parent_2.12</artifactId> | ||
<version>23.12.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit/question: is |
||
</parent> | ||
<artifactId>rapids-4-spark-aggregator_2.12</artifactId> | ||
<name>RAPIDS Accelerator for Apache Spark Aggregator</name> | ||
<description>Creates an aggregated shaded package of the RAPIDS plugin for Apache Spark</description> | ||
<version>23.12.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<rapids.module>aggregator</rapids.module> | ||
<!-- | ||
we store ASM-relocated packages in /spark3xx parallel worlds in dist | ||
and they are auto-deduped using binary diff | ||
|
@@ -172,7 +174,9 @@ | |
<profile> | ||
<id>release311</id> | ||
<activation> | ||
<!-- #if scala-2.12 --> | ||
<activeByDefault>true</activeByDefault> | ||
<!-- #endif scala-2.12 --> | ||
<property> | ||
<name>buildver</name> | ||
<value>311</value> | ||
|
@@ -360,6 +364,9 @@ | |
<profile> | ||
<id>release330</id> | ||
<activation> | ||
<!-- #if scala-2.13 --><!-- | ||
<activeByDefault>true</activeByDefault> | ||
--><!-- #endif scala-2.13 --> | ||
<property> | ||
<name>buildver</name> | ||
<value>330</value> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. | ||
# | ||
# 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. | ||
# | ||
|
||
|
||
set -e | ||
|
||
VALID_VERSIONS=( 2.13 ) | ||
declare -A DEFAULT_SPARK | ||
DEFAULT_SPARK[2.12]="spark311" | ||
DEFAULT_SPARK[2.13]="spark330" | ||
|
||
usage() { | ||
echo "Usage: $(basename $0) [-h|--help] <version> | ||
where : | ||
-h| --help Display this help text | ||
valid version values : ${VALID_VERSIONS[*]} | ||
" 1>&2 | ||
exit 1 | ||
} | ||
|
||
if [[ ($# -ne 1) || ( $1 == "--help") || $1 == "-h" ]]; then | ||
usage | ||
fi | ||
|
||
TO_VERSION=$1 | ||
|
||
check_scala_version() { | ||
for i in ${VALID_VERSIONS[*]}; do [ $i = "$1" ] && return 0; done | ||
echo "Invalid Scala version: $1. Valid versions: ${VALID_VERSIONS[*]}" 1>&2 | ||
exit 1 | ||
} | ||
|
||
check_scala_version "$TO_VERSION" | ||
|
||
sed_i() { | ||
sed -e "$1" "$2" > "$2.tmp" && mv "$2.tmp" "$2" | ||
} | ||
|
||
BASEDIR=$(dirname $0)/.. | ||
if [ $TO_VERSION = "2.13" ]; then | ||
FROM_VERSION="2.12" | ||
SUBDIR="scala2.13" | ||
fi | ||
|
||
TO_DIR="$BASEDIR/$SUBDIR" | ||
mkdir -p $TO_DIR | ||
|
||
for f in $(git ls-files '**pom.xml'); do | ||
if [[ $f == $SUBDIR* ]]; then | ||
echo "Skipping $f" | ||
continue | ||
fi | ||
echo $f | ||
tof="$TO_DIR/$f" | ||
mkdir -p $(dirname $tof) | ||
cp -f $f $tof | ||
echo $tof | ||
sed_i 's/\(artifactId.*\)_'$FROM_VERSION'/\1_'$TO_VERSION'/g' $tof | ||
sed_i 's/^\([[:space:]]*<!-- #if scala-'$TO_VERSION' -->\)<!--/\1/' $tof | ||
sed_i 's/^\([[:space:]]*\)-->\(<!-- #endif scala-'$TO_VERSION' -->\)/\1\2/' $tof | ||
sed_i 's/^\([[:space:]]*<!-- #if scala-'$FROM_VERSION' -->\)$/\1<!--/' $tof | ||
sed_i 's/^\([[:space:]]*\)\(<!-- #endif scala-'$FROM_VERSION' -->\)/\1-->\2/' $tof | ||
done | ||
|
||
# Update spark.version to spark330.version for Scala 2.13 | ||
SPARK_VERSION=${DEFAULT_SPARK[$TO_VERSION]} | ||
sed_i '/<java\.major\.version>/,/<spark\.version>\${spark[0-9]\+\.version}</s/<spark\.version>\${spark[0-9]\+\.version}</<spark.version>\${'$SPARK_VERSION'.version}</' \ | ||
"$TO_DIR/pom.xml" | ||
|
||
sed_i '/<java\.major\.version>/,/<spark\.version>\${spark[0-9]\+\.version}</s/<spark\.version>\${spark[0-9]\+\.version}</<spark.version>\${'$SPARK_VERSION'.version}</' \ | ||
"$TO_DIR/pom.xml" | ||
|
||
# Update <scala.binary.version> in parent POM | ||
# Match any scala binary version to ensure idempotency | ||
sed_i '/<spark\-rapids\-jni\.version>/,/<scala\.binary\.version>[0-9]*\.[0-9]*</s/<scala\.binary\.version>[0-9]*\.[0-9]*</<scala.binary.version>'$TO_VERSION'</' \ | ||
"$TO_DIR/pom.xml" | ||
|
||
|
||
# Update <scala.version> in parent POM | ||
# Match any scala version to ensure idempotency | ||
SCALA_VERSION=$(mvn help:evaluate -Pscala-${TO_VERSION} -Dexpression=scala.version -q -DforceStdout) | ||
sed_i '/<spark\-rapids\-jni\.version>/,/<scala.version>[0-9]*\.[0-9]*\.[0-9]*</s/<scala\.version>[0-9]*\.[0-9]*\.[0-9]*</<scala.version>'$SCALA_VERSION'</' \ | ||
"$TO_DIR/pom.xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we get private artifact version under
scala2.13
dir though the version is the same?