[ARVADOS] created: 1.3.0-3109-gb07b70d90

Git user git at public.arvados.org
Wed Sep 9 13:45:19 UTC 2020


        at  b07b70d9024e7203f4cae3bbc526fc36e9cca19e (commit)


commit b07b70d9024e7203f4cae3bbc526fc36e9cca19e
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Tue Sep 8 23:45:21 2020 -0400

    16578: Few more copy script tweaks
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/tools/copy-tutorial/copy-tutorial.sh b/tools/copy-tutorial/copy-tutorial.sh
index 9bede5e39..e7fac7af4 100755
--- a/tools/copy-tutorial/copy-tutorial.sh
+++ b/tools/copy-tutorial/copy-tutorial.sh
@@ -42,14 +42,14 @@ make_project() {
     project_uuid=$(arv --format=uuid group list --filters '[["name", "=", "'"$name"'"], ["owner_uuid", "=", "'$owner'"]]')
     if test -z "$project_uuid" ; then
 	project_uuid=$(arv --format=uuid group create --group '{"name":"'"$name"'", "group_class": "project", "owner_uuid": "'$owner'"}')
-	link=$(arv link create --link '{"link_class": "permission", "name": "can_read", "tail_uuid": "'$dest'-j7d0g-anonymouspublic", "head_uuid": "'$project_uuid'"}')
+
     fi
     echo $project_uuid
 }
 
 copy_jobs_image() {
     if ! arv-keepdocker | grep "arvados/jobs *latest" ; then
-	arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-4zz18-sxmit0qs6i9n2s4
+	arv-copy --project-uuid=$parent_project jutro-4zz18-sxmit0qs6i9n2s4
     fi
 }
 
@@ -64,7 +64,7 @@ if test "$tutorial" = "bwa-mem" ; then
     arv-copy --project-uuid=$parent_project jutro-j7d0g-rehmt1w5v2p2drp
 
     echo
-    echo "Finished, data copied to \"User guide resources\" at $project_uuid"
+    echo "Finished, data copied to \"User guide resources\" at $parent_project"
     echo "You can now go to Workbench and choose 'Run a process' and then select 'bwa-mem.cwl'"
     echo
 fi
@@ -77,7 +77,7 @@ if test "$tutorial" = "whole-genome" ; then
     arv-copy --project-uuid=$parent_project jutro-j7d0g-n2g87m02rsl4cx2
 
     echo
-    echo "Finished, data copied to \"WGS Processing Tutorial\" at $project_uuid"
+    echo "Finished, data copied to \"WGS Processing Tutorial\" at $parent_project"
     echo "You can now go to Workbench and choose 'Run a process' and then select 'WGS Processing Tutorial'"
     echo
 fi

commit 301e3064182f1ac65fce6e9ee9b2d30443cf5e2a
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Tue Sep 8 23:43:59 2020 -0400

    16578: Fix issue with copying large manifests
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/python/arvados/commands/arv_copy.py b/sdk/python/arvados/commands/arv_copy.py
index aee71195d..93fd6b598 100755
--- a/sdk/python/arvados/commands/arv_copy.py
+++ b/sdk/python/arvados/commands/arv_copy.py
@@ -34,6 +34,7 @@ import sys
 import logging
 import tempfile
 import urllib.parse
+import io
 
 import arvados
 import arvados.config
@@ -533,7 +534,7 @@ def copy_collection(obj_uuid, src, dst, args):
     # a new manifest as we go.
     src_keep = arvados.keep.KeepClient(api_client=src, num_retries=args.retries)
     dst_keep = arvados.keep.KeepClient(api_client=dst, num_retries=args.retries)
-    dst_manifest = ""
+    dst_manifest = io.StringIO()
     dst_locators = {}
     bytes_written = 0
     bytes_expected = total_collection_size(manifest)
@@ -544,14 +545,15 @@ def copy_collection(obj_uuid, src, dst, args):
 
     for line in manifest.splitlines():
         words = line.split()
-        dst_manifest += words[0]
+        dst_manifest.write(words[0])
         for word in words[1:]:
             try:
                 loc = arvados.KeepLocator(word)
             except ValueError:
                 # If 'word' can't be parsed as a locator,
                 # presume it's a filename.
-                dst_manifest += ' ' + word
+                dst_manifest.write(' ')
+                dst_manifest.write(word)
                 continue
             blockhash = loc.md5sum
             # copy this block if we haven't seen it before
@@ -564,17 +566,18 @@ def copy_collection(obj_uuid, src, dst, args):
                 dst_locator = dst_keep.put(data)
                 dst_locators[blockhash] = dst_locator
                 bytes_written += loc.size
-            dst_manifest += ' ' + dst_locators[blockhash]
-        dst_manifest += "\n"
+            dst_manifest.write(' ')
+            dst_manifest.write(dst_locators[blockhash])
+        dst_manifest.write("\n")
 
     if progress_writer:
         progress_writer.report(obj_uuid, bytes_written, bytes_expected)
         progress_writer.finish()
 
     # Copy the manifest and save the collection.
-    logger.debug('saving %s with manifest: <%s>', obj_uuid, dst_manifest)
+    logger.debug('saving %s with manifest: <%s>', obj_uuid, dst_manifest.getvalue())
 
-    c['manifest_text'] = dst_manifest
+    c['manifest_text'] = dst_manifest.getvalue()
     return create_collection_from(c, src, dst, args)
 
 def select_git_url(api, repo_name, retries, allow_insecure_http, allow_insecure_http_opt):

commit 1e3dce82b4f2f5a8c0d3a75c84bd7a18c4dd82dc
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Tue Sep 8 23:08:02 2020 -0400

    16578: Simplify copy-tutorial based on arv-copy updates
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/tools/copy-tutorial/copy-tutorial.sh b/tools/copy-tutorial/copy-tutorial.sh
index 6addeb1cd..9bede5e39 100755
--- a/tools/copy-tutorial/copy-tutorial.sh
+++ b/tools/copy-tutorial/copy-tutorial.sh
@@ -5,27 +5,23 @@
 
 set -e -o pipefail
 
-if test -z "$1" -o -z "$2"  ; then
+if test -z "$1" ; then
   echo "$0: Copies Arvados tutorial resources from public data cluster (jutro)"
-  echo "Usage: copy-tutorial.sh <dest> <tutorial>"
-  echo "<dest> is 5-character cluster id of the destination"
+  echo "Usage: copy-tutorial.sh <tutorial>"
   echo "<tutorial> is which tutorial to copy, one of:"
   echo " bwa-mem        Tutorial from https://doc.arvados.org/user/tutorials/tutorial-workflow-workbench.html"
   echo " whole-genome   Whole genome variant calling tutorial workflow (large)"
   exit
 fi
 
-src=jutro
-dest=$1
-tutorial=$2
-
-if ! test -f $HOME/.config/arvados/${dest}.conf ; then
-    echo "Please create $HOME/.config/arvados/${dest}.conf with the following contents:"
-    echo "ARVADOS_API_HOST=<${dest} host>"
-    echo "ARVADOS_API_TOKEN=<${dest} token>"
-    exit 1
+if test -z "ARVADOS_API_HOST" ; then
+    echo "Please set ARVADOS_API_HOST to the destination cluster"
+    exit
 fi
 
+src=jutro
+tutorial=$1
+
 if ! test -f $HOME/.config/arvados/jutro.conf ; then
     # Set it up with the anonymous user token.
     echo "ARVADOS_API_HOST=jutro.arvadosapi.com" > $HOME/.config/arvados/jutro.conf
@@ -33,10 +29,8 @@ if ! test -f $HOME/.config/arvados/jutro.conf ; then
     exit 1
 fi
 
-for a in $(cat $HOME/.config/arvados/${dest}.conf) ; do export $a ; done
-
 echo
-echo "Copying from public data cluster (jutro) to $dest"
+echo "Copying from public data cluster (jutro) to $ARVADOS_API_HOST"
 echo
 
 make_project() {
@@ -67,14 +61,7 @@ if test "$tutorial" = "bwa-mem" ; then
     echo "Copying bwa mem tutorial"
     echo
 
-    set -x
-
-    project_uuid=$(make_project 'User guide resources' $parent_project)
-
-    # Bwa-mem workflow
-    arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-7fd4e-mkmmq53m1ze6apx
-
-    set +x
+    arv-copy --project-uuid=$parent_project jutro-j7d0g-rehmt1w5v2p2drp
 
     echo
     echo "Finished, data copied to \"User guide resources\" at $project_uuid"
@@ -87,17 +74,10 @@ if test "$tutorial" = "whole-genome" ; then
     echo "Copying whole genome variant calling tutorial"
     echo
 
-    set -x
-
-    project_uuid=$(make_project 'WGS Processing Tutorial' $parent_project)
-
-    # WGS workflow
-    arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-7fd4e-tnxg9ytblbxm26i
-
-    set +x
+    arv-copy --project-uuid=$parent_project jutro-j7d0g-n2g87m02rsl4cx2
 
     echo
     echo "Finished, data copied to \"WGS Processing Tutorial\" at $project_uuid"
-    echo "You can now go to Workbench and choose 'Run a process' and then select 'bwa-mem.cwl'"
+    echo "You can now go to Workbench and choose 'Run a process' and then select 'WGS Processing Tutorial'"
     echo
 fi

commit 21a8bf8d7f82bfd4f59afbce64d52eabe621151b
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Tue Sep 8 22:57:22 2020 -0400

    16578: Add project copy to arv-copy
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/python/arvados/commands/arv_copy.py b/sdk/python/arvados/commands/arv_copy.py
index dc6cdac88..aee71195d 100755
--- a/sdk/python/arvados/commands/arv_copy.py
+++ b/sdk/python/arvados/commands/arv_copy.py
@@ -2,7 +2,7 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 
-# arv-copy [--recursive] [--no-recursive] object-uuid src dst
+# arv-copy [--recursive] [--no-recursive] object-uuid
 #
 # Copies an object from Arvados instance src to instance dst.
 #
@@ -87,17 +87,17 @@ def main():
         '-f', '--force', dest='force', action='store_true',
         help='Perform copy even if the object appears to exist at the remote destination.')
     copy_opts.add_argument(
-        '--src', dest='source_arvados', required=True,
+        '--src', dest='source_arvados',
         help='The name of the source Arvados instance (required) - points at an Arvados config file. May be either a pathname to a config file, or (for example) "foo" as shorthand for $HOME/.config/arvados/foo.conf.')
     copy_opts.add_argument(
-        '--dst', dest='destination_arvados', required=True,
+        '--dst', dest='destination_arvados',
         help='The name of the destination Arvados instance (required) - points at an Arvados config file. May be either a pathname to a config file, or (for example) "foo" as shorthand for $HOME/.config/arvados/foo.conf.')
     copy_opts.add_argument(
         '--recursive', dest='recursive', action='store_true',
-        help='Recursively copy any dependencies for this object. (default)')
+        help='Recursively copy any dependencies for this object, and subprojects. (default)')
     copy_opts.add_argument(
         '--no-recursive', dest='recursive', action='store_false',
-        help='Do not copy any dependencies. NOTE: if this option is given, the copied object will need to be updated manually in order to be functional.')
+        help='Do not copy any dependencies or subprojects.')
     copy_opts.add_argument(
         '--project-uuid', dest='project_uuid',
         help='The UUID of the project at the destination to which the collection or workflow should be copied.')
@@ -118,6 +118,9 @@ def main():
     else:
         logger.setLevel(logging.INFO)
 
+    if not args.source_arvados:
+        args.source_arvados = args.object_uuid[:5]
+
     # Create API clients for the source and destination instances
     src_arv = api_for_instance(args.source_arvados)
     dst_arv = api_for_instance(args.destination_arvados)
@@ -135,6 +138,9 @@ def main():
     elif t == 'Workflow':
         set_src_owner_uuid(src_arv.workflows(), args.object_uuid, args)
         result = copy_workflow(args.object_uuid, src_arv, dst_arv, args)
+    elif t == 'Group':
+        set_src_owner_uuid(src_arv.groups(), args.object_uuid, args)
+        result = copy_project(args.object_uuid, src_arv, dst_arv, args.project_uuid, args)
     else:
         abort("cannot copy object {} of type {}".format(args.object_uuid, t))
 
@@ -170,6 +176,10 @@ def set_src_owner_uuid(resource, uuid, args):
 #     $HOME/.config/arvados/instance_name.conf
 #
 def api_for_instance(instance_name):
+    if not instance_name:
+        # Use environment
+        return arvados.api('v1', model=OrderedJsonModel())
+
     if '/' in instance_name:
         config_file = instance_name
     else:
@@ -296,7 +306,14 @@ def copy_workflow(wf_uuid, src, dst, args):
     # copy the workflow itself
     del wf['uuid']
     wf['owner_uuid'] = args.project_uuid
-    return dst.workflows().create(body=wf).execute(num_retries=args.retries)
+
+    existing = dst.workflows().list(filters=[["owner_uuid", "=", args.project_uuid],
+                                             ["name", "=", wf["name"]]]).execute()
+    if len(existing["items"]) == 0:
+        return dst.workflows().create(body=wf).execute(num_retries=args.retries)
+    else:
+        return dst.workflows().update(uuid=existing["items"][0]["uuid"], body=wf).execute(num_retries=args.retries)
+
 
 def workflow_collections(obj, locations, docker_images):
     if isinstance(obj, dict):
@@ -632,6 +649,42 @@ def copy_docker_image(docker_image, docker_image_tag, src, dst, args):
     else:
         logger.warning('Could not find docker image {}:{}'.format(docker_image, docker_image_tag))
 
+def copy_project(obj_uuid, src, dst, owner_uuid, args):
+
+    src_project_record = src.groups().get(uuid=obj_uuid).execute(num_retries=args.retries)
+
+    # Create/update the destination project
+    existing = dst.groups().list(filters=[["owner_uuid", "=", owner_uuid],
+                                          ["name", "=", src_project_record["name"]]]).execute(num_retries=args.retries)
+    if len(existing["items"]) == 0:
+        project_record = dst.groups().create(body={"group": {"group_class": "project",
+                                                             "owner_uuid": owner_uuid,
+                                                             "name": src_project_record["name"]}}).execute(num_retries=args.retries)
+    else:
+        project_record = existing["items"][0]
+
+    dst.groups().update(uuid=project_record["uuid"],
+                        body={"group": {
+                            "description": src_project_record["description"]}}).execute(num_retries=args.retries)
+
+    args.project_uuid = project_record["uuid"]
+
+    logger.debug('Copying %s to %s', obj_uuid, project_record["uuid"])
+
+    # Copy collections
+    copy_collections([col["uuid"] for col in arvados.util.list_all(src.collections().list, filters=[["owner_uuid", "=", obj_uuid]])],
+                     src, dst, args)
+
+    # Copy workflows
+    for w in arvados.util.list_all(src.workflows().list, filters=[["owner_uuid", "=", obj_uuid]]):
+        copy_workflow(w["uuid"], src, dst, args)
+
+    if args.recursive:
+        for g in arvados.util.list_all(src.groups().list, filters=[["owner_uuid", "=", obj_uuid]]):
+            copy_project(g["uuid"], src, dst, project_record["uuid"], args)
+
+    return project_record
+
 # git_rev_parse(rev, repo)
 #
 #    Returns the 40-character commit hash corresponding to 'rev' in
@@ -654,7 +707,7 @@ def git_rev_parse(rev, repo):
 #    Special case: if handed a Keep locator hash, return 'Collection'.
 #
 def uuid_type(api, object_uuid):
-    if re.match(r'^[a-f0-9]{32}\+[0-9]+(\+[A-Za-z0-9+-]+)?$', object_uuid):
+    if re.match(arvados.util.keep_locator_pattern, object_uuid):
         return 'Collection'
     p = object_uuid.split('-')
     if len(p) == 3:

commit 9b7a2816e223bd0cae3c9c69cf70afa74748a07d
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Tue Sep 8 10:10:03 2020 -0400

    16578: Copy tutorials script WIP
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/sdk/python/arvados/commands/arv_copy.py b/sdk/python/arvados/commands/arv_copy.py
index 5f12b62ee..dc6cdac88 100755
--- a/sdk/python/arvados/commands/arv_copy.py
+++ b/sdk/python/arvados/commands/arv_copy.py
@@ -305,7 +305,7 @@ def workflow_collections(obj, locations, docker_images):
             if loc.startswith("keep:"):
                 locations.append(loc[5:])
 
-        docker_image = obj.get('dockerImageId', None) or obj.get('dockerPull', None)
+        docker_image = obj.get('dockerImageId', None) or obj.get('dockerPull', None) or obj.get('acrContainerImage', None)
         if docker_image is not None:
             ds = docker_image.split(":", 1)
             tag = ds[1] if len(ds)==2 else 'latest'
diff --git a/tools/copy-tutorial/copy-tutorial.sh b/tools/copy-tutorial/copy-tutorial.sh
index 8d8d2d5e3..6addeb1cd 100755
--- a/tools/copy-tutorial/copy-tutorial.sh
+++ b/tools/copy-tutorial/copy-tutorial.sh
@@ -5,15 +5,19 @@
 
 set -e -o pipefail
 
-if test -z "$1"  ; then
+if test -z "$1" -o -z "$2"  ; then
   echo "$0: Copies Arvados tutorial resources from public data cluster (jutro)"
-  echo "Usage: copy-tutorial.sh <dest>"
+  echo "Usage: copy-tutorial.sh <dest> <tutorial>"
   echo "<dest> is 5-character cluster id of the destination"
+  echo "<tutorial> is which tutorial to copy, one of:"
+  echo " bwa-mem        Tutorial from https://doc.arvados.org/user/tutorials/tutorial-workflow-workbench.html"
+  echo " whole-genome   Whole genome variant calling tutorial workflow (large)"
   exit
 fi
 
 src=jutro
 dest=$1
+tutorial=$2
 
 if ! test -f $HOME/.config/arvados/${dest}.conf ; then
     echo "Please create $HOME/.config/arvados/${dest}.conf with the following contents:"
@@ -32,27 +36,68 @@ fi
 for a in $(cat $HOME/.config/arvados/${dest}.conf) ; do export $a ; done
 
 echo
-echo "Copying bwa mem example from public data cluster (jutro) to $dest"
+echo "Copying from public data cluster (jutro) to $dest"
 echo
 
-set -x
+make_project() {
+    name="$1"
+    owner="$2"
+    if test -z "$owner" ; then
+	owner=$(arv --format=uuid user current)
+    fi
+    project_uuid=$(arv --format=uuid group list --filters '[["name", "=", "'"$name"'"], ["owner_uuid", "=", "'$owner'"]]')
+    if test -z "$project_uuid" ; then
+	project_uuid=$(arv --format=uuid group create --group '{"name":"'"$name"'", "group_class": "project", "owner_uuid": "'$owner'"}')
+	link=$(arv link create --link '{"link_class": "permission", "name": "can_read", "tail_uuid": "'$dest'-j7d0g-anonymouspublic", "head_uuid": "'$project_uuid'"}')
+    fi
+    echo $project_uuid
+}
 
-project_uuid=$(arv --format=uuid group list --filters '[["name", "=", "User guide resources"]]')
-if test -z "$project_uuid" ; then
-    project_uuid=$(arv --format=uuid group create --group '{"name":"User guide resources", "group_class": "project"}')
-    arv link create --link '{"link_class": "permission", "name": "can_read", "tail_uuid": "'$dest'-j7d0g-anonymouspublic", "head_uuid": "'$project_uuid'"}'
-fi
+copy_jobs_image() {
+    if ! arv-keepdocker | grep "arvados/jobs *latest" ; then
+	arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-4zz18-sxmit0qs6i9n2s4
+    fi
+}
+
+parent_project=$(make_project "Tutorial projects")
+copy_jobs_image
+
+if test "$tutorial" = "bwa-mem" ; then
+    echo
+    echo "Copying bwa mem tutorial"
+    echo
+
+    set -x
+
+    project_uuid=$(make_project 'User guide resources' $parent_project)
+
+    # Bwa-mem workflow
+    arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-7fd4e-mkmmq53m1ze6apx
+
+    set +x
 
-if ! arv-keepdocker | grep "arvados/jobs *latest" ; then
-    arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-4zz18-sxmit0qs6i9n2s4
+    echo
+    echo "Finished, data copied to \"User guide resources\" at $project_uuid"
+    echo "You can now go to Workbench and choose 'Run a process' and then select 'bwa-mem.cwl'"
+    echo
 fi
 
-# Bwa-mem workflow
-arv-copy --src jutro --dst $dest --project-uuid=$project_uuid f141fc27e7cfa7f7b6d208df5e0ee01b+59
-arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-7fd4e-mkmmq53m1ze6apx
+if test "$tutorial" = "whole-genome" ; then
+    echo
+    echo "Copying whole genome variant calling tutorial"
+    echo
 
-set +x
+    set -x
 
-echo
-echo "Finished, data copied to \"User guide resources\" at $project_uuid"
-echo
+    project_uuid=$(make_project 'WGS Processing Tutorial' $parent_project)
+
+    # WGS workflow
+    arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-7fd4e-tnxg9ytblbxm26i
+
+    set +x
+
+    echo
+    echo "Finished, data copied to \"WGS Processing Tutorial\" at $project_uuid"
+    echo "You can now go to Workbench and choose 'Run a process' and then select 'bwa-mem.cwl'"
+    echo
+fi

commit 237ebe3735eb8c4622c602d02c1a6119cff42b6b
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Fri Sep 4 16:25:57 2020 -0400

    16578: Copy bwa tutorial from jutro to local cluster
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/tools/copy-tutorial/copy-tutorial.sh b/tools/copy-tutorial/copy-tutorial.sh
index bdc75da2e..8d8d2d5e3 100755
--- a/tools/copy-tutorial/copy-tutorial.sh
+++ b/tools/copy-tutorial/copy-tutorial.sh
@@ -1,25 +1,58 @@
-#!/bin/sh
+#!/bin/bash
 # Copyright (C) The Arvados Authors. All rights reserved.
 #
 # SPDX-License-Identifier: AGPL-3.0
 
-set -e
+set -e -o pipefail
 
 if test -z "$1"  ; then
   echo "$0: Copies Arvados tutorial resources from public data cluster (jutro)"
   echo "Usage: copy-tutorial.sh <dest>"
-  echo "<dest> is destination cluster configuration that can be found in ~/.config/arvados"
+  echo "<dest> is 5-character cluster id of the destination"
   exit
 fi
 
-echo "Copying from public data cluster (jutro) to $1"
+src=jutro
+dest=$1
 
-for a in $(cat $HOME/.config/arvados/$1.conf) ; do export $a ; done
+if ! test -f $HOME/.config/arvados/${dest}.conf ; then
+    echo "Please create $HOME/.config/arvados/${dest}.conf with the following contents:"
+    echo "ARVADOS_API_HOST=<${dest} host>"
+    echo "ARVADOS_API_TOKEN=<${dest} token>"
+    exit 1
+fi
+
+if ! test -f $HOME/.config/arvados/jutro.conf ; then
+    # Set it up with the anonymous user token.
+    echo "ARVADOS_API_HOST=jutro.arvadosapi.com" > $HOME/.config/arvados/jutro.conf
+    echo "ARVADOS_API_TOKEN=v2/jutro-gj3su-e2o9x84aeg7q005/22idg1m3zna4qe4id3n0b9aw86t72jdw8qu1zj45aboh1mm4ej" >> $HOME/.config/arvados/jutro.conf
+    exit 1
+fi
+
+for a in $(cat $HOME/.config/arvados/${dest}.conf) ; do export $a ; done
+
+echo
+echo "Copying bwa mem example from public data cluster (jutro) to $dest"
+echo
 
-project_uuid=$(arv --format=uuid group create --group '{"name":"User guide resources", "group_class": "project"}')
+set -x
+
+project_uuid=$(arv --format=uuid group list --filters '[["name", "=", "User guide resources"]]')
+if test -z "$project_uuid" ; then
+    project_uuid=$(arv --format=uuid group create --group '{"name":"User guide resources", "group_class": "project"}')
+    arv link create --link '{"link_class": "permission", "name": "can_read", "tail_uuid": "'$dest'-j7d0g-anonymouspublic", "head_uuid": "'$project_uuid'"}'
+fi
+
+if ! arv-keepdocker | grep "arvados/jobs *latest" ; then
+    arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-4zz18-sxmit0qs6i9n2s4
+fi
 
 # Bwa-mem workflow
-arv-copy --src jutro --dst $1 --project-uuid=$project_uuid f141fc27e7cfa7f7b6d208df5e0ee01b+59
-arv-copy --src jutro --dst $1 --project-uuid=$project_uuid jutro-7fd4e-mkmmq53m1ze6apx
+arv-copy --src jutro --dst $dest --project-uuid=$project_uuid f141fc27e7cfa7f7b6d208df5e0ee01b+59
+arv-copy --src jutro --dst $dest --project-uuid=$project_uuid jutro-7fd4e-mkmmq53m1ze6apx
+
+set +x
 
-echo "Data copied to \"User guide resources\" at $project_uuid"
+echo
+echo "Finished, data copied to \"User guide resources\" at $project_uuid"
+echo

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list