You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yarn-issues@hadoop.apache.org by "Charo Zhang (JIRA)" <ji...@apache.org> on 2018/11/28 03:40:00 UTC
[jira] [Comment Edited] (YARN-9053) Support set environment
variables for Docker Containers In nonEntryPoint mode
[ https://issues.apache.org/jira/browse/YARN-9053?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16701364#comment-16701364 ]
Charo Zhang edited comment on YARN-9053 at 11/28/18 3:39 AM:
-------------------------------------------------------------
[~Jim_Brennan] Maybe we're not talking about the same thing. writeLaunchEnv would generate launch_container.sh for launching Docker container, all defined variables by *-shell_env*
appearing in the script file with "export" prefix(I found hadoop_security_authentication_tbds_securekey in it),i think it's only valid for running the launch_container.sh script.
However, I care about the environment variables which used in Docker Containers (like docker run with -e option). After i read more Yarn code, i find the environment variables pass to container by set_env method in docker-util.c, which will reading a env file. And the env file records all environment variables added by "addEnv" in DockerRunCommand.java. So I think it's reasonable to add
{code:java}
runCommand.addEnv(environment);
{code}
in DockerLinuxContainerRuntime.java for non-entrypoint case. We apply the uploaded patch, it works fine as expected( hadoop_security_authentication_tbds_securekey appear in Container env).
was (Author: charo zhang):
[~Jim_Brennan] Maybe we're not talking about the same thing. writeLaunchEnv would generate launch_container.sh for launching Docker container, all defined variables by *-shell_env*
appearing in the script file with "export" prefix(I found hadoop_security_authentication_tbds_securekey in it),i think it's only valid for running the launch_container.sh script.
However, I care about the environment variables which used in Docker Containers (like docker run with -e option). After i read more Yarn code, i find the environment variables pass to container by set_env method in docker-util.c, which will reading a env file. And the env file record all environment variables added by "addEnv" in DockerRunCommand.java. So I think it's reasonable to add
{code:java}
runCommand.addEnv(environment);
{code}
in DockerLinuxContainerRuntime.java for non-entrypoint case. We apply the uploaded patch, it works fine for us ( hadoop_security_authentication_tbds_securekey appear in Container env).
> 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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-issues-help@hadoop.apache.org