X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/b54d7820e899733ce10b8960b1f04d0481f2e11f..63511ce5f1dc6d6e38cfafe240f0c907ad11748e:/doc/user/tutorials/tutorial-job1.html.textile.liquid diff --git a/doc/user/tutorials/tutorial-job1.html.textile.liquid b/doc/user/tutorials/tutorial-job1.html.textile.liquid index b88ba60516..a0dd896033 100644 --- a/doc/user/tutorials/tutorial-job1.html.textile.liquid +++ b/doc/user/tutorials/tutorial-job1.html.textile.liquid @@ -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. @@ -29,7 +29,7 @@ For your first job, you will run the "hash" crunch script using the Arvados syst Crunch jobs are described using JSON objects. For example: -
$ cat >the_job <<EOF
+
~$ cat >the_job <<EOF
 {
  "script": "hash",
  "script_version": "arvados:master",
@@ -46,13 +46,13 @@ EOF
 * @<the_job@ redirects standard output to a file called @the_job@
 * @"script"@ specifies the name of the script to run.  The script is searched for in the "crunch_scripts/" subdirectory of the @git@ checkout specified by @"script_version"@.
-* @"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, or in the form "repository:branch" (in which case it will take 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.  You can access a list of available @git@ repositories on the Arvados workbench through _Access %(rarr)→% Repositories_.
+* @"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, or in the form "repository:branch" (in which case it will take 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.  You can access a list of available @git@ repositories on the Arvados workbench under _Compute %(rarr)→% Code repositories_.
 * @"script_parameters"@ are provided to the script.  In this case, the input is the locator for the collection that we inspected in the previous section.
 
 Use @arv job create@ to actually submit the job.  It should print out a JSON object which describes the newly created job:
 
 
-
$ arv -h job create --job "$(cat the_job)"
+
~$ arv job create --job "$(cat the_job)"
 {
  "href":"https://qr1hi.arvadosapi.com/arvados/v1/jobs/qr1hi-8i9sb-1pm1t02dezhupss",
  "kind":"arvados#job",
@@ -91,29 +91,29 @@ Use @arv job create@ to actually submit the job.  It should print out a JSON obj
 
-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. h2. Monitor job progress -Go to Workbench, and use the menu to navigate to _Compute %(rarr)→% Jobs_. The job you submitted can be identified by the *uuid* row, which will match the "uuid" field of the JSON object returned when the job was created. +Go to the Workbench dashboard. Your job should be at the top of the "Recent jobs" table. This table refreshes automatically. When the job has completed successfully, it will show finished in the *Status* column. -Hit "Refresh" until it finishes. Successful completion is indicated by a green check mark in the *status* column. +On the command line, you can access log messages while the job runs using @arv job log_tail_follow@: -You can access log messages while the job runs using @arv job log_tail_follow@: - -notextile.
$ arv job log_tail_follow --uuid qr1hi-8i9sb-xxxxxxxxxxxxxxx
+notextile.
~$ arv job log_tail_follow --uuid qr1hi-8i9sb-xxxxxxxxxxxxxxx
This will print out the last several lines of the log for that job. h2. Inspect the job output -You can access the job output under the *output* column of the _Compute %(rarr)→% Jobs_ page. Alternately, you can use @arv job get@ to access a JSON object describing the output: +On the workbench dashboard, look for the *Output* column of the *Recent jobs* table. Click on the link under *Output* for your job to go to the files page with the job output. The files page lists all the files that were output by the job. Click on the link under the *files* column to view a file, or click on the download icon to download the output file. + +On the command line, you can use @arv job get@ to access a JSON object describing the output: -
$ arv -h job get --uuid qr1hi-8i9sb-xxxxxxxxxxxxxxx
+
~$ arv job get --uuid qr1hi-8i9sb-xxxxxxxxxxxxxxx
 {
  "href":"https://qr1hi.arvadosapi.com/arvados/v1/jobs/qr1hi-8i9sb-1pm1t02dezhupss",
  "kind":"arvados#job",
@@ -162,15 +162,15 @@ You can access the job output under the *output* column of the _Compute %(rarr)&
 Now you can list the files in the collection:
 
 
-
$ arv keep get 880b55fb4470b148a447ff38cacdd952+54
-. 78b268d1e03d87f8270bdee9d5d427c5+61 0:61:md5sum.txt
+
~$ arv keep ls 880b55fb4470b148a447ff38cacdd952+54
+md5sum.txt
 
This collection consists of the @md5sum.txt@ file. Use @arv keep get@ to show the contents of the @md5sum.txt@ file: -
$ arv keep get 880b55fb4470b148a447ff38cacdd952+54/md5sum.txt
+
~$ arv keep get 880b55fb4470b148a447ff38cacdd952+54/md5sum.txt
 44b8ae3fde7a8a88d2f7ebd237625b4f var-GS000016015-ASM.tsv.bz2
 
@@ -179,10 +179,12 @@ This md5 hash matches the md5 hash which we computed earlier. h2. The job log -When the job completes, you can access the job log. The keep identifier listed in the @"log"@ field from @arv job get@ specifies a collection. You can list the files in the collection: +When the job completes, you can access the job log. On the workbench dashboard, this is the link under the *Log* column of the *Recent jobs* table. + +On the command line, the keep identifier listed in the @"log"@ field from @arv job get@ specifies a collection. You can list the files in the collection: -
$ arv keep ls xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+91
+
~$ arv keep ls xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+91
 qr1hi-8i9sb-xxxxxxxxxxxxxxx.log.txt
 
@@ -190,7 +192,7 @@ qr1hi-8i9sb-xxxxxxxxxxxxxxx.log.txt The log collection consists of one log file named with the job id. You can access it using @arv keep get@: -
$ arv keep get xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+91/qr1hi-8i9sb-xxxxxxxxxxxxxxx.log.txt
+
~$ arv keep get xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+91/qr1hi-8i9sb-xxxxxxxxxxxxxxx.log.txt
 2013-12-16_20:44:35 qr1hi-8i9sb-1pm1t02dezhupss 7575  check slurm allocation
 2013-12-16_20:44:35 qr1hi-8i9sb-1pm1t02dezhupss 7575  node compute13 - 8 slots
 2013-12-16_20:44:36 qr1hi-8i9sb-1pm1t02dezhupss 7575  start