From c9648c5cfd2b683f1bc55405d6be9a7274a75c40 Mon Sep 17 00:00:00 2001 From: Fred Park Date: Thu, 6 Oct 2016 09:29:53 -0700 Subject: [PATCH] Fix GlusterFS mount ownership/permissions --- Dockerfile | 2 +- recipes/NAMD-GPU/README.md | 2 +- recipes/Torch-CPU/docker/run_mnist.sh | 2 +- recipes/Torch-GPU/docker/run_mnist.sh | 2 +- scripts/shipyard_glusterfs.sh | 5 +++++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f54755..dbda561 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN apk update \ && tar zxvpf libtorrent-${libtorrent_version}.tar.gz \ && cd libtorrent-rasterbar-${libtorrent_version} \ && ./configure --prefix=/usr --enable-debug=no --enable-python-binding --with-boost-system=boost_system \ - && make -j4 install \ + && make -j"$(nproc)" install \ && ldconfig /usr/lib \ && cd .. \ && rm -rf libtorrent-rasterbar-${libtorrent_version} \ diff --git a/recipes/NAMD-GPU/README.md b/recipes/NAMD-GPU/README.md index ac442d4..5705aa4 100644 --- a/recipes/NAMD-GPU/README.md +++ b/recipes/NAMD-GPU/README.md @@ -42,7 +42,7 @@ The jobs configuration should set the following properties within the `tasks` array which should have a task definition containing: * `image` should be the name of the Docker image for this container invocation, e.g., `alfpark/namd:2.11-cuda` -* `command` should contain the `mpirun` command. If using the sample NAMD-TCP +* `command` should contain the `mpirun` command. If using the sample NAMD-GPU image provided, `"/sw/run_namd.sh "` can be used to run the included benchmarks: * `` is the benchmark to run: `apoa1` or `stmv` diff --git a/recipes/Torch-CPU/docker/run_mnist.sh b/recipes/Torch-CPU/docker/run_mnist.sh index 2c0498a..7a6728b 100755 --- a/recipes/Torch-CPU/docker/run_mnist.sh +++ b/recipes/Torch-CPU/docker/run_mnist.sh @@ -15,4 +15,4 @@ curl -O $github_url/$dataset curl -O $github_url/$train # train -th $train -t "$(nproc)" +th $train -t "$(nproc)" $* diff --git a/recipes/Torch-GPU/docker/run_mnist.sh b/recipes/Torch-GPU/docker/run_mnist.sh index b6f8c39..aa03737 100755 --- a/recipes/Torch-GPU/docker/run_mnist.sh +++ b/recipes/Torch-GPU/docker/run_mnist.sh @@ -30,4 +30,4 @@ sed -i "/ local targets = torch.Tensor(opt.batchSize)/a \ targets = targets:cuda()\n" $train # train -th $train -t "$(nproc)" +th $train -t "$(nproc)" $* diff --git a/scripts/shipyard_glusterfs.sh b/scripts/shipyard_glusterfs.sh index e6929f7..92242af 100755 --- a/scripts/shipyard_glusterfs.sh +++ b/scripts/shipyard_glusterfs.sh @@ -41,6 +41,9 @@ if [ $AZ_BATCH_IS_CURRENT_NODE_MASTER == "true" ]; then # create volume echo "creating gv0 ($bricks)" gluster volume create gv0 replica $numnodes transport tcp$bricks + # modify volume properties + gluster volume set gv0 storage.owner-uid `id -u _azbatch` + gluster volume set gv0 storage.owner-gid `id -g _azbatch` # start volume echo "starting gv0" gluster volume start gv0 @@ -64,6 +67,7 @@ set -e # add gv0 to /etc/fstab for auto-mount on reboot mountpoint=$AZ_BATCH_NODE_SHARED_DIR/.gluster/gv0 mkdir -p $mountpoint +chmod 775 $mountpoint echo "adding $mountpoint to fstab" echo "$ipaddress:/gv0 $mountpoint glusterfs defaults,_netdev 0 0" >> /etc/fstab @@ -88,6 +92,7 @@ do fi done set -e +chmod 775 $mountpoint # touch file noting success touch .glusterfs_success