skonto commented on a change in pull request #25870: [SPARK-27936][K8S] Support 
python deps
URL: https://github.com/apache/spark/pull/25870#discussion_r344351132
 
 

 ##########
 File path: 
resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/DepsTestsSuite.scala
 ##########
 @@ -183,6 +187,62 @@ private[spark] trait DepsTestsSuite { k8sSuite: 
KubernetesSuite =>
     }
   }
 
+  test("Launcher python client dependencies using py", k8sTestTag, 
MinikubeTag) {
+    val depsFile = Utils.getTestFileAbsolutePath("py_container_checks.py", 
sparkHomeDir)
+    testPythonDeps(depsFile)
+  }
+
+  test("Launcher python client dependencies using a zip file", k8sTestTag, 
MinikubeTag) {
+    val inDepsFile = Utils.getTestFileAbsolutePath("py_container_checks.py", 
sparkHomeDir)
+    val outDepsFile = s"${inDepsFile.substring(0, 
inDepsFile.lastIndexOf("."))}.zip"
+    Utils.createZipFile(inDepsFile, outDepsFile)
+    testPythonDeps(outDepsFile)
+  }
+
+  private def testPythonDeps(depsFile: String): Unit = {
+    try {
+      setupCephStorage()
+      val cephUrlStr = getServiceUrl(svcName)
+      val cephUrl = new URL(cephUrlStr)
+      val cephHost = cephUrl.getHost
+      val cephPort = cephUrl.getPort
+      val examplesJar = 
Utils.getTestFileAbsolutePath(Utils.getExamplesJarName(), sparkHomeDir)
+
+      val (accessKey, secretKey) = getCephCredentials()
+      sparkAppConf
+        .set("spark.kubernetes.container.image", pyImage)
+        .set("spark.kubernetes.pyspark.pythonVersion", "3")
+        .set("spark.hadoop.fs.s3a.access.key", accessKey)
+        .set("spark.hadoop.fs.s3a.secret.key", secretKey)
+        .set("spark.hadoop.fs.s3a.connection.ssl.enabled", "false")
+        .set("spark.hadoop.fs.s3a.endpoint", s"$cephHost:$cephPort")
+        .set("spark.kubernetes.file.upload.path", s"s3a://$bucket")
+        .set("spark.hadoop.fs.s3a.impl", 
"org.apache.hadoop.fs.s3a.S3AFileSystem")
+        .set("spark.jars.packages", "com.amazonaws:aws-java-sdk:" +
+          "1.7.4,org.apache.hadoop:hadoop-aws:2.7.6")
+        .set("spark.driver.extraJavaOptions", "-Divy.cache.dir=/tmp 
-Divy.home=/tmp")
+      createS3Bucket(accessKey, secretKey, cephUrlStr)
 
 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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to