You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by vanzin <gi...@git.apache.org> on 2017/01/25 00:55:38 UTC

[GitHub] spark pull request #16695: [SPARK-19277][yarn] Localize topology scripts ins...

GitHub user vanzin opened a pull request:

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

    [SPARK-19277][yarn] Localize topology scripts inside Hadoop configuration.

    Hadoop has some configurations that can be used to run an external script
    that prints out information about cluster host topology. When a Spark
    application runs, the Hadoop configuration is localized in each Spark
    container, but these paths remain pointing to their original location,
    which may not exist in the target machine.
    
    This change updates those configs so that the Spark AM points to the
    localized path of the scripts, when the original files are localized
    by Spark (i.e. when they live inside the Hadoop configuration directory).
    The scripts seem to only be used by the AM, so the change skips updating
    the configs for executors, since that would be more complicated.
    
    Tested with added unit test and by trying this out in a real cluster and
    verifying the updated configuration was being used.

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

    $ git pull https://github.com/vanzin/spark SPARK-19277

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

    https://github.com/apache/spark/pull/16695.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 #16695
    
----
commit df3922ef023570846da6d86d121fe50be969adbd
Author: Marcelo Vanzin <va...@cloudera.com>
Date:   2017-01-24T00:50:23Z

    [SPARK-19277][yarn] Localize topology scripts inside Hadoop configuration.
    
    Hadoop has some configurations that can be used to run an external script
    that prints out information about cluster host topology. When a Spark
    application runs, the Hadoop configuration is localized in each Spark
    container, but these paths remain pointing to their original location,
    which may not exist in the target machine.
    
    This change updates those configs so that the Spark AM points to the
    localized path of the scripts, when the original files are localized
    by Spark (i.e. when they live inside the Hadoop configuration directory).
    The scripts seem to only be used by the AM, so the change skips updating
    the configs for executors, since that would be more complicated.
    
    Tested with added unit test and by trying this out in a real cluster and
    verifying the updated configuration was being used.

----


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    **[Test build #71961 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71961/testReport)** for PR 16695 at commit [`812a776`](https://github.com/apache/spark/commit/812a776486f61f2a345e853681ac2dc3c5bf9c12).
     * This patch **fails to build**.
     * 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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    **[Test build #71953 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71953/testReport)** for PR 16695 at commit [`df3922e`](https://github.com/apache/spark/commit/df3922ef023570846da6d86d121fe50be969adbd).
     * This patch **fails to build**.
     * 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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    **[Test build #71962 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71962/testReport)** for PR 16695 at commit [`11567bb`](https://github.com/apache/spark/commit/11567bb9e5e8b425b38d67ad4b986d365491776f).


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

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


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    **[Test build #71962 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71962/testReport)** for PR 16695 at commit [`11567bb`](https://github.com/apache/spark/commit/11567bb9e5e8b425b38d67ad4b986d365491776f).
     * This patch passes all 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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    Merged build finished. Test FAILed.


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

Posted by tgravescs <gi...@git.apache.org>.
Github user tgravescs commented on the issue:

    https://github.com/apache/spark/pull/16695
  
    this seems really really specific to the scripts being in the hadoop conf directory and the user using default mapping.  I assume the hadoop confs on the nodemanagers have a different config then the gateways?  I know this can happen but if this is the case shouldn't it just be using the hadoop conf dir on the cluster vs us copying it from the gateway? this is kind of the opposite problem you were trying to solve with SPARK-2669.  yes and there can be a whole mix of these but to me that just seems like bad cluster setup.   You should either be expecting to use gateways side configs or nodemanager side configs not a mix of both. 
    
    What if I have the paths different but they aren't on in the hadoop conf dir?  I assume it breaks then also and this doesn't handle it.  
    
    I'm hesitant to start doing this as it opens it up for us doing this for any/all hadoop configs.
    
    Users can also just override by setting spark.hadoop.net.topology.script.file.name


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/71953/
    Test FAILed.


---
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 #16695: [SPARK-19277][yarn] Localize topology scripts ins...

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

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


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/16695
  
    It's kind of a side-effect of how we deploy client configurations, I think. We've had some issues with the topology scripts not being available together with Spark client configs in certain situations. Let me sit on this for a while and think about it more. I'll close the PR for now.


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    Merged build finished. Test PASSed.


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    **[Test build #71961 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71961/testReport)** for PR 16695 at commit [`812a776`](https://github.com/apache/spark/commit/812a776486f61f2a345e853681ac2dc3c5bf9c12).


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    Merged build finished. Test FAILed.


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/16695
  
    Actually this can be considered kind of a continuation of SPARK-2669.
    
    The issue this is trying to solve is that the NMs don't necessarily have a client Hadoop configuration in place. (Or maybe I'm mistaken and that's a requirement?) Or, in case I'm wrong and they do, they might be different from the gateway's.
    
    So the Spark app is started and it's using the configuration as defined by the user, and now on the actual NM a bunch of files that the user configuration expects to exist on certain paths do not. What do we do?
    
    Hadoop's configuration is not very flexible here... if it had a concept of "these paths are inside the config directory" or something like that this wouldn't be needed. So this is the solution I thought about.
    
    Or maybe a better approach is to try to be smarter and, instead of blindly loading the user's config, try to load the NM's config first, and then overlay the user's config on top of it. Then, for example, "final" configs in the NM's files wouldn't be overwritten by the user. How does that one sound?
    
    I'm not a super big fan of the latter approach because then Spark exposes different functionality in client and cluster mode. In client mode the user has full control of the Hadoop configs, and in cluster mode they wouldn't anymore. But maybe it's an ok compromise.



---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

Posted by tgravescs <gi...@git.apache.org>.
Github user tgravescs commented on the issue:

    https://github.com/apache/spark/pull/16695
  
    So I'm just curious, in the specific case you saw this issue, what were the configs?  The configs on NM had the correct path or the ones on the gateways were only pointing to gateway.  If any jobs use this at all I would assume the NM's have to have the correct path in the configs otherwise the config never works.


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    **[Test build #71953 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/71953/testReport)** for PR 16695 at commit [`df3922e`](https://github.com/apache/spark/commit/df3922ef023570846da6d86d121fe50be969adbd).


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

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

    https://github.com/apache/spark/pull/16695
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/71961/
    Test FAILed.


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/16695
  
    @tgravescs 


---
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 #16695: [SPARK-19277][yarn] Localize topology scripts ins...

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

    https://github.com/apache/spark/pull/16695#discussion_r97867966
  
    --- Diff: resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/config.scala ---
    @@ -349,4 +351,47 @@ package object config {
         CACHED_FILES_TYPES,
         CACHED_CONF_ARCHIVE)
     
    +
    +  /**
    +   * Mirror for Hadoop's NET_TOPOLOGY_SCRIPT_FILE_NAME_KEY to allow for variable expansion.
    +   */
    +  private[spark] val TOPOLOGY_SCRIPT_FILE = ConfigBuilder("spark.yarn.net.topology.script")
    +    .internal()
    +    .stringConf
    +    .createOptional
    +
    +  /**
    +   * Mirror for Hadoop's NET_TOPOLOGY_SCRIPT_FILE_NAME_KEY to allow for variable expansion.
    +   */
    +  private[spark] val TOPOLOGY_DEPENDENCY_SCRIPT_FILE =
    +    ConfigBuilder("spark.yarn.net.topology.dependency.script")
    +      .internal()
    +      .stringConf
    +      .createOptional
    +
    +  /**
    +   * Mirror for Hadoop's NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY to allow for variable expansion.
    +   */
    +  private[spark] val TOPOLOGY_TABLE_MAPPING_FILE =
    +    ConfigBuilder("spark.yarn.net.topology.table.mapping.file")
    +      .internal()
    +      .stringConf
    +      .createOptional
    +
    +  /**
    +   * Maps the original Hadoop configuration key to the Spark mirror config entry defined above.
    +   */
    +  private[spark] val TOPOLOGY_CONFIG_MAPPING = Map(
    +      "NET_TOPOLOGY_SCRIPT_FILE_NAME_KEY" -> TOPOLOGY_SCRIPT_FILE,
    +      "NET_DEPENDENCY_SCRIPT_FILE_NAME_KEY" -> TOPOLOGY_DEPENDENCY_SCRIPT_FILE,
    +      "NET_TOPOLOGY_TABLE_MAPPING_FILE_KEY" -> TOPOLOGY_TABLE_MAPPING_FILE)
    +    .flatMap { case (k, e) =>
    --- End diff --
    
    I guess since I'm doing this I could just hardcode the config names (which should be just as public)... either way.


---
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 issue #16695: [SPARK-19277][yarn] Localize topology scripts inside Had...

Posted by vanzin <gi...@git.apache.org>.
Github user vanzin commented on the issue:

    https://github.com/apache/spark/pull/16695
  
    > then overlay the user's config on top of it
    
    Just tried this for kicks and doing it the naive way (with `addResource`) would result in a bunch of warnings:
    
        WARN conf.Configuration: foo.xml:an attempt to override final parameter: bar;  Ignoring.
    
    Meaning it works, but at the very least we'd have to try to avoid the noise when going that route.


---
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