Skip to content

Commit 2c1fb22

Browse files
committed
Updated to use spark 3.2.1.
Also changed to use a file spark/docker/spark_version to indicate which spark version to download and use. Just change this one file and it will change our spark version.
1 parent d257cae commit 2c1fb22

File tree

9 files changed

+18
-12
lines changed

9 files changed

+18
-12
lines changed

benchmark/tpch/build_tpch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22
# Bring in environment including ${ROOT_DIR} etc.
3+
source ../../spark/docker/spark_version
34
source ../../spark/docker/setup.sh
45
if [ ! -d tpch-spark/lib ]; then
56
mkdir tpch-spark/lib

benchmark/tpch/run_tpch.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/bin/bash
22

3+
source ../../spark/docker/spark_version
34
source ../../spark/docker/setup.sh
45

56
if [ "$#" -lt 1 ]; then

pushdown-datasource/build.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
source ../spark/docker/spark_version
23
source ../spark/docker/setup.sh
34
SPARK_JAR_DIR=../spark/build/spark-${SPARK_VERSION}/jars/
45
if [ ! -d $SPARK_JAR_DIR ]; then
@@ -14,10 +15,10 @@ fi
1415
echo "Copy over spark jars"
1516
cp $SPARK_JAR_DIR/*.jar pushdown-datasource/lib
1617

17-
SPARK_TEST_JAR_DIR=../spark/spark/
18-
cp $SPARK_TEST_JAR_DIR/sql/core/target/spark-sql_2.12-${SPARK_VERSION}-tests.jar pushdown-datasource/lib
19-
cp $SPARK_TEST_JAR_DIR/sql/catalyst/target/spark-catalyst_2.12-${SPARK_VERSION}-tests.jar pushdown-datasource/lib
20-
cp $SPARK_TEST_JAR_DIR/core/target/spark-core_2.12-${SPARK_VERSION}-tests.jar pushdown-datasource/lib
18+
#SPARK_TEST_JAR_DIR=../spark/spark/
19+
#cp $SPARK_TEST_JAR_DIR/sql/core/target/spark-sql_2.12-${SPARK_VERSION}-tests.jar pushdown-datasource/lib
20+
#cp $SPARK_TEST_JAR_DIR/sql/catalyst/target/spark-catalyst_2.12-${SPARK_VERSION}-tests.jar pushdown-datasource/lib
21+
#cp $SPARK_TEST_JAR_DIR/core/target/spark-core_2.12-${SPARK_VERSION}-tests.jar pushdown-datasource/lib
2122

2223
DIKECLIENTJAR=../dikeHDFS/client/ndp-hdfs/target/ndp-hdfs-1.0.jar
2324

spark/docker/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /e
6363
&& sudo apt-get install sbt
6464

6565
# Setup Spark Environment
66-
ENV SPARK_VERSION 3.2.0
66+
ARG SPARK_VERSION=
67+
ENV SPARK_VERSION ${SPARK_VERSION}
6768
ENV SPARK_PACKAGE spark-${SPARK_VERSION}-bin-hadoop2.7.tgz
69+
ENV SPARK_PACKAGE_FOLDER spark-${SPARK_VERSION}-bin-hadoop2.7
6870
ENV SPARK_PACKAGE_URL https://downloads.apache.org/spark/spark-${SPARK_VERSION}/$SPARK_PACKAGE
6971
ENV SPARK_SRC /spark
7072
ENV SPARK_BUILD /build

spark/docker/build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
17-
17+
source spark_version
18+
echo "SPARK_VERSION $SPARK_VERSION"
1819
ROOT_DIR=$(pwd)
1920

2021
DOCKER_DIR=${ROOT_DIR}
@@ -61,10 +62,10 @@ fi
6162
echo "User id is: $USER_ID"
6263
echo "Group id is: $GROUP_ID"
6364

64-
docker build -f Dockerfile --target builder -t spark_build .
65+
docker build -f Dockerfile --target builder --build-arg SPARK_VERSION=$SPARK_VERSION -t spark_build .
6566
echo "Done building spark_build docker"
6667

67-
docker build -f Dockerfile -t spark_run .
68+
docker build -f Dockerfile --build-arg SPARK_VERSION=$SPARK_VERSION -t spark_run .
6869
echo "Done building spark_run docker"
6970

7071
# Set the home directory in the Docker container.

spark/docker/setup.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
ROOT_DIR=$(pwd)
1919
DOCKER_DIR=docker
2020
DOCKER_FILE="${DOCKER_DIR}/Dockerfile"
21-
SPARK_VERSION="3.2.0"
2221
USER_NAME=${SUDO_USER:=$USER}
2322
USER_ID=$(id -u "${USER_NAME}")
2423

spark/docker/spark_version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SPARK_VERSION=3.2.1

spark/scripts/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ if [ "$1" == "spark" ]; then
3030
fi
3131
# Extract our built package into our install directory.
3232
echo "Extracting $SPARK_PACKAGE to $SPARK_HOME"
33-
tar -xzf spark-3.2.0-bin-hadoop2.7.tgz -C /build \
34-
&& mv $SPARK_BUILD/spark-3.2.0-bin-hadoop2.7 $SPARK_HOME
33+
tar -xzf $SPARK_PACKAGE -C /build \
34+
&& mv $SPARK_BUILD/$SPARK_PACKAGE_FOLDER $SPARK_HOME
3535
popd
3636
else
3737
echo "Building spark"

0 commit comments

Comments
 (0)