tracdap-runtime 0.6.5__py3-none-any.whl → 0.7.0rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. tracdap/rt/__init__.py +6 -5
  2. tracdap/rt/_exec/actors.py +6 -5
  3. tracdap/rt/_exec/context.py +278 -110
  4. tracdap/rt/_exec/dev_mode.py +237 -143
  5. tracdap/rt/_exec/engine.py +223 -64
  6. tracdap/rt/_exec/functions.py +31 -6
  7. tracdap/rt/_exec/graph.py +15 -5
  8. tracdap/rt/_exec/graph_builder.py +301 -203
  9. tracdap/rt/_exec/runtime.py +13 -10
  10. tracdap/rt/_exec/server.py +6 -5
  11. tracdap/rt/_impl/__init__.py +6 -5
  12. tracdap/rt/_impl/config_parser.py +17 -9
  13. tracdap/rt/_impl/data.py +284 -172
  14. tracdap/rt/_impl/ext/__init__.py +14 -0
  15. tracdap/rt/_impl/ext/sql.py +117 -0
  16. tracdap/rt/_impl/ext/storage.py +58 -0
  17. tracdap/rt/_impl/grpc/__init__.py +6 -5
  18. tracdap/rt/_impl/grpc/codec.py +6 -5
  19. tracdap/rt/_impl/grpc/tracdap/metadata/job_pb2.py +62 -54
  20. tracdap/rt/_impl/grpc/tracdap/metadata/job_pb2.pyi +37 -2
  21. tracdap/rt/_impl/guard_rails.py +6 -5
  22. tracdap/rt/_impl/models.py +6 -5
  23. tracdap/rt/_impl/repos.py +6 -5
  24. tracdap/rt/_impl/schemas.py +6 -5
  25. tracdap/rt/_impl/shim.py +6 -5
  26. tracdap/rt/_impl/static_api.py +30 -16
  27. tracdap/rt/_impl/storage.py +8 -7
  28. tracdap/rt/_impl/type_system.py +6 -5
  29. tracdap/rt/_impl/util.py +16 -5
  30. tracdap/rt/_impl/validation.py +72 -18
  31. tracdap/rt/_plugins/__init__.py +6 -5
  32. tracdap/rt/_plugins/_helpers.py +6 -5
  33. tracdap/rt/_plugins/config_local.py +6 -5
  34. tracdap/rt/_plugins/format_arrow.py +6 -5
  35. tracdap/rt/_plugins/format_csv.py +6 -5
  36. tracdap/rt/_plugins/format_parquet.py +6 -5
  37. tracdap/rt/_plugins/repo_git.py +6 -5
  38. tracdap/rt/_plugins/repo_local.py +6 -5
  39. tracdap/rt/_plugins/repo_pypi.py +6 -5
  40. tracdap/rt/_plugins/storage_aws.py +6 -5
  41. tracdap/rt/_plugins/storage_azure.py +6 -5
  42. tracdap/rt/_plugins/storage_gcp.py +6 -5
  43. tracdap/rt/_plugins/storage_local.py +6 -5
  44. tracdap/rt/_plugins/storage_sql.py +418 -0
  45. tracdap/rt/_plugins/storage_sql_dialects.py +118 -0
  46. tracdap/rt/_version.py +7 -6
  47. tracdap/rt/api/__init__.py +23 -5
  48. tracdap/rt/api/experimental.py +85 -37
  49. tracdap/rt/api/hook.py +16 -5
  50. tracdap/rt/api/model_api.py +110 -90
  51. tracdap/rt/api/static_api.py +142 -100
  52. tracdap/rt/config/common.py +26 -27
  53. tracdap/rt/config/job.py +5 -6
  54. tracdap/rt/config/platform.py +41 -42
  55. tracdap/rt/config/result.py +5 -6
  56. tracdap/rt/config/runtime.py +6 -7
  57. tracdap/rt/exceptions.py +13 -7
  58. tracdap/rt/ext/__init__.py +6 -5
  59. tracdap/rt/ext/config.py +6 -5
  60. tracdap/rt/ext/embed.py +6 -5
  61. tracdap/rt/ext/plugins.py +6 -5
  62. tracdap/rt/ext/repos.py +6 -5
  63. tracdap/rt/ext/storage.py +6 -5
  64. tracdap/rt/launch/__init__.py +10 -5
  65. tracdap/rt/launch/__main__.py +6 -5
  66. tracdap/rt/launch/cli.py +6 -5
  67. tracdap/rt/launch/launch.py +38 -15
  68. tracdap/rt/metadata/__init__.py +4 -0
  69. tracdap/rt/metadata/common.py +2 -3
  70. tracdap/rt/metadata/custom.py +3 -4
  71. tracdap/rt/metadata/data.py +30 -31
  72. tracdap/rt/metadata/file.py +6 -7
  73. tracdap/rt/metadata/flow.py +22 -23
  74. tracdap/rt/metadata/job.py +89 -45
  75. tracdap/rt/metadata/model.py +26 -27
  76. tracdap/rt/metadata/object.py +11 -12
  77. tracdap/rt/metadata/object_id.py +23 -24
  78. tracdap/rt/metadata/resource.py +0 -1
  79. tracdap/rt/metadata/search.py +15 -16
  80. tracdap/rt/metadata/stoarge.py +22 -23
  81. tracdap/rt/metadata/tag.py +8 -9
  82. tracdap/rt/metadata/tag_update.py +11 -12
  83. tracdap/rt/metadata/type.py +38 -38
  84. {tracdap_runtime-0.6.5.dist-info → tracdap_runtime-0.7.0rc1.dist-info}/LICENSE +1 -1
  85. {tracdap_runtime-0.6.5.dist-info → tracdap_runtime-0.7.0rc1.dist-info}/METADATA +4 -2
  86. tracdap_runtime-0.7.0rc1.dist-info/RECORD +121 -0
  87. {tracdap_runtime-0.6.5.dist-info → tracdap_runtime-0.7.0rc1.dist-info}/WHEEL +1 -1
  88. tracdap_runtime-0.6.5.dist-info/RECORD +0 -116
  89. {tracdap_runtime-0.6.5.dist-info → tracdap_runtime-0.7.0rc1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,5 @@
1
1
  # Code generated by TRAC
2
2
 
3
- from __future__ import annotations
4
3
  import typing as _tp # noqa
5
4
  import dataclasses as _dc # noqa
6
5
  import enum as _enum # noqa
@@ -36,124 +35,124 @@ class DeploymentLayout(_enum.Enum):
36
35
  @_dc.dataclass
37
36
  class PlatformConfig:
38
37
 
39
- config: _tp.Dict[str, str] = _dc.field(default_factory=dict)
38
+ config: "_tp.Dict[str, str]" = _dc.field(default_factory=dict)
40
39
 
41
- platformInfo: PlatformInfo = _dc.field(default_factory=lambda: PlatformInfo())
40
+ platformInfo: "PlatformInfo" = _dc.field(default_factory=lambda: PlatformInfo())
42
41
 
43
- authentication: AuthenticationConfig = _dc.field(default_factory=lambda: AuthenticationConfig())
42
+ authentication: "AuthenticationConfig" = _dc.field(default_factory=lambda: AuthenticationConfig())
44
43
 
45
- metadata: MetadataConfig = _dc.field(default_factory=lambda: MetadataConfig())
44
+ metadata: "MetadataConfig" = _dc.field(default_factory=lambda: MetadataConfig())
46
45
 
47
- storage: StorageConfig = _dc.field(default_factory=lambda: StorageConfig())
46
+ storage: "StorageConfig" = _dc.field(default_factory=lambda: StorageConfig())
48
47
 
49
- repositories: _tp.Dict[str, PluginConfig] = _dc.field(default_factory=dict)
48
+ repositories: "_tp.Dict[str, PluginConfig]" = _dc.field(default_factory=dict)
50
49
 
51
- executor: PluginConfig = _dc.field(default_factory=lambda: PluginConfig())
50
+ executor: "PluginConfig" = _dc.field(default_factory=lambda: PluginConfig())
52
51
 
53
- jobCache: PluginConfig = _dc.field(default_factory=lambda: PluginConfig())
52
+ jobCache: "PluginConfig" = _dc.field(default_factory=lambda: PluginConfig())
54
53
 
55
- tenants: _tp.Dict[str, TenantConfig] = _dc.field(default_factory=dict)
54
+ tenants: "_tp.Dict[str, TenantConfig]" = _dc.field(default_factory=dict)
56
55
 
57
- webServer: _tp.Optional[WebServerConfig] = None
56
+ webServer: "_tp.Optional[WebServerConfig]" = None
58
57
 
59
- gateway: _tp.Optional[GatewayConfig] = None
58
+ gateway: "_tp.Optional[GatewayConfig]" = None
60
59
 
61
- services: _tp.Dict[str, ServiceConfig] = _dc.field(default_factory=dict)
60
+ services: "_tp.Dict[str, ServiceConfig]" = _dc.field(default_factory=dict)
62
61
 
63
- deployment: DeploymentConfig = _dc.field(default_factory=lambda: DeploymentConfig())
62
+ deployment: "DeploymentConfig" = _dc.field(default_factory=lambda: DeploymentConfig())
64
63
 
65
64
 
66
65
  @_dc.dataclass
67
66
  class MetadataConfig:
68
67
 
69
- database: PluginConfig = _dc.field(default_factory=lambda: PluginConfig())
68
+ database: "PluginConfig" = _dc.field(default_factory=lambda: PluginConfig())
70
69
 
71
- format: metadata.MetadataFormat = metadata.MetadataFormat.METADATA_FORMAT_NOT_SET
70
+ format: "metadata.MetadataFormat" = metadata.MetadataFormat.METADATA_FORMAT_NOT_SET
72
71
 
73
72
 
74
73
  @_dc.dataclass
75
74
  class TenantConfig:
76
75
 
77
- defaultBucket: _tp.Optional[str] = None
76
+ defaultBucket: "_tp.Optional[str]" = None
78
77
 
79
- defaultFormat: _tp.Optional[str] = None
78
+ defaultFormat: "_tp.Optional[str]" = None
80
79
 
81
80
 
82
81
  @_dc.dataclass
83
82
  class WebServerConfig:
84
83
 
85
- enabled: bool = False
84
+ enabled: "bool" = False
86
85
 
87
- contentRoot: PluginConfig = _dc.field(default_factory=lambda: PluginConfig())
86
+ contentRoot: "PluginConfig" = _dc.field(default_factory=lambda: PluginConfig())
88
87
 
89
- rewriteRules: _tp.List[WebServerRewriteRule] = _dc.field(default_factory=list)
88
+ rewriteRules: "_tp.List[WebServerRewriteRule]" = _dc.field(default_factory=list)
90
89
 
91
- redirects: _tp.List[WebServerRedirect] = _dc.field(default_factory=list)
90
+ redirects: "_tp.List[WebServerRedirect]" = _dc.field(default_factory=list)
92
91
 
93
92
 
94
93
  @_dc.dataclass
95
94
  class WebServerRewriteRule:
96
95
 
97
- source: str = ""
96
+ source: "str" = ""
98
97
 
99
- target: str = ""
98
+ target: "str" = ""
100
99
 
101
100
 
102
101
  @_dc.dataclass
103
102
  class WebServerRedirect:
104
103
 
105
- source: str = ""
104
+ source: "str" = ""
106
105
 
107
- target: str = ""
106
+ target: "str" = ""
108
107
 
109
- status: int = 0
108
+ status: "int" = 0
110
109
 
111
110
 
112
111
  @_dc.dataclass
113
112
  class GatewayConfig:
114
113
 
115
- idleTimeout: int = 0
114
+ idleTimeout: "int" = 0
116
115
 
117
- routes: _tp.List[RouteConfig] = _dc.field(default_factory=list)
116
+ routes: "_tp.List[RouteConfig]" = _dc.field(default_factory=list)
118
117
 
119
- redirects: _tp.List[WebServerRedirect] = _dc.field(default_factory=list)
118
+ redirects: "_tp.List[WebServerRedirect]" = _dc.field(default_factory=list)
120
119
 
121
120
 
122
121
  @_dc.dataclass
123
122
  class RouteConfig:
124
123
 
125
- routeName: str = ""
124
+ routeName: "str" = ""
126
125
 
127
- routeType: RoutingProtocol = RoutingProtocol.PROTOCOL_NOT_SET
126
+ routeType: "RoutingProtocol" = RoutingProtocol.PROTOCOL_NOT_SET
128
127
 
129
- protocols: _tp.List[RoutingProtocol] = _dc.field(default_factory=list)
128
+ protocols: "_tp.List[RoutingProtocol]" = _dc.field(default_factory=list)
130
129
 
131
- match: RoutingMatch = _dc.field(default_factory=lambda: RoutingMatch())
130
+ match: "RoutingMatch" = _dc.field(default_factory=lambda: RoutingMatch())
132
131
 
133
- target: RoutingTarget = _dc.field(default_factory=lambda: RoutingTarget())
132
+ target: "RoutingTarget" = _dc.field(default_factory=lambda: RoutingTarget())
134
133
 
135
134
 
136
135
  @_dc.dataclass
137
136
  class RoutingMatch:
138
137
 
139
- host: str = ""
138
+ host: "str" = ""
140
139
 
141
- path: str = ""
140
+ path: "str" = ""
142
141
 
143
142
 
144
143
  @_dc.dataclass
145
144
  class RoutingTarget:
146
145
 
147
- scheme: str = ""
146
+ scheme: "str" = ""
148
147
 
149
- host: str = ""
148
+ host: "str" = ""
150
149
 
151
- port: int = 0
150
+ port: "int" = 0
152
151
 
153
- path: str = ""
152
+ path: "str" = ""
154
153
 
155
154
 
156
155
  @_dc.dataclass
157
156
  class DeploymentConfig:
158
157
 
159
- layout: DeploymentLayout = DeploymentLayout.LAYOUT_NOT_SET
158
+ layout: "DeploymentLayout" = DeploymentLayout.LAYOUT_NOT_SET
@@ -1,6 +1,5 @@
1
1
  # Code generated by TRAC
2
2
 
3
- from __future__ import annotations
4
3
  import typing as _tp # noqa
5
4
  import dataclasses as _dc # noqa
6
5
  import enum as _enum # noqa
@@ -12,16 +11,16 @@ import tracdap.rt.metadata as metadata
12
11
  @_dc.dataclass
13
12
  class TagUpdateList:
14
13
 
15
- attrs: _tp.List[metadata.TagUpdate] = _dc.field(default_factory=list)
14
+ attrs: "_tp.List[metadata.TagUpdate]" = _dc.field(default_factory=list)
16
15
 
17
16
 
18
17
  @_dc.dataclass
19
18
  class JobResult:
20
19
 
21
- jobId: metadata.TagHeader = _dc.field(default_factory=lambda: metadata.TagHeader())
20
+ jobId: "metadata.TagHeader" = _dc.field(default_factory=lambda: metadata.TagHeader())
22
21
 
23
- statusCode: metadata.JobStatusCode = metadata.JobStatusCode.JOB_STATUS_CODE_NOT_SET
22
+ statusCode: "metadata.JobStatusCode" = metadata.JobStatusCode.JOB_STATUS_CODE_NOT_SET
24
23
 
25
- statusMessage: str = ""
24
+ statusMessage: "str" = ""
26
25
 
27
- results: _tp.Dict[str, metadata.ObjectDefinition] = _dc.field(default_factory=dict)
26
+ results: "_tp.Dict[str, metadata.ObjectDefinition]" = _dc.field(default_factory=dict)
@@ -1,6 +1,5 @@
1
1
  # Code generated by TRAC
2
2
 
3
- from __future__ import annotations
4
3
  import typing as _tp # noqa
5
4
  import dataclasses as _dc # noqa
6
5
  import enum as _enum # noqa
@@ -12,18 +11,18 @@ from .common import * # noqa
12
11
  @_dc.dataclass
13
12
  class RuntimeConfig:
14
13
 
15
- config: _tp.Dict[str, str] = _dc.field(default_factory=dict)
14
+ config: "_tp.Dict[str, str]" = _dc.field(default_factory=dict)
16
15
 
17
- storage: StorageConfig = _dc.field(default_factory=lambda: StorageConfig())
16
+ storage: "StorageConfig" = _dc.field(default_factory=lambda: StorageConfig())
18
17
 
19
- repositories: _tp.Dict[str, PluginConfig] = _dc.field(default_factory=dict)
18
+ repositories: "_tp.Dict[str, PluginConfig]" = _dc.field(default_factory=dict)
20
19
 
21
- sparkSettings: SparkSettings = _dc.field(default_factory=lambda: SparkSettings())
20
+ sparkSettings: "SparkSettings" = _dc.field(default_factory=lambda: SparkSettings())
22
21
 
23
- runtimeApi: ServiceConfig = _dc.field(default_factory=lambda: ServiceConfig())
22
+ runtimeApi: "ServiceConfig" = _dc.field(default_factory=lambda: ServiceConfig())
24
23
 
25
24
 
26
25
  @_dc.dataclass
27
26
  class SparkSettings:
28
27
 
29
- sparkProps: _tp.Dict[str, str] = _dc.field(default_factory=dict)
28
+ sparkProps: "_tp.Dict[str, str]" = _dc.field(default_factory=dict)
tracdap/rt/exceptions.py CHANGED
@@ -1,8 +1,9 @@
1
- # Copyright 2021 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
@@ -13,6 +14,11 @@
13
14
  # limitations under the License.
14
15
 
15
16
 
17
+ """
18
+ Error types raised by the TRAC runtime
19
+ """
20
+
21
+
16
22
  class ETrac(Exception):
17
23
 
18
24
  """
@@ -166,8 +172,8 @@ class EDataCorruption(EData):
166
172
  structure of the binary data stream and will be detected if that data stream cannot be
167
173
  understood.
168
174
 
169
- Data corruption does not include data constraints, such as non-null or range constraints,
170
- which are reported as EDataConstraint.
175
+ Data corruption does not include errors relating to data constraints, such as non-null
176
+ or range constraints, which are reported as :py:class:`EDataConformance`.
171
177
  """
172
178
 
173
179
  pass
@@ -1,8 +1,9 @@
1
- # Copyright 2022 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
tracdap/rt/ext/config.py CHANGED
@@ -1,8 +1,9 @@
1
- # Copyright 2024 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
tracdap/rt/ext/embed.py CHANGED
@@ -1,8 +1,9 @@
1
- # Copyright 2022 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
tracdap/rt/ext/plugins.py CHANGED
@@ -1,8 +1,9 @@
1
- # Copyright 2023 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
tracdap/rt/ext/repos.py CHANGED
@@ -1,8 +1,9 @@
1
- # Copyright 2022 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
tracdap/rt/ext/storage.py CHANGED
@@ -1,8 +1,9 @@
1
- # Copyright 2022 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
@@ -1,8 +1,9 @@
1
- # Copyright 2021 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
@@ -12,5 +13,9 @@
12
13
  # See the License for the specific language governing permissions and
13
14
  # limitations under the License.
14
15
 
16
+ """
17
+ Helper functions for launching models
18
+ """
19
+
15
20
  from .launch import launch_model
16
21
  from .launch import launch_job
@@ -1,8 +1,9 @@
1
- # Copyright 2021 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
tracdap/rt/launch/cli.py CHANGED
@@ -1,8 +1,9 @@
1
- # Copyright 2021 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
@@ -1,8 +1,9 @@
1
- # Copyright 2022 Accenture Global Solutions Limited
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
1
+ # Licensed to the Fintech Open Source Foundation (FINOS) under one or
2
+ # more contributor license agreements. See the NOTICE file distributed
3
+ # with this work for additional information regarding copyright ownership.
4
+ # FINOS licenses this file to you under the Apache License, Version 2.0
5
+ # (the "License"); you may not use this file except in compliance with the
6
+ # License. You may obtain a copy of the License at
6
7
  #
7
8
  # http://www.apache.org/licenses/LICENSE-2.0
8
9
  #
@@ -68,18 +69,19 @@ def _optional_arg(launch_args: _tp.Dict[str, _tp.Any], arg_name: str) -> _tp.Any
68
69
 
69
70
  def launch_model(
70
71
  model_class: _api.TracModel.__class__,
71
- job_config: _tp.Union[str, _pathlib.Path],
72
- sys_config: _tp.Union[str, _pathlib.Path],
72
+ job_config: _tp.Union[_pathlib.Path, str],
73
+ sys_config: _tp.Union[_pathlib.Path, str],
73
74
  **launch_args):
74
75
 
75
76
  """
76
77
  Launch an individual model using its Python class
77
78
 
78
- This launch method launches the supplied model class directly, it must be called
79
+ This function launches the supplied model class directly, it must be called
79
80
  from the Python codebase containing the model class. The TRAC runtime will launch
80
- within the current Python process, job target and model repositories are configured
81
- automatically and dev mode will be enabled. This method is mainly useful for launching
82
- development and debugging runs.
81
+ in dev mode and execute the model inside the current Python process, a minimal
82
+ job definition and set of local resources will be configured automatically.
83
+ This method is useful for launching models during local development
84
+ for debugging and testing.
83
85
 
84
86
  To resolve the paths of the job and system config files, paths are tried in the
85
87
  following order:
@@ -91,7 +93,11 @@ def launch_model(
91
93
  :param model_class: The model class that will be launched
92
94
  :param job_config: Path to the job configuration file
93
95
  :param sys_config: Path to the system configuration file
94
- :param launch_args: Additional keyword args to control behavior of the TRAC runtime (not normally required)
96
+ :param launch_args: Additional arguments to control behavior of the TRAC runtime (not normally required)
97
+
98
+ :type model_class: :py:class:`TracModel.__class__ <tracdap.rt.api.TracModel>`
99
+ :type job_config: :py:class:`pathlib.Path` | str
100
+ :type sys_config: :py:class:`pathlib.Path` | str
95
101
  """
96
102
 
97
103
  model_file = _inspect.getfile(model_class)
@@ -114,18 +120,35 @@ def launch_model(
114
120
 
115
121
 
116
122
  def launch_job(
117
- job_config: _tp.Union[str, _pathlib.Path],
118
- sys_config: _tp.Union[str, _pathlib.Path],
123
+ job_config: _tp.Union[_pathlib.Path, str],
124
+ sys_config: _tp.Union[_pathlib.Path, str],
119
125
  dev_mode: bool = False,
120
126
  **launch_args):
121
127
 
122
128
  """
123
129
  Launch a TRAC job using external configuration files
124
130
 
131
+ This function launches the job definition supplied in the job_config file,
132
+ which must contain enough information to describe the job along with any
133
+ models and other resources that it needs. It allows for running more complex
134
+ job types such as :py:class:`JobType.RUN_FLOW <tracdap.rt.metadata.JobType>`
135
+ and can be used for local development by setting dev_mode = True. If the job
136
+ depends on external resources, those must be specified in the sys_config file.
137
+
138
+ To resolve the paths of the job and system config files, paths are tried in the
139
+ following order:
140
+
141
+ 1. If an absolute path is supplied, this takes priority
142
+ 2. Resolve relative to the current working directory
143
+
125
144
  :param job_config: Path to the job configuration file
126
145
  :param sys_config: Path to the system configuration file
127
146
  :param dev_mode: Whether to launch in dev mode (applies dev mode translation to the job inputs)
128
- :param launch_args: Additional keyword args to control behavior of the TRAC runtime (not normally required)
147
+ :param launch_args: Additional arguments to control behavior of the TRAC runtime (not normally required)
148
+
149
+ :type job_config: :py:class:`pathlib.Path` | str
150
+ :type sys_config: :py:class:`pathlib.Path` | str
151
+ :type dev_mode: bool
129
152
  """
130
153
 
131
154
  _sys_config = _resolve_config_file(sys_config, None)
@@ -45,12 +45,16 @@ from .flow import FlowDefinition
45
45
 
46
46
  from .job import JobType
47
47
  from .job import JobStatusCode
48
+ from .job import JobGroupType
48
49
  from .job import JobDefinition
49
50
  from .job import RunModelJob
50
51
  from .job import RunFlowJob
51
52
  from .job import ImportModelJob
52
53
  from .job import ImportDataJob
53
54
  from .job import ExportDataJob
55
+ from .job import JobGroup
56
+ from .job import SequentialJobGroup
57
+ from .job import ParallelJobGroup
54
58
 
55
59
  from .file import FileDefinition
56
60
 
@@ -1,6 +1,5 @@
1
1
  # Code generated by TRAC
2
2
 
3
- from __future__ import annotations
4
3
  import typing as _tp # noqa
5
4
  import dataclasses as _dc # noqa
6
5
  import enum as _enum # noqa
@@ -49,10 +48,10 @@ class TenantInfo:
49
48
 
50
49
  """Information about a tenant that is set up on the TRAC platform."""
51
50
 
52
- tenantCode: str = ""
51
+ tenantCode: "str" = ""
53
52
 
54
53
  """* Unique code used to identify the tenant, required by most API calls."""
55
54
 
56
- description: str = ""
55
+ description: "str" = ""
57
56
 
58
57
  """* A short description of the tenant, suitable for displaying to users in lists."""
@@ -1,6 +1,5 @@
1
1
  # Code generated by TRAC
2
2
 
3
- from __future__ import annotations
4
3
  import typing as _tp # noqa
5
4
  import dataclasses as _dc # noqa
6
5
  import enum as _enum # noqa
@@ -11,8 +10,8 @@ class CustomDefinition:
11
10
 
12
11
  """Define a custom object that can be stored and managed in the TRAC metadata store"""
13
12
 
14
- customSchemaType: str = ""
13
+ customSchemaType: "str" = ""
15
14
 
16
- customSchemaVersion: int = 0
15
+ customSchemaVersion: "int" = 0
17
16
 
18
- customData: bytes = b""
17
+ customData: "bytes" = b""