X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7791c7e1b09341ce1fed131c6b11c91da8217c3f..a795a8801fecdcbe5418c5d631b5b1ba1b22f1d7:/doc/user/tutorials/tutorial-keep.html.textile.liquid diff --git a/doc/user/tutorials/tutorial-keep.html.textile.liquid b/doc/user/tutorials/tutorial-keep.html.textile.liquid index f736bd0fa0..21efc475c5 100644 --- a/doc/user/tutorials/tutorial-keep.html.textile.liquid +++ b/doc/user/tutorials/tutorial-keep.html.textile.liquid @@ -1,173 +1,96 @@ --- layout: default navsection: userguide -navmenu: Tutorials -title: "Storing and Retrieving data using Keep" +title: "Uploading data" ... +{% comment %} +Copyright (C) The Arvados Authors. All rights reserved. -h1. Storing and Retrieving data using Keep +SPDX-License-Identifier: CC-BY-SA-3.0 +{% endcomment %} -This tutorial introduces you to the Arvados file storage system. +Arvados Data collections can be uploaded using either Workbench or the @arv-put@ command line tool. +# "*Upload using Workbench*":#upload-using-workbench +# "*Creating projects*":#creating-projects +# "*Upload using command line tool*":#upload-using-command -*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(#upload-using-workbench). Upload using Workbench -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. -* Systematic validation of data integrity by both server and client because the checksum is built into the identifier. -* Minimizes data duplication (two files with the same contents will result in the same identifier, and will not be stored twice.) -* Avoids data race conditions (an identifier always points to the same data.) +To upload using Workbench, visit the Workbench *Dashboard*. Click on *Projects* dropdown menu in the top navigation menu and select your *Home* project or any other project of your choosing. You will see the *Data collections* tab for this project, which lists the collections in this project. -h1. Putting Data into Keep +To upload files into a new collection, click on *Add data* dropdown menu and select *Upload files from my computer*. -We will start with downloading a freely available VCF file from the "Personal Genome Project (PGP)":http://www.personalgenomes.org subject "hu599905":https://my.personalgenomes.org/profile/hu599905 to a staging directory on the VM, and then add it to Keep. +!{display: block;margin-left: 25px;margin-right: auto;border:1px solid lightgray;}{{ site.baseurl }}/images/upload-using-workbench.png! -In the following tutorials, replace you with your user id. +
This will create a new empty collection in your chosen project and will take you to the *Upload* tab for that collection. -First, log into the Arvados VM instance and set up the staging area: +!{display: block;margin-left: 25px;margin-right: auto;border:1px solid lightgray;}{{ site.baseurl }}/images/upload-tab-in-new-collection.png! -notextile.
~$ mkdir /scratch/you
+Click on the *Browse...* button and select the files you would like to upload. Selected files will be added to a list of files to be uploaded. After you are done selecting files to upload, click on the * Start* button to start upload. This will start uploading files to Arvados and Workbench will show you the progress bar. When upload is completed, you will see an indication to that effect. -Next, download the file: +!{display: block;margin-left: 25px;margin-right: auto;border:1px solid lightgray;}{{ site.baseurl }}/images/files-uploaded.png! - -
~$ cd /scratch/you
-/scratch/you$ curl -o var-GS000016015-ASM.tsv.bz2 'https://warehouse.personalgenomes.org/warehouse/f815ec01d5d2f11cb12874ab2ed50daa+234+K@ant/var-GS000016015-ASM.tsv.bz2'
-  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
-                                 Dload  Upload   Total   Spent    Left  Speed
-100  216M  100  216M    0     0  10.0M      0  0:00:21  0:00:21 --:--:-- 9361k
-
-
- -{% include 'notebox_begin' %} - -If you have your own data, for example @MyData.vcf@, you can use @scp@ or @rsync@ to copy from your local workstation to the shell VM (run this on your local workstation): - -notextile.
~$ scp MyData.vcf you@shell.arvados:/scratch/you/MyData.vcf
- -{% include 'notebox_end' %} - -Now use @arv keep put@ to add your VCF data to Keep, then delete the local copy of the file: - - -
/scratch/you$ arv keep put var-GS000016015-ASM.tsv.bz2
-c1bad4b39ca5a924e481008009d94e32+210
-/scratch/you$ rm var-GS000016015-ASM.tsv.bz2
-
-
- -The output value @c1bad4b39ca5a924e481008009d94e32+210@ from @arv keep put@ is the Keep locator. This enables you to access the file you just uploaded, and is explained in the next section. - -h2. Putting a directory - -You can also use @arv keep put@ to add an entire directory: - - -
/scratch/you$ mkdir tmp
-/scratch/you$ echo "hello alice" > tmp/alice.txt
-/scratch/you$ echo "hello bob" > tmp/bob.txt
-/scratch/you$ echo "hello carol" > tmp/carol.txt
-/scratch/you$ arv keep put tmp
-0M / 0M 100.0% 
-887cd41e9c613463eab2f0d885c6dd96+83
-
-
+*Note:* If you leave the collection page during the upload, the upload process will be aborted and you will need to upload the files again. -The locator @887cd41e9c613463eab2f0d885c6dd96+83@ represents a collection with multiple files. +*Note:* You can also use the Upload tab to add additional files to an existing collection. -h1. Getting Data from Keep +notextile.
-h2. Using Workbench +h2(#creating-projects). Creating projects -You may access collections through the "Collections section of Arvados Workbench":https://{{ site.arvados_workbench_host }}/collections located at "https://{{ site.arvados_workbench_host }}/collections":https://{{ site.arvados_workbench_host }}/collections . You can also access individual collections and individual files within a collection. Some examples: +Files are organized into Collections, and Collections are organized by Projects. -* "https://{{ site.arvados_workbench_host }}/collections/c1bad4b39ca5a924e481008009d94e32+210":https://{{ site.arvados_workbench_host }}/collections/c1bad4b39ca5a924e481008009d94e32+210 -* "https://{{ site.arvados_workbench_host }}/collections/887cd41e9c613463eab2f0d885c6dd96+83/alice.txt":https://{{ site.arvados_workbench_host }}/collections/887cd41e9c613463eab2f0d885c6dd96+83/alice.txt +Click on *Projects* *Add a new project* to add a top level project. -h2. Using arv-get +To create a subproject, navigate to the parent project, and click on *Add a subproject*. -You can view the contents of a collection using @arv keep ls@: +See "Sharing collections":tutorial-keep-get.html#download-shared-collection for information about sharing projects and collections with other users. - -
/scratch/you$ arv keep ls c1bad4b39ca5a924e481008009d94e32+210
-var-GS000016015-ASM.tsv.bz2
-
- -
/scratch/you$ arv keep ls 887cd41e9c613463eab2f0d885c6dd96+83
-alice.txt
-bob.txt
-carol.txt
-
-
+h2(#upload-using-command). Upload using command line tool -Use @-s@ to print file sizes rounded up to the nearest kilobyte: +{% include 'tutorial_expectations' %} +To upload a file to Keep using @arv-put@: -
/scratch/you$ arv keep ls -s c1bad4b39ca5a924e481008009d94e32+210
-221887 var-GS000016015-ASM.tsv.bz2
+
~$ arv-put var-GS000016015-ASM.tsv.bz2
+216M / 216M 100.0%
+Collection saved as ...
+zzzzz-4zz18-xxxxxxxxxxxxxxx
 
-Use @arv keep get@ to download the contents of a collection and place it in the directory specified in the second argument (in this example, @.@ for the current directory): - -
/scratch/you$ arv keep get c1bad4b39ca5a924e481008009d94e32+210/ .
-
-
+The output value @zzzzz-4zz18-xxxxxxxxxxxxxxx@ is the uuid of the Arvados collection created. -You can also download indvidual files: +Note: The file used in this example is a freely available TSV file containing variant annotations from the "Personal Genome Project (PGP)":http://www.pgp-hms.org participant "hu599905":https://my.pgp-hms.org/profile/hu599905), downloadable "here":https://warehouse.pgp-hms.org/warehouse/f815ec01d5d2f11cb12874ab2ed50daa+234+K@ant/var-GS000016015-ASM.tsv.bz2. Alternatively, you can replace @var-GS000016015-ASM.tsv.bz2@ with the name of any file you have locally, or you could get the TSV file by "downloading it from Keep.":{{site.baseurl}}/user/tutorials/tutorial-keep-get.html - -
/scratch/you$ arv keep get 887cd41e9c613463eab2f0d885c6dd96+83/alice.txt .
-
-
- -With a local copy of the file, we can do some computation, for example computing the md5 hash of the complete file: +It is also possible to upload an entire directory with @arv-put@: -
/scratch/you$ md5sum var-GS000016015-ASM.tsv.bz2
-44b8ae3fde7a8a88d2f7ebd237625b4f  var-GS000016015-ASM.tsv.bz2
+
~$ mkdir tmp
+~$ echo "hello alice" > tmp/alice.txt
+~$ echo "hello bob" > tmp/bob.txt
+~$ echo "hello carol" > tmp/carol.txt
+~$ arv-put tmp
+0M / 0M 100.0%
+Collection saved as ...
+zzzzz-4zz18-yyyyyyyyyyyyyyy
 
-h2. Using arv-mount +In both examples, the @arv-put@ command created a collection. The first collection contains the single uploaded file. The second collection contains the entire uploaded directory. -Use @arv-mount@ to take advantage of the "File System in User Space / FUSE":http://fuse.sourceforge.net/ feature of the Linux kernel to mount a Keep collection as if it were a regular directory tree. +@arv-put@ accepts quite a few optional command line arguments, which are described on the "arv subcommands":{{site.baseurl}}/sdk/cli/subcommands.html#arv-keep-put page. - -
/scratch/you$ mkdir mnt
-/scratch/you$ arv-mount --collection c1bad4b39ca5a924e481008009d94e32+210 mnt &
-/scratch/you$ cd mnt
-/scratch/you/mnt$ ls
-var-GS000016015-ASM.tsv.bz2
-/scratch/you/mnt$ md5sum var-GS000016015-ASM.tsv.bz2
-44b8ae3fde7a8a88d2f7ebd237625b4f  var-GS000016015-ASM.tsv.bz2
-/scratch/you/mnt$ cd ..
-/scratch/you$ fusermount -u mnt
-
-
+h3. Locate your collection in Workbench -You can also mount the entire Keep namespace in "magic directory" mode: - - -
/scratch/you$ mkdir mnt
-/scratch/you$ arv-mount mnt &
-/scratch/you$ cd mnt/c1bad4b39ca5a924e481008009d94e32+210
-/scratch/you/mnt/c1bad4b39ca5a924e481008009d94e32+210$ ls
-var-GS000016015-ASM.tsv.bz2
-/scratch/you/mnt/c1bad4b39ca5a924e481008009d94e32+210$ md5sum var-GS000016015-ASM.tsv.bz2
-44b8ae3fde7a8a88d2f7ebd237625b4f  var-GS000016015-ASM.tsv.bz2
-/scratch/you/mnt/c1bad4b39ca5a924e481008009d94e32+210$ cd ../..
-/scratch/you$ fusermount -u mnt
-
-
+Visit the Workbench *Dashboard*. Click on *Projects* dropdown menu in the top navigation menu, select your *Home* project. Your newly uploaded collection should appear near the top of the *Data collections* tab. The collection name printed by @arv-put@ will appear under the *name* column. -Using @arv-mount@ has several significant benefits: +To move the collection to a different project, check the box at the left of the collection row. Pull down the *Selection...* menu near the top of the page tab, and select *Move selected...* button. This will open a dialog box where you can select a destination project for the collection. Click a project, then finally the Move button. -* You can browse, open and read Keep entries as if they are regular files. -* It is easy for existing tools to access files in Keep. -* Data is downloaded on demand, it is not necessary to download an entire file or collection to start processing +!{display: block;margin-left: 25px;margin-right: auto;}{{ site.baseurl }}/images/workbench-move-selected.png! -
+Click on the * Show* button next to the collection's listing on a project page to go to the Workbench page for your collection. On this page, you can see the collection's contents, download individual files, and set sharing options. -You are now ready to proceed to the next tutorial, "running a crunch job.":tutorial-job1.html +notextile.