[ARVADOS] updated: c5a633744aa99fb7c55f96ad69fd47a1c14d171c

Git user git at public.curoverse.com
Thu Jun 2 15:04:47 EDT 2016


Summary of changes:
 apps/workbench/app/models/container_work_unit.rb  | 25 +++++++++++++++
 apps/workbench/test/unit/work_unit_test.rb        |  1 +
 services/api/test/fixtures/container_requests.yml | 37 +++++++++++++++++++++++
 services/api/test/fixtures/containers.yml         | 32 ++++++++++++++++++++
 4 files changed, 95 insertions(+)

       via  c5a633744aa99fb7c55f96ad69fd47a1c14d171c (commit)
      from  cab53a136beb1c38d9c35a6a4b1e3d664f043e8d (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 c5a633744aa99fb7c55f96ad69fd47a1c14d171c
Author: radhika <radhika at curoverse.com>
Date:   Thu Jun 2 15:04:18 2016 -0400

    8650: add children to container_work_unit

diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index b513489..301e6b6 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -1,4 +1,25 @@
 class ContainerWorkUnit < ProxyWorkUnit
+  def children
+    return self.my_children if self.my_children
+
+    items = []
+
+    crs = {}
+    reqs = ContainerRequest.where(requesting_container_uuid: uuid).results
+    reqs.each { |cr| crs[cr.container_uuid] = cr.name }
+
+    containers = Container.where(uuid: crs.keys).results
+    containers.each do |c|
+      items << ContainerWorkUnit.new(c, crs[c.uuid])
+    end
+
+    self.my_children = items
+  end
+
+  def docker_image
+    get(:container_image)
+  end
+
   def uri
     uuid = get(:uuid)
     "/containers/#{uuid}"
@@ -7,4 +28,8 @@ class ContainerWorkUnit < ProxyWorkUnit
   def title
     "container"
   end
+
+  def can_cancel?
+    true
+  end
 end
diff --git a/apps/workbench/test/unit/work_unit_test.rb b/apps/workbench/test/unit/work_unit_test.rb
index a1de629..6d31b74 100644
--- a/apps/workbench/test/unit/work_unit_test.rb
+++ b/apps/workbench/test/unit/work_unit_test.rb
@@ -6,6 +6,7 @@ class WorkUnitTest < ActiveSupport::TestCase
     [PipelineInstance, 'pipeline_in_running_state', nil, 1, "Running", nil, 0.0],
     [PipelineInstance, 'has_component_with_completed_jobs', nil, 3, "Complete", true, 1.0],
     [PipelineInstance, 'pipeline_with_tagged_collection_input', "pwu", 1, "Ready", nil, 0.0],
+    [Container, 'requester', 'cwu', 3, "Complete", true, 1.0],
   ].each do |type, name, label, num_children, state, success, progress|
     test "children of #{name}" do
       use_token 'admin'
diff --git a/services/api/test/fixtures/container_requests.yml b/services/api/test/fixtures/container_requests.yml
index c9f3427..1e474bb 100644
--- a/services/api/test/fixtures/container_requests.yml
+++ b/services/api/test/fixtures/container_requests.yml
@@ -1,5 +1,7 @@
 queued:
+  uuid: zzzzz-xvhdp-cr4queuedcontnr
   owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: queued
   state: Committed
   priority: 1
   created_at: 2016-01-11 11:11:11.111111111 Z
@@ -11,3 +13,38 @@ queued:
   output_path: test
   command: ["echo", "hello"]
   container_uuid: zzzzz-dz642-queuedcontainer
+  requesting_container_uuid: zzzzz-dz642-requestingcntnr
+
+completed:
+  uuid: zzzzz-xvhdp-cr4completedctr
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: completed
+  state: Final
+  priority: 1
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  modified_at: 2016-01-11 11:11:11.111111111 Z
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-compltcontainer
+  requesting_container_uuid: zzzzz-dz642-requestingcntnr
+
+running:
+  uuid: zzzzz-xvhdp-cr4runningcntnr
+  owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  name: running
+  state: Committed
+  priority: 1
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  modified_at: 2016-01-11 11:11:11.111111111 Z
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-requestingcntnr
+  requesting_container_uuid: zzzzz-dz642-requestingcntnr
diff --git a/services/api/test/fixtures/containers.yml b/services/api/test/fixtures/containers.yml
index b804c80..4c8c8c1 100644
--- a/services/api/test/fixtures/containers.yml
+++ b/services/api/test/fixtures/containers.yml
@@ -29,3 +29,35 @@ completed:
   runtime_constraints:
     ram: 12000000000
     vcpus: 4
+
+running:
+  uuid: zzzzz-dz642-runningcontainr
+  owner_uuid: zzzzz-tpzed-000000000000000
+  state: Running
+  priority: 1
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  container_image: test
+  cwd: test
+  output: test
+  output_path: test
+  command: ["echo", "hello"]
+  runtime_constraints:
+    ram: 12000000000
+    vcpus: 4
+
+requester:
+  uuid: zzzzz-dz642-requestingcntnr
+  owner_uuid: zzzzz-tpzed-000000000000000
+  state: Complete
+  priority: 1
+  created_at: 2016-01-11 11:11:11.111111111 Z
+  updated_at: 2016-01-11 11:11:11.111111111 Z
+  container_image: test
+  cwd: test
+  output: test
+  output_path: test
+  command: ["echo", "hello"]
+  runtime_constraints:
+    ram: 12000000000
+    vcpus: 4

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list