Skip to content

Commit 6951caf

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 58e9bf4 commit 6951caf

File tree

6 files changed

+1430
-2
lines changed

6 files changed

+1430
-2
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
@@ -891,7 +891,23 @@ private static void addDeprecatedKeys() {
891891
/** The arguments to pass to the health check script.*/
892892
public static final String NM_HEALTH_CHECK_SCRIPT_OPTS =
893893
NM_PREFIX + "health-checker.script.opts";
894-
894+
895+
/** The Docker image name(For DockerContainerExecutor).*/
896+
public static final String NM_DOCKER_CONTAINER_EXECUTOR_IMAGE_NAME =
897+
NM_PREFIX + "docker-container-executor.image-name";
898+
899+
/** Args passed to docker run(For DockerContainerExecutor).*/
900+
public static final String NM_DOCKER_CONTAINER_EXECUTOR_RUN_ARGS =
901+
NM_PREFIX + "docker-container-executor.run-args";
902+
903+
/** The name of the docker executor (For DockerContainerExecutor).*/
904+
public static final String NM_DOCKER_CONTAINER_EXECUTOR_EXEC_NAME =
905+
NM_PREFIX + "docker-container-executor.exec-name";
906+
907+
/** The default docker executor (For DockerContainerExecutor).*/
908+
public static final String NM_DEFAULT_DOCKER_CONTAINER_EXECUTOR_EXEC_NAME =
909+
"/usr/bin/docker";
910+
895911
/** The path to the Linux container executor.*/
896912
public static final String NM_LINUX_CONTAINER_EXECUTOR_PATH =
897913
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>
@@ -1146,6 +1146,32 @@
11461146
<value>${hadoop.tmp.dir}/yarn-nm-recovery</value>
11471147
</property>
11481148

1149+
<!--Docker configuration-->
1150+
<property>
1151+
<name>yarn.nodemanager.docker-container-executor.image-name</name>
1152+
<value></value>
1153+
<description>
1154+
This image is used by all nodemanagers to launch containers.
1155+
This maybe modified by the users.
1156+
</description>
1157+
</property>
1158+
1159+
<property>
1160+
<name>yarn.nodemanager.docker-container-executor.run-args</name>
1161+
<value>--rm --net=host</value>
1162+
<description>
1163+
This arguments to pass to the 'docker run' invocation.
1164+
</description>
1165+
</property>
1166+
1167+
<property>
1168+
<name>yarn.nodemanager.docker-container-executor.exec-name</name>
1169+
<value>/usr/bin/docker</value>
1170+
<description>
1171+
Name or path to the Docker client.
1172+
</description>
1173+
</property>
1174+
11491175
<!--Map Reduce configuration-->
11501176
<property>
11511177
<name>yarn.nodemanager.aux-services.mapreduce_shuffle.class</name>

0 commit comments

Comments
 (0)