Merge branch '16809-s3-v4-signature'
[arvados.git] / sdk / cwl / arvados_cwl / context.py
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 from cwltool.context import LoadingContext, RuntimeContext
6 from collections import namedtuple
7
8 class ArvLoadingContext(LoadingContext):
9     def __init__(self, kwargs=None):
10         super(ArvLoadingContext, self).__init__(kwargs)
11
12 class ArvRuntimeContext(RuntimeContext):
13     def __init__(self, kwargs=None):
14         self.work_api = None
15         self.extra_reffiles = []
16         self.priority = 500
17         self.enable_reuse = True
18         self.runnerjob = ""
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
27         self.submit = True
28         self.submit_runner_image = None
29         self.wait = True
30         self.cwl_runner_job = None
31         self.storage_classes = "default"
32         self.current_container = None
33         self.http_timeout = 300
34         self.submit_runner_cluster = None
35         self.cluster_target_id = 0
36         self.always_submit_runner = False
37         self.collection_cache_size = 256
38
39         super(ArvRuntimeContext, self).__init__(kwargs)
40
41         if self.submit_request_uuid:
42             self.submit_runner_cluster = self.submit_request_uuid[0:5]