1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
5 from cwltool.context import LoadingContext, RuntimeContext
6 from collections import namedtuple
8 class ArvLoadingContext(LoadingContext):
9 def __init__(self, kwargs=None):
10 super(ArvLoadingContext, self).__init__(kwargs)
12 class ArvRuntimeContext(RuntimeContext):
13 def __init__(self, kwargs=None):
15 self.extra_reffiles = []
17 self.enable_reuse = True
19 self.submit_request_uuid = None
20 self.project_uuid = None
21 self.trash_intermediate = False
22 self.intermediate_output_ttl = 0
23 self.update_workflow = ""
24 self.create_workflow = False
25 self.submit_runner_ram = 0
26 self.ignore_docker_for_reuse = False
28 self.submit_runner_image = None
30 self.cwl_runner_job = None
31 self.storage_classes = "default"
32 self.intermediate_storage_classes = "default"
33 self.current_container = None
34 self.http_timeout = 300
35 self.submit_runner_cluster = None
36 self.cluster_target_id = 0
37 self.always_submit_runner = False
38 self.collection_cache_size = 256
39 self.match_local_docker = False
40 self.enable_preemptible = None
42 self.defer_downloads = False
43 self.varying_url_params = ""
44 self.prefer_cached_downloads = False
45 self.cached_docker_lookups = {}
47 super(ArvRuntimeContext, self).__init__(kwargs)
49 if self.submit_request_uuid:
50 self.submit_runner_cluster = self.submit_request_uuid[0:5]
52 def get_outdir(self) -> str:
53 """Return self.outdir or create one with self.tmp_outdir_prefix."""
56 def get_tmpdir(self) -> str:
57 """Return self.tmpdir or create one with self.tmpdir_prefix."""
60 def create_tmpdir(self) -> str:
61 """Return self.tmpdir or create one with self.tmpdir_prefix."""