You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/04/22 07:16:08 UTC

[GitHub] [spark] grarkydev opened a new pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

grarkydev opened a new pull request #32289:
URL: https://github.com/apache/spark/pull/32289


   Co-authored-by: hongdd <ho...@cmss.chinamobile.com>
   
   ### What changes were proposed in this pull request?
   Supporting SparkAppHandle object to be able to manage a running Spark application on Kubernetes. It can be used to monitor the application changes and to stop the application by pod deletion.
   
   This Pull Request has been raised due to a inactivity of a previous one - #30520
   
   
   ### Why are the changes needed?
   There is an inconsistency in the Spark application managing with SparkAppHandle object between Kubernetes and other resource managers such as Yarn/Mesos.
   
   Currently, this feature is not properly implemented on Kubernetes which may cause some issues.
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, it changes the behavior of `SparkAppHandle` object which the user may use to communicate with the launched Spark application. Its interface is remained as it is. Some missing functionalities have been implemented.
   
   
   ### How was this patch tested?
   Few unit tests has been added. May be found in org.apache.spark.deploy.k8s.submit package:
   
   - `PodStatusWatcherSuite` - new ones
   - `ClientSuite` - added some
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-889001238


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/141827/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-885590799


   Kubernetes integration test unable to build dist.
   
   exiting with code: 1
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46074/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868792346


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44866/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] grarkydev commented on a change in pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
grarkydev commented on a change in pull request #32289:
URL: https://github.com/apache/spark/pull/32289#discussion_r675464920



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/PodStatusWatcher.scala
##########
@@ -47,21 +49,31 @@ private[k8s] class LoggingPodStatusWatcherImpl(conf: KubernetesDriverConf)
 
   private var pod = Option.empty[Pod]
 
+  private var launcherBackend = Option.empty[LauncherBackend]
+
+  private var latestPhase: String = _
+
   private def phase: String = pod.map(_.getStatus.getPhase).getOrElse("unknown")
 
   override def reset(): Unit = {
     resourceTooOldReceived = false
   }
 
+  override def registerLauncherBackend(launcherBackend: LauncherBackend): Unit = {
+    this.launcherBackend = Option(launcherBackend)
+  }
+
   override def eventReceived(action: Action, pod: Pod): Unit = {
     this.pod = Option(pod)
     action match {
       case Action.DELETED | Action.ERROR =>
+        notifyStatusChanged()

Review comment:
       Yep, that makes sense, changed




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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-885591584






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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-889001238


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/141827/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-824603098


   Can one of the admins verify this patch?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] grarkydev commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
grarkydev commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-859343900


   @dongjoon-hyun could you verify this PR?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] grarkydev commented on a change in pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
grarkydev commented on a change in pull request #32289:
URL: https://github.com/apache/spark/pull/32289#discussion_r675464560



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/PodStatusWatcher.scala
##########
@@ -82,11 +94,29 @@ private[k8s] class LoggingPodStatusWatcherImpl(conf: KubernetesDriverConf)
     closeWatch()
   }
 
+  private def notifyStatusChanged(): Unit = {
+    if (phase != latestPhase) {
+      latestPhase = phase
+      latestPhase match {
+        case "Pending" => reportStatusChanged(SparkAppHandle.State.SUBMITTED)
+        case "Running" => reportStatusChanged(SparkAppHandle.State.RUNNING)
+        case "Succeeded" => reportStatusChanged(SparkAppHandle.State.FINISHED)
+        case "Failed" => reportStatusChanged(SparkAppHandle.State.FAILED)
+        case "Unknown" => reportStatusChanged(SparkAppHandle.State.LOST)
+        case _ => reportStatusChanged(SparkAppHandle.State.UNKNOWN)

Review comment:
       Good catch, changed

##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/PodStatusWatcher.scala
##########
@@ -82,11 +94,29 @@ private[k8s] class LoggingPodStatusWatcherImpl(conf: KubernetesDriverConf)
     closeWatch()
   }
 
+  private def notifyStatusChanged(): Unit = {
+    if (phase != latestPhase) {
+      latestPhase = phase
+      latestPhase match {
+        case "Pending" => reportStatusChanged(SparkAppHandle.State.SUBMITTED)
+        case "Running" => reportStatusChanged(SparkAppHandle.State.RUNNING)
+        case "Succeeded" => reportStatusChanged(SparkAppHandle.State.FINISHED)
+        case "Failed" => reportStatusChanged(SparkAppHandle.State.FAILED)
+        case "Unknown" => reportStatusChanged(SparkAppHandle.State.LOST)
+        case _ => reportStatusChanged(SparkAppHandle.State.UNKNOWN)

Review comment:
       Good catch, changed




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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] github-actions[bot] closed pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #32289:
URL: https://github.com/apache/spark/pull/32289


   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] holdenk commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
holdenk commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868734353


   Jenkins ok to test


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] grarkydev edited a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
grarkydev edited a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-869490893


   @holdenk 
   
   Before the changes the responsibility of this class was only to log status changes (`LoggingPodStatusWatcher`). After the changes it also handles application stopping and status change notifying, so I've changed the name to a more common one (`PodStatusWatcher`). Do you think the name should be reverted to the original one?
   
   Regarding the second question, what is a desired behavior in the client mode?


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-889076173


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46340/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868761110


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140335/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-888963138


   **[Test build #141827 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/141827/testReport)** for PR 32289 at commit [`7ebf708`](https://github.com/apache/spark/commit/7ebf7088f6ff608da334468137ad8336f5b0f28f).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868780791


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44866/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] github-actions[bot] closed pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #32289:
URL: https://github.com/apache/spark/pull/32289


   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868761762


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/44866/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868792346


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/44866/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868761110


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/140335/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868736342


   **[Test build #140335 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140335/testReport)** for PR 32289 at commit [`3d7b061`](https://github.com/apache/spark/commit/3d7b061a93aa443ce3081e244fb5bb8eb625602b).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868745454


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-885566288


   **[Test build #141556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/141556/testReport)** for PR 32289 at commit [`f30dea9`](https://github.com/apache/spark/commit/f30dea9efa8abc48214b3f1e065d07fe34cdabd3).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-885591583






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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-889035852


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46340/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-889057752


   Kubernetes integration test status success
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/46340/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-885574660


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-888963138


   **[Test build #141827 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/141827/testReport)** for PR 32289 at commit [`7ebf708`](https://github.com/apache/spark/commit/7ebf7088f6ff608da334468137ad8336f5b0f28f).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] github-actions[bot] commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-1007033628


   We're closing this PR because it hasn't been updated in a while. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
   If you'd like to revive this PR, please reopen it and ask a committer to remove the Stale tag!


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] grarkydev commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
grarkydev commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-832538779


   cc @dongjoon-hyun


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-868736342


   **[Test build #140335 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/140335/testReport)** for PR 32289 at commit [`3d7b061`](https://github.com/apache/spark/commit/3d7b061a93aa443ce3081e244fb5bb8eb625602b).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] grarkydev commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
grarkydev commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-869490893


   @holdenk 
   
   Before the changes the responsibility of this class was only to log status changes (LoggingPodStatusWatcher). After the changes it also handles application stopping and status change notifying, so I've changed the name to a more common one (PodStatusWatcher). Do you think the name should be reverted to the original one?
   
   Regarding the second question, what is a desired behavior in the client mode?


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] holdenk commented on a change in pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
holdenk commented on a change in pull request #32289:
URL: https://github.com/apache/spark/pull/32289#discussion_r673499689



##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/PodStatusWatcher.scala
##########
@@ -82,11 +94,29 @@ private[k8s] class LoggingPodStatusWatcherImpl(conf: KubernetesDriverConf)
     closeWatch()
   }
 
+  private def notifyStatusChanged(): Unit = {
+    if (phase != latestPhase) {
+      latestPhase = phase
+      latestPhase match {
+        case "Pending" => reportStatusChanged(SparkAppHandle.State.SUBMITTED)
+        case "Running" => reportStatusChanged(SparkAppHandle.State.RUNNING)
+        case "Succeeded" => reportStatusChanged(SparkAppHandle.State.FINISHED)
+        case "Failed" => reportStatusChanged(SparkAppHandle.State.FAILED)
+        case "Unknown" => reportStatusChanged(SparkAppHandle.State.LOST)
+        case _ => reportStatusChanged(SparkAppHandle.State.UNKNOWN)

Review comment:
       Why is Unknown lost? wouldn't it be unknown?

##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/PodStatusWatcher.scala
##########
@@ -47,21 +49,31 @@ private[k8s] class LoggingPodStatusWatcherImpl(conf: KubernetesDriverConf)
 
   private var pod = Option.empty[Pod]
 
+  private var launcherBackend = Option.empty[LauncherBackend]
+
+  private var latestPhase: String = _
+
   private def phase: String = pod.map(_.getStatus.getPhase).getOrElse("unknown")
 
   override def reset(): Unit = {
     resourceTooOldReceived = false
   }
 
+  override def registerLauncherBackend(launcherBackend: LauncherBackend): Unit = {
+    this.launcherBackend = Option(launcherBackend)
+  }
+
   override def eventReceived(action: Action, pod: Pod): Unit = {
     this.pod = Option(pod)
     action match {
       case Action.DELETED | Action.ERROR =>
+        notifyStatusChanged()

Review comment:
       If we do this every time (e.g. in the Action.DELTED or Action.ERROR or _ case), maybe just move it out of the match?

##########
File path: resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/submit/PodStatusWatcher.scala
##########
@@ -82,11 +94,29 @@ private[k8s] class LoggingPodStatusWatcherImpl(conf: KubernetesDriverConf)
     closeWatch()
   }
 
+  private def notifyStatusChanged(): Unit = {
+    if (phase != latestPhase) {
+      latestPhase = phase
+      latestPhase match {
+        case "Pending" => reportStatusChanged(SparkAppHandle.State.SUBMITTED)
+        case "Running" => reportStatusChanged(SparkAppHandle.State.RUNNING)
+        case "Succeeded" => reportStatusChanged(SparkAppHandle.State.FINISHED)
+        case "Failed" => reportStatusChanged(SparkAppHandle.State.FAILED)
+        case "Unknown" => reportStatusChanged(SparkAppHandle.State.LOST)
+        case _ => reportStatusChanged(SparkAppHandle.State.UNKNOWN)

Review comment:
       Why is Unknown lost? wouldn't it be unknown?




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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-888978286


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


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] SparkQA removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-885566288


   **[Test build #141556 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/141556/testReport)** for PR 32289 at commit [`f30dea9`](https://github.com/apache/spark/commit/f30dea9efa8abc48214b3f1e065d07fe34cdabd3).


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] grarkydev removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
grarkydev removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-832538779


   cc @dongjoon-hyun


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins commented on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-889076173


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/46340/
   


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [spark] AmplabJenkins removed a comment on pull request #32289: [SPARK-33357][K8S] Support Spark application managing with SparkAppHandle on Kubernetes

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #32289:
URL: https://github.com/apache/spark/pull/32289#issuecomment-824603098


   Can one of the admins verify this patch?


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

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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