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

Eric Yang commented on YARN-9053:
---------------------------------

[~Charo Zhang] When non-entrypoint mode is enabled, launch_script.sh is 
mandatory.  You are correct that environment variables are not globally 
visible.  However, this mode is trying to mimic YARN container and allow some 
level of environment variable evaluation, such as 
HADOOP_CONF_DIR=${HADOOP_HOME}/conf . This allows existing Hadoop shell script 
to work without modification.  The drawback is docker exec does not have the 
same environment variables as running inside launch_script.sh.  This was a bug 
that we chose to ignore because we don't want shell evaluation prior to getting 
into docker container.  This was done for security reason, and maintain 
backward compatibility.  If we pass raw environment string like the entrypoint 
mode, then HADOOP_CONF_DIR will evaluate differently between docker run and 
docker exec for non-entrypoint mode.  If global environment consistency is 
important to you, then I recommend to run with entrypoint mode only.

> Support set environment variables for Docker Containers In nonEntryPoint mode
> -----------------------------------------------------------------------------
>
>                 Key: YARN-9053
>                 URL: https://issues.apache.org/jira/browse/YARN-9053
>             Project: Hadoop YARN
>          Issue Type: New Feature
>          Components: nodemanager
>    Affects Versions: 3.1.1
>            Reporter: Charo Zhang
>            Priority: Major
>              Labels: Docker
>         Attachments: YARN-9053.patch
>
>
> In yarn 3.1.1, users can only set environment variables with "-shell_env" in 
> ENTRYPOINT mode, and variables must be registered in 
> yarn.nodemanager.env-whitelist.
> But in nonEntryPoint mode, we should allow users to set environment variables 
> like "-e KEY=VAULE" in docker run command, too.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org

Reply via email to