2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
8 if test -z "$1" -o -z "$2" ; then
9 echo "$0: Copies Arvados tutorial resources from public data cluster (jutro)"
10 echo "Usage: copy-tutorial.sh <dest> <tutorial>"
11 echo "<dest> is 5-character cluster id of the destination"
12 echo "<tutorial> is which tutorial to copy, one of:"
13 echo " bwa-mem Tutorial from https://doc.arvados.org/user/tutorials/tutorial-workflow-workbench.html"
14 echo " whole-genome Whole genome variant calling tutorial workflow (large)"
22 if ! test -f $HOME/.config/arvados/${dest}.conf ; then
23 echo "Please create $HOME/.config/arvados/${dest}.conf with the following contents:"
24 echo "ARVADOS_API_HOST=<${dest} host>"
25 echo "ARVADOS_API_TOKEN=<${dest} token>"
29 if ! test -f $HOME/.config/arvados/jutro.conf ; then
30 # Set it up with the anonymous user token.
31 echo "ARVADOS_API_HOST=jutro.arvadosapi.com" > $HOME/.config/arvados/jutro.conf
32 echo "ARVADOS_API_TOKEN=v2/jutro-gj3su-e2o9x84aeg7q005/22idg1m3zna4qe4id3n0b9aw86t72jdw8qu1zj45aboh1mm4ej" >> $HOME/.config/arvados/jutro.conf
36 for a in $(cat $HOME/.config/arvados/${dest}.conf) ; do export $a ; done
39 echo "Copying from public data cluster (jutro) to $dest"
45 if test -z "$owner" ; then
46 owner=$(arv --format=uuid user current)
48 project_uuid=$(arv --format=uuid group list --filters '[["name", "=", "'"$name"'"], ["owner_uuid", "=", "'$owner'"]]')
49 if test -z "$project_uuid" ; then
50 project_uuid=$(arv --format=uuid group create --group '{"name":"'"$name"'", "group_class": "project", "owner_uuid": "'$owner'"}')
51 link=$(arv link create --link '{"link_class": "permission", "name": "can_read", "tail_uuid": "'$dest'-j7d0g-anonymouspublic", "head_uuid": "'$project_uuid'"}')
57 if ! arv-keepdocker | grep "arvados/jobs *latest" ; then
58 arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-4zz18-sxmit0qs6i9n2s4
62 parent_project=$(make_project "Tutorial projects")
65 if test "$tutorial" = "bwa-mem" ; then
67 echo "Copying bwa mem tutorial"
72 project_uuid=$(make_project 'User guide resources' $parent_project)
75 arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-7fd4e-mkmmq53m1ze6apx
80 echo "Finished, data copied to \"User guide resources\" at $project_uuid"
81 echo "You can now go to Workbench and choose 'Run a process' and then select 'bwa-mem.cwl'"
85 if test "$tutorial" = "whole-genome" ; then
87 echo "Copying whole genome variant calling tutorial"
92 project_uuid=$(make_project 'WGS Processing Tutorial' $parent_project)
95 arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-7fd4e-tnxg9ytblbxm26i
100 echo "Finished, data copied to \"WGS Processing Tutorial\" at $project_uuid"
101 echo "You can now go to Workbench and choose 'Run a process' and then select 'bwa-mem.cwl'"