[ARVADOS] updated: 155b1aa3772eb2d9421c5bfc678320401eb3b058

git at public.curoverse.com git at public.curoverse.com
Wed Nov 18 18:00:30 EST 2015


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

       via  155b1aa3772eb2d9421c5bfc678320401eb3b058 (commit)
       via  1d6bcbbdbc374aa25b70c85717f987d2675c1205 (commit)
       via  04784067f7f39e15161cc165365aa2d0552dc219 (commit)
      from  58692c916bb6dfe2997838ca4147109d9410c86a (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 155b1aa3772eb2d9421c5bfc678320401eb3b058
Merge: 58692c9 1d6bcbb
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Nov 18 18:00:27 2015 -0500

    Merge branch '6923-crunch-no-dpkg-query-wip'
    
    Closes #6923, #7740.


commit 1d6bcbbdbc374aa25b70c85717f987d2675c1205
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Nov 18 15:30:09 2015 -0500

    6923: crunch-job logs PySDK version when minimally bootstrapped.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index a7f0602..a545cfd 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -965,7 +965,10 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
         $command .= $stdbuf;
         $command .= "perl - \Q$ENV{CRUNCH_SRC}/crunch_scripts/$Job->{script}\E";
       } else {
-        $command .= "/bin/sh -c \'mkdir -p \"$ENV{JOB_WORK}\" \"$ENV{TASK_WORK}\" && " .
+        $command .= "/bin/sh -c \'python -c " .
+            '"from pkg_resources import get_distribution as get; print \"Using Arvados SDK version\", get(\"arvados-python-client\").version"' .
+            ">&2 2>/dev/null; " .
+            "mkdir -p \"$ENV{JOB_WORK}\" \"$ENV{TASK_WORK}\" && " .
             "if which stdbuf >/dev/null ; then " .
             "  exec $stdbuf \Q$ENV{CRUNCH_SRC}/crunch_scripts/$Job->{script}\E ;" .
             " else " .

commit 04784067f7f39e15161cc165365aa2d0552dc219
Author: Brett Smith <brett at curoverse.com>
Date:   Mon Nov 9 10:13:21 2015 -0500

    6923: Improve Arvados SDK version logging in Crunch run script.
    
    * Use a mechanism that works in a wider variety of containers.  This
      only depends on Python itself and setuptools.  It won't generate
      spurious warnings by calling dpkg-query on Red Hat containers.
    * Don't log the version when we successfully set up the specified
      arvados_sdk_version.  The version will only be '0.1' in this case,
      and that's not helpful.

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 28da66d..a7f0602 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -2169,10 +2169,11 @@ if (@ARGV) {
     $Log->("Built Python SDK virtualenv");
   }
 
-  my $pip_bin = "pip";
+  my @pysdk_version_cmd = ("python", "-c",
+    "from pkg_resources import get_distribution as get; print get('arvados-python-client').version");
   if ($venv_built) {
     $Log->("Running in Python SDK virtualenv");
-    $pip_bin = "$venv_dir/bin/pip";
+    @pysdk_version_cmd = ();
     my $orig_argv = join(" ", map { quotemeta($_); } @ARGV);
     @ARGV = ("/bin/sh", "-ec",
              ". \Q$venv_dir/bin/activate\E; exec $orig_argv");
@@ -2181,14 +2182,18 @@ if (@ARGV) {
            "\$PATH. Can't install Python SDK.");
   }
 
-  my $pkgs = `(\Q$pip_bin\E freeze 2>/dev/null | grep arvados) || dpkg-query --show '*arvados*'`;
-  if ($pkgs) {
-    $Log->("Using Arvados SDK:");
-    foreach my $line (split /\n/, $pkgs) {
-      $Log->($line);
+  if (@pysdk_version_cmd) {
+    open(my $pysdk_version_pipe, "-|", @pysdk_version_cmd);
+    my $pysdk_version = <$pysdk_version_pipe>;
+    close($pysdk_version_pipe);
+    if ($? == 0) {
+      chomp($pysdk_version);
+      $Log->("Using Arvados SDK version $pysdk_version");
+    } else {
+      # A lot could've gone wrong here, but pretty much all of it means that
+      # Python won't be able to load the Arvados SDK.
+      $Log->("Warning: Arvados SDK not found");
     }
-  } else {
-    $Log->("Arvados SDK packages not found");
   }
 
   while (my ($sdk_dir, $sdk_envkey) = each(%SDK_ENVVARS)) {

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list