Skip to content

Commit a9a896d

Browse files
YARN-1964 Launching containers from docker
This adds a new ContainerExecutor called DockerContainerExecutor. This executor launches a container in a docker container, providing a full filesystem namespace and software isolation for the container.
1 parent c50fc92 commit a9a896d

File tree

7 files changed

+1418
-6
lines changed

7 files changed

+1418
-6
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,23 @@ public class YarnConfiguration extends Configuration {
848848
/** The arguments to pass to the health check script.*/
849849
public static final String NM_HEALTH_CHECK_SCRIPT_OPTS =
850850
NM_PREFIX + "health-checker.script.opts";
851-
851+
852+
/** The Docker image name(For DockerContainerExecutor).*/
853+
public static final String NM_DOCKER_CONTAINER_EXECUTOR_IMAGE_NAME =
854+
NM_PREFIX + "docker-container-executor.image-name";
855+
856+
/** Args passed to docker run(For DockerContainerExecutor).*/
857+
public static final String NM_DOCKER_CONTAINER_EXECUTOR_RUN_ARGS =
858+
NM_PREFIX + "docker-container-executor.run-args";
859+
860+
/** The name of the docker executor (For DockerContainerExecutor).*/
861+
public static final String NM_DOCKER_CONTAINER_EXECUTOR_EXEC_NAME =
862+
NM_PREFIX + "docker-container-executor.exec-name";
863+
864+
/** The default docker executor (For DockerContainerExecutor).*/
865+
public static final String NM_DEFAULT_DOCKER_CONTAINER_EXECUTOR_EXEC_NAME =
866+
"docker -H=tcp://0.0.0.0:4243";
867+
852868
/** The path to the Linux container executor.*/
853869
public static final String NM_LINUX_CONTAINER_EXECUTOR_PATH =
854870
NM_PREFIX + "linux-container-executor.path";

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<!-- there. If yarn-site.xml does not already exist, create it. -->
2424

2525
<configuration>
26-
26+
2727
<!-- IPC Configs -->
2828
<property>
2929
<description>Factory to create client IPC classes.</description>
@@ -1113,6 +1113,32 @@
11131113
<value>${hadoop.tmp.dir}/yarn-nm-recovery</value>
11141114
</property>
11151115

1116+
<!--Docker configuration-->
1117+
<property>
1118+
<name>yarn.nodemanager.docker-container-executor.image-name</name>
1119+
<value>centos</value>
1120+
<description>
1121+
This image is used by all nodemanagers to launch containers.
1122+
This maybe modified by the users(see below)
1123+
</description>
1124+
</property>
1125+
1126+
<property>
1127+
<name>yarn.nodemanager.docker-container-executor.run-args</name>
1128+
<value>--rm --net=host</value>
1129+
<description>
1130+
This arguments to pass to the 'docker run' invocation.
1131+
</description>
1132+
</property>
1133+
1134+
<property>
1135+
<name>yarn.nodemanager.docker-container-executor.exec-name</name>
1136+
<value>docker</value>
1137+
<description>
1138+
Name or path to the Docker client.
1139+
</description>
1140+
</property>
1141+
11161142
<!--Map Reduce configuration-->
11171143
<property>
11181144
<name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>

0 commit comments

Comments
 (0)