Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Zhaoyu/read only code dir #1422

Merged
merged 5 commits into from
Sep 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ task_role_no={{{ idx }}}

printf "%s %s\n%s\n\n" "[INFO]" "ENV" "$(printenv | sort)"

mv /pai/code/* ./
cp -r /pai/code/* ./

function webhdfs_create_file()
{
Expand Down
7 changes: 5 additions & 2 deletions src/rest-server/src/templates/yarnContainerScript.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ function exit_handler()
local handler="Yarn container exit handler"
debug_log "$handler" "EXIT signal received in yarn container, performing clean up action..."

debug_log "$handler" "clean the container code"
rm -fr tmp/pai-root/code 2>/dev/null

debug_log "$handler" "trying to kill docker container $docker_name"
pid=$(docker inspect --format={{{ inspectFormat }}} $docker_name 2>/dev/null)
if [ $pid ]; then
Expand Down Expand Up @@ -258,8 +261,8 @@ docker run --name $docker_name \
--security-opt apparmor:unconfined \
--volume /tmp/pai-root/alive/$APP_ID:/alive \
--volume /tmp/pai-root/log/$APP_ID/$CONTAINER_ID:/pai/log \
--volume $container_local_dir/$bootstrap_dir:/pai/bootstrap:rw \
--volume $container_local_dir/$code_dir:/pai/code:rw \
--volume $container_local_dir/$bootstrap_dir:/pai/bootstrap:ro \
--volume $container_local_dir/$code_dir:/pai/code:ro \
--volume /var/drivers/nvidia/current:/usr/local/nvidia:ro \
--volume /etc/hadoop-configuration-for-jobs:/etc/hadoop:ro \
--label GPU_ID=$gpu_id \
Expand Down