Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/3074#discussion_r28477204
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
 ---
    @@ -148,13 +148,26 @@ private[spark] class MesosSchedulerBackend(
             Value.Scalar.newBuilder()
               .setValue(MemoryUtils.calculateTotalMemory(sc)).build())
           .build()
    -    MesosExecutorInfo.newBuilder()
    +    val executorInfo = MesosExecutorInfo.newBuilder()
           .setExecutorId(ExecutorID.newBuilder().setValue(execId).build())
           .setCommand(command)
           .setData(ByteString.copyFrom(createExecArg()))
           .addResources(cpus)
           .addResources(memory)
    -      .build()
    +
    +    sc.conf.getOption("spark.mesos.executor.docker.image").map { 
image:String =>
    +      val container = executorInfo.getContainerBuilder()
    +      val volumes = sc.conf
    +        .getOption("spark.mesos.executor.docker.volumes")
    +        .map(MesosSchedulerBackendUtil.parseVolumesSpec)
    +      val portmaps = sc.conf
    +        .getOption("spark.mesos.executor.docker.portmaps")
    +        .map(MesosSchedulerBackendUtil.parsePortMappingsSpec)
    +      MesosSchedulerBackendUtil.withDockerInfo(
    +        container, image, volumes = volumes, portmaps = portmaps)
    +    }
    --- End diff --
    
    This chunk of code is duplicated. You should factor this into a method in 
your utils class, and maybe call it `setupDockerContainer(conf: SparkConf)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to