Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Conversation

@mccheah
Copy link

@mccheah mccheah commented May 31, 2017

No description provided.

<td><code>spark.kubernetes.executor.labels</code></td>
<td>(none)</td>
<td>
Custom labels that will be added to the executor pods. This should be a comma-separated list of label key-value pairs,
Copy link

Choose a reason for hiding this comment

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

how do you put a label where the value contains an =? Or a comma , ?

key1=value1,key2=value2=with-equals,key3=value3 ?

Copy link
Author

Choose a reason for hiding this comment

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

We haven't considered that in any of the cases where we use this format. Unfortunately I think that will have to be disallowed, but let me know if you can think of anything better.

Copy link
Author

Choose a reason for hiding this comment

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

We've been using this format for driver labels and annotations already.

Copy link

Choose a reason for hiding this comment

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

Given that there's precedent I'm fine with not supporting it. We probably will need to support values containing = and , at some point in the future though.

Could that be added with \ escaping or would it take a larger change in the format of spark.kubernetes.executor.annotations values?

Copy link
Author

Choose a reason for hiding this comment

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

One possibility is to support any conf of the following format:

spark.kubernetes.driver.label.myLabel

where the value of this configuration is the value of the label.

Then in SparkConf we look for all configurations with the prefix spark.kubernetes.driver.label and construct the labels map accordingly. I think in such a scheme we can support any string without escaping.

Copy link

Choose a reason for hiding this comment

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

And then we'd support both spark.kubernetes.driver.labels and spark.kubernetes.driver.label.myLabel formats simultaneously? How to handle conflicts of double-specified labels?

Copy link
Author

Choose a reason for hiding this comment

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

What I propose above would be a breaking change so that we don't have to support both at once. But we can also deduplicate fairly easily and throw an exception.

Copy link

Choose a reason for hiding this comment

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

Ok that feels like a good path forward without completely compromising backcompat if we wanted. Let's punt that to later. #322

<tr>
<td><code>spark.kubernetes.executor.annotations</code></td>
<td>(none)</td>
<td>
Copy link

Choose a reason for hiding this comment

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

list of annotation key-value pairs?

s"Custom executor labels cannot contain $SPARK_APP_ID_LABEL as it is reserved for Spark.")
require(
!executorLabels.contains(SPARK_EXECUTOR_ID_LABEL),
s"Custom executor labels cannot contain $SPARK_EXECUTOR_ID_LABEL as it is reserved for Spark.")
Copy link

Choose a reason for hiding this comment

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

indentation doesn't match the require above

org.apache.spark.internal.config.EXECUTOR_CLASS_PATH)
private val executorJarsDownloadDir = conf.get(INIT_CONTAINER_JARS_DOWNLOAD_LOCATION)

private val executorLabels = ConfigurationUtils.parseKeyValuePairs(
Copy link

Choose a reason for hiding this comment

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

separate issue, but do we have two versions of parseKeyValuePairs ? Also one in org.apache.spark.deploy.kubernetes.submit.Client

Copy link
Author

Choose a reason for hiding this comment

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

Yeah Client should be using the utility class.

@mccheah mccheah requested a review from erikerlandson June 1, 2017 00:57
@mccheah
Copy link
Author

mccheah commented Jun 1, 2017

@erikerlandson quick sign off and then we can merge?

@foxish
Copy link
Member

foxish commented Jun 1, 2017

LGTM after #321 (comment) is addressed. I'm convinced about the labels, but quick question on the annotations - do you have a use-case driving the setting of custom annotations?

@mccheah
Copy link
Author

mccheah commented Jun 1, 2017

The comments were addressed in the latest push. Regarding the need for custom annotations - we have some custom controllers that watch the API server for pods with given annotations, and perform actions to manage those pods accordingly.

@foxish foxish merged commit e5623b7 into branch-2.1-kubernetes Jun 1, 2017
@foxish foxish deleted the executor-annotations-and-labels branch June 1, 2017 19:05
foxish pushed a commit that referenced this pull request Jul 24, 2017
* Allow custom executor labels and annotations

* Address comments.

* Fix scalastyle.
ifilonenko pushed a commit to ifilonenko/spark that referenced this pull request Feb 26, 2019
puneetloya pushed a commit to puneetloya/spark that referenced this pull request Mar 11, 2019
* Allow custom executor labels and annotations

* Address comments.

* Fix scalastyle.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants