[ARVADOS] updated: c0deafee7a8c1938af6592b488a46fca2f0c1688

git at public.curoverse.com git at public.curoverse.com
Wed Apr 16 21:50:01 EDT 2014


Summary of changes:
 apps/workbench/app/assets/javascripts/selection.js |   10 +-
 .../app/controllers/collections_controller.rb      |    1 +
 .../controllers/pipeline_instances_controller.rb   |   11 -
 apps/workbench/app/helpers/application_helper.rb   |   39 +++-
 apps/workbench/app/models/arvados_base.rb          |    8 +-
 .../views/application/_selection_checkbox.html.erb |   19 ++-
 .../app/views/collections/_index_tbody.html.erb    |    8 +-
 .../app/views/collections/_show_files.html.erb     |    5 +-
 .../app/views/layouts/application.html.erb         |    2 +-
 apps/workbench/test/integration/users_test.rb      |    2 +-
 doc/_config.yml                                    |    3 +-
 doc/api/methods/jobs.html.textile.liquid           |   94 ++++++++-
 doc/api/schema/Job.html.textile.liquid             |   17 +--
 .../schema/PipelineTemplate.html.textile.liquid    |  127 +++++++++++-
 .../job-and-pipeline-reference.html.textile.liquid |  223 --------------------
 .../tutorial-firstscript.html.textile.liquid       |    2 +
 .../tutorial-new-pipeline.html.textile.liquid      |    2 +
 sdk/cli/bin/crunch-job                             |   15 +-
 .../app/controllers/arvados/v1/jobs_controller.rb  |    6 +-
 .../app/controllers/arvados/v1/links_controller.rb |   16 +-
 services/api/app/models/pipeline_instance.rb       |    3 +-
 .../functional/arvados/v1/links_controller_test.rb |   30 +++
 .../v1/pipeline_instances_controller_test.rb       |   24 ++
 services/keep/keep.go                              |  189 ++++++++++++++++-
 services/keep/keep_test.go                         |   76 +++++++-
 25 files changed, 622 insertions(+), 310 deletions(-)
 delete mode 100644 doc/user/reference/job-and-pipeline-reference.html.textile.liquid

       via  c0deafee7a8c1938af6592b488a46fca2f0c1688 (commit)
       via  86b78741c1d70ae5551a68dbee0cb51a5749edaf (commit)
       via  d0fce657daf5b12744538f8364faf7c6d352f280 (commit)
       via  2340ebeaf34778645e6071e8b077df50e5ae3df5 (commit)
       via  1881da329b33f722e35bef267c616a784163e482 (commit)
       via  fe046f1313fe9a0d56d4a000347b64f8686b7b48 (commit)
       via  2f91702d89b7a64093465a1923b87acade6b9715 (commit)
       via  89fcf2b60968558a6994ee14c202bc2c76f1d8fe (commit)
       via  8048da32800fab790b68f502c52dd00c89b5b690 (commit)
       via  51c1390ce92353a4fcf1adfe3643729eff5d6a8a (commit)
       via  dc51a3a6a2915d66f1b8f82580637b5733bb49f5 (commit)
       via  ea7c6effed14cd80a444c6e4d5b89c8b99c17d59 (commit)
       via  340bd4f69f320d541b6c352953ca9ac2336da470 (commit)
       via  b346f8754f5d4840ad80aa97bd910f3a6844b413 (commit)
       via  e6815764c940968ed825e8b2e4d984824a68fd23 (commit)
       via  52b3716d78c410806e8aaea89994b39015694258 (commit)
       via  d9f6071c52c33831be88546475480920fe7e1a60 (commit)
       via  ad2984e6eaf029ba7b6e35ae875bb78cfb76dfb6 (commit)
       via  d66cd99b144e949dc7128e7299689ca567a761c8 (commit)
       via  9067fd12d2c4259a2988286663098c59af18c854 (commit)
       via  8e69317214ad56a6255f56725fa3b966c663eda3 (commit)
       via  2a73947440a58ce3a63adac1b903421ea911c5cf (commit)
       via  6c76e5ce6520a465ff741e4510eafc757738e9ba (commit)
       via  dcea5126ac48ecb3916bc8c245d59b1ca4439677 (commit)
       via  ea6dd70f3178eb38afa4eda7ce49e1bfe8328c40 (commit)
       via  4f4f0f57721d854aaddec8ab7dbc8759075717b5 (commit)
       via  b7d408dfa43a15c6b97e35a72a54b23e8880d8c9 (commit)
       via  df05c261c2b3b3a20f77dcaf8d481a5a113e67e8 (commit)
       via  a27dd6c9ab51311af2fbe194a7e5e0b592b78e79 (commit)
       via  75df7deca434d9b3b161dc2d7d13ae21b1fe4b08 (commit)
       via  17c335f710c5f855f61c13fe69594d7ec439b007 (commit)
       via  c4b51836d29d37cb75c6432ce056d844cf27c3ac (commit)
       via  3c554a995e2b4f716106876ffbd311e87cce4091 (commit)
       via  0a09da628d4d7f1ced2daaa55603bea940b9211c (commit)
       via  c7b155c06452315396ec98f42cf5b502be38b221 (commit)
      from  eb7227693e8847a65798afa7f7e8a4ffe8a199a4 (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 c0deafee7a8c1938af6592b488a46fca2f0c1688
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 16 21:48:47 2014 -0400

    Fix errant use of symbol vs. string

diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index f9f4e1c..1cf0d1f 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -138,7 +138,7 @@ class ArvadosBase < ActiveRecord::Base
     # attributes can be modified during "save" -- we should update our copies
     resp.keys.each do |attr|
       if self.respond_to? "#{attr}=".to_sym
-        self.send(attr + '=', resp[attr.to_sym])
+        self.send(attr.to_s + '=', resp[attr.to_sym])
       end
     end
 

commit 86b78741c1d70ae5551a68dbee0cb51a5749edaf
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 16 20:43:56 2014 -0400

    Fix unwarranted use of instance variable.

diff --git a/services/api/app/controllers/arvados/v1/jobs_controller.rb b/services/api/app/controllers/arvados/v1/jobs_controller.rb
index 336877b..360d89c 100644
--- a/services/api/app/controllers/arvados/v1/jobs_controller.rb
+++ b/services/api/app/controllers/arvados/v1/jobs_controller.rb
@@ -23,7 +23,7 @@ class Arvados::V1::JobsController < ApplicationController
       # Search for jobs whose script_version is in the list of commits
       # returned by find_commit_range
       @object = nil
-      @incomplete_job = nil
+      incomplete_job = nil
       Job.readable_by(current_user).where(script: resource_attrs[:script],
                                           script_version: r).
         each do |j|
@@ -32,7 +32,7 @@ class Arvados::V1::JobsController < ApplicationController
             j.script_parameters == resource_attrs[:script_parameters]
           if j.running
             # We'll use this if we don't find a job that has completed
-            @incomplete_job ||= j
+            incomplete_job ||= j
           else
             # Record the first job in the list
             if !@object
@@ -45,7 +45,7 @@ class Arvados::V1::JobsController < ApplicationController
             end
           end
         end
-        @object ||= @incomplete_job
+        @object ||= incomplete_job
         if @object
           return show
         end

commit d0fce657daf5b12744538f8364faf7c6d352f280
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 16 20:42:51 2014 -0400

    Merge back-to-back condition blocks with the same condition.

diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index b5d2be8..953b666 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -121,6 +121,8 @@ module ApplicationHelper
   def render_pipeline_component_attribute(object, attr, subattr, value_info, htmloptions={})
     datatype = nil
     required = true
+    attrvalue = value_info
+
     if value_info.is_a? Hash
       if value_info[:output_of]
         return raw("<span class='label label-default'>#{value_info[:output_of]}</span>")
@@ -134,10 +136,9 @@ module ApplicationHelper
       if value_info[:required] != nil
         required = value_info[:required]
       end
-    end
 
-    attrvalue = value_info
-    if value_info.is_a? Hash
+      # Pick a suitable attrvalue to show as the current value (i.e.,
+      # the one that would be used if we ran the pipeline right now).
       if value_info[:value]
         attrvalue = value_info[:value]
       elsif value_info[:default]

commit 2340ebeaf34778645e6071e8b077df50e5ae3df5
Merge: 1881da3 2f91702
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 16 20:38:28 2014 -0400

    Merge branch 'master' into 2596-refactor-pipeline-create
    
    Conflicts:
    	apps/workbench/app/helpers/application_helper.rb

diff --cc apps/workbench/app/helpers/application_helper.rb
index e25bb57,c3409bd..b5d2be8
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@@ -169,14 -192,19 +178,18 @@@ module ApplicationHelpe
      subattr.each do |a|
        dn += "[#{a}]"
      end
 -
 -    if attrvalue.is_a? String
 -      attrvalue = attrvalue.strip
 +    if value_info.is_a? Hash
 +      dn += '[value]'
      end
  
 +    items = []
+     attrtext = attrvalue
      if dataclass and dataclass.is_a? Class
 -      items = []
        if attrvalue and !attrvalue.empty?
-         items.append({name: attrvalue, uuid: attrvalue, type: dataclass.to_s})
+         Link.where(head_uuid: attrvalue, link_class: ["tag", "identifier"]).each do |tag|
+           attrtext += " [#{tag.name}]"
+         end
+         items.append({name: attrtext, uuid: attrvalue, type: dataclass.to_s})
        end
        #dataclass.where(uuid: attrvalue).each do |item|
        #  items.append({name: item.uuid, uuid: item.uuid, type: dataclass.to_s})

commit 1881da329b33f722e35bef267c616a784163e482
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 16 20:21:42 2014 -0400

    Remove bootstrap_components logic from Workbench, now that it happens
    automatically on the API server side.

diff --git a/apps/workbench/app/controllers/pipeline_instances_controller.rb b/apps/workbench/app/controllers/pipeline_instances_controller.rb
index 4853b0a..221ed87 100644
--- a/apps/workbench/app/controllers/pipeline_instances_controller.rb
+++ b/apps/workbench/app/controllers/pipeline_instances_controller.rb
@@ -50,17 +50,6 @@ class PipelineInstancesController < ApplicationController
     return provenance, pips
   end
 
-  def create
-    @object = PipelineInstance.new params[:pipeline_instance]
-    @object.save!
-    if !@object.components.andand.any? and @object.pipeline_template_uuid
-      template = PipelineTemplate.find(@object.pipeline_template_uuid)
-      @object.components = template.components.deep_dup
-      @object.save!
-    end
-    super
-  end
-
   def show
     @pipelines = [@object]
 
diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index fc96cf5..f9f4e1c 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -135,10 +135,8 @@ class ArvadosBase < ActiveRecord::Base
     @etag = resp[:etag]
     @kind = resp[:kind]
 
-    # these attrs can be modified by "save" -- we should update our copies
-    %w(uuid owner_uuid created_at updated_at
-       modified_at modified_by_user_uuid modified_by_client_uuid
-      ).each do |attr|
+    # attributes can be modified during "save" -- we should update our copies
+    resp.keys.each do |attr|
       if self.respond_to? "#{attr}=".to_sym
         self.send(attr + '=', resp[attr.to_sym])
       end

commit fe046f1313fe9a0d56d4a000347b64f8686b7b48
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 16 20:19:45 2014 -0400

    Fix, and tests for, PipelineInstance#bootstrap_components

diff --git a/services/api/app/models/pipeline_instance.rb b/services/api/app/models/pipeline_instance.rb
index ad96b77..b16769c 100644
--- a/services/api/app/models/pipeline_instance.rb
+++ b/services/api/app/models/pipeline_instance.rb
@@ -5,7 +5,6 @@ class PipelineInstance < ArvadosModel
   serialize :components, Hash
   serialize :properties, Hash
   belongs_to :pipeline_template, :foreign_key => :pipeline_template_uuid, :primary_key => :uuid
-  attr_accessor :pipeline_template
 
   before_validation :bootstrap_components
   before_validation :update_success
@@ -68,7 +67,7 @@ class PipelineInstance < ArvadosModel
   protected
   def bootstrap_components
     if pipeline_template and (!components or components.empty?)
-      self.components = pipeline_template.components
+      self.components = pipeline_template.components.deep_dup
     end
   end
 
diff --git a/services/api/test/functional/arvados/v1/pipeline_instances_controller_test.rb b/services/api/test/functional/arvados/v1/pipeline_instances_controller_test.rb
index d1e6156..63c47ff 100644
--- a/services/api/test/functional/arvados/v1/pipeline_instances_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/pipeline_instances_controller_test.rb
@@ -1,4 +1,28 @@
 require 'test_helper'
 
 class Arvados::V1::PipelineInstancesControllerTest < ActionController::TestCase
+
+  test 'create pipeline with components copied from template' do
+    authorize_with :active
+    post :create, {
+      pipeline_instance: {
+        pipeline_template_uuid: pipeline_templates(:two_part).uuid
+      }
+    }
+    assert_response :success
+    assert_equal(pipeline_templates(:two_part).components.to_json,
+                 assigns(:object).components.to_json)
+  end
+
+  test 'create pipeline with no template' do
+    authorize_with :active
+    post :create, {
+      pipeline_instance: {
+        components: {}
+      }
+    }
+    assert_response :success
+    assert_equal({}, assigns(:object).components)
+  end
+
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list