Skip to content

Conversation

@devaraj-kavali
Copy link

What changes were proposed in this pull request?

Added provision to specify the 'spark.executor.extraJavaOptions' value in terms of the Executor Id(i.e. @execid@). @execid@ will be replaced with the Executor Id while starting the executor.

How was this patch tested?

I have verified this by checking the executor process command and gc logs. I verified the same in different deployement modes(Standalone, YARN, Mesos).

@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@rxin
Copy link
Contributor

rxin commented Apr 28, 2016

I think this is a good idea in general, but I'm less sure about @. Is @ used in windows? Any other places?

@devaraj-kavali
Copy link
Author

Thanks @rxin for checking this, I don't think @ is used any where. Here again we are replacing only for 'spark.executor.extraJavaOptions' value when @execid@ occurs, any other @ symbols we leave as it is, so I don't think any problem occurs due to this.

Environment.Variable.newBuilder().setName("SPARK_CLASSPATH").setValue(cp).build())
}
val extraJavaOpts = conf.get("spark.executor.extraJavaOptions", "")
var extraJavaOpts = conf.get("spark.executor.extraJavaOptions", "")
Copy link
Member

Choose a reason for hiding this comment

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

would it be a little cleaner to do the following

val extraJavaOpts = conf.getOption("spark.executor.extraJavaOptions").map {
  Utils.substituteExecIdWildCard(_, taskId)
}.getOrElse("")

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @BryanCutler for the suggestion, I have addressed it in the latest.

@devaraj-kavali
Copy link
Author

@rxin, Please have a look into this and let me know any thing needs to be done here. About @, M/R also uses @ for the taskid wild card in java opts and there is no problem in windows and as well as in other places with @.

@vanzin
Copy link
Contributor

vanzin commented Aug 4, 2016

Sorry this has been forgotten for so long. I think instead of adding a new way of referencing variables, it might be better to use the new code I'm adding in #14468; that way it would be easier to reference executor id (by creating a new ConfigProvider with that info) and even other config information if desired.

At the very least conflicts need to be resolved.

@devaraj-kavali
Copy link
Author

@vanzin Thanks for looking into this, I have resolved the conflicts.

@vanzin
Copy link
Contributor

vanzin commented Aug 5, 2016

Hmmm... wouldn't this be a one line change (for standalone and mesos) if instead you modified CommandUtils.buildLocalCommand to apply variable substitution to command.javaOpts instead of just to command.arguments?

That would replace {{EXECUTOR_ID}} in any of the arguments, since that variable is already in the list of things to replace (see ExecutorRunner.substituteVariables.)

You'd still need some extra code for YARN since it doesn't use that path. But it would be a smaller change that re-uses existing functionality.

EDIT: mesos seems to use a different path too. I just want to avoid creating yet another syntax for variable substitution. We should either use the standalone-style internal variable substitution ({{VARIABLE}}), or the one supported by SparkConf (${variable}), and re-use the code that processes those instead of adding more code to do the same thing.

@vanzin
Copy link
Contributor

vanzin commented Aug 5, 2016

Also the PR title is misleading, since this change is adding a single "wildcard" to a single configuration. The title makes it sound like it's way more generic than it is.

@vanzin
Copy link
Contributor

vanzin commented Aug 17, 2016

Hi @devaraj-kavali, are you still interested in updating this PR? I really think it should use the features I added in SPARK-16671 (especially the ConfigReader code), to avoid yet another way of expanding variables.

@devaraj-kavali
Copy link
Author

@vanzin, SPARK-3767 was resolved as 'Won't Fix' by @srowen. I was in assumption that SPARK-16671 covers this as well.

@vanzin
Copy link
Contributor

vanzin commented Aug 17, 2016

If you're willing to work on it you can re-open the bug. Otherwise you should close this PR.

@devaraj-kavali
Copy link
Author

I will update this PR with the ConfigReader and reopen the jira.

srowen added a commit to srowen/spark that referenced this pull request Aug 27, 2016
@asfgit asfgit closed this in 1a48c00 Aug 29, 2016
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