[ARVADOS] created: 6cd7a831d12be568d8e7e32b0860d494245bdb2f

git at public.curoverse.com git at public.curoverse.com
Mon Jun 30 14:50:20 EDT 2014


        at  6cd7a831d12be568d8e7e32b0860d494245bdb2f (commit)


commit 6cd7a831d12be568d8e7e32b0860d494245bdb2f
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Jun 30 14:50:15 2014 -0400

    Set $HOME to $TASK_WORK for tasks.  no issue #

diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job
index 219c315..befc0b6 100755
--- a/sdk/cli/bin/crunch-job
+++ b/sdk/cli/bin/crunch-job
@@ -622,6 +622,7 @@ for (my $todo_ptr = 0; $todo_ptr <= $#jobstep_todo; $todo_ptr ++)
     $ENV{"TASK_SLOT_NODE"} = $slot[$childslot]->{node}->{name};
     $ENV{"TASK_SLOT_NUMBER"} = $slot[$childslot]->{cpu};
     $ENV{"TASK_WORK"} = $ENV{"JOB_WORK"}."/$id.$$";
+    $ENV{"HOME"} = $ENV{"TASK_WORK"};
     $ENV{"TASK_KEEPMOUNT"} = $ENV{"TASK_WORK"}.".keep";
     $ENV{"TASK_TMPDIR"} = $ENV{"TASK_WORK"}; # deprecated
     $ENV{"CRUNCH_NODE_SLOTS"} = $slot[$childslot]->{node}->{ncpus};

commit 55e1aaff28b93822c0ee149b8c2c53d2a5d87dfc
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Jun 30 14:48:48 2014 -0400

    Fix 'arv' to handle missing/non-writable $HOME.  no issue #

diff --git a/sdk/cli/bin/arv b/sdk/cli/bin/arv
index 0d9051c..e84150a 100755
--- a/sdk/cli/bin/arv
+++ b/sdk/cli/bin/arv
@@ -56,14 +56,20 @@ class Google::APIClient
    return @discovery_documents["#{api}:#{version}"] ||=
      begin
        # fetch new API discovery doc if stale
-       cached_doc = File.expand_path '~/.cache/arvados/discovery_uri.json'
-       if not File.exist?(cached_doc) or (Time.now - File.mtime(cached_doc)) > 86400
+       cached_doc = File.expand_path '~/.cache/arvados/discovery_uri.json' rescue nil
+
+       if cached_doc.nil? or not File.exist?(cached_doc) or (Time.now - File.mtime(cached_doc)) > 86400
          response = self.execute!(:http_method => :get,
                                   :uri => self.discovery_uri(api, version),
                                   :authenticated => false)
-         FileUtils.makedirs(File.dirname cached_doc)
-         File.open(cached_doc, 'w') do |f|
-           f.puts response.body
+
+         begin
+           FileUtils.makedirs(File.dirname cached_doc)
+           File.open(cached_doc, 'w') do |f|
+             f.puts response.body
+           end
+         rescue
+           return JSON.load response.body
          end
        end
 
@@ -85,8 +91,8 @@ end
 def init_config
   # read authentication data from arvados configuration file if present
   lineno = 0
-  config_file = File.expand_path('~/.config/arvados/settings.conf')
-  if File.exist? config_file then
+  config_file = File.expand_path('~/.config/arvados/settings.conf') rescue nil
+  if not config_file.nil? and File.exist? config_file then
     File.open(config_file, 'r').each do |line|
       lineno = lineno + 1
       # skip comments

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list