X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/134815098b060c232d1eee381d1eeb8e9d6162ff..8e36cb0c7568f687e0287c06d987553d2921ad8b:/sdk/cwl/arvados_cwl/arvdocker.py diff --git a/sdk/cwl/arvados_cwl/arvdocker.py b/sdk/cwl/arvados_cwl/arvdocker.py index 7508febb08..6bca07c883 100644 --- a/sdk/cwl/arvados_cwl/arvdocker.py +++ b/sdk/cwl/arvados_cwl/arvdocker.py @@ -31,7 +31,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 dockerRequirement["dockerImageId"] + return cached_lookups[dockerRequirement["dockerImageId"]] with SourceLine(dockerRequirement, "dockerImageId", WorkflowException, logger.isEnabledFor(logging.DEBUG)): sp = dockerRequirement["dockerImageId"].split(":") @@ -70,10 +70,12 @@ 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"]] = True + cached_lookups[dockerRequirement["dockerImageId"]] = pdh - return dockerRequirement["dockerImageId"] + return pdh def arv_docker_clear_cache(): global cached_lookups