0yukali0 commented on code in PR #553:
URL: https://github.com/apache/yunikorn-k8shim/pull/553#discussion_r1153702160


##########
scripts/run-e2e-tests.sh:
##########
@@ -101,14 +101,24 @@ function install_kind() {
 }
 
 function install_spark() {
-  check_cmd "wget"
-  wget -qO-  
https://archive.apache.org/dist/spark/spark-3.3.1/spark-3.3.1-bin-hadoop3.tgz | 
tar xzvf - && chmod +x spark-3.3.1-bin-hadoop3 && sudo mv 
spark-3.3.1-bin-hadoop3 /opt/.
-  exit_on_error "install spark failed."
-  sudo ln -s /opt/spark-3.3.1-bin-hadoop3 /opt/spark
-  exit_on_error "install spark failed. unable to create symlink"
-  export SPARK_HOME=/opt/spark/
-  export SPARK_PYTHON_IMAGE=docker.io/apache/spark-py:v3.3.1
+  CURRENT=$(pwd)
+  SPARK_VERSION="3.3.1"
+  DOWNLOAD="${CURRENT}/_spark"
+  SPARK_SUBMIT_CMD="${DOWNLOAD}/spark/bin/spark-submit"
+  if [[ ! -d "${DOWNLOAD}" || ! -f "${SPARK_SUBMIT_CMD}" ]]; then
+    echo  "Installing spark in yunikorn rep."
+    rm -rf "${DOWNLOAD}"
+    mkdir "${DOWNLOAD}" \
+      && cd "${DOWNLOAD}" \
+      && curl 
"https://archive.apache.org/dist/spark/spark-${SPARK_VERSION}/spark-${SPARK_VERSION}-bin-hadoop3.tgz";
 | tar xzvf - \
+      && mv "spark-${SPARK_VERSION}-bin-hadoop3" spark \
+      && chmod +x spark
+    exit_on_error "install spark failed."
+  fi
+  export SPARK_HOME="${DOWNLOAD}/spark"

Review Comment:
   Ok



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to