X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8e6cd14b7884a691a110110b0f366577437c6d9e..67fbf00f0d868384f1585f2473b5f89455001638:/sdk/cwl/arvados_cwl/arvdocker.py diff --git a/sdk/cwl/arvados_cwl/arvdocker.py b/sdk/cwl/arvados_cwl/arvdocker.py index 88c5dd2d4f..4fc8b8e722 100644 --- a/sdk/cwl/arvados_cwl/arvdocker.py +++ b/sdk/cwl/arvados_cwl/arvdocker.py @@ -1,6 +1,7 @@ import logging import sys import threading +import copy from schema_salad.sourceline import SourceLine @@ -17,6 +18,7 @@ def arv_docker_get_image(api_client, dockerRequirement, pull_image, project_uuid """Check if a Docker image is available in Keep, if not, upload it using arv-keepdocker.""" if "dockerImageId" not in dockerRequirement and "dockerPull" in dockerRequirement: + dockerRequirement = copy.deepcopy(dockerRequirement) dockerRequirement["dockerImageId"] = dockerRequirement["dockerPull"] if hasattr(dockerRequirement, 'lc'): dockerRequirement.lc.data["dockerImageId"] = dockerRequirement.lc.data["dockerPull"] @@ -25,7 +27,7 @@ def arv_docker_get_image(api_client, dockerRequirement, pull_image, project_uuid global cached_lookups_lock with cached_lookups_lock: if dockerRequirement["dockerImageId"] in cached_lookups: - return cached_lookups[dockerRequirement["dockerImageId"]] + return dockerRequirement["dockerImageId"] with SourceLine(dockerRequirement, "dockerImageId", WorkflowException): sp = dockerRequirement["dockerImageId"].split(":") @@ -61,12 +63,10 @@ def arv_docker_get_image(api_client, dockerRequirement, pull_image, project_uuid if not images: raise WorkflowException("Could not find Docker image %s:%s" % (image_name, image_tag)) - pdh = api_client.collections().get(uuid=images[0][0]).execute()["portable_data_hash"] - with cached_lookups_lock: - cached_lookups[dockerRequirement["dockerImageId"]] = pdh + cached_lookups[dockerRequirement["dockerImageId"]] = True - return pdh + return dockerRequirement["dockerImageId"] def arv_docker_clear_cache(): global cached_lookups