[ARVADOS] updated: f7a3e11f6017b329bb381f7ef10f9bae9dcece8f

git at public.curoverse.com git at public.curoverse.com
Tue May 27 10:36:41 EDT 2014


Summary of changes:
 sdk/cli/bin/arv-run-pipeline-instance  | 19 ++++++++++++++++++-
 services/api/script/crunch-dispatch.rb |  8 ++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

       via  f7a3e11f6017b329bb381f7ef10f9bae9dcece8f (commit)
      from  6abd2d88cce48e0c5f908ed584cd5f575a82de90 (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 f7a3e11f6017b329bb381f7ef10f9bae9dcece8f
Author: radhika <radhika at curoverse.com>
Date:   Tue May 27 10:35:03 2014 -0400

    2678: update a-r-p-i to set the owner_uuid on the newly created job when the pi belongs to a group. also, update crunch-dspatch to create the log lines with the group's owner_uuid.

diff --git a/sdk/cli/bin/arv-run-pipeline-instance b/sdk/cli/bin/arv-run-pipeline-instance
index e552d77..bf493cf 100755
--- a/sdk/cli/bin/arv-run-pipeline-instance
+++ b/sdk/cli/bin/arv-run-pipeline-instance
@@ -443,6 +443,21 @@ class WhRunPipelineInstance
     moretodo = true
     interrupted = false
 
+    # check if the pipeline os owned by a group
+    owner_uuid = nil
+    group_result = $client.execute(:api_method => $arvados.groups.get,
+                               :parameters => {
+                                 :uuid => @instance[:owner_uuid]
+                               },
+                               :authenticated => false,
+                               :headers => {
+                                 authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
+                               })
+    group = JSON.parse group_result.body, :symbolize_names => true
+    if group[:uuid]
+      owner_uuid = group[:uuid]
+    end
+
     while moretodo
       moretodo = false
       @components.each do |cname, c|
@@ -465,6 +480,7 @@ class WhRunPipelineInstance
             :repository => c[:repository],
             :nondeterministic => c[:nondeterministic],
             :output_is_persistent => c[:output_is_persistent] || false,
+            :owner_uuid => owner_uuid,
             # TODO: Delete the following three attributes when
             # supporting pre-20140418 API servers is no longer
             # important. New API servers take these as flags that
@@ -537,7 +553,8 @@ class WhRunPipelineInstance
                     tail_kind: 'arvados#user',
                     tail_uuid: @my_user_uuid,
                     head_kind: 'arvados#collection',
-                    head_uuid: wanted
+                    head_uuid: wanted,
+                    owner_uuid: owner_uuid
                   }
                   debuglog "added link, uuid #{newlink[:uuid]}"
                 end
diff --git a/services/api/script/crunch-dispatch.rb b/services/api/script/crunch-dispatch.rb
index ad406ef..3b29f10 100755
--- a/services/api/script/crunch-dispatch.rb
+++ b/services/api/script/crunch-dispatch.rb
@@ -392,9 +392,17 @@ class Dispatcher
   # send message to log table. we want these records to be transient
   def write_log running_job
     begin
+      owner_uuid = nil
+      begin
+        Group.find_by_uuid(running_job[:job].owner_uuid)
+        owner_uuid = running_job[:job].owner_uuid
+      rescue
+      end
+
       if (running_job && running_job[:stderr_buf] != '')
         log = Log.new(object_uuid: running_job[:job].uuid,
                       event_type: 'stderr',
+                      owner_uuid: owner_uuid,
                       properties: {"text" => running_job[:stderr_buf]})
         log.save!
         running_job[:stderr_buf] = ''

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list