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

ASF GitHub Bot commented on AIRFLOW-5744:
-----------------------------------------

jmccartin commented on pull request #6796: [AIRFLOW-5744] Environment variables 
not correctly set in Spark
URL: https://github.com/apache/airflow/pull/6796
 
 
   This pull request fixes a case where the environment variables supported by 
the Spark submit operator were not being applied at runtime when running in 
YARN mode. This is useful when creating dynamic clusters on a cloud 
environment, where the master address isn't known apriori. For more 
information, please see the associated Jira.
   
   Also fixed a typo in a comment in the same file.
   
   Closes [AIRFLOW-5744](https://issues.apache.org/jira/browse/AIRFLOW-5744)
   
   ### Jira
   
   - [x] My PR addresses the following [Airflow 
Jira](https://issues.apache.org/jira/browse/AIRFLOW/) issues and references 
them in the PR title. For example, "\[AIRFLOW-XXX\] My Airflow PR"
     - https://issues.apache.org/jira/browse/AIRFLOW-XXX
     - In case you are fixing a typo in the documentation you can prepend your 
commit with \[AIRFLOW-XXX\], code changes always need a Jira issue.
     - In case you are proposing a fundamental code change, you need to create 
an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)).
     - In case you are adding a dependency, check if the license complies with 
the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Description
   
   - [x] Here are some details about my PR, including screenshots of any UI 
changes:
   
   ### Tests
   
   - [x] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
   
   ### Commits
   
   - [x] My commits all reference Jira issues in their subject lines, and I 
have squashed multiple commits if they address the same issue. In addition, my 
commits follow the guidelines from "[How to write a good git commit 
message](http://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [x] In case of new functionality, my PR adds documentation that describes 
how to use it.
     - All the public functions and the classes in the PR contain docstrings 
that explain what it does
     - If you implement backwards incompatible changes, please leave a note in 
the [Updating.md](https://github.com/apache/airflow/blob/master/UPDATING.md) so 
we can assign it to a appropriate release
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Environment variables not correctly set in Spark submit operator
> ----------------------------------------------------------------
>
>                 Key: AIRFLOW-5744
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5744
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: contrib, operators
>    Affects Versions: 1.10.5
>            Reporter: Joseph McCartin
>            Assignee: Joseph McCartin
>            Priority: Trivial
>
> AIRFLOW-2380 added support for setting environment variables at runtime for 
> the SparkSubmitOperator. The intention was to allow for dynamic configuration 
> paths (such as HADOOP_CONF_DIR). The pull request, however, only made it so 
> that these env vars would only be set at runtime if a standalone cluster and 
> a client deploy mode was chosen. For kubernetes and yarn modes, the env vars 
> would be sent to the driver via the spark arguments _spark.yarn.appMasterEnv_ 
> (and equivalent for k8s).
> If one wishes to dynamically set the yarn master address (via a 
> _yarn-site.xml_ file), then one or more environment variables __ need to be 
> present at runtime, and this is not currently done.
> The SparkSubmitHook class var `_env` is assigned the `_env_vars` variable 
> from the SparkSubmitOperator, in the `_build_spark_submit_command` method. If 
> running in YARN mode however, this is not set as it should be, and therefore 
> `_env` is not passed to the Popen process.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to