[ARVADOS] updated: 475c550e2ee1377b2f7b2ad9fcfdf392ecbd983b

git at public.curoverse.com git at public.curoverse.com
Wed Apr 23 18:35:36 EDT 2014


Summary of changes:
 .gitignore                                         |    3 +
 .../pipeline_instances/_show_components.html.erb   |    2 +-
 doc/api/methods/jobs.html.textile.liquid           |   19 ++--
 .../methods/virtual_machines.html.textile.liquid   |   33 ++++--
 doc/api/resources.html.textile.liquid              |    4 +-
 .../app/controllers/arvados/v1/users_controller.rb |    2 +-
 services/api/app/models/arvados_model.rb           |   19 +++-
 services/api/app/models/job.rb                     |    4 +
 services/api/app/models/pipeline_instance.rb       |  101 +++++++++++++++
 services/api/app/models/user.rb                    |    6 +-
 .../views/user_notifier/account_is_setup.text.erb  |   13 ++-
 services/api/config/environments/test.rb.example   |    3 +
 .../20140422011506_pipeline_instance_state.rb      |   87 +++++++++++++
 services/api/db/schema.rb                          |    8 +-
 services/api/lib/current_api_client.rb             |    8 +-
 services/api/test/fixtures/jobs.yml                |   21 +++-
 services/api/test/fixtures/pipeline_instances.yml  |    3 +
 .../arvados/v1/job_reuse_controller_test.rb        |   46 ++++----
 .../functional/arvados/v1/jobs_controller_test.rb  |   15 +++
 .../functional/arvados/v1/users_controller_test.rb |   32 +++++-
 services/api/test/test_helper.rb                   |   18 +++
 services/api/test/unit/application_test.rb         |   32 +++++
 services/api/test/unit/pipeline_instance_test.rb   |  129 +++++++++++++++++++-
 services/api/test/unit/user_test.rb                |   61 +++++++++-
 services/keep/build.sh                             |   36 ++++++
 services/keep/{ => src}/keep/keep.go               |    0
 services/keep/{ => src}/keep/keep_test.go          |    0
 27 files changed, 634 insertions(+), 71 deletions(-)
 create mode 100644 services/api/db/migrate/20140422011506_pipeline_instance_state.rb
 create mode 100644 services/api/test/fixtures/pipeline_instances.yml
 create mode 100644 services/api/test/unit/application_test.rb
 create mode 100755 services/keep/build.sh
 rename services/keep/{ => src}/keep/keep.go (100%)
 rename services/keep/{ => src}/keep/keep_test.go (100%)

       via  475c550e2ee1377b2f7b2ad9fcfdf392ecbd983b (commit)
       via  ad79a64bd1503e1e47d3849a00b894c4a6bc9810 (commit)
       via  22db59393203f550e0c77e65c650e664667492ab (commit)
       via  6a0ce3e88fc2122fe7749b6e4bc3eb01fb37b97c (commit)
       via  a955d5a89402d4b68ccec2d00c1ecf7d86334875 (commit)
       via  1059fd1f9e22ebcae51413d2b0fde0416c71c79b (commit)
       via  49aaa9f26dfaf50056abd7527976b681be26208b (commit)
       via  f03e21f7d50e34e7f7f7e7f570e8604fbd4d27da (commit)
       via  35295980b918232db8a8f3321e3bf02729e26c9f (commit)
       via  074147b4138f7a29ed9ff054b916ac1856b71e9f (commit)
       via  beef5fec7c77e3de84902969f877f1b4d5b89eef (commit)
       via  8072742e6557966b3e3d699e18fd3ee8656ed5b7 (commit)
       via  007a1e6edf9125990e286c71b00f51405470a4a6 (commit)
       via  c92d3fcdc2ab6bc3ec9bb03567de9203ff9b1f79 (commit)
       via  3aa0915d0b9b0affd9a784df3d138f0d13df303b (commit)
       via  5cb205c567c312345376bcd2b7104075b5710d7f (commit)
       via  a3c5fac3f7849cab38bedd313b522b994be17b15 (commit)
       via  8bd2381e50d3c575cef3bc0f0d4c10a9bafaf292 (commit)
       via  8d6efcbfb559e377a8f21873b736390035bc44ed (commit)
       via  309e25a64fe994867db8459543af372f850e25b9 (commit)
       via  afe657cad834e66867b11bef08a5e9a372f525a4 (commit)
      from  7cbc35ccbc4d78bb43c901e197a1746a325173c0 (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 475c550e2ee1377b2f7b2ad9fcfdf392ecbd983b
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 23 18:35:48 2014 -0400

    Improve examples, explanations, typography, tests

diff --git a/doc/api/methods/jobs.html.textile.liquid b/doc/api/methods/jobs.html.textile.liquid
index 60d5a9e..1d1451f 100644
--- a/doc/api/methods/jobs.html.textile.liquid
+++ b/doc/api/methods/jobs.html.textile.liquid
@@ -30,9 +30,10 @@ Arguments:
 
 table(table table-bordered table-condensed).
 |_. Argument |_. Type |_. Description |_. Location |_. Example |
-{background:#ccffcc}.|job|object|See "Job resource":{{site.baseurl}}/schema/Job.html|request body||
-|minimum_script_version |string     |Git branch, tag, or commit hash specifying the minimum acceptable script version (earliest ancestor) to consider when deciding whether to re-use a past job.|query|@c3e86c9@|
-|exclude_script_versions|array of strings|Git commit branches, tags, or hashes to exclude when deciding whether to re-use a past job.|query|@["8f03c71","8f03c71"]@|
+{background:#ccffcc}.|job|object|See "Job resource":{{site.baseurl}}/api/schema/Job.html|request body||
+|minimum_script_version |string     |Git branch, tag, or commit hash specifying the minimum acceptable script version (earliest ancestor) to consider when deciding whether to re-use a past job.|query|@"c3e86c9"@|
+|exclude_script_versions|array of strings|Git commit branches, tags, or hashes to exclude when deciding whether to re-use a past job.|query|@["8f03c71","8f03c71"]@
+@["badtag1","badtag2"]@|
 |find_or_create         |boolean    |Before creating, look for an existing job that has identical script, script_version, and script_parameters to those in the present job, has nondeterministic=false, and did not fail (it could be queued, running, or completed). If such a job exists, respond with the existing job instead of submitting a new one.|query|@false@|
 
 When a job is submitted to the queue using the **create** method, the 'script_version' field is updated to a full 40-character Git commit hash based on the current content of the specified repository. If 'script_version' cannot be resolved, the job submission is rejected.
@@ -43,16 +44,16 @@ Because Arvados records the exact version of the script, input parameters, and r
 
 notextile. <div class="spaced-out">
 
-# If 'find_or_create' is false or omitted, create a new job and skip the rest of these steps.
-# Find a list of acceptable values for 'script_version'.  If 'minimum_script_version' is specified, this is the set of all revisions in the Git commit graph between 'minimum_script_version' and 'script_version' (inclusive) [2].  If 'minimum_script_version' is not specified, only 'script_version' is added to the list.  If 'exclude_script_versions' is specified, the listed versions are excluded from the list.
-# Select jobs whose 'script' and 'script_parameters' attributes match the submitted job, and whose 'script_version' attribute is in the list of acceptable versions.  Exclude jobs that failed or set 'nondeterministic' to true.
-# If more than one of candidate jobs has finished, check that all such jobs actually did produce the same output.
-# If existing jobs exist and do not disagree with one another about the correct output, re-use one of the selected past jobs. If there is more than one match, which job will be returned is undefined.
+# If @find_or_create@ is false or omitted, create a new job and skip the rest of these steps.
+# Find a list of acceptable values for @script_version at .  If @minimum_script_version@ is specified, this is the set of all revisions in the Git commit graph between @minimum_script_version@ and the @script_version@ in the submitted "job object":{{site.baseurl}}/api/schema/Job.html (inclusive)[2].  If @minimum_script_version@ is not specified, only @script_version@ is added to the list.  If @exclude_script_versions@ is specified, the listed versions are excluded from the list.
+# Select jobs whose @script@ and @script_parameters@ attributes match those in the submitted "job object":{{site.baseurl}}/api/schema/Job.html, and whose @script_version@ attribute is in the list of acceptable versions.  Exclude jobs that failed or set @nondeterministic@ to true.
+# If more than one of the candidate jobs has finished, check that all such jobs actually did produce the same output.
+# If existing jobs exist and do not disagree with one another about the correct output, return one of the selected past jobs instead of creating a new job. If there is more than one match, which job will be returned is undefined.
 # If an existing job could not be chosen this way, create a new job.
 
 fn1. As of this writing, versioning the runtime environment is still under development.
 
-fn2. This may include parallel branches if there is more than one path between 'minimum_script_version' and 'script_version' in the Git commit graph.  Use 'exclude_script_versions' to blacklist specific versions.
+fn2. This may include parallel branches if there is more than one path between @minimum_script_version@ and the submitted job's @script_version@ in the Git commit graph.  Use @exclude_script_versions@ to blacklist specific commits.
 
 </div>
 
diff --git a/doc/api/methods/virtual_machines.html.textile.liquid b/doc/api/methods/virtual_machines.html.textile.liquid
index 0a7853c..390abdc 100644
--- a/doc/api/methods/virtual_machines.html.textile.liquid
+++ b/doc/api/methods/virtual_machines.html.textile.liquid
@@ -43,12 +43,35 @@ table(table table-bordered table-condensed).
 |_. Argument |_. Type |_. Description |_. Location |_. Example |
 {background:#ccffcc}.|uuid|string|The UUID of the VirtualMachine in question.|path||
 
+h2(#logins). logins
+
+Get a list of SSH keys and account names that should be able to log in to a given virtual machine.
+
+Arguments:
+
+table(table table-bordered table-condensed).
+|_. Argument |_. Type |_. Description |_. Location |_. Example |
+{background:#ccffcc}.|uuid|string||path||
+
+The response is a "resource list":{{site.baseurl}}/api/resources.html#resourceList with @kind@ set to @"arvados#HashList"@. Each item is a hash with the following keys:
+
+table(table table-bordered table-condensed).
+|_. Key|_. Value type|_. Description|_. Example|
+|username|string|Name of the Unix login account to which the user should be able to log in|@"jsmith"@|
+|hostname|string|Hostname of the virtual machine|@"shell.xyzzy.arvadosapi.com"@|
+|public_key|string|SSH public key|@"ssh-rsa AAAAB3NzaC1yc2E..."@|
+|user_uuid|string|UUID of the user who should be able to log in|@"xyzzy-tpzed-mv4d7dy7n91te11"@|
+|virtual_machine_uuid|string|UUID of the "VirtualMachine resource":{{site.baseurl}}/api/schema/VirtualMachine.html|@"xyzzy-2x53u-kvszmclnbjuv8xc"@|
+|authorized_key_uuid|string|UUID of the "AuthorizedKey resource":{{site.baseurl}}/api/schema/AuthorizedKey.html|@"xyzzy-fngyi-v9p0cyfmjxbio64"@|
+
 h2. get_all_logins
 
 Get a list, for every virtual machine in the system, of SSH keys and account names that should be able to log in.
 
 Arguments: none.
 
+The response has the same format as the response to the "logins method":#logins above.
+
 h2. list
 
 List virtual_machines.
@@ -61,16 +84,6 @@ table(table table-bordered table-condensed).
 |order|string|Order in which to return matching virtual_machines.|query||
 |filters|array|Conditions for filtering virtual_machines.|query||
 
-h2. logins
-
-Get a list of SSH keys and account names that should be able to log in to a given virtual machine.
-
-Arguments:
-
-table(table table-bordered table-condensed).
-|_. Argument |_. Type |_. Description |_. Location |_. Example |
-{background:#ccffcc}.|uuid|string||path||
-
 h2. update
 
 Update attributes of an existing VirtualMachine.
diff --git a/doc/api/resources.html.textile.liquid b/doc/api/resources.html.textile.liquid
index 0f800a5..a93b4ac 100644
--- a/doc/api/resources.html.textile.liquid
+++ b/doc/api/resources.html.textile.liquid
@@ -16,7 +16,7 @@ h2. Object IDs
 
 Object IDs are alphanumeric strings, unique across all installations (each installation has a unique prefix to prevent collisions).
 
-h2. Attributes of resources
+h2(#resource). Attributes of resources
 
 table(table table-bordered table-condensed).
 |*Attribute*|*Type*|*Description*|*Example*|
@@ -31,7 +31,7 @@ table(table table-bordered table-condensed).
 |modified_by_user_uuid|string|Authenticated user, on whose behalf the client was acting when modifying the resource|@mk2qn-tpzed-a4lcehql0dv2u25@|
 |modified_at|datetime|When resource was last modified|@2013-01-25T22:29:32Z@|
 
-h2. Attributes of resource lists
+h2(#resourceList). Attributes of resource lists
 
 table(table table-bordered table-condensed).
 |*Attribute*|*Type*|*Description*|*Example*|
diff --git a/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb b/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
index 1cd3f2d..bfecf54 100644
--- a/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/job_reuse_controller_test.rb
@@ -7,9 +7,12 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   # See git_setup.rb for the commit log for test.git.tar
   include GitSetup
 
-  test "reuse job with no_reuse=false" do
+  setup do
     @controller = Arvados::V1::JobsController.new
     authorize_with :active
+  end
+
+  test "reuse job with no_reuse=false" do
     post :create, job: {
       no_reuse: false,
       script: "hash",
@@ -28,8 +31,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "reuse job with find_or_create=true" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, {
       job: {
         script: "hash",
@@ -50,8 +51,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "do not reuse job because no_reuse=true" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, {
       job: {
         no_reuse: true,
@@ -72,8 +71,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "do not reuse job because find_or_create=false" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, {
       job: {
         script: "hash",
@@ -94,8 +91,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "test_cannot_reuse_job_no_output" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, job: {
       no_reuse: false,
       script: "hash",
@@ -113,8 +108,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "test_reuse_job_range" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, job: {
       no_reuse: false,
       script: "hash",
@@ -133,9 +126,25 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
     assert_equal '4fe459abe02d9b365932b8f5dc419439ab4e2577', new_job['script_version']
   end
 
+  test "cannot_reuse_job_no_minimum_given_so_must_use_specified_commit" do
+    post :create, job: {
+      no_reuse: false,
+      script: "hash",
+      script_version: "master",
+      repository: "foo",
+      script_parameters: {
+        input: 'fa7aeb5140e2848d39b416daeef4ffc5+45',
+        an_integer: '1'
+      }
+    }
+    assert_response :success
+    assert_not_nil assigns(:object)
+    new_job = JSON.parse(@response.body)
+    assert_not_equal 'zzzzz-8i9sb-cjs4pklxxjykqqq', new_job['uuid']
+    assert_equal '077ba2ad3ea24a929091a9e6ce545c93199b8e57', new_job['script_version']
+  end
+
   test "test_cannot_reuse_job_different_input" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, job: {
       no_reuse: false,
       script: "hash",
@@ -154,8 +163,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "test_cannot_reuse_job_different_version" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, job: {
       no_reuse: false,
       script: "hash",
@@ -174,8 +181,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "test_can_reuse_job_submitted_nondeterministic" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, job: {
       no_reuse: false,
       script: "hash",
@@ -195,8 +200,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "test_cannot_reuse_job_past_nondeterministic" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, job: {
       no_reuse: false,
       script: "hash2",
@@ -215,7 +218,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "test_cannot_reuse_job_no_permission" do
-    @controller = Arvados::V1::JobsController.new
     authorize_with :spectator
     post :create, job: {
       no_reuse: false,
@@ -235,8 +237,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "test_cannot_reuse_job_excluded" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, job: {
       no_reuse: false,
       script: "hash",
@@ -257,8 +257,6 @@ class Arvados::V1::JobReuseControllerTest < ActionController::TestCase
   end
 
   test "cannot reuse job with find_or_create but excluded version" do
-    @controller = Arvados::V1::JobsController.new
-    authorize_with :active
     post :create, {
       job: {
         script: "hash",

commit ad79a64bd1503e1e47d3849a00b894c4a6bc9810
Merge: 7cbc35c 22db593
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Apr 23 17:31:14 2014 -0400

    Merge branch 'master' into 2505-update-docs
    
    Conflicts:
    	.gitignore

diff --cc .gitignore
index 83eb73c,5a92ffe..2156fdf
--- a/.gitignore
+++ b/.gitignore
@@@ -8,6 -6,8 +8,9 @@@ doc/.sit
  doc/sdk/python/arvados
  sdk/perl/MYMETA.*
  sdk/perl/Makefile
 -sdk/perl/blib/*
 +sdk/perl/blib
  sdk/perl/pm_to_blib
 +*/vendor/bundle
+ services/keep/bin
+ services/keep/pkg
+ services/keep/src/github.com

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list