Skip to content

Commit

Permalink
add mount tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane Kumpf committed Nov 19, 2017
1 parent 6dbacb9 commit f1137a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion roles/common/files/test-dshell-docker-yarn-mounts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source env.sh
export DSHELL_JAR=./share/hadoop/yarn/hadoop-yarn-applications-distributedshell-*.jar

yarn jar $DSHELL_JAR -shell_env YARN_CONTAINER_RUNTIME_TYPE=docker -shell_env YARN_CONTAINER_RUNTIME_DOCKER_IMAGE=centos -shell_env YARN_CONTAINER_RUNTIME_DOCKER_MOUNTS='/tmp:/newtmp:rw,/etc/passwd:/tmp/passwd:ro' -shell_command "sleep 60" -jar $DSHELL_JAR -num_containers 1
yarn jar $DSHELL_JAR -shell_env YARN_CONTAINER_RUNTIME_TYPE=docker -shell_env YARN_CONTAINER_RUNTIME_DOCKER_IMAGE=centos -shell_env YARN_CONTAINER_RUNTIME_DOCKER_MOUNTS='/tmp/readwrite:/newtmp:rw,/tmp/readonly:/tmp/readonly:ro' -shell_command "sleep 60" -jar $DSHELL_JAR -num_containers 1
4 changes: 2 additions & 2 deletions roles/common/templates/container-executor.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ feature.tc.enabled=1
docker.allowed.capabilities=CHOWN,DAC_OVERRIDE,FSETID,FOWNER,MKNOD,NET_RAW,SETGID,SETUID,SETFCAP,SETPCAP,NET_BIND_SERVICE,SYS_CHROOT,KILL,AUDIT_WRITE,DAC_READ_SEARCH,SYS_PTRACE,SYS_ADMIN
docker.allowed.devices=
docker.allowed.networks=bridge,host,none
docker.allowed.ro-mounts=/sys/fs/cgroup
docker.allowed.rw-mounts={{ hadoop_install_dir }}/hadoop/logs/userlogs,{{ hadoop_install_dir }}/hadoop/tmp/yarn/nm-local-dir
docker.allowed.ro-mounts=/sys/fs/cgroup,/tmp/readonly
docker.allowed.rw-mounts={{ hadoop_install_dir }}/hadoop/logs/userlogs,{{ hadoop_install_dir }}/hadoop/tmp/yarn/nm-local-dir,/tmp/readwrite
docker.privileged-containers.enabled=1
7 changes: 7 additions & 0 deletions roles/common/templates/provision-hadoop.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,11 @@ for cgroup in $(mount | grep ^cgroup | awk '{print $3}'); do
mkdir -p ${cgroup}/${CGROUP_HIERARCHY}
chown -R ${CE_GROUP}:${CE_GROUP} ${cgroup}/${CGROUP_HIERARCHY}
done

echo "Create directories for bind mount tests"
mkdir -p /tmp/readwrite
chown nobody:nobody /tmp/readwrite
mkdir -p /tmp/readonly
chown nobody:nobody /tmp/readonly

{% endraw %}

0 comments on commit f1137a5

Please sign in to comment.