[ARVADOS] created: dfa8eb5554bca6e0b593fa189a6e05ebad69ea52

git at public.curoverse.com git at public.curoverse.com
Mon Feb 17 12:39:14 EST 2014


        at  dfa8eb5554bca6e0b593fa189a6e05ebad69ea52 (commit)


commit dfa8eb5554bca6e0b593fa189a6e05ebad69ea52
Merge: 6462d38 7e41832
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Feb 17 09:30:35 2014 -0800

    Merge branch 'master' into 2199-crunch-virtualenv


commit 6462d38bbbd0b490b0c2416a3a6e1f6c08d4ee42
Author: Tom Clegg <tom at curoverse.com>
Date:   Mon Feb 17 09:26:52 2014 -0800

    Install Python SDK from repository (if present) into virtualenv for
    crunch job.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 97a4bbb..0fd8c94 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -84,6 +84,7 @@ unless (defined $ENV{"CRUNCH_TMP"}) {
   }
 }
 $ENV{"JOB_WORK"} = $ENV{"CRUNCH_TMP"} . "/work";
+$ENV{"CRUNCH_INSTALL"} = "$ENV{CRUNCH_TMP}/opt";
 $ENV{"CRUNCH_WORK"} = $ENV{"JOB_WORK"}; # deprecated
 mkdir ($ENV{"JOB_WORK"});
 
@@ -331,6 +332,16 @@ my $skip_install = ($local_job && $Job->{script_version} =~ m{^/});
 if ($skip_install)
 {
   $ENV{"CRUNCH_SRC"} = $Job->{script_version};
+  system("virtualenv", "$ENV{CRUNCH_TMP}/opt") == 0
+      or croak ("virtualenv $ENV{CRUNCH_TMP}/opt failed: exit ".($?>>8));
+  for my $src_path ("$ENV{CRUNCH_SRC}/arvados/sdk/python",
+                    "$ENV{CRUNCH_SRC}/sdk/python") {
+    if (-d $src_path) {
+      system ("cd $src_path && \$CRUNCH_TMP/opt/bin/python setup.py install")
+          == 0
+          or croak ("setup.py in $src_path failed: exit ".($?>>8));
+    }
+  }
 }
 else
 {
@@ -367,7 +378,6 @@ else
 
   $ENV{"CRUNCH_SRC_COMMIT"} = $Job->{script_version};
   $ENV{"CRUNCH_SRC"} = "$ENV{CRUNCH_TMP}/src";
-  $ENV{"CRUNCH_INSTALL"} = "$ENV{CRUNCH_TMP}/opt";
 
   my $commit;
   my $git_archive;
@@ -548,6 +558,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
     $ENV{"TASK_WORK"} = $ENV{"JOB_WORK"}."/".$slot[$childslot]->{cpu};
     $ENV{"TASK_TMPDIR"} = $ENV{"TASK_WORK"}; # deprecated
     $ENV{"CRUNCH_NODE_SLOTS"} = $slot[$childslot]->{node}->{ncpus};
+    $ENV{"PATH"} = $ENV{"CRUNCH_INSTALL"} . "/bin:" . $ENV{"PATH"};
 
     $ENV{"GZIP"} = "-n";
 
@@ -1371,6 +1382,14 @@ my $pwd;
 chomp ($pwd = `pwd`);
 my $install_dir = $ENV{"CRUNCH_INSTALL"} || "$pwd/opt";
 mkdir $install_dir;
+
+shell_or_die ("virtualenv", $install_dir);
+for my $src_path ("$destdir/arvados/sdk/python", "$destdir/sdk/python") {
+  if (-d $src_path) {
+    shell_or_die ("cd $src_path && $install_dir/bin/python setup.py install");
+  }
+}
+
 if (-e "$destdir/crunch_scripts/install") {
     shell_or_die ("$destdir/crunch_scripts/install", $install_dir);
 } elsif (!-e "./install.sh" && -e "./tests/autotests.sh") {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list