-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[SPARK-20085] [MESOS] Configurable mesos labels for executors #17413
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,8 @@ private[spark] class MesosCoarseGrainedSchedulerBackend( | |
|
|
||
| private val maxGpus = conf.getInt("spark.mesos.gpus.max", 0) | ||
|
|
||
| private val taskLabels = conf.get("spark.mesos.task.labels", "").toString | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whoops, that is redundant, i'll drop that |
||
|
|
||
| private[this] val shutdownTimeoutMS = | ||
| conf.getTimeAsMs("spark.mesos.coarse.shutdownTimeout", "10s") | ||
| .ensuring(_ >= 0, "spark.mesos.coarse.shutdownTimeout must be >= 0") | ||
|
|
@@ -408,6 +410,22 @@ private[spark] class MesosCoarseGrainedSchedulerBackend( | |
| taskBuilder.addAllResources(resourcesToUse.asJava) | ||
| taskBuilder.setContainer(MesosSchedulerBackendUtil.containerInfo(sc.conf)) | ||
|
|
||
| val labelsBuilder = taskBuilder.getLabelsBuilder | ||
|
|
||
| taskLabels.split(",").foreach(label => { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please create a separate method for this.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done! |
||
| label.split(":") match { | ||
| case Array(key, value) => | ||
| labelsBuilder.addLabels(Label.newBuilder() | ||
| .setKey(key) | ||
| .setValue(value) | ||
| .build()) | ||
| case _ => | ||
| logWarning(s"Unable to parse $label into a key:value label for the task.") | ||
| } | ||
| }) | ||
|
|
||
| taskBuilder.setLabels(labelsBuilder) | ||
|
|
||
| tasks(offer.getId) ::= taskBuilder.build() | ||
| remainingResources(offerId) = resourcesLeft.asJava | ||
| totalCoresAcquired += taskCPUs | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalize Mesos.