Merge branch 'master' into 2221-complete-docker
authorTim Pierce <twp@curoverse.com>
Wed, 5 Mar 2014 20:01:25 +0000 (15:01 -0500)
committerTim Pierce <twp@curoverse.com>
Wed, 5 Mar 2014 20:01:25 +0000 (15:01 -0500)
29 files changed:
apps/admin/setup-new-user.rb
apps/workbench/app/views/users/_tables.html.erb
doc/Rakefile
doc/_config.yml
doc/_includes/_navbar_top.liquid
doc/_includes/_parallel_hash_script_py.liquid
doc/install/install-api-server.html.md.liquid
doc/install/install-crunch-dispatch.html.textile.liquid
doc/sdk/python/sdk-python.html.textile.liquid
doc/user/getting_started/check-environment.html.textile.liquid
doc/user/reference/api-tokens.html.textile.liquid
doc/user/reference/sdk-cli.html.textile.liquid
doc/user/tutorials/running-external-program.html.textile.liquid
doc/user/tutorials/tutorial-firstscript.html.textile.liquid
doc/user/tutorials/tutorial-gatk-variantfiltration.html.textile.liquid
doc/user/tutorials/tutorial-job-debug.html.textile.liquid
doc/user/tutorials/tutorial-job1.html.textile.liquid
doc/user/tutorials/tutorial-keep.html.textile.liquid
doc/user/tutorials/tutorial-new-pipeline.html.textile.liquid
doc/user/tutorials/tutorial-parallel.html.textile.liquid
doc/user/tutorials/tutorial-trait-search.html.textile.liquid
sdk/cli/bin/crunch-job
sdk/python/arvados/fuse.py
sdk/python/bin/arv-mount
sdk/ruby/Gemfile.lock
services/api/app/controllers/arvados/v1/jobs_controller.rb
services/api/test/integration/collections_api_test.rb
services/api/test/integration/jobs_api_test.rb [new file with mode: 0644]
services/api/test/test_helper.rb

index 09fd8a76d9ebfc88023c132dc17afa8dabab7031..ab5aa2edf31e031b4a88e65f4aaf85ba4c8537b0 100755 (executable)
@@ -86,14 +86,14 @@ rescue
 end
 log.info { "vm uuid: " + vm[:uuid] }
 
-# Look up the "all users" group (we expect uuid *-*-fffffffffffffff).
+# Look up the "All users" group (we expect uuid *-*-fffffffffffffff).
 group = arv.group.list(where: {name: 'All users'})[:items].select do |g|
   g[:uuid].match /-f+$/
 end.first
 if not group
-  abort "Could not look up the 'all users' group with uuid '*-*-fffffffffffffff'. Stop."
+  abort "Could not look up the 'All users' group with uuid '*-*-fffffffffffffff'. Stop."
 end
-log.info { "\"all users\" group uuid: " + group[:uuid] }
+log.info { "\"All users\" group uuid: " + group[:uuid] }
 
 # Look for signs the user has already been activated / set up.
 
index 09ca3ce1ba32af6f5a7193caded7f65aec75536d..320f32c5716f67a346eef72bd03dfd65478fc572 100644 (file)
 </div>
 
 <% else %>
-  <%= image_tag "dax.png", style: "max-width=40%" %>
+
+  <div class="row-fluid">
+    <div class="col-sm-4">
+      <%= image_tag "dax.png", style: "max-width:100%" %>
+    </div>
+    <div class="col-sm-8">
+      <h2>Welcome to Arvados, <%= current_user.first_name %>!</h2>
+      <div class="well">
+       <p>
+         Your account must be activated by an Arvados administrator.  If this
+         is your first time accessing Arvados and would like to request
+         access, or you believe you are seeing the page in error, please 
+         <%= link_to "contact us", Rails.configuration.activation_contact_link %>.  
+         You should receive an email at the address you used to log in when
+         your account is activated.  In the mean time, you can 
+         <%= link_to "learn more about Arvados", "https://arvados.org/projects/arvados/wiki/Introduction_to_Arvados" %>,
+         and <%= link_to "read the Arvados user guide", "http://doc.arvados.org/user" %>.
+       </p>
+       <p style="padding-bottom: 1em">
+         <%= link_to raw('Contact us &#x2709;'),
+             Rails.configuration.activation_contact_link, class: "pull-right btn btn-primary" %></p>
+      </div>
+    </div>
+  </div>
 <% end %>
 
 <% content_for :js do %>
index f2f3700c444637e617191ce2997097031ba12eda..a10d54cdee319411f83419fac5e731cb3eb26aec 100644 (file)
@@ -3,7 +3,7 @@
 require "rubygems"
 require "colorize"
 
-Rake.application.rake_require "zenweb/tasks"
+require "zenweb/tasks"
 load "zenweb-textile.rb"
 load "zenweb-liquid.rb"
 
index 3e40c589d54fa42310f1d687cf2a2d6aad193920..dbf638979ebdc2a0e785f1527c4e36fd0e699e51 100644 (file)
@@ -1,5 +1,12 @@
-exclude: ["Rakefile", "tmp", "vendor"]
+# baseurl is the location of the generated site from the browser's
+# perspective (e.g., http://doc.arvados.org or
+# file:///tmp/arvados/doc/.site). To make docs show up inside
+# workbench, use /doc here and add a symlink at
+# apps/workbench/public/doc pointing to ../../../doc/.site
+
 baseurl: /doc
+
+exclude: ["Rakefile", "tmp", "vendor"]
 arvados_api_host: qr1hi.arvadosapi.com
 
 navbar:
@@ -15,8 +22,8 @@ navbar:
       - user/tutorials/tutorial-job1.html.textile.liquid
       - user/tutorials/tutorial-firstscript.html.textile.liquid
       - user/tutorials/tutorial-job-debug.html.textile.liquid
-      - user/tutorials/tutorial-new-pipeline.html.textile.liquid
       - user/tutorials/tutorial-parallel.html.textile.liquid
+      - user/tutorials/tutorial-new-pipeline.html.textile.liquid
       - user/tutorials/tutorial-trait-search.html.textile.liquid
       - user/tutorials/tutorial-gatk-variantfiltration.html.textile.liquid
       - user/tutorials/running-external-program.html.textile.liquid
index 9303da2fd3dca022ac738ca976efc69f0be8eb4c..9123893c38b95ce10a493349924171530fa8e5aa 100644 (file)
     </div>
     <div class="collapse navbar-collapse" id="bs-navbar-collapse">
       <ul class="nav navbar-nav">
-        <li {% if page.navsection == 'userguide' %} class="active" {% endif %}><a href="{{ site.baseurl }}/user/">User&nbsp;Guide</a></li>
-        <li {% if page.navsection == 'sdk' %} class="active" {% endif %}><a href="{{ site.baseurl }}/sdk/">SDK&nbsp;Reference</a></li>
-        <li {% if page.navsection == 'api' %} class="active" {% endif %}><a href="{{ site.baseurl }}/api/">API&nbsp;Reference</a></li>
-        <li {% if page.navsection == 'adminguide' %} class="active" {% endif %}><a href="{{ site.baseurl }}/admin/">Admin Guide</a></li>
-        <li {% if page.navsection == 'installguide' %} class="active" {% endif %}><a href="{{ site.baseurl }}/install/">Install Guide</a></li>
+        <li {% if page.navsection == 'userguide' %} class="active" {% endif %}><a href="{{ site.baseurl }}/user/index.html">User&nbsp;Guide</a></li>
+        <li {% if page.navsection == 'sdk' %} class="active" {% endif %}><a href="{{ site.baseurl }}/sdk/index.html">SDK&nbsp;Reference</a></li>
+        <li {% if page.navsection == 'api' %} class="active" {% endif %}><a href="{{ site.baseurl }}/api/index.html">API&nbsp;Reference</a></li>
+        <li {% if page.navsection == 'adminguide' %} class="active" {% endif %}><a href="{{ site.baseurl }}/admin/index.html">Admin Guide</a></li>
+        <li {% if page.navsection == 'installguide' %} class="active" {% endif %}><a href="{{ site.baseurl }}/install/index.html">Install Guide</a></li>
         <li><a href="https://arvados.org/" style="padding-left: 2em">arvados.org&nbsp;&raquo;</a></li>
       </ul>
     </div>
index 8e39c0b543f54bd24e33092e86c77231f5f40d1e..a914e0482ae902644c2af11c74a2209e6f752084 100644 (file)
@@ -3,7 +3,7 @@
 import hashlib
 import arvados
 
-# Jobs consist of one of more tasks.  A task is a single invocation of
+# Jobs consist of one or more tasks.  A task is a single invocation of
 # a crunch script.
 
 # Get the current task
index f8d66dac5557f65d2746ce1ecb54c0a9c2ca567e..a16e50f94a97e07fb0ad4db70f0a88c29dc30e9c 100644 (file)
@@ -20,9 +20,13 @@ Please follow the instructions on the [Download page](https://arvados.org/projec
 
 ## Configure the API server
 
-First configure the database:
+First install the gems:
 
     cd arvados/services/api
+    bundle install
+
+Next, configure the database:
+
     cp config/database.yml.sample config/database.yml
 
 Edit database.yml to your liking and make sure the database and db user exist.
@@ -48,11 +52,9 @@ and put it in config/initializers/secret_token.rb:
 
     Server::Application.config.secret_token = 'your-new-secret-here'
 
-Finally, edit your
-
-    environments/production.rb
+Finally, edit the main configuration:
 
-file. 
+    cp config/environments/production.rb.example config/environments/production.rb
 
 First, you want to make sure that 
 
index f8cc14321cdb3f9763a287333e56497eb4d67230..4905b45dce0111932fb99d6810a7847f7e1f2821 100644 (file)
@@ -13,6 +13,14 @@ h4. Perl SDK dependencies
 
 * @apt-get install libjson-perl libwww-perl libio-socket-ssl-perl libipc-system-simple-perl@
 
+Add this to @/etc/apt/sources.list@
+
+@deb http://git.oxf.freelogy.org/apt wheezy main contrib@
+
+Then
+
+@apt-get install libwarehouse-perl@
+
 h4. Python SDK dependencies
 
 On controller and all compute nodes:
index 975d6000a78285a18b772fad4b0b32341bb870c9..911f03220691d8798accc811d0c8a26821c8ccbf 100644 (file)
@@ -41,7 +41,7 @@ $ <code class="userinput">sudo python setup.py install</code>
 
 h4. Test installation
 
-If the SDK is installed and your @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ environment variables are set up correctly (see "api-tokens":{{site.basedoc}}/user/reference/api-tokens.html for details), @import arvados@ should produce no errors:
+If the SDK is installed and your @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ environment variables are set up correctly (see "api-tokens":{{site.baseurl}}/user/reference/api-tokens.html for details), @import arvados@ should produce no errors:
 
 <notextile>
 <pre>$ <code class="userinput">python</code>
index 559133dc4a54028a0fc1e7248882f396751d1764..6cf35f340a662bf2816d2e912f81d78c64bc3706 100644 (file)
@@ -8,7 +8,7 @@ title: "Checking your environment"
 
 h1. Checking your environment
 
-First you should "log into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login if you have not already done so.
+First you should "log into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login if you have not already done so.
 
 If @arv user current@ is able to access the API server, it will print out information about your account.  Check that you are able to access the Arvados API server using the following command:
 
@@ -41,6 +41,6 @@ However, if you receive the following message:
 
 bc. ARVADOS_API_HOST and ARVADOS_API_TOKEN need to be defined as environment variables
 
-Then follow the instructions for "getting an API token,":{{site.basedoc}}/user/reference/api-tokens.html and try @arv user current@ again.
+Then follow the instructions for "getting an API token,":{{site.baseurl}}/user/reference/api-tokens.html and try @arv user current@ again.
 
-Once you are able to access the API server, you are ready proceed to the first tutorial: "Storing and retrieving data using Arvados Keep.":{{site.basedoc}}/user/tutorials/tutorial-keep.html
+Once you are able to access the API server, you are ready proceed to the first tutorial: "Storing and retrieving data using Arvados Keep.":{{site.baseurl}}/user/tutorials/tutorial-keep.html
index 4c49d4ae88b15b968430a9670f608c1f19a56b3f..d47c1ccdae42436b8c5bd8b55345a81e26875658 100644 (file)
@@ -14,7 +14,7 @@ Access the Arvados workbench using this link: "https://workbench.{{ site.arvados
 
 (Replace @{{ site.arvados_api_host }}@ with the hostname of your local Arvados instance if necessary.)
 
-First, open a shell on the system on which you intend to use the Arvados client (this may be your local workstation, or an Arvados VM, refer to "Accessing Arvados over ssh":{{site.basedoc}}/user/getting_started/ssh-access.html ) .
+First, open a shell on the system on which you intend to use the Arvados client (this may be your local workstation, or an Arvados VM, refer to "Accessing Arvados over ssh":{{site.baseurl}}/user/getting_started/ssh-access.html ) .
 
 Click on the user icon <span class="glyphicon glyphicon-user"></span> in the upper right corner to access the user settings menu, and click on the menu item _Manage API token_ to go to the "api client authorizations" page.  
 
index f8d3a431a720fcd307be873199e893d95fbd56bc..c79563161c4d60722b3040029fec5ef931dd8269 100644 (file)
@@ -7,7 +7,7 @@ title: "Command line interface"
 
 h1. Reference: Command Line Interface
 
-*First, you should be "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*First, you should be "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 h3. Usage
 
@@ -15,8 +15,10 @@ h3. Usage
 
 h4. Global options
 
-- @--format=json@ := Output response as JSON
+- @--format=json@ := Output response as JSON. This is the default format.
+
 - @--format=yaml@ := Output response as YAML
+
 - @--format=uuid@ := Output only the UUIDs of object(s) in the API response, one per line.
 
 
index e7819a194579c23d9fe3b2b9e1529123b4a23fe1..7b31e17818318f178da36b46562f65fc6ff89bd0 100644 (file)
@@ -10,7 +10,7 @@ h1. Running external programs
 
 This tutorial demonstrates how to use Crunch to run an external program by writting a wrapper using the Python SDK.
 
-*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 In this tutorial, you will use the external program @md5sum@ to compute hashes instead of the built-in Python library used in earlier tutorials.
 
index 41f8a84c3b03200b1ee378453c165811f3da4f54..130f59117653fd321eafae41d1b572695246cc06 100644 (file)
@@ -10,7 +10,7 @@ h1. Writing a Crunch script
 
 In this tutorial, we will write the "hash" script demonstrated in the first tutorial.
 
-*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 This tutorial uses *@you@* to denote your username.  Replace *@you@* with your user name in all the following examples.
 
@@ -66,6 +66,11 @@ Make the file executable:
 
 notextile. <pre><code>~/<b>you</b>/crunch_scripts$ <span class="userinput">chmod +x hash.py</span></code></pre>
 
+{% include 'notebox_begin' %}
+The below steps describe how to execute the script after committing changes to git. To test the script locally, please see the "debugging a crunch script":tutorial-job-debug.html page.
+
+{% include 'notebox_end' %}
+
 Next, add the file to @git@ staging.  This tells @git@ that the file should be included on the next commit.
 
 notextile. <pre><code>~/<b>you</b>/crunch_scripts$ <span class="userinput">git add hash.py</span></code></pre>
index e522b6e272fbbc9a9ecfd7891246c18dd53bf506..3bf05a5dbd9903a4410c5a56339d9da6ea32d82c 100644 (file)
@@ -8,9 +8,9 @@ title: "Using GATK with Arvados"
 
 h1. Using GATK with Arvados
 
-This tutorials demonstrates how to use the Genome Analysis Toolkit (GATK) with Arvados. In this example we will install GATK and then create a VariantFiltration job to assign pass/fail scores to variants in a VCF file.
+This tutorial demonstrates how to use the Genome Analysis Toolkit (GATK) with Arvados. In this example we will install GATK and then create a VariantFiltration job to assign pass/fail scores to variants in a VCF file.
 
-*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 h2. Installing GATK
 
index 560b9ba6fbc63ef5b4ab40c252befe583f78f8bb..91c900ba8e6ddb211de43e334010be28e4d0e1c8 100644 (file)
@@ -10,7 +10,7 @@ h1. Debugging a Crunch script
 
 To test changes to a script by running a job, the change must be pushed into @git@, the job queued asynchronously, and the actual execution may be run on any compute server.  As a result, debugging a script can be difficult and time consuming.  This tutorial demonstrates using @arv-crunch-job@ to run your job in your local VM.  This avoids the job queue and allows you to execute the script from your uncomitted git tree.
 
-*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 This tutorial uses _you_ to denote your username.  Replace _you_ with your user name in all the following examples.
 
index 88478bb4c8317105b01a508debda31573c31eb9a..a0dd8960335f2a57b2466f9c7a34c227b712ddde 100644 (file)
@@ -10,7 +10,7 @@ h1. Running a crunch job
 
 This tutorial introduces the concepts and use of the Crunch job system using the @arv@ command line tool and Arvados Workbench.
 
-*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 In "retrieving data using Keep,":tutorial-keep.html we downloaded a file from Keep and did some computation with it (specifically, computing the md5 hash of the complete file).  While a straightforward way to accomplish a computational task, there are several obvious drawbacks to this approach:
 * Large files require significant time to download.
@@ -91,7 +91,7 @@ Use @arv job create@ to actually submit the job.  It should print out a JSON obj
 </code></pre>
 </notextile>
 
-The job is new queued and will start running as soon as it reaches the front of the queue.  Fields to pay attention to include:
+The job is now queued and will start running as soon as it reaches the front of the queue.  Fields to pay attention to include:
 
  * @"uuid"@ is the unique identifier for this specific job
  * @"script_version"@ is the actual revision of the script used.  This is useful if the version was described using the "repository:branch" format.
index 44df0aad6353869d700901470b2a42acfda23c39..f487feb75f89db249aedbbd58b308fafe961b7d9 100644 (file)
@@ -11,7 +11,7 @@ h1. Storing and Retrieving data using Arvados Keep
 This tutorial introduces you to the Arvados file storage system.
 
 
-*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 The Arvados distributed file system is called *Keep*.  Keep is a content-addressable file system.  This means that files are managed using special unique identifiers derived from the _contents_ of the file, rather than human-assigned file names (specifically, the md5 hash).  This has a number of advantages:
 * Files can be stored and replicated across a cluster of servers without requiring a central name server.
index 008316691e20e81e129c6d2c32562be0af9907bb..d128b4b1951e04c887c4a8f57015237f0df65336 100644 (file)
@@ -10,7 +10,7 @@ h1. Constructing a Crunch pipeline
 
 A pipeline in Arvados is a collection of crunch scripts, in which the output from one script may be used as the input to another script.
 
-*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 h2. Create a new script
 
@@ -41,7 +41,7 @@ Next, create a file that contains the pipeline definition:
       "script_parameters":{
         "input": "887cd41e9c613463eab2f0d885c6dd96+83"
       },
-      "script_version":"tetron:master"
+      "script_version":"you:master"
     },
     "filter":{
       "script":"0-filter.py",
@@ -50,7 +50,7 @@ Next, create a file that contains the pipeline definition:
           "output_of":"do_hash"
         }
       },
-      "script_version":"tetron:master"
+      "script_version":"you:master"
     }
   }
 }
@@ -128,7 +128,7 @@ Notice that the pipeline definition explicitly specifies the Keep locator for th
 What if we want to run the pipeline on a different input block?  One option is to define a new pipeline template, but would potentially result in clutter with many pipeline templates defined for one-off jobs.  Instead, you can override values in the input of the component like this:
 
 <notextile>
-<pre><code>$ <span class="userinput">arv pipeline run --template qr1hi-d1hrv-vxzkp38nlde9yyr do_hash::input=33a9f3842b01ea3fdf27cc582f5ea2af</span>
+<pre><code>$ <span class="userinput">arv pipeline run --template qr1hi-d1hrv-vxzkp38nlde9yyr do_hash::input=33a9f3842b01ea3fdf27cc582f5ea2af+242</span>
 2013-12-17 20:31:24 +0000 -- pipeline_instance qr1hi-d1hrv-tlkq20687akys8e
 do_hash qr1hi-8i9sb-rffhuay4jryl2n2 queued 2013-12-17T20:31:24Z
 filter  -                           -
index fde36dea4b1d3da6365a7c9933d7c86596c06dee..be78506f5db5cad5aa4459af88426fcaff56e039 100644 (file)
@@ -82,4 +82,7 @@ md5sum.txt
 
 h2. The one job per file pattern
 
-This example demonstrates how to schedule a new task per file.  Because this is a common pattern, the Crunch Python API contains a convenience function to "queue a task for each input file":{{site.basedoc}}/sdk/python/crunch-utility-libraries.html#one_task_per_input which reduces the amount of boilerplate code required to handle parallel jobs.
+This example demonstrates how to schedule a new task per file.  Because this is a common pattern, the Crunch Python API contains a convenience function to "queue a task for each input file":{{site.baseurl}}/sdk/python/crunch-utility-libraries.html#one_task_per_input which reduces the amount of boilerplate code required to handle parallel jobs.
+
+Next, "Constructing a Crunch pipeline":tutorial-new-pipeline.html
+
index 13945ff4cd62aaaf68c6f6fab68d688c7496d184..6402c7e1d3fa0cbb19b456e0a6a55b8949214551 100644 (file)
@@ -10,7 +10,7 @@ h1. Querying the Metadata Database
 
 This tutorial introduces the Arvados Metadata Database.  The Metadata Database stores information about files in Keep.  This example will use the Python SDK to find public WGS (Whole Genome Sequencing) data for people who have reported a certain medical condition.
 
-*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.basedoc}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.basedoc}}/user/getting_started/check-environment.html*
+*This tutorial assumes that you are "logged into an Arvados VM instance":{{site.baseurl}}/user/getting_started/ssh-access.html#login, and have a "working environment.":{{site.baseurl}}/user/getting_started/check-environment.html*
 
 In the tutorial examples, three angle brackets (&gt;&gt;&gt;) will be used to denote code to enter at the interactive Python prompt.
 
index bd9db89b13d44630af74962b714f0897e2a042ef..87b4fbf8a5385f498c2e016f9225d467a3dd664a 100755 (executable)
@@ -331,12 +331,11 @@ my $skip_install = ($local_job && $Job->{script_version} =~ m{^/});
 if ($skip_install)
 {
   $ENV{"CRUNCH_SRC"} = $Job->{script_version};
-  system("virtualenv", "$ENV{CRUNCH_TMP}/opt") == 0
-      or croak ("virtualenv $ENV{CRUNCH_TMP}/opt failed: exit ".($?>>8));
-  for my $src_path ("$ENV{CRUNCH_SRC}/arvados/sdk/python",
-                    "$ENV{CRUNCH_SRC}/sdk/python") {
+  for my $src_path ("$ENV{CRUNCH_SRC}/arvados/sdk/python") {
     if (-d $src_path) {
-      system ("cd $src_path && \$CRUNCH_TMP/opt/bin/python setup.py install")
+      system("virtualenv", "$ENV{CRUNCH_TMP}/opt") == 0
+          or croak ("virtualenv $ENV{CRUNCH_TMP}/opt failed: exit ".($?>>8));
+      system ("cd $src_path && ./build.sh && \$CRUNCH_TMP/opt/bin/python setup.py install")
           == 0
           or croak ("setup.py in $src_path failed: exit ".($?>>8));
     }
@@ -1388,10 +1387,13 @@ open STDOUT, ">", "$destdir.log";
 open STDERR, ">&STDOUT";
 
 mkdir $destdir;
-open TARX, "|-", "tar", "-C", $destdir, "-xf", "-";
-print TARX <DATA>;
-if(!close(TARX)) {
-  die "'tar -C $destdir -xf -' exited $?: $!";
+my @git_archive_data = <DATA>;
+if (@git_archive_data) {
+  open TARX, "|-", "tar", "-C", $destdir, "-xf", "-";
+  print TARX @git_archive_data;
+  if(!close(TARX)) {
+    die "'tar -C $destdir -xf -' exited $?: $!";
+  }
 }
 
 my $pwd;
@@ -1399,10 +1401,10 @@ chomp ($pwd = `pwd`);
 my $install_dir = $ENV{"CRUNCH_INSTALL"} || "$pwd/opt";
 mkdir $install_dir;
 
-shell_or_die ("virtualenv", $install_dir);
-for my $src_path ("$destdir/arvados/sdk/python", "$destdir/sdk/python") {
+for my $src_path ("$destdir/arvados/sdk/python") {
   if (-d $src_path) {
-    shell_or_die ("cd $src_path && $install_dir/bin/python setup.py install");
+    shell_or_die ("virtualenv", $install_dir);
+    shell_or_die ("cd $src_path && ./build.sh && $install_dir/bin/python setup.py install");
   }
 }
 
index 48e9b2c8739bb6eda30f6ca3adc4f852c0f4fa89..983dc2efbb65748d4c0b5c9e0f47f4c41171470e 100644 (file)
@@ -10,7 +10,6 @@ import errno
 import stat
 import threading
 import arvados
-import argparse
 import pprint
 
 from time import time
index 2424979646b111443bbc536393fcef7adb230d56..ac9cd9bcf6088cbc54751ec340d143b66c423154 100755 (executable)
@@ -3,10 +3,9 @@
 from arvados.fuse import * 
 import arvados
 import subprocess
+import argparse
 
 if __name__ == '__main__':
-    api = arvados.api()
-
     # Handle command line parameters
     parser = argparse.ArgumentParser(
         description='Mount Keep data under the local filesystem.',
index f76ba445be6b09b23aed4f3c7184d28fb70148ca..c71fea02959beec5feb3405be9635335e8129d49 100644 (file)
@@ -1,18 +1,16 @@
 PATH
   remote: .
   specs:
-    arvados (0.1.20140127093947)
+    arvados (0.1.20140228213600)
       activesupport (>= 3.2.13)
       andand
       google-api-client (~> 0.6.3)
       json (>= 1.7.7)
-      minitest (>= 5.0.0)
-      rake
 
 GEM
   remote: https://rubygems.org/
   specs:
-    activesupport (3.2.16)
+    activesupport (3.2.17)
       i18n (~> 0.6, >= 0.6.4)
       multi_json (~> 1.0)
     addressable (2.3.5)
@@ -56,3 +54,5 @@ PLATFORMS
 
 DEPENDENCIES
   arvados!
+  minitest (>= 5.0.0)
+  rake
index 6c45f88e61b1915a955d1e2895c22234965e2657..5c2f5db6cf9683a3b2f6b0904381c42c6e4ddd49 100644 (file)
@@ -42,6 +42,7 @@ class Arvados::V1::JobsController < ApplicationController
   end
 
   def cancel
+    reload_object_before_update
     @object.update_attributes cancelled_at: Time.now
     show
   end
index 076b2342a2a64798efb8e478c444532c1c592d45..1ceedd7dd20face2204a1dd51b9bff75f23d9a38 100644 (file)
@@ -3,10 +3,6 @@ require 'test_helper'
 class CollectionsApiTest < ActionDispatch::IntegrationTest
   fixtures :all
 
-  def jresponse
-    @jresponse ||= ActiveSupport::JSON.decode @response.body
-  end
-
   test "should get index" do
     get "/arvados/v1/collections", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
     assert_response :success
diff --git a/services/api/test/integration/jobs_api_test.rb b/services/api/test/integration/jobs_api_test.rb
new file mode 100644 (file)
index 0000000..1c4e294
--- /dev/null
@@ -0,0 +1,23 @@
+require 'test_helper'
+
+class JobsApiTest < ActionDispatch::IntegrationTest
+  fixtures :all
+
+  test "cancel job" do
+    post "/arvados/v1/jobs/#{jobs(:running).uuid}/cancel", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:active).api_token}"}
+    assert_response :success
+    assert_equal "arvados#job", jresponse['kind']
+    assert_not_nil jresponse['cancelled_at']
+  end
+
+  test "cancel someone else's visible job" do
+    post "/arvados/v1/jobs/#{jobs(:barbaz).uuid}/cancel", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:spectator).api_token}"}
+    assert_response 403
+  end
+
+  test "cancel someone else's invisible job" do
+    post "/arvados/v1/jobs/#{jobs(:running).uuid}/cancel", {:format => :json}, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:spectator).api_token}"}
+    assert_response 404
+  end
+
+end
index 8c12ffb5df4718df4c5d19dbd5eae5d109da764a..8e3399523ea800a43c8afaafae38bc10e0066dbf 100644 (file)
@@ -20,5 +20,11 @@ class ActiveSupport::TestCase
   # Add more helper methods to be used by all tests here...
 end
 
+class ActionDispatch::IntegrationTest
+  def jresponse
+    @jresponse ||= ActiveSupport::JSON.decode @response.body
+  end
+end
+
 # Ensure permissions are computed from the test fixtures.
 User.invalidate_permissions_cache