This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.2 by this push:
     new a225ba0  [SPARK-38072][K8S][TESTS] Support K8s imageTag parameter in 
SBT K8s IT
a225ba0 is described below

commit a225ba020ef348dc2ccd5c1e91154d105571dcc9
Author: William Hyun <[email protected]>
AuthorDate: Sun Jan 30 10:11:03 2022 -0800

    [SPARK-38072][K8S][TESTS] Support K8s imageTag parameter in SBT K8s IT
    
    ### What changes were proposed in this pull request?
    This PR aims to support K8s `imageTag` parameter in SBT K8s integration 
test.
    
    ### Why are the changes needed?
    To make maven and SBT consistent.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    Manually.
    
    Closes #35365 from williamhyun/imagetag.
    
    Authored-by: William Hyun <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
    (cherry picked from commit 419d17378c7fe4d9715eca3f84bcc86354c71941)
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 project/SparkBuild.scala | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 63cee78..6aeaa8c 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -614,7 +614,7 @@ object KubernetesIntegrationTests {
 
   val dockerBuild = TaskKey[Unit]("docker-imgs", "Build the docker images for 
ITs.")
   val runITs = TaskKey[Unit]("run-its", "Only run ITs, skip image build.")
-  val imageTag = settingKey[String]("Tag to use for images built during the 
test.")
+  val imageTag = sys.props.get("spark.kubernetes.test.imageTag")
   val namespace = sys.props.get("spark.kubernetes.test.namespace")
   val deployMode = sys.props.get("spark.kubernetes.test.deployMode")
 
@@ -624,13 +624,12 @@ object KubernetesIntegrationTests {
   private var shouldBuildImage = true
 
   lazy val settings = Seq(
-    imageTag := "dev",
     dockerBuild := {
       if (shouldBuildImage) {
         val dockerTool = s"$sparkHome/bin/docker-image-tool.sh"
         val bindingsDir = 
s"$sparkHome/resource-managers/kubernetes/docker/src/main/dockerfiles/spark/bindings"
         val cmd = Seq(dockerTool,
-          "-t", imageTag.value,
+          "-t", imageTag.getOrElse("dev"),
           "-p", s"$bindingsDir/python/Dockerfile",
           "-R", s"$bindingsDir/R/Dockerfile") ++
           (if (deployMode == Some("docker-for-desktop")) Seq.empty else 
Seq("-m")) :+
@@ -651,7 +650,7 @@ object KubernetesIntegrationTests {
     (Test / test) := (Test / test).dependsOn(dockerBuild).value,
     (Test / javaOptions) ++= Seq(
       
s"-Dspark.kubernetes.test.deployMode=${deployMode.getOrElse("minikube")}",
-      s"-Dspark.kubernetes.test.imageTag=${imageTag.value}",
+      s"-Dspark.kubernetes.test.imageTag=${imageTag.getOrElse("dev")}",
       s"-Dspark.kubernetes.test.unpackSparkDir=$sparkHome"
     ),
     (Test / javaOptions) ++= 
namespace.map("-Dspark.kubernetes.test.namespace=" + _),

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

Reply via email to