[ 
https://issues.apache.org/jira/browse/SPARK-8939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14744792#comment-14744792
 ] 

Sen Fang commented on SPARK-8939:
---------------------------------

The issue seems to lie in: 
https://github.com/amplab/spark-ec2/blob/branch-1.5/templates/root/spark/conf/spark-env.sh#L7
where {{{{spark_worker_instances}}}} is set to empty string 
here:
https://github.com/apache/spark/blob/branch-1.5/ec2/spark_ec2.py#L810
This results the following replacement:
{code}
if [ -n  ]; then
  export SPARK_WORKER_INSTANCES=
fi
{code}
in spark-env.sh. Somehow bash thinks this evaluates to true. This simple fix is 
to surround the variable with quote in the if statement.

However, I'm a bit confused that at
https://github.com/apache/spark/blob/v1.5.0/core/src/main/scala/org/apache/spark/SparkConf.scala#L481
suggests this environment variable has been deprecated in favor for 
`SPARK_EXECUTOR_INSTANCES` but `--worker-instances` are referenced at a lot of 
places thus I'm not sure if we want to remove/deprecate it.

I'm submitting a PR for now since I have tested my fix for YARN and also 
verified it didn't break for regular standalone.

> YARN EC2 default setting fails with IllegalArgumentException
> ------------------------------------------------------------
>
>                 Key: SPARK-8939
>                 URL: https://issues.apache.org/jira/browse/SPARK-8939
>             Project: Spark
>          Issue Type: Bug
>          Components: EC2
>    Affects Versions: 1.5.0
>            Reporter: Andrew Or
>
> I just set it up from scratch using the spark-ec2 script. Then I ran
> {code}
> bin/spark-shell --master yarn
> {code}
> which failed with
> {code}
> 15/07/09 03:44:29 ERROR SparkContext: Error initializing SparkContext.
> java.lang.IllegalArgumentException: Unknown/unsupported param 
> List(--num-executors, , --executor-memory, 6154m, --executor-memory, 6154m, 
> --executor-cores, 2, --name, Spark shell)
> {code}
> This goes away if I provide `--num-executors`, but we should fix the default.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to