X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/04b9d6e93ca8bd18dca697e56689820516c8c572..d7e80d62a0e1c8587c65975c8bb020200cd0d7d6:/sdk/cwl/arvados_cwl/context.py diff --git a/sdk/cwl/arvados_cwl/context.py b/sdk/cwl/arvados_cwl/context.py index 48a3edec52..316250106b 100644 --- a/sdk/cwl/arvados_cwl/context.py +++ b/sdk/cwl/arvados_cwl/context.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 from cwltool.context import LoadingContext, RuntimeContext +from collections import namedtuple class ArvLoadingContext(LoadingContext): def __init__(self, kwargs=None): @@ -28,7 +29,29 @@ class ArvRuntimeContext(RuntimeContext): self.wait = True self.cwl_runner_job = None self.storage_classes = "default" + self.intermediate_storage_classes = "default" self.current_container = None self.http_timeout = 300 + self.submit_runner_cluster = None + self.cluster_target_id = 0 + self.always_submit_runner = False + self.collection_cache_size = 256 + self.match_local_docker = False + self.enable_preemptible = None super(ArvRuntimeContext, self).__init__(kwargs) + + if self.submit_request_uuid: + self.submit_runner_cluster = self.submit_request_uuid[0:5] + + def get_outdir(self) -> str: + """Return self.outdir or create one with self.tmp_outdir_prefix.""" + return self.outdir + + def get_tmpdir(self) -> str: + """Return self.tmpdir or create one with self.tmpdir_prefix.""" + return self.tmpdir + + def create_tmpdir(self) -> str: + """Return self.tmpdir or create one with self.tmpdir_prefix.""" + return self.tmpdir