Skip to content

Conversation

@mgummelt
Copy link

@mgummelt mgummelt commented Jul 13, 2016

What changes were proposed in this pull request?

Added new configuration namespace: spark.mesos.env.*

This allows a user submitting a job in cluster mode to set arbitrary environment variables on the driver.
spark.mesos.driverEnv.KEY=VAL will result in the env var "KEY" being set to "VAL"

I've also refactored the tests a bit so we can re-use code in MesosClusterScheduler.

And I've refactored the command building logic in buildDriverCommand. Command builder values were very intertwined before, and now it's easier to determine exactly how each variable is set.

How was this patch tested?

unit tests

@SparkQA
Copy link

SparkQA commented Jul 13, 2016

Test build #62201 has finished for PR 14167 at commit e706ca6.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 13, 2016

Test build #62270 has finished for PR 14167 at commit 37dc48a.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@mgummelt mgummelt changed the title [WIP] [SPARK-16194] Mesos Driver env vars [SPARK-16194] Mesos Driver env vars Jul 13, 2016
@mgummelt
Copy link
Author

Error message from build: ERROR: Step ?Publish JUnit test result report? failed: No test report files were found. Configuration error?

Copy link
Contributor

@skonto skonto Jul 14, 2016

Choose a reason for hiding this comment

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

Spark does not have a spark.driverEnv.[EnvironmentVariableName] while it has a spark.executorEnv.[EnvironmentVariableName] http://spark.apache.org/docs/latest/configuration.html.
From a UX experience and name consistency view i would expect something like that. The problem is that this pr only handles the mesos case so we cannot rename it to that name (unless we explicitly defined it in docs), also in client mode you do not need that so you will need to ignore it.
"spark.mesos.env." needs to be more specific like spark.mesos.driver.env but as i said spark.driverEnv seems more appropriate.

Copy link
Author

Choose a reason for hiding this comment

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

From a UX experience and name consistency view i would expect something like that.

Yea I went back and forth on this. I'm fine with spark.mesos.driverEnv Does that work?

also in client mode you do not need that so you will need to ignore it.

Do you mean there needs to be some code change to ignore it? The only handling code is in the cluster dispatcher, so it's effectively ignored in client mode.

@skonto
Copy link
Contributor

skonto commented Jul 14, 2016

The build fails with: [error] /home/jenkins/workspace/SparkPullRequestBuilder@4/core/src/test/scala/org/apache/spark/scheduler/cluster/mesos/MesosClusterSchedulerSuite.scala:34: object Utils is not a member of package org.apache.spark.scheduler.cluster.mesos
[error] import org.apache.spark.scheduler.cluster.mesos.Utils._

https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/62270/consoleFull

I reproduced it locally you are missing the Utils object.

Copy link
Contributor

@skonto skonto Jul 14, 2016

Choose a reason for hiding this comment

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

Wild card imports should be avoided (unless you are importing more than 6 entities, or implicit methods) https://github.com/databricks/scala-style-guide. I think there are 5 (a bit picky here)...

Copy link
Author

Choose a reason for hiding this comment

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

Removed the wildcard.

@mgummelt
Copy link
Author

@skonto comments addressed. Please re-review.

@mgummelt
Copy link
Author

Note that I'll add docs once the code is 👍

@SparkQA
Copy link

SparkQA commented Jul 14, 2016

Test build #62341 has finished for PR 14167 at commit 1bfee1d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 14, 2016

Test build #62340 has finished for PR 14167 at commit 9f7b151.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Contributor

@skonto skonto Jul 14, 2016

Choose a reason for hiding this comment

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

Pls fix indentation for method parameters (4 spaces, first parameter in a new line).

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@skonto
Copy link
Contributor

skonto commented Jul 15, 2016

LGTM other than minor style issues. I run our tests against it so refactoring is successful i guess.

@mgummelt
Copy link
Author

@skonto fixed the style issues

@andrewor14 plz merge

@SparkQA
Copy link

SparkQA commented Jul 16, 2016

Test build #62391 has finished for PR 14167 at commit de75386.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@mgummelt
Copy link
Author

@srowen Can we get a merge?

@srowen
Copy link
Member

srowen commented Jul 20, 2016

I don't know anything about mesos, but I presume y'all are pretty expert. Unless anyone else with Mesos knowledge chimes in, and tests pass and all that, OK to merge.

@viirya
Copy link
Member

viirya commented Jul 20, 2016

nit: From the code, it is spark.mesos.driverEnv but in PR description it is spark.mesos.env.

@skonto
Copy link
Contributor

skonto commented Jul 20, 2016

LGTM. I agree with @viirya for the description.

@mgummelt
Copy link
Author

Updated the description and added docs.

@SparkQA
Copy link

SparkQA commented Jul 20, 2016

Test build #62629 has finished for PR 14167 at commit b9c396b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jul 20, 2016

Test build #62635 has finished for PR 14167 at commit 1824d63.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@skonto
Copy link
Contributor

skonto commented Jul 21, 2016

@andrewor14 @srowen pls merge

@srowen
Copy link
Member

srowen commented Jul 21, 2016

Merged to master

@asfgit asfgit closed this in 235cb25 Jul 21, 2016
@mgummelt mgummelt deleted the driver-env-vars branch July 21, 2016 17:42
@skonto
Copy link
Contributor

skonto commented Jul 21, 2016

great thnx @srowen

asfgit pushed a commit that referenced this pull request Jul 29, 2016
## What changes were proposed in this pull request?

New config var: spark.mesos.docker.containerizer={"mesos","docker" (default)}

This adds support for running docker containers via the Mesos unified containerizer: http://mesos.apache.org/documentation/latest/container-image/

The benefit is losing the dependency on `dockerd`, and all the costs which it incurs.

I've also updated the supported Mesos version to 0.28.2 for support of the required protobufs.

This is blocked on: #14167

## How was this patch tested?

- manually testing jobs submitted with both "mesos" and "docker" settings for the new config var.
- spark/mesos integration test suite

Author: Michael Gummelt <mgummelt@mesosphere.io>

Closes #14275 from mgummelt/unified-containerizer.
mgummelt pushed a commit to d2iq-archive/spark that referenced this pull request Aug 2, 2016
## What changes were proposed in this pull request?

Added new configuration namespace: spark.mesos.env.*

This allows a user submitting a job in cluster mode to set arbitrary environment variables on the driver.
spark.mesos.driverEnv.KEY=VAL will result in the env var "KEY" being set to "VAL"

I've also refactored the tests a bit so we can re-use code in MesosClusterScheduler.

And I've refactored the command building logic in `buildDriverCommand`.  Command builder values were very intertwined before, and now it's easier to determine exactly how each variable is set.

## How was this patch tested?

unit tests

Author: Michael Gummelt <mgummelt@mesosphere.io>

Closes apache#14167 from mgummelt/driver-env-vars.
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.

5 participants