[ARVADOS] updated: 0eb77fba3f7de714a7edef1c57491f3c285f6d67

git at public.curoverse.com git at public.curoverse.com
Tue Jun 24 13:50:30 EDT 2014


Summary of changes:
 sdk/cli/bin/crunch-job | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

       via  0eb77fba3f7de714a7edef1c57491f3c285f6d67 (commit)
      from  a9a53c64110796f0ddc97f384b8787f93e8a125b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 0eb77fba3f7de714a7edef1c57491f3c285f6d67
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Tue Jun 24 13:50:23 2014 -0400

    Make task working directory world writable, to deal with uid mapping problems
    where the uid of the crunch-job user doesn't match uid the docker image user.
    CRUNCH_SRC, TASK_WORK, TASK_KEEPMOUNT and are now always bound to
    /tmp/crunch-src, /tmp/crunch-job, /mnt respectively when running inside a
    docker image.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 6224a64..05185ca 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -639,7 +639,9 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
     my $command =
 	"if [ -e $ENV{TASK_WORK} ]; then rm -rf $ENV{TASK_WORK}; fi; "
         ."mkdir -p $ENV{JOB_WORK} $ENV{CRUNCH_TMP} $ENV{TASK_WORK} $ENV{TASK_KEEPMOUNT} "
+        ."&& chmod og+wrx $ENV{TASK_WORK}"
 	."&& cd $ENV{CRUNCH_TMP} ";
+    umask(077);
     if ($build_script)
     {
       $build_script_to_send = $build_script;
@@ -657,14 +659,24 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
       $command .=
           q{$(ip -o address show scope global |
               gawk 'match($4, /^([0-9\.:]+)\//, x){print "--dns", x[1]}') };
-      foreach my $env_key (qw(CRUNCH_SRC CRUNCH_TMP TASK_KEEPMOUNT))
-      {
-        $command .= "-v \Q$ENV{$env_key}:$ENV{$env_key}:rw\E ";
-      }
+      $command .= "-v \Q$ENV{TASK_WORK}:/tmp/crunch-job:rw\E ";
+      $command .= "-v \Q$ENV{CRUNCH_SRC}:/tmp/crunch-src:ro\E ";
+      $command .= "-v \Q$ENV{TASK_KEEPMOUNT}:/mnt:ro\E ";
       while (my ($env_key, $env_val) = each %ENV)
       {
         if ($env_key =~ /^(ARVADOS|JOB|TASK)_/) {
-          $command .= "-e \Q$env_key=$env_val\E ";
+          if ($env_key eq "TASK_WORK") {
+            $command .= "-e \QTASK_WORK=/tmp/crunch-job\E ";
+          }
+          elsif ($env_key eq "TASK_KEEPMOUNT") {
+            $command .= "-e \QTASK_KEEPMOUNT=/mnt\E ";
+          }
+          elsif ($env_key eq "CRUNCH_SRC") {
+            $command .= "-e \QCRUNCH_SRC=/tmp/crunch-src\E ";
+          }
+          else {
+            $command .= "-e \Q$env_key=$env_val\E ";
+          }
         }
       }
       $command .= "\Q$docker_hash\E ";
@@ -672,7 +684,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
       $command .= "crunchstat -cgroup-root=/sys/fs/cgroup -poll=10000 "
     }
     $command .= "stdbuf -o0 -e0 ";
-    $command .= "$ENV{CRUNCH_SRC}/crunch_scripts/" . $Job->{"script"};
+    $command .= "/tmp/crunch-src/crunch_scripts/" . $Job->{"script"};
     my @execargs = ('bash', '-c', $command);
     srun (\@srunargs, \@execargs, undef, $build_script_to_send);
     exit (111);

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list