Skip to content

[SPARK-4286] Integrate external shuffle service to coarse grained Mesos mode #3861

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

Closed
wants to merge 15 commits into from

Conversation

tnachen
Copy link
Contributor

@tnachen tnachen commented Dec 31, 2014

No description provided.

@SparkQA
Copy link

SparkQA commented Dec 31, 2014

Test build #24969 has started for PR 3861 at commit 5c9fd75.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Dec 31, 2014

Test build #24969 has finished for PR 3861 at commit 5c9fd75.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • "cd %s*; %s ./bin/spark-class ".format(basename, prefixEnv)

@AmplabJenkins
Copy link

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

@tnachen tnachen changed the title Integrate external shuffle service to coarse grained Mesos mode [SPARK-4286] Integrate external shuffle service to coarse grained Mesos mode Dec 31, 2014
@SparkQA
Copy link

SparkQA commented Dec 31, 2014

Test build #24976 has started for PR 3861 at commit 392486e.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 1, 2015

Test build #24976 has finished for PR 3861 at commit 392486e.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • "cd %s*; %s ./bin/spark-class ".format(basename, prefixEnv)

@AmplabJenkins
Copy link

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

@tnachen
Copy link
Contributor Author

tnachen commented Jan 1, 2015

I don't think the test failure is related, and the test passes locally too.

@@ -998,7 +998,7 @@ class SparkContext(config: SparkConf) extends Logging with ExecutorAllocationCli
*/
@DeveloperApi
override def requestExecutors(numAdditionalExecutors: Int): Boolean = {
assert(master.contains("yarn") || dynamicAllocationTesting,
assert(master.contains("mesos") || master.contains("yarn") || dynamicAllocationTesting,
"Requesting executors is currently only supported in YARN mode")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this message to be "... only supported in YARN or Mesos modes", and the message below

@tnachen
Copy link
Contributor Author

tnachen commented Jan 3, 2015

@ash211 Thanks for the review, updated the PR.

@SparkQA
Copy link

SparkQA commented Jan 3, 2015

Test build #25002 has started for PR 3861 at commit a8d036c.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 3, 2015

Test build #25002 has finished for PR 3861 at commit a8d036c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • "cd %s*; %s ./bin/spark-class ".format(basename, prefixEnv)

@AmplabJenkins
Copy link

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

@tnachen
Copy link
Contributor Author

tnachen commented Jan 5, 2015

@aarondav

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25082 has started for PR 3861 at commit ae1d91a.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25083 has started for PR 3861 at commit c601c3f.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25082 has finished for PR 3861 at commit ae1d91a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • "cd %s*; %s ./bin/spark-class ".format(basename, prefixEnv)
    • implicit class StringToAttributeConversionHelper(val sc: StringContext)

@AmplabJenkins
Copy link

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

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25083 has finished for PR 3861 at commit c601c3f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • "cd %s*; %s ./bin/spark-class ".format(basename, prefixEnv)

@AmplabJenkins
Copy link

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

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25119 has started for PR 3861 at commit c954dc7.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Jan 6, 2015

Test build #25119 has finished for PR 3861 at commit c954dc7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
    • "cd %s*; %s ./bin/spark-class ".format(basename, prefixEnv)

@AmplabJenkins
Copy link

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

@@ -54,6 +53,8 @@ class StandaloneWorkerShuffleService(sparkConf: SparkConf, securityManager: Secu
require(server == null, "Shuffle server already started")
logInfo(s"Starting shuffle service on port $port with useSasl = $useSasl")
server = transportContext.createServer(port)
} else {
logInfo(s"Skip launching shuffle service as it's not enabled.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This message doesn't seem particularly useful

@andrewor14
Copy link
Contributor

Hi @tnachen thanks for your work. I will do a closer review within the next few days, but first I have a high level question. IIUC, the changes in this PR basically enable the dynamic allocation feature to be used with Mesos coarse-grained mode. However, in Mesos I believe we express the amount of resources an application wants in terms of cores, not the number of executors. Is the concern raised in SPARK-4751 for standalone mode relevant here?

driver.sendStatusUpdate(TaskStatus.newBuilder()
.setState(TaskState.TASK_RUNNING)
.setTaskId(taskInfo.getTaskId)
.build)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For readability I would prefer that you put the builder in a val first, and then calling driver.sendStatusUpdate on it. Also, please use parentheses for build() here because it's not a getter without side-effects.

@andrewor14
Copy link
Contributor

@tnachen Thanks for working on this. Before I dive deeper into the implementation there's a main open question that I'd like to address. The external shuffle service is intended to live across the executor lifetime and so launched independently of any Spark application. The service enables dynamic allocation of resources because it can continue to serve an executor's shuffle files after the executor has been killed. However, in this patch the service seems to be started inside the executor backend itself and its fate necessarily tied with the application.

If I understand correctly, the Mesos slave is equivalent to the standalone Worker in that it is long running and lives beyond the lifetime of a particular application. If this is the case, the appropriate place to start the shuffle service would be there instead.

Another issue is that this patch in its current state seems to conflate two issues (1) dynamic allocation and (2) external shuffle service. (1) is what you refer to as auto-scaling on the JIRA, and depends on (2) to work. However, since we already check whether shuffle service is enabled in ExecutorAllocationManager, we shouldn't check it again when launching the Mesos executor. More specifically, I don't understand why we launch the executor two different ways depending on whether (2) is enabled. I believe a better solution is to separate these two concerns and launch the executor the same way we already do today.

@tnachen
Copy link
Contributor Author

tnachen commented Feb 13, 2015

@andrewor14 Mesos slave doesn't have the concept of Auxilary service as YARN, that launches a service as part of the Slave. It requires a task to be running to launch anything.

Therefore to have a long running service that lives longer than the task lifetime, I went the route to create a custom Mesos executor that launches the Coarse grained spark executor, and continue to run when the spark executor finishes. The custom executor also launches the external shuffle service.

I agree I didn't really like the diverging path, but I felt like the original method is much simpler as it directly launches the coarse grain executor, and don't want to increase the complexity by making it also have to launch this custom executor.

@pwendell
Copy link
Contributor

We spoke a bit offline about this, but my feeling was that the best thing here might be to add a way to launch the shuffle service as a standalone application (initially, not one managed by Mesos) so that it can be shared across Spark applications. That would involve writing some simple launching scripts for it in a similar way to existing daemons we launch, and you'd ask users to launch the shuffle service similar to other storage systems like HDFS. That's very simple and would avoid diverging a lot between Mesos and the other modes. And longer term we could actually have a single shared shuffle service that is scheduled by mesos.

@tnachen
Copy link
Contributor Author

tnachen commented Feb 18, 2015

Agree and it's currently being worked on. We can close this PR too.

@dragos
Copy link
Contributor

dragos commented Mar 12, 2015

I'd like to take a shot at making the external shuffle service a "daemon". Just to make sure I understand the requirements:

  • the shuffle service is launched manually on cluster machines
  • it does not care about spark.shuffle.service.enabled, if it's started -- it just starts
  • it should not depend on Spark or Scala -- this is the part I'd like to get confirmation. If that's the case, it means we can't use helper scripts like spark-submit or spark-class that would simplify loading configuration files

/cc @tnachen

asfgit pushed a commit that referenced this pull request Apr 28, 2015
…mon.

This allows Mesos deployments to use the shuffle service (and implicitly dynamic allocation). It does so by adding a new "main" class and two corresponding scripts in `sbin`:

- `sbin/start-shuffle-service.sh`
- `sbin/stop-shuffle-service.sh`

Specific options can be passed in `SPARK_SHUFFLE_OPTS`.

This is picking up work from #3861 /cc tnachen

Author: Iulian Dragos <jaguarul@gmail.com>

Closes #4990 from dragos/feature/external-shuffle-service and squashes the following commits:

6c2b148 [Iulian Dragos] Import order and wrong name fixup.
07804ad [Iulian Dragos] Moved ExternalShuffleService to the `deploy` package + other minor tweaks.
4dc1f91 [Iulian Dragos] Reviewer’s comments:
8145429 [Iulian Dragos] Add an external shuffle service that can be run as a daemon.
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request May 14, 2015
…mon.

This allows Mesos deployments to use the shuffle service (and implicitly dynamic allocation). It does so by adding a new "main" class and two corresponding scripts in `sbin`:

- `sbin/start-shuffle-service.sh`
- `sbin/stop-shuffle-service.sh`

Specific options can be passed in `SPARK_SHUFFLE_OPTS`.

This is picking up work from apache#3861 /cc tnachen

Author: Iulian Dragos <jaguarul@gmail.com>

Closes apache#4990 from dragos/feature/external-shuffle-service and squashes the following commits:

6c2b148 [Iulian Dragos] Import order and wrong name fixup.
07804ad [Iulian Dragos] Moved ExternalShuffleService to the `deploy` package + other minor tweaks.
4dc1f91 [Iulian Dragos] Reviewer’s comments:
8145429 [Iulian Dragos] Add an external shuffle service that can be run as a daemon.
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
…mon.

This allows Mesos deployments to use the shuffle service (and implicitly dynamic allocation). It does so by adding a new "main" class and two corresponding scripts in `sbin`:

- `sbin/start-shuffle-service.sh`
- `sbin/stop-shuffle-service.sh`

Specific options can be passed in `SPARK_SHUFFLE_OPTS`.

This is picking up work from apache#3861 /cc tnachen

Author: Iulian Dragos <jaguarul@gmail.com>

Closes apache#4990 from dragos/feature/external-shuffle-service and squashes the following commits:

6c2b148 [Iulian Dragos] Import order and wrong name fixup.
07804ad [Iulian Dragos] Moved ExternalShuffleService to the `deploy` package + other minor tweaks.
4dc1f91 [Iulian Dragos] Reviewer’s comments:
8145429 [Iulian Dragos] Add an external shuffle service that can be run as a daemon.
asfgit pushed a commit that referenced this pull request Jul 9, 2015
…os scheduler

This is largely based on extracting the dynamic allocation parts from tnachen's #3861.

Author: Iulian Dragos <jaguarul@gmail.com>

Closes #4984 from dragos/issue/mesos-coarse-dynamicAllocation and squashes the following commits:

39df8cd [Iulian Dragos] Update tests to latest changes in core.
9d2c9fa [Iulian Dragos] Remove adjustment of executorLimitOption in doKillExecutors.
8b00f52 [Iulian Dragos] Latest round of reviews.
0cd00e0 [Iulian Dragos] Add persistent shuffle directory
15c45c1 [Iulian Dragos] Add dynamic allocation to the Spark coarse-grained scheduler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants