metaflow-stubs 2.12.28__py2.py3-none-any.whl → 2.12.29__py2.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.
- metaflow-stubs/__init__.pyi +297 -3001
- metaflow-stubs/cards.pyi +19 -473
- metaflow-stubs/cli.pyi +17 -81
- metaflow-stubs/client/__init__.pyi +19 -1113
- metaflow-stubs/client/core.pyi +18 -158
- metaflow-stubs/client/filecache.pyi +8 -12
- metaflow-stubs/clone_util.pyi +6 -26
- metaflow-stubs/events.pyi +6 -5
- metaflow-stubs/exception.pyi +8 -6
- metaflow-stubs/flowspec.pyi +22 -106
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +16 -564
- metaflow-stubs/info_file.pyi +6 -5
- metaflow-stubs/metadata_provider/__init__.pyi +16 -0
- metaflow-stubs/metadata_provider/heartbeat.pyi +34 -0
- metaflow-stubs/{metadata → metadata_provider}/metadata.pyi +10 -22
- metaflow-stubs/metadata_provider/util.pyi +19 -0
- metaflow-stubs/metaflow_config.pyi +8 -11
- metaflow-stubs/metaflow_current.pyi +10 -9
- metaflow-stubs/mflog/__init__.pyi +6 -0
- metaflow-stubs/mflog/mflog.pyi +52 -5
- metaflow-stubs/multicore_utils.pyi +6 -5
- metaflow-stubs/parameters.pyi +13 -23
- metaflow-stubs/plugins/__init__.pyi +51 -163
- metaflow-stubs/plugins/airflow/__init__.pyi +12 -5
- metaflow-stubs/plugins/airflow/airflow.pyi +19 -130
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +17 -136
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +7 -26
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +7 -6
- metaflow-stubs/plugins/airflow/exception.pyi +7 -11
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +10 -97
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +9 -30
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +9 -40
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +9 -40
- metaflow-stubs/plugins/argo/__init__.pyi +12 -5
- metaflow-stubs/plugins/argo/argo_client.pyi +8 -26
- metaflow-stubs/plugins/argo/argo_events.pyi +7 -11
- metaflow-stubs/plugins/argo/argo_workflows.pyi +16 -120
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +22 -460
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +12 -404
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +65 -322
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +165 -0
- metaflow-stubs/plugins/aws/__init__.pyi +11 -5
- metaflow-stubs/plugins/aws/aws_client.pyi +6 -5
- metaflow-stubs/plugins/aws/aws_utils.pyi +6 -11
- metaflow-stubs/plugins/aws/batch/__init__.pyi +10 -5
- metaflow-stubs/plugins/aws/batch/batch.pyi +10 -55
- metaflow-stubs/plugins/aws/batch/batch_cli.pyi +10 -31
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +7 -11
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +15 -140
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +7 -5
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +10 -21
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +15 -5
- metaflow-stubs/plugins/aws/step_functions/dynamo_db_client.pyi +6 -5
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +6 -5
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +6 -5
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +7 -5
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +11 -65
- metaflow-stubs/plugins/aws/step_functions/step_functions_cli.pyi +19 -175
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +6 -5
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +8 -37
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +53 -290
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +127 -0
- metaflow-stubs/plugins/azure/__init__.pyi +12 -7
- metaflow-stubs/plugins/azure/azure_credential.pyi +6 -5
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +7 -11
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +11 -24
- metaflow-stubs/plugins/azure/azure_utils.pyi +11 -29
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +8 -23
- metaflow-stubs/plugins/azure/includefile_support.pyi +7 -17
- metaflow-stubs/plugins/cards/__init__.pyi +15 -5
- metaflow-stubs/plugins/cards/card_cli.pyi +22 -491
- metaflow-stubs/plugins/cards/card_client.pyi +13 -75
- metaflow-stubs/plugins/cards/card_creator.pyi +7 -10
- metaflow-stubs/plugins/cards/card_datastore.pyi +10 -18
- metaflow-stubs/plugins/cards/card_decorator.pyi +10 -126
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +14 -81
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +14 -97
- metaflow-stubs/plugins/cards/card_modules/card.pyi +6 -5
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +12 -73
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +6 -61
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +6 -5
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +8 -45
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +7 -6
- metaflow-stubs/plugins/cards/card_modules/components.pyi +25 -108
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +6 -5
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +6 -12
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +11 -88
- metaflow-stubs/plugins/cards/card_resolver.pyi +6 -49
- metaflow-stubs/plugins/cards/component_serializer.pyi +13 -63
- metaflow-stubs/plugins/cards/exception.pyi +7 -11
- metaflow-stubs/plugins/catch_decorator.pyi +10 -30
- metaflow-stubs/plugins/datatools/__init__.pyi +13 -392
- metaflow-stubs/plugins/datatools/local.pyi +7 -11
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +19 -653
- metaflow-stubs/plugins/datatools/s3/s3.pyi +16 -264
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +7 -10
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +6 -11
- metaflow-stubs/plugins/debug_logger.pyi +7 -5
- metaflow-stubs/plugins/debug_monitor.pyi +7 -5
- metaflow-stubs/plugins/environment_decorator.pyi +7 -5
- metaflow-stubs/plugins/events_decorator.pyi +8 -14
- metaflow-stubs/plugins/frameworks/__init__.pyi +7 -5
- metaflow-stubs/plugins/frameworks/pytorch.pyi +8 -45
- metaflow-stubs/plugins/gcp/__init__.pyi +11 -7
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +11 -24
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +7 -11
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +6 -5
- metaflow-stubs/plugins/gcp/gs_utils.pyi +8 -20
- metaflow-stubs/plugins/gcp/includefile_support.pyi +7 -17
- metaflow-stubs/plugins/kubernetes/__init__.pyi +13 -5
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +6 -10
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +9 -29
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +16 -155
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +9 -72
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +19 -142
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +8 -41
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +7 -11
- metaflow-stubs/plugins/logs_cli.pyi +11 -10
- metaflow-stubs/plugins/package_cli.pyi +7 -5
- metaflow-stubs/plugins/parallel_decorator.pyi +11 -59
- metaflow-stubs/plugins/project_decorator.pyi +8 -14
- metaflow-stubs/plugins/pypi/__init__.pyi +12 -11
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +8 -27
- metaflow-stubs/plugins/pypi/conda_environment.pyi +14 -20
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +7 -5
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +7 -39
- metaflow-stubs/plugins/pypi/utils.pyi +7 -11
- metaflow-stubs/plugins/resources_decorator.pyi +7 -5
- metaflow-stubs/plugins/retry_decorator.pyi +7 -11
- metaflow-stubs/plugins/secrets/__init__.pyi +9 -5
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +9 -14
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +7 -11
- metaflow-stubs/plugins/storage_executor.pyi +6 -11
- metaflow-stubs/plugins/tag_cli.pyi +14 -396
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +9 -34
- metaflow-stubs/plugins/timeout_decorator.pyi +8 -12
- metaflow-stubs/procpoll.pyi +7 -5
- metaflow-stubs/pylint_wrapper.pyi +7 -11
- metaflow-stubs/runner/__init__.pyi +13 -5
- metaflow-stubs/runner/deployer.pyi +102 -210
- metaflow-stubs/runner/deployer_impl.pyi +87 -0
- metaflow-stubs/runner/metaflow_runner.pyi +24 -508
- metaflow-stubs/runner/nbdeploy.pyi +16 -60
- metaflow-stubs/runner/nbrun.pyi +11 -148
- metaflow-stubs/runner/subprocess_manager.pyi +9 -10
- metaflow-stubs/runner/utils.pyi +44 -9
- metaflow-stubs/system/__init__.pyi +9 -87
- metaflow-stubs/system/system_logger.pyi +7 -6
- metaflow-stubs/system/system_monitor.pyi +6 -5
- metaflow-stubs/tagging_util.pyi +6 -10
- metaflow-stubs/tuple_util.pyi +6 -5
- metaflow-stubs/version.pyi +6 -5
- {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.29.dist-info}/METADATA +2 -2
- metaflow_stubs-2.12.29.dist-info/RECORD +158 -0
- metaflow-stubs/metadata/util.pyi +0 -18
- metaflow_stubs-2.12.28.dist-info/RECORD +0 -152
- {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.29.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.12.28.dist-info → metaflow_stubs-2.12.29.dist-info}/top_level.txt +0 -0
@@ -1,155 +1,34 @@
|
|
1
|
-
|
2
|
-
#
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-11-
|
5
|
-
|
1
|
+
######################################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.12.29 #
|
4
|
+
# Generated on 2024-11-07T22:19:34.661073 #
|
5
|
+
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
|
+
import metaflow
|
10
11
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow
|
12
|
+
import metaflow
|
12
13
|
import metaflow.runner.deployer
|
13
|
-
import metaflow.
|
14
|
+
import metaflow.plugins.argo.argo_workflows_deployer_objects
|
15
|
+
import metaflow.plugins.argo.argo_workflows_deployer
|
16
|
+
import metaflow.plugins.aws.step_functions.step_functions_deployer_objects
|
17
|
+
import metaflow.plugins.aws.step_functions.step_functions_deployer
|
14
18
|
|
15
|
-
|
16
|
-
...
|
19
|
+
from ..exception import MetaflowNotFound as MetaflowNotFound
|
17
20
|
|
18
|
-
|
19
|
-
"""
|
20
|
-
A manager for subprocesses. The subprocess manager manages one or more
|
21
|
-
CommandManager objects, each of which manages an individual subprocess.
|
22
|
-
"""
|
23
|
-
def __init__(self):
|
24
|
-
...
|
25
|
-
def __aenter__(self) -> metaflow.runner.subprocess_manager.SubprocessManager:
|
26
|
-
...
|
27
|
-
def __aexit__(self, exc_type, exc_value, traceback):
|
28
|
-
...
|
29
|
-
def run_command(self, command: typing.List[str], env: typing.Optional[typing.Dict[str, str]] = None, cwd: typing.Optional[str] = None, show_output: bool = False) -> int:
|
30
|
-
"""
|
31
|
-
Run a command synchronously and return its process ID.
|
32
|
-
|
33
|
-
Parameters
|
34
|
-
----------
|
35
|
-
command : List[str]
|
36
|
-
The command to run in List form.
|
37
|
-
env : Optional[Dict[str, str]], default None
|
38
|
-
Environment variables to set for the subprocess; if not specified,
|
39
|
-
the current enviornment variables are used.
|
40
|
-
cwd : Optional[str], default None
|
41
|
-
The directory to run the subprocess in; if not specified, the current
|
42
|
-
directory is used.
|
43
|
-
show_output : bool, default False
|
44
|
-
Suppress the 'stdout' and 'stderr' to the console by default.
|
45
|
-
They can be accessed later by reading the files present in the
|
46
|
-
CommandManager object:
|
47
|
-
- command_obj.log_files["stdout"]
|
48
|
-
- command_obj.log_files["stderr"]
|
49
|
-
Returns
|
50
|
-
-------
|
51
|
-
int
|
52
|
-
The process ID of the subprocess.
|
53
|
-
"""
|
54
|
-
...
|
55
|
-
def async_run_command(self, command: typing.List[str], env: typing.Optional[typing.Dict[str, str]] = None, cwd: typing.Optional[str] = None) -> int:
|
56
|
-
"""
|
57
|
-
Run a command asynchronously and return its process ID.
|
58
|
-
|
59
|
-
Parameters
|
60
|
-
----------
|
61
|
-
command : List[str]
|
62
|
-
The command to run in List form.
|
63
|
-
env : Optional[Dict[str, str]], default None
|
64
|
-
Environment variables to set for the subprocess; if not specified,
|
65
|
-
the current enviornment variables are used.
|
66
|
-
cwd : Optional[str], default None
|
67
|
-
The directory to run the subprocess in; if not specified, the current
|
68
|
-
directory is used.
|
69
|
-
|
70
|
-
Returns
|
71
|
-
-------
|
72
|
-
int
|
73
|
-
The process ID of the subprocess.
|
74
|
-
"""
|
75
|
-
...
|
76
|
-
def get(self, pid: int) -> typing.Optional["CommandManager"]:
|
77
|
-
"""
|
78
|
-
Get one of the CommandManager managed by this SubprocessManager.
|
79
|
-
|
80
|
-
Parameters
|
81
|
-
----------
|
82
|
-
pid : int
|
83
|
-
The process ID of the subprocess (returned by run_command or async_run_command).
|
84
|
-
|
85
|
-
Returns
|
86
|
-
-------
|
87
|
-
Optional[CommandManager]
|
88
|
-
The CommandManager object for the given process ID, or None if not found.
|
89
|
-
"""
|
90
|
-
...
|
91
|
-
def cleanup(self):
|
92
|
-
"""
|
93
|
-
Clean up log files for all running subprocesses.
|
94
|
-
"""
|
95
|
-
...
|
96
|
-
...
|
21
|
+
TYPE_CHECKING: bool
|
97
22
|
|
98
|
-
|
99
|
-
"""
|
100
|
-
Handle the timeout for a running subprocess command that reads a file
|
101
|
-
and raises an error with appropriate logs if a TimeoutError occurs.
|
102
|
-
|
103
|
-
Parameters
|
104
|
-
----------
|
105
|
-
tfp_runner_attribute : NamedTemporaryFile
|
106
|
-
Temporary file that stores runner attribute data.
|
107
|
-
command_obj : CommandManager
|
108
|
-
Command manager object that encapsulates the running command details.
|
109
|
-
file_read_timeout : int
|
110
|
-
Timeout for reading the file.
|
111
|
-
|
112
|
-
Returns
|
113
|
-
-------
|
114
|
-
str
|
115
|
-
Content read from the temporary file.
|
116
|
-
|
117
|
-
Raises
|
118
|
-
------
|
119
|
-
RuntimeError
|
120
|
-
If a TimeoutError occurs, it raises a RuntimeError with the command's
|
121
|
-
stdout and stderr logs.
|
122
|
-
"""
|
123
|
-
...
|
23
|
+
DEFAULT_FROM_DEPLOYMENT_IMPL: str
|
124
24
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
Parameters
|
130
|
-
----------
|
131
|
-
api : MetaflowAPI
|
132
|
-
Metaflow API instance.
|
133
|
-
top_level_kwargs : Dict
|
134
|
-
Top-level keyword arguments to pass to the API.
|
135
|
-
_type : str
|
136
|
-
Type of the deployer implementation to target.
|
137
|
-
deployer_kwargs : Dict
|
138
|
-
Keyword arguments specific to the deployer.
|
139
|
-
|
140
|
-
Returns
|
141
|
-
-------
|
142
|
-
Any
|
143
|
-
The lower-level group object retrieved from the API.
|
144
|
-
|
145
|
-
Raises
|
146
|
-
------
|
147
|
-
ValueError
|
148
|
-
If the `_type` is None.
|
149
|
-
"""
|
25
|
+
class DeployerMeta(type, metaclass=type):
|
26
|
+
@staticmethod
|
27
|
+
def __new__(mcs, name, bases, dct):
|
28
|
+
...
|
150
29
|
...
|
151
30
|
|
152
|
-
class Deployer(object, metaclass=
|
31
|
+
class Deployer(object, metaclass=DeployerMeta):
|
153
32
|
"""
|
154
33
|
Use the `Deployer` class to configure and access one of the production
|
155
34
|
orchestrators supported by Metaflow.
|
@@ -176,40 +55,45 @@ class Deployer(object, metaclass=type):
|
|
176
55
|
"""
|
177
56
|
def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
|
178
57
|
...
|
179
|
-
def
|
58
|
+
def step_functions(self, *, name: typing.Optional[str] = None) -> "metaflow.plugins.aws.step_functions.step_functions_deployer.StepFunctionsDeployer":
|
180
59
|
"""
|
181
|
-
|
60
|
+
Deployer implementation for AWS Step Functions.
|
182
61
|
|
183
62
|
Parameters
|
184
63
|
----------
|
185
|
-
|
186
|
-
|
64
|
+
name : str, optional, default None
|
65
|
+
State Machine name. The flow name is used instead if this option is not specified.
|
66
|
+
"""
|
67
|
+
...
|
68
|
+
def argo_workflows(self, *, name: typing.Optional[str] = None) -> "metaflow.plugins.argo.argo_workflows_deployer.ArgoWorkflowsDeployer":
|
69
|
+
"""
|
70
|
+
Deployer implementation for Argo Workflows.
|
187
71
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
72
|
+
Parameters
|
73
|
+
----------
|
74
|
+
name : str, optional, default None
|
75
|
+
Argo workflow name. The flow name is used instead if this option is not specified.
|
192
76
|
"""
|
193
77
|
...
|
194
78
|
...
|
195
79
|
|
196
80
|
class TriggeredRun(object, metaclass=type):
|
197
81
|
"""
|
198
|
-
TriggeredRun class represents a run that has been triggered on a
|
199
|
-
|
200
|
-
Only when the `start` task starts running, the `run` object corresponding to the run
|
201
|
-
becomes available.
|
82
|
+
TriggeredRun class represents a run that has been triggered on a
|
83
|
+
production orchestrator.
|
202
84
|
"""
|
203
|
-
def
|
204
|
-
...
|
205
|
-
def wait_for_run(self, timeout = None):
|
85
|
+
def wait_for_run(self, timeout: typing.Optional[int] = None):
|
206
86
|
"""
|
207
87
|
Wait for the `run` property to become available.
|
208
88
|
|
89
|
+
The `run` property becomes available only after the `start` task of the triggered
|
90
|
+
flow starts running.
|
91
|
+
|
209
92
|
Parameters
|
210
93
|
----------
|
211
|
-
timeout : int, optional
|
212
|
-
Maximum time to wait for the `run` to become available, in seconds. If
|
94
|
+
timeout : int, optional, default None
|
95
|
+
Maximum time to wait for the `run` to become available, in seconds. If
|
96
|
+
None, wait indefinitely.
|
213
97
|
|
214
98
|
Raises
|
215
99
|
------
|
@@ -218,7 +102,7 @@ class TriggeredRun(object, metaclass=type):
|
|
218
102
|
"""
|
219
103
|
...
|
220
104
|
@property
|
221
|
-
def run(self):
|
105
|
+
def run(self) -> typing.Optional["metaflow.Run"]:
|
222
106
|
"""
|
223
107
|
Retrieve the `Run` object for the triggered run.
|
224
108
|
|
@@ -233,77 +117,85 @@ class TriggeredRun(object, metaclass=type):
|
|
233
117
|
...
|
234
118
|
...
|
235
119
|
|
236
|
-
class
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
Parameters
|
241
|
-
----------
|
242
|
-
deployer : DeployerImpl
|
243
|
-
Instance of the deployer implementation.
|
244
|
-
"""
|
245
|
-
def __init__(self, deployer: DeployerImpl):
|
120
|
+
class DeployedFlowMeta(type, metaclass=type):
|
121
|
+
@staticmethod
|
122
|
+
def __new__(mcs, name, bases, dct):
|
246
123
|
...
|
247
124
|
...
|
248
125
|
|
249
|
-
class
|
126
|
+
class DeployedFlow(object, metaclass=DeployedFlowMeta):
|
250
127
|
"""
|
251
|
-
|
252
|
-
class variable that matches the name of the CLI group.
|
128
|
+
DeployedFlow class represents a flow that has been deployed.
|
253
129
|
|
254
|
-
|
255
|
-
|
256
|
-
flow_file : str
|
257
|
-
Path to the flow file to deploy.
|
258
|
-
show_output : bool, default True
|
259
|
-
Show the 'stdout' and 'stderr' to the console by default.
|
260
|
-
profile : Optional[str], default None
|
261
|
-
Metaflow profile to use for the deployment. If not specified, the default
|
262
|
-
profile is used.
|
263
|
-
env : Optional[Dict], default None
|
264
|
-
Additional environment variables to set for the deployment.
|
265
|
-
cwd : Optional[str], default None
|
266
|
-
The directory to run the subprocess in; if not specified, the current
|
267
|
-
directory is used.
|
268
|
-
file_read_timeout : int, default 3600
|
269
|
-
The timeout until which we try to read the deployer attribute file.
|
270
|
-
**kwargs : Any
|
271
|
-
Additional arguments that you would pass to `python myflow.py` before
|
272
|
-
the deployment command.
|
130
|
+
This class is not meant to be instantiated directly. Instead, it is returned from
|
131
|
+
methods of `Deployer`.
|
273
132
|
"""
|
274
|
-
|
275
|
-
|
276
|
-
def __enter__(self) -> DeployerImpl:
|
277
|
-
...
|
278
|
-
def create(self, **kwargs) -> DeployedFlow:
|
133
|
+
@classmethod
|
134
|
+
def from_deployment(cls, *, identifier: str, metadata: typing.Optional[str] = None, impl: typing.Optional[str] = 'given by METAFLOW_DEFAULT_FROM_DEPLOYMENT_IMPL') -> typing.Union["metaflow.plugins.argo.argo_workflows_deployer_objects.ArgoWorkflowsDeployedFlow", "metaflow.plugins.aws.step_functions.step_functions_deployer_objects.StepFunctionsDeployedFlow"]:
|
279
135
|
"""
|
280
|
-
|
136
|
+
Retrieves a `DeployedFlow` object from an identifier and optional
|
137
|
+
metadata. The `impl` parameter specifies the deployer implementation
|
138
|
+
to use (like `argo-workflows`).
|
139
|
+
|
140
|
+
|
281
141
|
|
282
142
|
Parameters
|
283
143
|
----------
|
284
|
-
|
285
|
-
|
286
|
-
|
144
|
+
identifier : str
|
145
|
+
Deployer specific identifier for the workflow to retrieve
|
146
|
+
metadata : str, optional, default None
|
147
|
+
Optional deployer specific metadata.
|
148
|
+
impl : str, optional, default given by METAFLOW_DEFAULT_FROM_DEPLOYMENT_IMPL
|
149
|
+
The default implementation to use if not specified
|
150
|
+
|
151
|
+
|
287
152
|
|
288
153
|
Returns
|
289
154
|
-------
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
Raises
|
294
|
-
------
|
295
|
-
Exception
|
296
|
-
If there is an error during deployment.
|
155
|
+
typing.Union[ForwardRef('metaflow.plugins.argo.argo_workflows_deployer_objects.ArgoWorkflowsDeployedFlow'), ForwardRef('metaflow.plugins.aws.step_functions.step_functions_deployer_objects.StepFunctionsDeployedFlow')]
|
156
|
+
A `DeployedFlow` object
|
297
157
|
"""
|
298
158
|
...
|
299
|
-
|
159
|
+
@classmethod
|
160
|
+
def from_step_functions(cls) -> "metaflow.plugins.aws.step_functions.step_functions_deployer_objects.StepFunctionsDeployedFlow":
|
300
161
|
"""
|
301
|
-
|
162
|
+
This method is not currently implemented for Step Functions.
|
163
|
+
|
164
|
+
Raises
|
165
|
+
------
|
166
|
+
NotImplementedError
|
167
|
+
This method is not implemented for Step Functions.
|
168
|
+
|
169
|
+
Parameters
|
170
|
+
----------
|
171
|
+
|
172
|
+
|
173
|
+
Returns
|
174
|
+
-------
|
302
175
|
"""
|
303
176
|
...
|
304
|
-
|
177
|
+
@classmethod
|
178
|
+
def from_argo_workflows(cls, *, identifier: str, metadata: typing.Optional[str] = None) -> "metaflow.plugins.argo.argo_workflows_deployer_objects.ArgoWorkflowsDeployedFlow":
|
305
179
|
"""
|
306
|
-
|
180
|
+
Retrieves a `ArgoWorkflowsDeployedFlow` object from an identifier and optional
|
181
|
+
metadata.
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
Parameters
|
186
|
+
----------
|
187
|
+
identifier : str
|
188
|
+
Deployer specific identifier for the workflow to retrieve
|
189
|
+
metadata : str, optional, default None
|
190
|
+
Optional deployer specific metadata.
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
Returns
|
195
|
+
-------
|
196
|
+
ArgoWorkflowsDeployedFlow
|
197
|
+
A `ArgoWorkflowsDeployedFlow` object representing the
|
198
|
+
deployed flow on argo workflows.
|
307
199
|
"""
|
308
200
|
...
|
309
201
|
...
|
@@ -0,0 +1,87 @@
|
|
1
|
+
######################################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.12.29 #
|
4
|
+
# Generated on 2024-11-07T22:19:34.582946 #
|
5
|
+
######################################################################################################
|
6
|
+
|
7
|
+
from __future__ import annotations
|
8
|
+
|
9
|
+
import typing
|
10
|
+
if typing.TYPE_CHECKING:
|
11
|
+
import metaflow.runner.deployer
|
12
|
+
import typing
|
13
|
+
|
14
|
+
from .subprocess_manager import SubprocessManager as SubprocessManager
|
15
|
+
from .utils import get_lower_level_group as get_lower_level_group
|
16
|
+
from .utils import handle_timeout as handle_timeout
|
17
|
+
|
18
|
+
TYPE_CHECKING: bool
|
19
|
+
|
20
|
+
class DeployerImpl(object, metaclass=type):
|
21
|
+
"""
|
22
|
+
Base class for deployer implementations. Each implementation should define a TYPE
|
23
|
+
class variable that matches the name of the CLI group.
|
24
|
+
|
25
|
+
Parameters
|
26
|
+
----------
|
27
|
+
flow_file : str
|
28
|
+
Path to the flow file to deploy.
|
29
|
+
show_output : bool, default True
|
30
|
+
Show the 'stdout' and 'stderr' to the console by default.
|
31
|
+
profile : Optional[str], default None
|
32
|
+
Metaflow profile to use for the deployment. If not specified, the default
|
33
|
+
profile is used.
|
34
|
+
env : Optional[Dict], default None
|
35
|
+
Additional environment variables to set for the deployment.
|
36
|
+
cwd : Optional[str], default None
|
37
|
+
The directory to run the subprocess in; if not specified, the current
|
38
|
+
directory is used.
|
39
|
+
file_read_timeout : int, default 3600
|
40
|
+
The timeout until which we try to read the deployer attribute file.
|
41
|
+
**kwargs : Any
|
42
|
+
Additional arguments that you would pass to `python myflow.py` before
|
43
|
+
the deployment command.
|
44
|
+
"""
|
45
|
+
def __init__(self, flow_file: str, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, cwd: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
|
46
|
+
...
|
47
|
+
@property
|
48
|
+
def deployer_kwargs(self) -> typing.Dict[str, typing.Any]:
|
49
|
+
...
|
50
|
+
@staticmethod
|
51
|
+
def deployed_flow_type() -> typing.Type["metaflow.runner.deployer.DeployedFlow"]:
|
52
|
+
...
|
53
|
+
def __enter__(self) -> "DeployerImpl":
|
54
|
+
...
|
55
|
+
def create(self, **kwargs) -> "metaflow.runner.deployer.DeployedFlow":
|
56
|
+
"""
|
57
|
+
Create a sub-class of a `DeployedFlow` depending on the deployer implementation.
|
58
|
+
|
59
|
+
Parameters
|
60
|
+
----------
|
61
|
+
**kwargs : Any
|
62
|
+
Additional arguments to pass to `create` corresponding to the
|
63
|
+
command line arguments of `create`
|
64
|
+
|
65
|
+
Returns
|
66
|
+
-------
|
67
|
+
DeployedFlow
|
68
|
+
DeployedFlow object representing the deployed flow.
|
69
|
+
|
70
|
+
Raises
|
71
|
+
------
|
72
|
+
Exception
|
73
|
+
If there is an error during deployment.
|
74
|
+
"""
|
75
|
+
...
|
76
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
77
|
+
"""
|
78
|
+
Cleanup resources on exit.
|
79
|
+
"""
|
80
|
+
...
|
81
|
+
def cleanup(self):
|
82
|
+
"""
|
83
|
+
Cleanup resources.
|
84
|
+
"""
|
85
|
+
...
|
86
|
+
...
|
87
|
+
|