[ARVADOS] updated: dfda2d511b5581968c5fa456c78776ac453dedd9

Git user git at public.curoverse.com
Wed Sep 14 12:21:54 EDT 2016


Summary of changes:
 doc/_config.yml                                    |  6 ++
 .../_container_runtime_constraints.liquid          |  9 +++
 doc/_includes/_mount_types.liquid                  | 63 ++++++++++++++++++
 .../methods/container_requests.html.textile.liquid | 74 ++++++++++++++++++++++
 ...xtile.liquid => containers.html.textile.liquid} | 48 +++++++-------
 ...extile.liquid => workflows.html.textile.liquid} | 30 ++++-----
 doc/api/schema/Container.html.textile.liquid       | 59 +++++++++++++++++
 .../schema/ContainerRequest.html.textile.liquid    | 50 +++++++++++++++
 doc/api/schema/Workflow.html.textile.liquid        | 23 +++++++
 services/api/app/models/container_request.rb       |  2 +-
 services/api/test/unit/container_request_test.rb   | 11 +++-
 11 files changed, 332 insertions(+), 43 deletions(-)
 create mode 100644 doc/_includes/_container_runtime_constraints.liquid
 create mode 100644 doc/_includes/_mount_types.liquid
 create mode 100644 doc/api/methods/container_requests.html.textile.liquid
 copy doc/api/methods/{nodes.html.textile.liquid => containers.html.textile.liquid} (51%)
 copy doc/api/methods/{specimens.html.textile.liquid => workflows.html.textile.liquid} (59%)
 create mode 100644 doc/api/schema/Container.html.textile.liquid
 create mode 100644 doc/api/schema/ContainerRequest.html.textile.liquid
 create mode 100644 doc/api/schema/Workflow.html.textile.liquid

       via  dfda2d511b5581968c5fa456c78776ac453dedd9 (commit)
       via  849f35d1cafa1b58e55832426436689b95d69ac5 (commit)
       via  eb097927c63ac10900489b7728efcb639dd286b1 (commit)
       via  05428b719b804e68a17e07af0de00c0607d0be04 (commit)
       via  0b19ca02c8387ff1eda4ccafb9bd0fda7b79c3b1 (commit)
       via  39c12f4da6dcdbfa1a4232dc849d303692dfb401 (commit)
       via  adfe146695a6acebe65b7953db1e8a88dc53a6b4 (commit)
       via  4a46faf1f480ab6d40389be752f56bcda3581b2e (commit)
       via  e8db2a47dd834640eeafeb7fa6741d725c1fac9c (commit)
       via  882be2b6f0e2b45e282cf584cf14e5dccc4b5b9a (commit)
       via  f00a2304c3668e74c6ab53e27793166b02b709d2 (commit)
       via  769189c406bb42761f4d7bfe35fd2cc36edcef00 (commit)
      from  3c69428a8165f485140f1bbbbb899a308e289df2 (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 dfda2d511b5581968c5fa456c78776ac453dedd9
Merge: 3c69428 849f35d
Author: Lucas Di Pentima <lucas at curoverse.com>
Date:   Wed Sep 14 13:20:49 2016 -0300

    Merge branch 'master' into 9623-reuse-containers

diff --cc services/api/test/unit/container_request_test.rb
index d75472c,7b7eef4..e44084e
--- a/services/api/test/unit/container_request_test.rb
+++ b/services/api/test/unit/container_request_test.rb
@@@ -242,7 -242,9 +242,9 @@@ class ContainerRequestTest < ActiveSupp
      c = Container.find_by_uuid cr.container_uuid
      assert_equal 5, c.priority
  
-     cr2 = create_minimal_req!(priority: 10, state: "Committed", requesting_container_uuid: c.uuid, command: ["echo", "foo2"])
+     cr2 = create_minimal_req!
 -    cr2.update_attributes!(priority: 10, state: "Committed", requesting_container_uuid: c.uuid)
++    cr2.update_attributes!(priority: 10, state: "Committed", requesting_container_uuid: c.uuid, command: ["echo", "foo2"])
+     cr2.reload
  
      c2 = Container.find_by_uuid cr2.container_uuid
      assert_equal 10, c2.priority
@@@ -396,31 -398,10 +398,38 @@@
      assert_empty Container.readable_by(users(:spectator)).where(uuid: containers(:running).uuid)
    end
  
 +  [
 +    [{"var" => "value1"}, {"var" => "value1"}],
 +    [{"var" => "value1"}, {"var" => "value2"}]
 +  ].each do |env1, env2|
 +    test "Container request #{(env1 == env2) ? 'does' : 'does not'} reuse container when committed" do
 +      common_attrs = {cwd: "test",
 +                      priority: 1,
 +                      command: ["echo", "hello"],
 +                      output_path: "test",
 +                      runtime_constraints: {"vcpus" => 4,
 +                                            "ram" => 12000000000},
 +                      mounts: {"test" => {"kind" => "json"}}}
 +      set_user_from_auth :active
 +      cr1 = create_minimal_req!(common_attrs.merge({state: ContainerRequest::Committed,
 +                                                    environment: env1}))
 +      cr2 = create_minimal_req!(common_attrs.merge({state: ContainerRequest::Uncommitted,
 +                                                    environment: env2}))
 +      assert_not_nil cr1.container_uuid
 +      assert_nil cr2.container_uuid
 +
 +      # Update cr2 to commited state and check for container equality on both cases,
 +      # when env1 and env2 are equal the same container should be assigned, and
 +      # when env1 and env2 are different, cr2 container should be different.
 +      cr2.update_attributes!({state: ContainerRequest::Committed})
 +      assert_equal (env1 == env2), (cr1.container_uuid == cr2.container_uuid)
 +    end
 +  end
++
+   test "requesting_container_uuid at create is not allowed" do
+     set_user_from_auth :active
+     assert_raises(ActiveRecord::RecordNotSaved) do
+       create_minimal_req!(state: "Uncommitted", priority: 1, requesting_container_uuid: 'youcantdothat')
+     end
+   end
  end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list