You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by vanzin <gi...@git.apache.org> on 2018/10/30 18:45:45 UTC

[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

GitHub user vanzin opened a pull request:

    https://github.com/apache/spark/pull/22897

    [SPARK-25875][k8s] Merge code to set up driver command into a single step.

    Right now there are 3 different classes dealing with building the driver
    command to run inside the pod, one for each "binding" supported by Spark.
    This has two main shortcomings:
    
    - the code in the 3 classes is very similar; changing things in one place
      would probably mean making a similar change in the others.
    
    - it gives the false impression that the step implementation is the only
      place where binding-specific logic is needed. That is not true; there
      was code in KubernetesConf that was binding-specific, and there's also
      code in the executor-specific config step. So the 3 classes weren't really
      working as a language-specific abstraction.
    
    On top of that, the current code was propagating command line parameters in
    a different way depending on the binding. That doesn't seem necessary, and
    in fact using environment variables for command line parameters is in general
    a really bad idea, since you can't handle special characters (e.g. spaces)
    that way.
    
    This change merges the 3 different code paths for Java, Python and R into
    a single step, and also merges the 3 code paths to start the Spark driver
    in the k8s entry point script. This increases the amount of shared code,
    and also moves more feature logic into the step itself, so it doesn't live
    in KubernetesConf.
    
    Note that not all logic related to setting up the driver lives in that
    step. For example, the memory overhead calculation still lives separately,
    except it now happens in the driver config step instead of outside the
    step hierarchy altogether.
    
    Some of the noise in the diff is because of changes to KubernetesConf, which
    will be addressed in a separate change.
    
    Tested with new and updated unit tests + integration tests.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/vanzin/spark SPARK-25875

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/22897.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #22897
    
----
commit 8148f49e31b30edaa03973198042cb044df46cae
Author: Marcelo Vanzin <va...@...>
Date:   2018-10-29T23:28:36Z

    [SPARK-25875][k8s] Merge code to set up driver command into a single step.
    
    Right now there are 3 different classes dealing with building the driver
    command to run inside the pod, one for each "binding" supported by Spark.
    This has two main shortcomings:
    
    - the code in the 3 classes is very similar; changing things in one place
      would probably mean making a similar change in the others.
    
    - it gives the false impression that the step implementation is the only
      place where binding-specific logic is needed. That is not true; there
      was code in KubernetesConf that was binding-specific, and there's also
      code in the executor-specific config step. So the 3 classes weren't really
      working as a language-specific abstraction.
    
    On top of that, the current code was propagating command line parameters in
    a different way depending on the binding. That doesn't seem necessary, and
    in fact using environment variables for command line parameters is in general
    a really bad idea, since you can't handle special characters (e.g. spaces)
    that way.
    
    This change merges the 3 different code paths for Java, Python and R into
    a single step, and also merges the 3 code paths to start the Spark driver
    in the k8s entry point script. This increases the amount of shared code,
    and also moves more feature logic into the step itself, so it doesn't live
    in KubernetesConf.
    
    Note that not all logic related to setting up the driver lives in that
    step. For example, the memory overhead calculation still lives separately,
    except it now happens in the driver config step instead of outside the
    step hierarchy altogether.
    
    Some of the noise in the diff is because of changes to KubernetesConf, which
    will be addressed in a separate change.
    
    Tested with new and updated unit tests + integration tests.

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98403/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98378 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98378/testReport)** for PR 22897 at commit [`4152c76`](https://github.com/apache/spark/commit/4152c76872f8c3145c1ac5038652ea8c4be13441).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98375 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98375/testReport)** for PR 22897 at commit [`5601d16`](https://github.com/apache/spark/commit/5601d16fde34bb6b35d773466332b400905a8e30).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4706/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4635/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98375 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98375/testReport)** for PR 22897 at commit [`5601d16`](https://github.com/apache/spark/commit/5601d16fde34bb6b35d773466332b400905a8e30).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230167668
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,137 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(_)) | None =>
    +        configureForJava(pod)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        configureForPython(pod, res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(res)) =>
    +        additionalJavaProperties(res)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        additionalPythonProperties(res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        additionalRProperties(res)
    +
    +      case None =>
    +        Map.empty
    --- End diff --
    
    We can create a new main app resource type which encodes NO_RESOURCE, and then make the main app resource non-optional in KubernetesConf. Think it would simplify some of the case matching we do here. Thoughts?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98381 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98381/testReport)** for PR 22897 at commit [`da4856e`](https://github.com/apache/spark/commit/da4856ee09017be0ffe4c9b66c64b9cfcee16e4b).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4645/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230429059
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,134 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case JavaMainAppResource(_) =>
    +        configureForJava(pod)
    +
    +      case PythonMainAppResource(res) =>
    +        configureForPython(pod, res)
    +
    +      case RMainAppResource(res) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case JavaMainAppResource(res) =>
    +        res.map(additionalJavaProperties).getOrElse(Map.empty)
    --- End diff --
    
    Why this is handled differently than the two below?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98286 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98286/testReport)** for PR 22897 at commit [`91a4741`](https://github.com/apache/spark/commit/91a47418d7ee8c4d564a79fae6ffa3bc384b09cc).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98378 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98378/testReport)** for PR 22897 at commit [`4152c76`](https://github.com/apache/spark/commit/4152c76872f8c3145c1ac5038652ea8c4be13441).
     * This patch **fails SparkR unit tests**.
     * This patch **does not merge cleanly**.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98276/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4714/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/22897


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98375/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4699/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98286 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98286/testReport)** for PR 22897 at commit [`91a4741`](https://github.com/apache/spark/commit/91a47418d7ee8c4d564a79fae6ffa3bc384b09cc).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230469595
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,134 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case JavaMainAppResource(_) =>
    +        configureForJava(pod)
    +
    +      case PythonMainAppResource(res) =>
    +        configureForPython(pod, res)
    +
    +      case RMainAppResource(res) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case JavaMainAppResource(res) =>
    +        res.map(additionalJavaProperties).getOrElse(Map.empty)
    --- End diff --
    
    I see.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98360 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98360/testReport)** for PR 22897 at commit [`1a61f72`](https://github.com/apache/spark/commit/1a61f72e1fdad6d7e71e0d8deceed39f57b2cc01).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98276 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98276/testReport)** for PR 22897 at commit [`8148f49`](https://github.com/apache/spark/commit/8148f49e31b30edaa03973198042cb044df46cae).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230119272
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,137 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(_)) | None =>
    --- End diff --
    
    Again - don't match on options, use the option functional primitives.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4706/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230169913
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,137 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(_)) | None =>
    +        configureForJava(pod)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        configureForPython(pod, res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(res)) =>
    +        additionalJavaProperties(res)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        additionalPythonProperties(res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        additionalRProperties(res)
    +
    +      case None =>
    +        Map.empty
    --- End diff --
    
    Given the current logic I think `JavaMainAppResource(Option[String])` would make more sense, since "no resource" translates to Java. If that's ok I can make that change - including making it not optional in `KubernetesConf`.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230438469
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala ---
    @@ -58,16 +58,13 @@ private[spark] class BasicExecutorFeatureStep(
           (kubernetesConf.get(MEMORY_OVERHEAD_FACTOR) * executorMemoryMiB).toInt,
           MEMORY_OVERHEAD_MIN_MIB))
       private val executorMemoryWithOverhead = executorMemoryMiB + memoryOverheadMiB
    -  private val executorMemoryTotal = kubernetesConf.sparkConf
    -    .getOption(APP_RESOURCE_TYPE.key).map{ res =>
    -      val additionalPySparkMemory = res match {
    -        case "python" =>
    -          kubernetesConf.sparkConf
    -            .get(PYSPARK_EXECUTOR_MEMORY).map(_.toInt).getOrElse(0)
    -        case _ => 0
    -      }
    -    executorMemoryWithOverhead + additionalPySparkMemory
    -  }.getOrElse(executorMemoryWithOverhead)
    +  private val executorMemoryTotal =
    +    if (kubernetesConf.get(APP_RESOURCE_TYPE) == Some("python")) {
    --- End diff --
    
    Will do.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4714/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98276 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98276/testReport)** for PR 22897 at commit [`8148f49`](https://github.com/apache/spark/commit/8148f49e31b30edaa03973198042cb044df46cae).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4722/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4722/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4714/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230115856
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicDriverFeatureStep.scala ---
    @@ -47,10 +48,24 @@ private[spark] class BasicDriverFeatureStep(
     
       // Memory settings
       private val driverMemoryMiB = conf.get(DRIVER_MEMORY)
    +
    +  // The memory overhead factor to use. If the user has not set it, then use a different
    +  // value for non-JVM apps. This value is propagated to executors.
    +  private val overheadFactor = conf.roleSpecificConf.mainAppResource match {
    +    case Some(_: NonJVMResource) =>
    --- End diff --
    
    I was under the impression that generally we don'5 want to match against option types - instead we should be using `option.map.getOrElse`? More just my impression of the Scala idiomatic style than anything.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230130484
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicDriverFeatureStep.scala ---
    @@ -47,10 +48,24 @@ private[spark] class BasicDriverFeatureStep(
     
       // Memory settings
       private val driverMemoryMiB = conf.get(DRIVER_MEMORY)
    +
    +  // The memory overhead factor to use. If the user has not set it, then use a different
    +  // value for non-JVM apps. This value is propagated to executors.
    +  private val overheadFactor = conf.roleSpecificConf.mainAppResource match {
    +    case Some(_: NonJVMResource) =>
    --- End diff --
    
    See above.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98378/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230131315
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,137 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(_)) | None =>
    +        configureForJava(pod)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        configureForPython(pod, res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(res)) =>
    +        additionalJavaProperties(res)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        additionalPythonProperties(res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        additionalRProperties(res)
    +
    +      case None =>
    +        Map.empty
    --- End diff --
    
    I believe so. The code in `KubernetesClientApplication.scala` can leave the resource as `None`, and these were even unit tests (which I just moved to a new place) to make sure that it translated to a JVM-based driver.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230476657
  
    --- Diff: resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh ---
    @@ -96,22 +96,6 @@ case "$SPARK_K8S_CMD" in
           "$@"
         )
         ;;
    -  driver-py)
    --- End diff --
    
    I think this is fine and what we want to do. But at some point we're going to want to make the API between spark submit and launched containers stable.
    
    Using this as an example, if a user upgraded their spark-submit version to 3.0 but didn't upgrade the version of Spark in their docker image, the docker container's command will attempt to look up these old environment variables that are no longer being set by spark submit.
    
    We should be thinking about making this contract stable from 3.0 onwards. For this coming release I think this is fine.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230130335
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala ---
    @@ -58,16 +58,13 @@ private[spark] class BasicExecutorFeatureStep(
           (kubernetesConf.get(MEMORY_OVERHEAD_FACTOR) * executorMemoryMiB).toInt,
           MEMORY_OVERHEAD_MIN_MIB))
       private val executorMemoryWithOverhead = executorMemoryMiB + memoryOverheadMiB
    -  private val executorMemoryTotal = kubernetesConf.sparkConf
    -    .getOption(APP_RESOURCE_TYPE.key).map{ res =>
    -      val additionalPySparkMemory = res match {
    -        case "python" =>
    -          kubernetesConf.sparkConf
    -            .get(PYSPARK_EXECUTOR_MEMORY).map(_.toInt).getOrElse(0)
    -        case _ => 0
    -      }
    -    executorMemoryWithOverhead + additionalPySparkMemory
    -  }.getOrElse(executorMemoryWithOverhead)
    +  private val executorMemoryTotal = kubernetesConf.get(APP_RESOURCE_TYPE) match {
    +    case Some("python") =>
    --- End diff --
    
    We use both depending on the context. In this case, I think this is more readable than the previous code.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230491208
  
    --- Diff: resource-managers/kubernetes/docker/src/main/dockerfiles/spark/entrypoint.sh ---
    @@ -96,22 +96,6 @@ case "$SPARK_K8S_CMD" in
           "$@"
         )
         ;;
    -  driver-py)
    --- End diff --
    
    > if a user upgraded their spark-submit version to 3.0 but didn't upgrade the version of Spark in their docker image
    
    I don't think Spark really supports that in any case. It is expected that you're using the same version of Spark in the spark-submit side and on the other side, regardless of the cluster manager. e.g., imagine client mode in the scenario you're talking about.
    
    But definitely, the contract here needs to be well defined (I've asked for this a long time ago and that's one of the reasons why k8s is still experimental).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98286/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98369 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98369/testReport)** for PR 22897 at commit [`91765ab`](https://github.com/apache/spark/commit/91765abc11ff3a0d44357ddb140fc494125fc1bb).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230130812
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,137 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(_)) | None =>
    --- End diff --
    
    See above. This is an even better case of using matching since it has multiple things that can happen. It's way more readable than cascading ifs.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4713/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4713/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98403 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98403/testReport)** for PR 22897 at commit [`0d755d6`](https://github.com/apache/spark/commit/0d755d6549c46332ee7fa54c335d5c6c19727671).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230131792
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,137 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(_)) | None =>
    +        configureForJava(pod)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        configureForPython(pod, res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(res)) =>
    +        additionalJavaProperties(res)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        additionalPythonProperties(res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        additionalRProperties(res)
    +
    +      case None =>
    +        Map.empty
    --- End diff --
    
    Ah: using `JavaMainAppResource(NO_RESOURCE)` would also work, but it means that there would be logic to ignore that elsewhere, where the resource is added to the jars that are part of the application (in this same class).


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    @mccheah @liyinan926 
    
    (I'm kinda assuming you guys monitor github / jira instead of relying on pings.)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4710/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98369/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4710/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230119092
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,137 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(_)) | None =>
    +        configureForJava(pod)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        configureForPython(pod, res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(res)) =>
    +        additionalJavaProperties(res)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        additionalPythonProperties(res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        additionalRProperties(res)
    +
    +      case None =>
    +        Map.empty
    --- End diff --
    
    Is this for `SparkLauncher.NO_RESOURCE`? Or otherwise should this even be a valid state? If it isn't then we should throw an exception here. I'm wondering if we should encode `SparkLauncher.NO_RESOURCE` as its own resource type.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98360 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98360/testReport)** for PR 22897 at commit [`1a61f72`](https://github.com/apache/spark/commit/1a61f72e1fdad6d7e71e0d8deceed39f57b2cc01).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4635/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4722/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4706/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Ok, I am merging into master. Thanks!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4699/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230181127
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,137 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(_)) | None =>
    +        configureForJava(pod)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        configureForPython(pod, res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case Some(JavaMainAppResource(res)) =>
    +        additionalJavaProperties(res)
    +
    +      case Some(PythonMainAppResource(res)) =>
    +        additionalPythonProperties(res)
    +
    +      case Some(RMainAppResource(res)) =>
    +        additionalRProperties(res)
    +
    +      case None =>
    +        Map.empty
    --- End diff --
    
    Sounds great, thanks!


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98360/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98369 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98369/testReport)** for PR 22897 at commit [`91765ab`](https://github.com/apache/spark/commit/91765abc11ff3a0d44357ddb140fc494125fc1bb).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230137873
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala ---
    @@ -58,16 +58,13 @@ private[spark] class BasicExecutorFeatureStep(
           (kubernetesConf.get(MEMORY_OVERHEAD_FACTOR) * executorMemoryMiB).toInt,
           MEMORY_OVERHEAD_MIN_MIB))
       private val executorMemoryWithOverhead = executorMemoryMiB + memoryOverheadMiB
    -  private val executorMemoryTotal = kubernetesConf.sparkConf
    -    .getOption(APP_RESOURCE_TYPE.key).map{ res =>
    -      val additionalPySparkMemory = res match {
    -        case "python" =>
    -          kubernetesConf.sparkConf
    -            .get(PYSPARK_EXECUTOR_MEMORY).map(_.toInt).getOrElse(0)
    -        case _ => 0
    -      }
    -    executorMemoryWithOverhead + additionalPySparkMemory
    -  }.getOrElse(executorMemoryWithOverhead)
    +  private val executorMemoryTotal = kubernetesConf.get(APP_RESOURCE_TYPE) match {
    +    case Some("python") =>
    --- End diff --
    
    (I can use an `if` here if you prefer it. Probably better than either.)


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Build finished. Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4635/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test status success
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4645/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Please take a look at the parent bug before commenting on this patch in isolation:
    https://issues.apache.org/jira/browse/SPARK-25874


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4699/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test starting
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4645/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/4713/
    Test FAILed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Kubernetes integration test status failure
    URL: https://amplab.cs.berkeley.edu/jenkins/job/testing-k8s-prb-make-spark-distribution-unified/4710/



---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Merged build finished. Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/98381/
    Test PASSed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by mccheah <gi...@git.apache.org>.
Github user mccheah commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230115469
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala ---
    @@ -58,16 +58,13 @@ private[spark] class BasicExecutorFeatureStep(
           (kubernetesConf.get(MEMORY_OVERHEAD_FACTOR) * executorMemoryMiB).toInt,
           MEMORY_OVERHEAD_MIN_MIB))
       private val executorMemoryWithOverhead = executorMemoryMiB + memoryOverheadMiB
    -  private val executorMemoryTotal = kubernetesConf.sparkConf
    -    .getOption(APP_RESOURCE_TYPE.key).map{ res =>
    -      val additionalPySparkMemory = res match {
    -        case "python" =>
    -          kubernetesConf.sparkConf
    -            .get(PYSPARK_EXECUTOR_MEMORY).map(_.toInt).getOrElse(0)
    -        case _ => 0
    -      }
    -    executorMemoryWithOverhead + additionalPySparkMemory
    -  }.getOrElse(executorMemoryWithOverhead)
    +  private val executorMemoryTotal = kubernetesConf.get(APP_RESOURCE_TYPE) match {
    +    case Some("python") =>
    --- End diff --
    
    I was under the impression that generally we don' want to match against option types - instead we should be using `option.map.getOrElse`? More just my impression of the Scala idiomatic style than anything.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98381 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98381/testReport)** for PR 22897 at commit [`da4856e`](https://github.com/apache/spark/commit/da4856ee09017be0ffe4c9b66c64b9cfcee16e4b).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #22897: [SPARK-25875][k8s] Merge code to set up driver command i...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/22897
  
    **[Test build #98403 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/98403/testReport)** for PR 22897 at commit [`0d755d6`](https://github.com/apache/spark/commit/0d755d6549c46332ee7fa54c335d5c6c19727671).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230438567
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala ---
    @@ -0,0 +1,134 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.spark.deploy.k8s.features
    +
    +import scala.collection.JavaConverters._
    +
    +import io.fabric8.kubernetes.api.model.{ContainerBuilder, EnvVarBuilder}
    +
    +import org.apache.spark.deploy.k8s._
    +import org.apache.spark.deploy.k8s.Config._
    +import org.apache.spark.deploy.k8s.Constants._
    +import org.apache.spark.deploy.k8s.submit._
    +import org.apache.spark.internal.config._
    +import org.apache.spark.launcher.SparkLauncher
    +import org.apache.spark.util.Utils
    +
    +/**
    + * Creates the driver command for running the user app, and propagates needed configuration so
    + * executors can also find the app code.
    + */
    +private[spark] class DriverCommandFeatureStep(conf: KubernetesConf[KubernetesDriverSpecificConf])
    +  extends KubernetesFeatureConfigStep {
    +
    +  private val driverConf = conf.roleSpecificConf
    +
    +  override def configurePod(pod: SparkPod): SparkPod = {
    +    driverConf.mainAppResource match {
    +      case JavaMainAppResource(_) =>
    +        configureForJava(pod)
    +
    +      case PythonMainAppResource(res) =>
    +        configureForPython(pod, res)
    +
    +      case RMainAppResource(res) =>
    +        configureForR(pod, res)
    +    }
    +  }
    +
    +  override def getAdditionalPodSystemProperties(): Map[String, String] = {
    +    driverConf.mainAppResource match {
    +      case JavaMainAppResource(res) =>
    +        res.map(additionalJavaProperties).getOrElse(Map.empty)
    --- End diff --
    
    See discussion: https://github.com/apache/spark/pull/22897#discussion_r230119092


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #22897: [SPARK-25875][k8s] Merge code to set up driver co...

Posted by liyinan926 <gi...@git.apache.org>.
Github user liyinan926 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22897#discussion_r230428297
  
    --- Diff: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/BasicExecutorFeatureStep.scala ---
    @@ -58,16 +58,13 @@ private[spark] class BasicExecutorFeatureStep(
           (kubernetesConf.get(MEMORY_OVERHEAD_FACTOR) * executorMemoryMiB).toInt,
           MEMORY_OVERHEAD_MIN_MIB))
       private val executorMemoryWithOverhead = executorMemoryMiB + memoryOverheadMiB
    -  private val executorMemoryTotal = kubernetesConf.sparkConf
    -    .getOption(APP_RESOURCE_TYPE.key).map{ res =>
    -      val additionalPySparkMemory = res match {
    -        case "python" =>
    -          kubernetesConf.sparkConf
    -            .get(PYSPARK_EXECUTOR_MEMORY).map(_.toInt).getOrElse(0)
    -        case _ => 0
    -      }
    -    executorMemoryWithOverhead + additionalPySparkMemory
    -  }.getOrElse(executorMemoryWithOverhead)
    +  private val executorMemoryTotal =
    +    if (kubernetesConf.get(APP_RESOURCE_TYPE) == Some("python")) {
    --- End diff --
    
    Can we define a constant for each resource type string? I saw `python` being used in a couple of places.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org