You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by EugenCepoi <gi...@git.apache.org> on 2014/09/21 19:16:21 UTC

[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

GitHub user EugenCepoi opened a pull request:

    https://github.com/apache/spark/pull/2481

    SPARK-2058: Overriding SPARK_HOME/conf with SPARK_CONF_DIR

    Update of PR #997.
    
    With this PR, setting SPARK_CONF_DIR overrides SPARK_HOME/conf (not only spark-defaults.conf and spark-env).

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/EugenCepoi/spark SPARK-2058

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/2481.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2481
    
----
commit 77f35d77f06b12d3ffb968a2060ff088b182b9bd
Author: EugenCepoi <ce...@gmail.com>
Date:   2014-09-21T17:03:32Z

    SPARK-2058: Overriding SPARK_HOME/conf with SPARK_CONF_DIR

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by EugenCepoi <gi...@git.apache.org>.
Github user EugenCepoi commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-57786084
  
    @andrewor14 The trailing % came from a bad copy paste, nice catch :) Double percent exists but was wrong in this case, http://stackoverflow.com/questions/14509652/what-is-the-difference-between-and-in-a-cmd-file.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-57795374
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/21243/consoleFull) for   PR 2481 at commit [`0bb32c2`](https://github.com/apache/spark/commit/0bb32c2b991a7af7a2028f1978e8e5a99f617a6b).
     * This patch **passes** unit tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-57826573
  
    Ah yes I believe that's for the Spark daemons. We can merge that separately.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-56305629
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/20630/consoleFull) for   PR 2481 at commit [`77f35d7`](https://github.com/apache/spark/commit/77f35d77f06b12d3ffb968a2060ff088b182b9bd).
     * This patch merges cleanly.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by EugenCepoi <gi...@git.apache.org>.
Github user EugenCepoi commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-57824300
  
    @andrewor14 great! Glad to see it merged into master :)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-56307689
  
      [QA tests have finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/20630/consoleFull) for   PR 2481 at commit [`77f35d7`](https://github.com/apache/spark/commit/77f35d77f06b12d3ffb968a2060ff088b182b9bd).
     * This patch **passes** unit tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2481#discussion_r18406038
  
    --- Diff: bin/compute-classpath.sh ---
    @@ -27,8 +27,14 @@ FWDIR="$(cd "`dirname "$0"`"/..; pwd)"
     
     . "$FWDIR"/bin/load-spark-env.sh
     
    +CLASSPATH="$SPARK_CLASSPATH:$SPARK_SUBMIT_CLASSPATH"
    --- End diff --
    
    I would move this back down to where the comment is, but this is trivial I can fix it myself when I merge it.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-57245137
  
    Minor comments, but LGTM otherwise.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2481#discussion_r18190316
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala ---
    @@ -124,8 +117,8 @@ private[spark] class SparkSubmitArguments(args: Seq[String]) {
         jars = Option(jars).getOrElse(properties.get("spark.jars").orNull)
     
         // This supports env vars in older versions of Spark
    -    master = Option(master).getOrElse(System.getenv("MASTER"))
    -    deployMode = Option(deployMode).getOrElse(System.getenv("DEPLOY_MODE"))
    +    master = Option(master).getOrElse(env.get("MASTER").orNull)
    +    deployMode = Option(deployMode).getOrElse(env.get("DEPLOY_MODE").orNull)
    --- End diff --
    
    A better way to write this is:
    ```
    deployMode = Option(deployMode).orElse(env.get("DEPLOY_MODE")).orNull
    ```


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2481#discussion_r18190131
  
    --- Diff: bin/compute-classpath.cmd ---
    @@ -36,7 +36,13 @@ rem Load environment variables from conf\spark-env.cmd, if it exists
     if exist "%FWDIR%conf\spark-env.cmd" call "%FWDIR%conf\spark-env.cmd"
     
     rem Build up classpath
    -set CLASSPATH=%SPARK_CLASSPATH%;%SPARK_SUBMIT_CLASSPATH%;%FWDIR%conf
    +set CLASSPATH=%SPARK_CLASSPATH%;%SPARK_SUBMIT_CLASSPATH%
    +
    +if "x%SPARK_CONF_DIR%"!="x" (
    +  set CLASSPATH=%CLASSPATH%;%SPARK_CONF_DIR%
    +) else (
    +  set CLASSPATH=%%CLASSPATH%;%FWDIR%conf
    --- End diff --
    
    Why do you have an extra `%` here before `CLASSPATH`? What does that do?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/2481


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-57786537
  
      [QA tests have started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/21243/consoleFull) for   PR 2481 at commit [`0bb32c2`](https://github.com/apache/spark/commit/0bb32c2b991a7af7a2028f1978e8e5a99f617a6b).
     * This patch merges cleanly.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2481#discussion_r18190367
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/SparkSubmitArguments.scala ---
    @@ -86,20 +87,12 @@ private[spark] class SparkSubmitArguments(args: Seq[String]) {
       private def mergeSparkProperties(): Unit = {
         // Use common defaults file, if not specified by user
         if (propertiesFile == null) {
    -      sys.env.get("SPARK_CONF_DIR").foreach { sparkConfDir =>
    -        val sep = File.separator
    -        val defaultPath = s"${sparkConfDir}${sep}spark-defaults.conf"
    -        val file = new File(defaultPath)
    -        if (file.exists()) {
    -          propertiesFile = file.getAbsolutePath
    -        }
    -      }
    -    }
    +      val sep = File.separator
    +      val sparkHomeConfig = env.get("SPARK_HOME").map(sparkHome => s"${sparkHome}${sep}conf")
    +      val confDir = env.get("SPARK_CONF_DIR").orElse(sparkHomeConfig)
     
    -    if (propertiesFile == null) {
    -      sys.env.get("SPARK_HOME").foreach { sparkHome =>
    -        val sep = File.separator
    -        val defaultPath = s"${sparkHome}${sep}conf${sep}spark-defaults.conf"
    +      confDir.foreach { sparkConfDir =>
    +        val defaultPath = s"${sparkConfDir}${sep}spark-defaults.conf"
    --- End diff --
    
    +1 for this change. The previous code is duplicated.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-57795383
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/21243/


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: SPARK-2058: Overriding SPARK_HOME/conf with SP...

Posted by andrewor14 <gi...@git.apache.org>.
Github user andrewor14 commented on the pull request:

    https://github.com/apache/spark/pull/2481#issuecomment-57823932
  
    LGTM. I'm merging this into master and 1.1. Thanks @EugenCepoi!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org