Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-2933] [yarn] Refactor and cleanup Yarn AM code. #2020

Closed
wants to merge 22 commits into from

Commits on Aug 18, 2014

  1. [SPARK-2933] [yarn] Refactor and cleanup Yarn AM code.

    This change modifies the Yarn module so that all the logic related
    to running the ApplicationMaster is localized. Instead of, previously,
    4 different classes with mostly identical code, now we have:
    
    - A single, shared ApplicationMaster class, which can operate both in
      client and cluster mode, and substitutes the old ApplicationMaster
      (for cluster mode) and ExecutorLauncher (for client mode).
    
    The benefit here is that all different execution modes for all supported
    yarn versions use the same shared code for monitoring executor allocation,
    setting up configuration, and monitoring the process's lifecycle.
    
    - A new YarnRMClient interface, which defines basic RM functionality needed
      by the ApplicationMaster. This interface has concrete implementations for
      each supported Yarn version.
    
    - A new YarnAllocator interface, which just abstracts the existing interface
      of the YarnAllocationHandler class. This is to avoid having to touch the
      allocator code too much in this change, although it might benefit from a
      similar effort in the future.
    
    The end result is much easier to understand code, with much less duplication,
    making it much easier to fix bugs, add features, and test everything knowing
    that all supported versions will behave the same.
    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    848ca6d View commit details
    Browse the repository at this point in the history
  2. Changes to the yarn-alpha project to use common AM code.

    Made some tweaks to the YarnAllocator interface to cover both
    APIs more easily. There's still a lot of cleanup possible on
    that front, but I'll leave that as a separate task.
    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    99a52d5 View commit details
    Browse the repository at this point in the history
  3. Trivial cleanups.

    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    8c72239 View commit details
    Browse the repository at this point in the history
  4. Fix UI filter registration.

    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    91beabb View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0e4be3d View commit details
    Browse the repository at this point in the history
  6. Finish app if SparkContext initialization times out.

    This avoids the NPEs that would happen if code just kept going.
    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    5657c7d View commit details
    Browse the repository at this point in the history
  7. Fix some questionable error handling.

    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    34f1e63 View commit details
    Browse the repository at this point in the history
  8. More trivial cleanup.

    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    ecb23cd View commit details
    Browse the repository at this point in the history
  9. Move cluster/client code to separate methods.

    Makes code a little cleaner and easier to follow.
    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    b6289ab View commit details
    Browse the repository at this point in the history
  10. Some more cleanup.

    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    5150993 View commit details
    Browse the repository at this point in the history
  11. Restore shutdown hook to clean up staging dir.

    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    be6068d View commit details
    Browse the repository at this point in the history
  12. Cleanup a couple more constants.

    Marcelo Vanzin committed Aug 18, 2014
    Configuration menu
    Copy the full SHA
    557fdeb View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2014

  1. Review feedback.

    Marcelo Vanzin committed Aug 19, 2014
    Configuration menu
    Copy the full SHA
    f581122 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into SPARK-2933

    Conflicts:
    	yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
    	yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ExecutorLauncher.scala
    	yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
    	yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ExecutorLauncher.scala
    Marcelo Vanzin committed Aug 19, 2014
    Configuration menu
    Copy the full SHA
    f02d3f8 View commit details
    Browse the repository at this point in the history
  3. Small fix to shutdown code.

    Avoid an interrupted exception when shutting down from the
    reporter thread. Also, make extra effort to finish the RM
    connection.
    Marcelo Vanzin committed Aug 19, 2014
    Configuration menu
    Copy the full SHA
    ecaf332 View commit details
    Browse the repository at this point in the history

Commits on Aug 20, 2014

  1. Merge branch 'master' into SPARK-2933

    Conflicts:
    	yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
    	yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ExecutorLauncher.scala
    	yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala
    	yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ExecutorLauncher.scala
    Marcelo Vanzin committed Aug 20, 2014
    Configuration menu
    Copy the full SHA
    92770cc View commit details
    Browse the repository at this point in the history
  2. Correctly clean up staging directory.

    This change also avoids overriding the app's status with "SUCCEEDED"
    in cluster mode when the shutdown hook runs, by signaling the AM that
    the SparkContext was shut down (see YarnClusterScheduler.scala). That
    way the AM can correctly expose its final status to the RM.
    Marcelo Vanzin committed Aug 20, 2014
    Configuration menu
    Copy the full SHA
    c0794be View commit details
    Browse the repository at this point in the history

Commits on Aug 21, 2014

  1. Fix app status reporting.

    Marcelo Vanzin committed Aug 21, 2014
    Configuration menu
    Copy the full SHA
    41f8c8a View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2014

  1. Review feedback.

    Marcelo Vanzin committed Aug 25, 2014
    Configuration menu
    Copy the full SHA
    0f5142c View commit details
    Browse the repository at this point in the history
  2. Remote stale comment.

    Marcelo Vanzin committed Aug 25, 2014
    Configuration menu
    Copy the full SHA
    3a8ed37 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2014

  1. Do not interrupt reporter thread from within itself.

    Marcelo Vanzin committed Aug 26, 2014
    Configuration menu
    Copy the full SHA
    ff389ed View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into SPARK-2933

    Conflicts:
    	yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/ExecutorLauncher.scala
    	yarn/alpha/src/main/scala/org/apache/spark/deploy/yarn/YarnAllocationHandler.scala
    	yarn/stable/src/main/scala/org/apache/spark/deploy/yarn/ExecutorLauncher.scala
    Marcelo Vanzin committed Aug 26, 2014
    Configuration menu
    Copy the full SHA
    3bbf3e7 View commit details
    Browse the repository at this point in the history