Don't use "arv" command wrapper, call arv-get/arv-put directly. Avoids
[arvados.git] / sdk / cli / bin / crunch-job
index ac3934049745423c9781a22c58ca15fb972e3037..ca2e8c49a5b66048c0918f8725a95c50f2365a86 100755 (executable)
@@ -96,15 +96,6 @@ $ENV{"CRUNCH_INSTALL"} = "$ENV{CRUNCH_TMP}/opt";
 $ENV{"CRUNCH_WORK"} = $ENV{"JOB_WORK"}; # deprecated
 mkdir ($ENV{"JOB_WORK"});
 
-my $arv_cli;
-
-if (defined $ENV{"ARV_CLI"}) {
-  $arv_cli = $ENV{"ARV_CLI"};
-}
-else {
-  $arv_cli = 'arv';
-}
-
 my $force_unlock;
 my $git_dir;
 my $jobspec;
@@ -678,6 +669,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
           }
         }
       }
+      $command .= "--env=\QCRUNCH_NODE_SLOTS=$ENV{CRUNCH_NODE_SLOTS}\E ";
       $command .= "\Q$docker_hash\E ";
       $command .= "stdbuf --output=0 --error=0 ";
       $command .= "/tmp/crunch-src/crunch_scripts/" . $Job->{"script"};
@@ -840,7 +832,7 @@ if ($job_has_uuid) {
 if ($collated_output)
 {
   eval {
-    open(my $orig_manifest, '-|', 'arv', 'keep', 'get', $collated_output)
+    open(my $orig_manifest, '-|', 'arv-get', $collated_output)
         or die "failed to get collated manifest: $!";
     # Read the original manifest, and strip permission hints from it,
     # so we can put the result in a Collection.
@@ -1178,7 +1170,7 @@ sub fetch_block
   my $hash = shift;
   my ($keep, $child_out, $output_block);
 
-  my $cmd = "$arv_cli keep get \Q$hash\E";
+  my $cmd = "arv-get \Q$hash\E";
   open($keep, '-|', $cmd) or die "fetch_block: $cmd: $!";
   sysread($keep, $output_block, 64 * 1024 * 1024);
   close $keep;
@@ -1190,7 +1182,7 @@ sub collate_output
   Log (undef, "collate");
 
   my ($child_out, $child_in);
-  my $pid = open2($child_out, $child_in, $arv_cli, 'keep', 'put', '--raw');
+  my $pid = open2($child_out, $child_in, 'arv-put', '--raw');
   my $joboutput;
   for (@jobstep)
   {
@@ -1227,7 +1219,7 @@ sub collate_output
       sysread($child_out, $joboutput, 64 * 1024 * 1024);
       chomp($joboutput);
     } else {
-      Log (undef, "timed out reading from 'arv keep put'");
+      Log (undef, "timed out reading from 'arv-put'");
     }
   }
   waitpid($pid, 0);
@@ -1340,7 +1332,7 @@ sub save_meta
   return if $justcheckpoint;  # checkpointing is not relevant post-Warehouse.pm
 
   $local_logfile->flush;
-  my $cmd = "$arv_cli keep put --filename ''\Q$keep_logfile\E "
+  my $cmd = "arv-put --filename ''\Q$keep_logfile\E "
       . quotemeta($local_logfile->filename);
   my $loglocator = `$cmd`;
   die "system $cmd failed: $?" if $?;