Skip to content

Fix spark download and add check/cleanup #1184

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

Merged
merged 3 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion regtests/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# Run without args to run all tests, or single arg for single test.
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

export SPARK_VERSION=spark-3.5.4
export SPARK_VERSION=spark-3.5.5
export SPARK_DISTRIBUTION=${SPARK_VERSION}-bin-hadoop3

if [ -z "${SPARK_HOME}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion regtests/run_spark_sql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fi
REGTEST_HOME=$(dirname $(realpath $0))
cd ${REGTEST_HOME}

export SPARK_VERSION=spark-3.5.4
export SPARK_VERSION=spark-3.5.5
export SPARK_DISTRIBUTION=${SPARK_VERSION}-bin-hadoop3
export SPARK_LOCAL_HOSTNAME=localhost # avoid VPN messing up driver local IP address binding

Expand Down
17 changes: 14 additions & 3 deletions regtests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,30 @@ if ! [ -f ${SPARK_HOME}/bin/spark-sql ]; then
fi
if ! [ -f ~/${SPARK_DISTRIBUTION}.tgz ]; then
echo 'Downloading spark distro...'
wget -O ~/${SPARK_DISTRIBUTION}.tgz https://dlcdn.apache.org/spark/${SPARK_VERSION}/${SPARK_DISTRIBUTION}.tgz
wget -O ~/${SPARK_DISTRIBUTION}.tgz https://archive.apache.org/dist/spark/${SPARK_VERSION}/${SPARK_DISTRIBUTION}.tgz
if ! [ -f ~/${SPARK_DISTRIBUTION}.tgz ]; then
if [[ "${OSTYPE}" == "darwin"* ]]; then
echo "Detected OS: mac. Running 'brew install wget' to try again."
brew install wget
wget -O ~/${SPARK_DISTRIBUTION}.tgz https://dlcdn.apache.org/spark/${SPARK_VERSION}/${SPARK_DISTRIBUTION}.tgz
wget -O ~/${SPARK_DISTRIBUTION}.tgz https://archive.apache.org/dist/spark/${SPARK_VERSION}/${SPARK_DISTRIBUTION}.tgz
fi
fi
else
echo 'Found existing Spark tarball'
fi
# check if the download was successful
if ! [ -f ~/${SPARK_DISTRIBUTION}.tgz ]; then
echo 'Failed to download Spark distribution. Please check the logs.'
exit 1
fi
tar xzvf ~/${SPARK_DISTRIBUTION}.tgz -C ~
echo 'Done!'
if [ $? -ne 0 ]; then
echo 'Failed to extract Spark distribution. Please check the logs.'
exit 1
else
echo 'Extracted Spark distribution.'
rm ~/${SPARK_DISTRIBUTION}.tgz
fi
SPARK_HOME=$(realpath ~/${SPARK_DISTRIBUTION})
SPARK_CONF="${SPARK_HOME}/conf/spark-defaults.conf"
else
Expand Down