Skip to content

Conversation

@yanji84
Copy link

@yanji84 yanji84 commented Mar 1, 2017

What changes were proposed in this pull request?

Allow passing in arbitrary parameters into docker when launching spark executors on mesos with docker containerizer @tnachen

How was this patch tested?

Manually built and tested with passed in parameter

@yanji84 yanji84 changed the title [SPARK-19740][MESOS] [SPARK-19740][MESOS]Add support in Spark to pass arbitrary parameters into docker when running on mesos with docker containerizer Mar 1, 2017
@tnachen
Copy link
Contributor

tnachen commented Mar 1, 2017

ok to test

@tnachen
Copy link
Contributor

tnachen commented Mar 1, 2017

@yanji84 can you add a test for this?

@SparkQA
Copy link

SparkQA commented Mar 1, 2017

Test build #73645 has finished for PR 17109 at commit ecb7a8e.

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

@yanji84
Copy link
Author

yanji84 commented Mar 1, 2017

@tnachen I will add test

@SparkQA
Copy link

SparkQA commented Mar 5, 2017

Test build #73937 has finished for PR 17109 at commit 4087936.

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

@SparkQA
Copy link

SparkQA commented Mar 5, 2017

Test build #73938 has finished for PR 17109 at commit 54f9ec8.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class MesosSchedulerBackendUtilSuite extends SparkFunSuite with Matchers with MockitoSugar

@yanji84
Copy link
Author

yanji84 commented Mar 5, 2017

@tnachen test ready

@SparkQA
Copy link

SparkQA commented Mar 5, 2017

Test build #73942 has finished for PR 17109 at commit 423dfa8.

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

@SparkQA
Copy link

SparkQA commented Mar 5, 2017

Test build #73944 has finished for PR 17109 at commit 0696d4f.

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

@yanji84
Copy link
Author

yanji84 commented Mar 10, 2017

@tnachen does the PR look good? Thanks!

@tnachen
Copy link
Contributor

tnachen commented Mar 10, 2017

Hey sorry for the late response, code looks good to me, however we need to add documentation about the new flag. Can you modify the Mesos configuration docs in the docs folder?

@SparkQA
Copy link

SparkQA commented Mar 10, 2017

Test build #74299 has finished for PR 17109 at commit 03e89eb.

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

@tnachen
Copy link
Contributor

tnachen commented Mar 10, 2017

@srowen @mgummelt PTAL

<tr>
<td><code>spark.mesos.executor.docker.params</code></td>
<td>(none)</td>
<td>

Choose a reason for hiding this comment

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

s/mesos/Mesos

s/docker containerizer/the docker containerizer

<td><code>spark.mesos.executor.docker.params</code></td>
<td>(none)</td>
<td>
Set the list of custom parameters which will be passed into the <code>docker run</code> command when launching the Spark executor on mesos using docker containerizer. The format of this property is a comma-separated list of

Choose a reason for hiding this comment

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

s/That is they take the form:/Example:

By default Mesos agents will not pull images they already have cached.
</td>
</tr>
<tr>

Choose a reason for hiding this comment

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

s/params/parameters

to be consistent with the Mesos protobuf terminology

* takes the form key=value
*/
def parseParamsSpec(params: String): List[Parameter] = {
params.split(",").map(_.split("=")).flatMap { kv: Array[String] =>

Choose a reason for hiding this comment

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

s/kv/parameter for naming consistency

* Parse a comma-delimited list of arbitrary parameters, each of which
* takes the form key=value
*/
def parseParamsSpec(params: String): List[Parameter] = {

Choose a reason for hiding this comment

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

private

}

/**
* Parse a comma-delimited list of arbitrary parameters, each of which

Choose a reason for hiding this comment

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

"list of docker parameters"


test("Parse arbitrary parameter to pass into docker containerizer") {
val parsed = MesosSchedulerBackendUtil.parseParamsSpec("a=1,b=2,c=3")
parsed(0).getKey shouldBe "a"

Choose a reason for hiding this comment

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

check out the other test suites. We use assert, not Matchers

parsed(2).getKey shouldBe "c"
parsed(2).getValue shouldBe "3"

val invalid = MesosSchedulerBackendUtil.parseParamsSpec("a,b")

Choose a reason for hiding this comment

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

invalid entries should be in a separate test

class MesosSchedulerBackendUtilSuite extends SparkFunSuite with Matchers with MockitoSugar {

test("Parse arbitrary parameter to pass into docker containerizer") {
val parsed = MesosSchedulerBackendUtil.parseParamsSpec("a=1,b=2,c=3")

Choose a reason for hiding this comment

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

This should be a private method, so let's not test it. Just test containerInfo

@SparkQA
Copy link

SparkQA commented Mar 12, 2017

Test build #74392 has finished for PR 17109 at commit 737acf0.

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

@yanji84
Copy link
Author

yanji84 commented Mar 12, 2017

@mgummelt comments addressed, please take another look

* takes the form key=value
*/
private def parseParamsSpec(params: String): List[Parameter] = {
params.split(",").map(_.split("=")).flatMap { spec: Array[String] =>

Choose a reason for hiding this comment

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

s/spec/parameter, for consistency

Choose a reason for hiding this comment

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

to be consistent with other methods, i think we should stick with spec.

def parsePortMappingsSpec(portmaps: String): List[DockerInfo.PortMapping] = {
portmaps.split(",").map(_.split(":")).flatMap { spec: Array[String] =>
val portmap: DockerInfo.PortMapping.Builder = DockerInfo.PortMapping

it seems to be better to reserve the name parameter later for builder

val param: Parameter.Builder = Parameter.newBuilder()

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not very familiar with docker parameters - but wont this method not fail if '=' exists in the value ?
Or is that prohibited by docker ?

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm if a value contains a '=' we will have a parsing error.

Copy link
Contributor

@skonto skonto Apr 12, 2017

Choose a reason for hiding this comment

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

= in values seems valid for env vars: moby/moby#12763

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, so we should split with a limit instead.
@yanji84 can you fix this?

Copy link
Author

Choose a reason for hiding this comment

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

sorry missed out this comment earlier, Ii set limit to 2, pushed the new pull request


import org.apache.spark.{SparkConf, SparkFunSuite}

class MesosSchedulerBackendUtilSuite extends SparkFunSuite with Matchers with MockitoSugar {

Choose a reason for hiding this comment

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

Is Matchers used anymore?

Choose a reason for hiding this comment

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

i'll check, if not, will remove it

@SparkQA
Copy link

SparkQA commented Mar 14, 2017

Test build #74488 has finished for PR 17109 at commit cbb784a.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):
  • class MesosSchedulerBackendUtilSuite extends SparkFunSuite

@mgummelt
Copy link

LGTM @srowen ready to merge

@yanji84
Copy link
Author

yanji84 commented Mar 18, 2017

hello, any update on this?

@yanji84
Copy link
Author

yanji84 commented Apr 11, 2017

@srowen is there anything else holding this up? why does it take so long? thanks

@srowen
Copy link
Member

srowen commented Apr 11, 2017

@yanji84 I have no experience with Mesos and am not, in general, a reviewer for this code, and don't follow Mesos changes. That's why. I pitch in to help merge but would appreciate others stepping up to help.

@mgummelt
Copy link

mgummelt commented Apr 11, 2017

@srowen We do appreciate your help with Mesos commits, and generally find you responsive. I have a habit of pinging you for merges because you seemed to have stepped in once @andrewor14 stepped away. There are really only two active Spark contributers with knowledge of Mesos code, being myself and @skonto. We would obviously love it if one of us could be made a committer so we could more effectively maintain the Mesos module. It's something @rxin emailed me about previously, but there was some concern about my total code volume. I'll be upstreaming a sizable feature this week (Kerberos support on Mesos). Maybe that, along with my 1.5 year history of responsive code reviews and contributions, would push me over the edge?

I'd be more than happy to take this maintenance burden away from you :)

@tnachen
Copy link
Contributor

tnachen commented Apr 12, 2017

@srowen Appreciate the help you're doing, I think we're doing what we can to help review these patches and making sure Mesos support is still being maintained and improved over time.
If you trust our judgement and also us still around fixing issues when arises, then we really just need someone like you to help merge patches.
Ensuring someone else or if anyone that's been contributing to this area can become a committer definitely is a ever ongoing problem that we're still hoping one day can be addressed. Another parallel effort that I think is very worth investigating is to decouple the cluster manager intergation from Spark, which I believe is becoming more relevant now as we have more integration coming.

Long story short, if you can still help in the mean time will be greatly appreciated as we can still make sure improvements around Mesos integration can still happen

@srowen
Copy link
Member

srowen commented Apr 15, 2017

Is this one still good to go? I see a late comment above. I can merge it, no problem.

@SparkQA
Copy link

SparkQA commented Apr 15, 2017

Test build #75828 has finished for PR 17109 at commit 2f3f8b2.

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

@yanji84
Copy link
Author

yanji84 commented Apr 16, 2017

@srowen @tnachen confirm merge

@srowen
Copy link
Member

srowen commented Apr 16, 2017

Merged to master

@asfgit asfgit closed this in a888fed Apr 16, 2017
peter-toth pushed a commit to peter-toth/spark that referenced this pull request Oct 6, 2018
…s into docker when running on mesos with docker containerizer

## What changes were proposed in this pull request?

Allow passing in arbitrary parameters into docker when launching spark executors on mesos with docker containerizer tnachen

## How was this patch tested?

Manually built and tested with passed in parameter

Author: Ji Yan <jiyan@Jis-MacBook-Air.local>

Closes apache#17109 from yanji84/ji/allow_set_docker_user.
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.

8 participants