ob-metaflow-stubs 6.0.3.117__py2.py3-none-any.whl → 6.0.3.118__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- metaflow-stubs/__init__.pyi +319 -2739
- 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 -13
- metaflow-stubs/metaflow_current.pyi +134 -133
- metaflow-stubs/mf_extensions/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +129 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +26 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +156 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +25 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +111 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +188 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +30 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +28 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +19 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +115 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +40 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +71 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +56 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +67 -0
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +49 -0
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +130 -0
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +42 -0
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +6 -0
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +17 -0
- 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 +52 -165
- metaflow-stubs/plugins/airflow/__init__.pyi +9 -5
- 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 +18 -130
- 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 +63 -448
- 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 +9 -5
- metaflow-stubs/plugins/aws/batch/batch.pyi +10 -55
- 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 +9 -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_client.pyi +6 -5
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +52 -292
- 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 +13 -81
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +13 -96
- metaflow-stubs/plugins/cards/card_modules/card.pyi +6 -5
- metaflow-stubs/plugins/cards/card_modules/components.pyi +24 -107
- 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 +12 -5
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +6 -10
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +10 -38
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +16 -155
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +7 -11
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +19 -142
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +7 -11
- metaflow-stubs/plugins/logs_cli.pyi +10 -9
- metaflow-stubs/plugins/package_cli.pyi +7 -5
- metaflow-stubs/plugins/parallel_decorator.pyi +11 -59
- metaflow-stubs/plugins/perimeters.pyi +6 -11
- 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 +8 -13
- 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 +8 -33
- metaflow-stubs/plugins/timeout_decorator.pyi +8 -12
- metaflow-stubs/procpoll.pyi +7 -5
- metaflow-stubs/profilers/__init__.pyi +7 -11
- metaflow-stubs/pylint_wrapper.pyi +7 -11
- metaflow-stubs/runner/__init__.pyi +13 -5
- metaflow-stubs/runner/deployer.pyi +99 -223
- 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 -107
- metaflow-stubs/system/system_logger.pyi +6 -15
- metaflow-stubs/system/system_monitor.pyi +6 -16
- metaflow-stubs/tagging_util.pyi +6 -10
- metaflow-stubs/tuple_util.pyi +6 -5
- {ob_metaflow_stubs-6.0.3.117.dist-info → ob_metaflow_stubs-6.0.3.118.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.118.dist-info/RECORD +174 -0
- metaflow-stubs/metadata/util.pyi +0 -18
- ob_metaflow_stubs-6.0.3.117.dist-info/RECORD +0 -140
- {ob_metaflow_stubs-6.0.3.117.dist-info → ob_metaflow_stubs-6.0.3.118.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.117.dist-info → ob_metaflow_stubs-6.0.3.118.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.30.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-11-13T23:34:52.935544 #
|
5
|
+
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
|
+
import metaflow
|
9
10
|
import typing
|
10
11
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.
|
12
|
+
import metaflow.plugins.aws.step_functions.step_functions_deployer_objects
|
13
|
+
import metaflow.plugins.aws.step_functions.step_functions_deployer
|
14
|
+
import metaflow.plugins.argo.argo_workflows_deployer_objects
|
15
|
+
import metaflow
|
12
16
|
import metaflow.runner.deployer
|
13
|
-
import metaflow.
|
17
|
+
import metaflow.plugins.argo.argo_workflows_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 argo_workflows(self, *, name: typing.Optional[str] = None) -> "metaflow.plugins.argo.argo_workflows_deployer.ArgoWorkflowsDeployer":
|
180
59
|
"""
|
181
|
-
|
60
|
+
Deployer implementation for Argo Workflows.
|
182
61
|
|
183
62
|
Parameters
|
184
63
|
----------
|
185
|
-
|
186
|
-
|
64
|
+
name : str, optional, default None
|
65
|
+
Argo workflow name. The flow name is used instead if this option is not specified.
|
66
|
+
"""
|
67
|
+
...
|
68
|
+
def step_functions(self, *, name: typing.Optional[str] = None) -> "metaflow.plugins.aws.step_functions.step_functions_deployer.StepFunctionsDeployer":
|
69
|
+
"""
|
70
|
+
Deployer implementation for AWS Step Functions.
|
187
71
|
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
72
|
+
Parameters
|
73
|
+
----------
|
74
|
+
name : str, optional, default None
|
75
|
+
State Machine 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,93 +117,85 @@ class TriggeredRun(object, metaclass=type):
|
|
233
117
|
...
|
234
118
|
...
|
235
119
|
|
236
|
-
class
|
237
|
-
def __init__(self, module_path, func_name):
|
238
|
-
...
|
239
|
-
def __call__(self, *args, **kwargs):
|
240
|
-
...
|
241
|
-
...
|
242
|
-
|
243
|
-
class DeploymentMethodsMeta(type, metaclass=type):
|
120
|
+
class DeployedFlowMeta(type, metaclass=type):
|
244
121
|
@staticmethod
|
245
122
|
def __new__(mcs, name, bases, dct):
|
246
123
|
...
|
247
124
|
...
|
248
125
|
|
249
|
-
class DeployedFlow(object, metaclass=
|
126
|
+
class DeployedFlow(object, metaclass=DeployedFlowMeta):
|
250
127
|
"""
|
251
128
|
DeployedFlow class represents a flow that has been deployed.
|
252
129
|
|
253
|
-
|
254
|
-
|
255
|
-
deployer : DeployerImpl
|
256
|
-
Instance of the deployer implementation.
|
257
|
-
"""
|
258
|
-
def __init__(self, deployer: DeployerImpl):
|
259
|
-
...
|
260
|
-
@staticmethod
|
261
|
-
def from_deployment(identifier, metadata = None, impl = None):
|
262
|
-
...
|
263
|
-
...
|
264
|
-
|
265
|
-
class DeployerImpl(object, metaclass=type):
|
130
|
+
This class is not meant to be instantiated directly. Instead, it is returned from
|
131
|
+
methods of `Deployer`.
|
266
132
|
"""
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
Parameters
|
271
|
-
----------
|
272
|
-
flow_file : str
|
273
|
-
Path to the flow file to deploy.
|
274
|
-
show_output : bool, default True
|
275
|
-
Show the 'stdout' and 'stderr' to the console by default.
|
276
|
-
profile : Optional[str], default None
|
277
|
-
Metaflow profile to use for the deployment. If not specified, the default
|
278
|
-
profile is used.
|
279
|
-
env : Optional[Dict], default None
|
280
|
-
Additional environment variables to set for the deployment.
|
281
|
-
cwd : Optional[str], default None
|
282
|
-
The directory to run the subprocess in; if not specified, the current
|
283
|
-
directory is used.
|
284
|
-
file_read_timeout : int, default 3600
|
285
|
-
The timeout until which we try to read the deployer attribute file.
|
286
|
-
**kwargs : Any
|
287
|
-
Additional arguments that you would pass to `python myflow.py` before
|
288
|
-
the deployment command.
|
289
|
-
"""
|
290
|
-
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):
|
291
|
-
...
|
292
|
-
def __enter__(self) -> DeployerImpl:
|
293
|
-
...
|
294
|
-
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"]:
|
295
135
|
"""
|
296
|
-
|
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
|
+
|
297
141
|
|
298
142
|
Parameters
|
299
143
|
----------
|
300
|
-
|
301
|
-
|
302
|
-
|
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
|
+
|
303
152
|
|
304
153
|
Returns
|
305
154
|
-------
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
Raises
|
310
|
-
------
|
311
|
-
Exception
|
312
|
-
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
|
313
157
|
"""
|
314
158
|
...
|
315
|
-
|
159
|
+
@classmethod
|
160
|
+
def from_argo_workflows(cls, *, identifier: str, metadata: typing.Optional[str] = None) -> "metaflow.plugins.argo.argo_workflows_deployer_objects.ArgoWorkflowsDeployedFlow":
|
316
161
|
"""
|
317
|
-
|
162
|
+
Retrieves a `ArgoWorkflowsDeployedFlow` object from an identifier and optional
|
163
|
+
metadata.
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
Parameters
|
168
|
+
----------
|
169
|
+
identifier : str
|
170
|
+
Deployer specific identifier for the workflow to retrieve
|
171
|
+
metadata : str, optional, default None
|
172
|
+
Optional deployer specific metadata.
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
Returns
|
177
|
+
-------
|
178
|
+
ArgoWorkflowsDeployedFlow
|
179
|
+
A `ArgoWorkflowsDeployedFlow` object representing the
|
180
|
+
deployed flow on argo workflows.
|
318
181
|
"""
|
319
182
|
...
|
320
|
-
|
183
|
+
@classmethod
|
184
|
+
def from_step_functions(cls) -> "metaflow.plugins.aws.step_functions.step_functions_deployer_objects.StepFunctionsDeployedFlow":
|
321
185
|
"""
|
322
|
-
|
186
|
+
This method is not currently implemented for Step Functions.
|
187
|
+
|
188
|
+
Raises
|
189
|
+
------
|
190
|
+
NotImplementedError
|
191
|
+
This method is not implemented for Step Functions.
|
192
|
+
|
193
|
+
Parameters
|
194
|
+
----------
|
195
|
+
|
196
|
+
|
197
|
+
Returns
|
198
|
+
-------
|
323
199
|
"""
|
324
200
|
...
|
325
201
|
...
|
@@ -0,0 +1,87 @@
|
|
1
|
+
######################################################################################################
|
2
|
+
# Auto-generated Metaflow stub file #
|
3
|
+
# MF version: 2.12.30.1+obcheckpoint(0.1.4);ob(v1) #
|
4
|
+
# Generated on 2024-11-13T23:34:52.858861 #
|
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
|
+
|