doc: Use $USER in tutorial JSON.
authorBrett Smith <brett@curoverse.com>
Mon, 31 Mar 2014 13:51:42 +0000 (09:51 -0400)
committerBrett Smith <brett@curoverse.com>
Wed, 2 Apr 2014 14:04:42 +0000 (10:04 -0400)
The tutorial encourages users to copy and paste command text.
However, most of the JSON needs to have a user-specific value for
"repository", which is easy to overlook.  Since we're telling users to
save JSON with @cat@, we can take advantage of shell variable
expansion to make the right thing happen automatically.

I added accompanying notes to help explain what's going on for people
who aren't copying instructions so literally.

Conflicts:
doc/user/tutorials/tutorial-firstscript.html.textile.liquid
doc/user/tutorials/tutorial-new-pipeline.html.textile.liquid

doc/user/topics/running-pipeline-command-line.html.textile.liquid
doc/user/topics/tutorial-parallel.html.textile.liquid
doc/user/tutorials/running-external-program.html.textile.liquid
doc/user/tutorials/tutorial-firstscript.html.textile.liquid
doc/user/tutorials/tutorial-new-pipeline.html.textile.liquid

index 7940348f0937752299473c62a1f3868af0fa46ae..79e122d6eaf6623b2a850cbd651d0f925bc76756 100644 (file)
@@ -16,7 +16,7 @@ In "Writing a pipeline":{{ site.baseurl }}/user/tutorials/tutorial-firstscript.h
       "script_parameters":{
         "input": "887cd41e9c613463eab2f0d885c6dd96+83"
       },
-      "repository":"<b>you</b>",
+      "repository":"$USER",
       "script_version":"master"
     },
     "filter":{
@@ -26,7 +26,7 @@ In "Writing a pipeline":{{ site.baseurl }}/user/tutorials/tutorial-firstscript.h
           "output_of":"do_hash"
         }
       },
-      "repository":"<b>you</b>",
+      "repository":"$USER",
       "script_version":"master"
     }
   }
@@ -35,6 +35,8 @@ EOF</span>
 ~$ <span class="userinput">arv pipeline_template create --pipeline-template "$(cat the_pipeline)"</span></code></pre>
 </notextile>
 
+(Your shell should automatically fill in @$USER@ with your login name.  The JSON that gets saved should have @"repository"@ pointed at your personal git repository.)
+
 You can run this pipeline from the command line using @arv pipeline run@, filling in the UUID that you received from @arv pipeline_template create@:
 
 <notextile>
index 6dbdb8af23a74176e4d8767031e88c4bdbd857ac..bbb506f2d9b31b78012d3bf1860666c950b79f96 100644 (file)
@@ -17,7 +17,7 @@ Next, using @nano@ or your favorite Unix text editor, create a new file called @
 
 notextile. <pre>~/<b>you</b>/crunch_scripts$ <code class="userinput">nano parallel-hash.py</code></pre>
 
-Add the following code to compute the md5 hash of each file in a 
+Add the following code to compute the md5 hash of each file in a
 
 <notextile> {% code 'parallel_hash_script_py' as python %} </notextile>
 
@@ -40,7 +40,7 @@ You should now be able to run your new script using Crunch, with "script" referr
 <pre><code>~/<b>you</b>/crunch_scripts$ <span class="userinput">cat &gt;~/the_job &lt;&lt;EOF
 {
  "script": "parallel-hash.py",
- "repository": "<b>you</b>",
+ "repository": "$USER",
  "script_version": "master",
  "script_parameters":
  {
@@ -63,6 +63,8 @@ EOF</span>
 </code></pre>
 </notextile>
 
+(Your shell should automatically fill in @$USER@ with your login name.  The job JSON that gets saved should have @"repository"@ pointed at your personal git repository.)
+
 Because the job ran in parallel, each instance of parallel-hash creates a separate @md5sum.txt@ as output.  Arvados automatically collates theses files into a single collection, which is the output of the job:
 
 <notextile>
index c46630dc67219054f900ee6246bef44b2fe7e573..56b71c05eec10c68b48fee0b28821278be86b750 100644 (file)
@@ -53,7 +53,7 @@ You should now be able to run your new script using Crunch, with @"script"@ refe
           "dataclass": "Collection"
         }
       },
-      "repository":"<b>you</b>",
+      "repository":"$USER",
       "script_version":"master"
     }
   }
@@ -63,4 +63,6 @@ EOF
 </code></pre>
 </notextile>
 
+(Your shell should automatically fill in @$USER@ with your login name.  The JSON that gets saved should have @"repository"@ pointed at your personal git repository.)
+
 Your new pipeline template will appear on the Workbench "Compute %(rarr)&rarr;% Pipeline&nbsp;templates":https://{{ site.arvados_workbench_host }}/pipeline_instances page.  You can run the "pipeline using Workbench":tutorial-pipeline-workbench.html.
index 5cec9c1785c0b97bade4d9aea7a24ebcd276101c..36187d2dcaf9a03ddbbb3761a0b2267d9c88b024 100644 (file)
@@ -109,7 +109,7 @@ Next, create a file that contains the pipeline definition:
           "dataclass": "Collection"
         }
       },
-      "repository":"<b>you</b>",
+      "repository":"$USER",
       "script_version":"master",
       "output_is_persistent":true
     }
@@ -125,7 +125,7 @@ EOF
 * @"name"@ is a human-readable name for the pipeline.
 * @"components"@ is a set of scripts that make up the pipeline.
 * The component is listed with a human-readable name (@"do_hash"@ in this example).
-* @"repository"@ is the name of a git repository to search for the script version.  You can access a list of available git repositories on the Arvados Workbench under "Compute %(rarr)&rarr;% Code repositories":https://{{site.arvados_workbench_host}}/repositories.
+* @"repository"@ is the name of a git repository to search for the script version.  You can access a list of available git repositories on the Arvados Workbench under "Compute %(rarr)&rarr;% Code repositories":https://{{site.arvados_workbench_host}}/repositories.  Your shell should automatically fill in @$USER@ with your login name, so that the final JSON has @"repository"@ pointed at your personal git repository.
 * @"script_version"@ specifies the version of the script that you wish to run.  This can be in the form of an explicit git revision hash, a tag, or a branch (in which case it will use the HEAD of the specified branch).  Arvados logs the script version that was used in the run, enabling you to go back and re-run any past job with the guarantee that the exact same code will be used as was used in the previous run.
 * @"script"@ specifies the filename of the script to run.  Crunch expects to find this in the @crunch_scripts/@ subdirectory of the git repository.
 * @"script_parameters"@ describes the parameters for the script.  In this example, there is one parameter called @input@ which is @required@ and is a @Collection@.
index b0025c7176f1da1bc5684bb934396ead0cb08bae..fa63588730e93dfd462518287f7b4df59cc04a36 100644 (file)
@@ -43,7 +43,7 @@ Next, create a file that contains the pipeline definition:
           "dataclass": "Collection"
         }
       },
-      "repository":"<b>you</b>",
+      "repository":"$USER",
       "script_version":"master",
       "output_is_persistent":false
     },
@@ -54,7 +54,7 @@ Next, create a file that contains the pipeline definition:
           "output_of":"do_hash"
         }
       },
-      "repository":"<b>you</b>",
+      "repository":"$USER",
       "script_version":"master",
       "output_is_persistent":true
     }
@@ -66,6 +66,8 @@ EOF
 
 * @"output_of"@ indicates that the @output@ of the @do_hash@ component is connected to the @"input"@ of @do_filter@.  This is a _dependency_.  Arvados uses the dependencies between jobs to automatically determine the correct order to run the jobs.
 
+(Your shell should automatically fill in @$USER@ with your login name.  The JSON that gets saved should have @"repository"@ pointed at your personal git repository.)
+
 Now, use @arv pipeline_template create@ to register your pipeline template in Arvados:
 
 <notextile>