ob-metaflow-stubs 6.0.3.103rc3__py2.py3-none-any.whl → 6.0.3.105__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 +836 -498
- metaflow-stubs/cards.pyi +211 -5
- metaflow-stubs/cli.pyi +23 -3
- metaflow-stubs/client/__init__.pyi +129 -4
- metaflow-stubs/client/core.pyi +227 -7
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/clone_util.pyi +5 -2
- metaflow-stubs/events.pyi +21 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +71 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +157 -4
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata/metadata.pyi +8 -2
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +39 -36
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +70 -4
- metaflow-stubs/plugins/__init__.pyi +13 -2
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +80 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +5 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +45 -3
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +45 -3
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_events.pyi +16 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +18 -5
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +98 -7
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +33 -5
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +50 -5
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +103 -3
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +15 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +21 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +49 -4
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +21 -3
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_cli.pyi +62 -4
- metaflow-stubs/plugins/cards/card_client.pyi +33 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +5 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +8 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +52 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +28 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +42 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +28 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +183 -3
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +5 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +36 -3
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +55 -2
- metaflow-stubs/plugins/cards/exception.pyi +8 -2
- metaflow-stubs/plugins/catch_decorator.pyi +20 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +63 -3
- metaflow-stubs/plugins/datatools/local.pyi +16 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +72 -3
- metaflow-stubs/plugins/datatools/s3/s3.pyi +82 -5
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +10 -2
- metaflow-stubs/plugins/events_decorator.pyi +106 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +23 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +15 -3
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +12 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +65 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +100 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +5 -2
- metaflow-stubs/plugins/logs_cli.pyi +4 -4
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +29 -2
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +59 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +45 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +33 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +33 -2
- metaflow-stubs/plugins/retry_decorator.pyi +21 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +11 -2
- metaflow-stubs/plugins/storage_executor.pyi +6 -2
- metaflow-stubs/plugins/tag_cli.pyi +36 -5
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +9 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +23 -2
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +71 -132
- metaflow-stubs/runner/metaflow_runner.pyi +117 -9
- metaflow-stubs/runner/nbdeploy.pyi +66 -2
- metaflow-stubs/runner/nbrun.pyi +79 -2
- metaflow-stubs/runner/subprocess_manager.pyi +16 -4
- metaflow-stubs/runner/utils.pyi +32 -2
- metaflow-stubs/system/__init__.pyi +3 -3
- metaflow-stubs/system/system_logger.pyi +2 -2
- metaflow-stubs/system/system_monitor.pyi +3 -3
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- {ob_metaflow_stubs-6.0.3.103rc3.dist-info → ob_metaflow_stubs-6.0.3.105.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.3.105.dist-info/RECORD +140 -0
- ob_metaflow_stubs-6.0.3.103rc3.dist-info/RECORD +0 -140
- {ob_metaflow_stubs-6.0.3.103rc3.dist-info → ob_metaflow_stubs-6.0.3.105.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.3.103rc3.dist-info → ob_metaflow_stubs-6.0.3.105.dist-info}/top_level.txt +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.668413 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -11,5 +11,36 @@ if typing.TYPE_CHECKING:
|
|
11
11
|
import metaflow.decorators
|
12
12
|
|
13
13
|
class ResourcesDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
14
|
+
"""
|
15
|
+
Specifies the resources needed when executing this step.
|
16
|
+
|
17
|
+
Use `@resources` to specify the resource requirements
|
18
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
19
|
+
|
20
|
+
You can choose the compute layer on the command line by executing e.g.
|
21
|
+
```
|
22
|
+
python myflow.py run --with batch
|
23
|
+
```
|
24
|
+
or
|
25
|
+
```
|
26
|
+
python myflow.py run --with kubernetes
|
27
|
+
```
|
28
|
+
which executes the flow on the desired system using the
|
29
|
+
requirements specified in `@resources`.
|
30
|
+
|
31
|
+
Parameters
|
32
|
+
----------
|
33
|
+
cpu : int, default 1
|
34
|
+
Number of CPUs required for this step.
|
35
|
+
gpu : int, default 0
|
36
|
+
Number of GPUs required for this step.
|
37
|
+
disk : int, optional, default None
|
38
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
39
|
+
memory : int, default 4096
|
40
|
+
Memory size (in MB) required for this step.
|
41
|
+
shared_memory : int, optional, default None
|
42
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
43
|
+
This parameter maps to the `--shm-size` option in Docker.
|
44
|
+
"""
|
14
45
|
...
|
15
46
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.668792 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -20,6 +20,25 @@ class MetaflowException(Exception, metaclass=type):
|
|
20
20
|
MAX_ATTEMPTS: int
|
21
21
|
|
22
22
|
class RetryDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
23
|
+
"""
|
24
|
+
Specifies the number of times the task corresponding
|
25
|
+
to a step needs to be retried.
|
26
|
+
|
27
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
28
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
29
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
30
|
+
|
31
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
32
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
33
|
+
ensuring that the flow execution can continue.
|
34
|
+
|
35
|
+
Parameters
|
36
|
+
----------
|
37
|
+
times : int, default 3
|
38
|
+
Number of times to retry this task.
|
39
|
+
minutes_between_retries : int, default 2
|
40
|
+
Number of minutes between retries.
|
41
|
+
"""
|
23
42
|
def step_init(self, flow, graph, step, decos, environment, flow_datastore, logger):
|
24
43
|
...
|
25
44
|
def step_task_retry_count(self):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.672213 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.710233 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.710006 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -69,6 +69,15 @@ def get_secrets_backend_provider(secrets_backend_type):
|
|
69
69
|
...
|
70
70
|
|
71
71
|
class SecretsDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
72
|
+
"""
|
73
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
74
|
+
the execution of a step.
|
75
|
+
|
76
|
+
Parameters
|
77
|
+
----------
|
78
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
79
|
+
List of secret specs, defining how the secrets are to be retrieved
|
80
|
+
"""
|
72
81
|
def task_pre_step(self, step_name, task_datastore, metadata, run_id, task_id, flow, graph, retry_count, max_user_code_retries, ubf_context, inputs):
|
73
82
|
...
|
74
83
|
...
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.671104 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -15,6 +15,10 @@ class MetaflowException(Exception, metaclass=type):
|
|
15
15
|
...
|
16
16
|
|
17
17
|
class StorageExecutor(object, metaclass=type):
|
18
|
+
"""
|
19
|
+
Thin wrapper around a ProcessPoolExecutor, or a ThreadPoolExecutor where
|
20
|
+
the former may be unsafe.
|
21
|
+
"""
|
18
22
|
def __init__(self, use_processes = False):
|
19
23
|
...
|
20
24
|
def warm_up(self):
|
@@ -1,18 +1,18 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.676371 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.exception
|
12
|
-
import datetime
|
13
|
-
import metaflow.events
|
14
11
|
import metaflow.metaflow_current
|
12
|
+
import metaflow.events
|
13
|
+
import datetime
|
15
14
|
import metaflow.client.core
|
15
|
+
import metaflow.exception
|
16
16
|
|
17
17
|
def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
18
18
|
"""
|
@@ -35,6 +35,17 @@ def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
|
|
35
35
|
...
|
36
36
|
|
37
37
|
class Flow(metaflow.client.core.MetaflowObject, metaclass=type):
|
38
|
+
"""
|
39
|
+
A Flow represents all existing flows with a certain name, in other words,
|
40
|
+
classes derived from `FlowSpec`. A container of `Run` objects.
|
41
|
+
|
42
|
+
Attributes
|
43
|
+
----------
|
44
|
+
latest_run : Run
|
45
|
+
Latest `Run` (in progress or completed, successfully or not) of this flow.
|
46
|
+
latest_successful_run : Run
|
47
|
+
Latest successfully completed `Run` of this flow.
|
48
|
+
"""
|
38
49
|
def __init__(self, *args, **kwargs):
|
39
50
|
...
|
40
51
|
@property
|
@@ -121,6 +132,26 @@ class Flow(metaflow.client.core.MetaflowObject, metaclass=type):
|
|
121
132
|
...
|
122
133
|
|
123
134
|
class Run(metaflow.client.core.MetaflowObject, metaclass=type):
|
135
|
+
"""
|
136
|
+
A `Run` represents an execution of a `Flow`. It is a container of `Step`s.
|
137
|
+
|
138
|
+
Attributes
|
139
|
+
----------
|
140
|
+
data : MetaflowData
|
141
|
+
a shortcut to run['end'].task.data, i.e. data produced by this run.
|
142
|
+
successful : bool
|
143
|
+
True if the run completed successfully.
|
144
|
+
finished : bool
|
145
|
+
True if the run completed.
|
146
|
+
finished_at : datetime
|
147
|
+
Time this run finished.
|
148
|
+
code : MetaflowCode
|
149
|
+
Code package for this run (if present). See `MetaflowCode`.
|
150
|
+
trigger : MetaflowTrigger
|
151
|
+
Information about event(s) that triggered this run (if present). See `MetaflowTrigger`.
|
152
|
+
end_task : Task
|
153
|
+
`Task` for the end step (if it is present already).
|
154
|
+
"""
|
124
155
|
def steps(self, *tags: str) -> typing.Iterator[metaflow.client.core.Step]:
|
125
156
|
"""
|
126
157
|
[Legacy function - do not use]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.667387 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -25,6 +25,9 @@ UBF_TASK: str
|
|
25
25
|
CONTROL_TASK_TAG: str
|
26
26
|
|
27
27
|
class MetaDatum(tuple, metaclass=type):
|
28
|
+
"""
|
29
|
+
MetaDatum(field, value, type, tags)
|
30
|
+
"""
|
28
31
|
@staticmethod
|
29
32
|
def __new__(_cls, field, value, type, tags):
|
30
33
|
"""
|
@@ -44,6 +47,10 @@ class MetaDatum(tuple, metaclass=type):
|
|
44
47
|
...
|
45
48
|
|
46
49
|
class InternalTestUnboundedForeachInput(metaflow.unbounded_foreach.UnboundedForeachInput, metaclass=type):
|
50
|
+
"""
|
51
|
+
Test class that wraps around values (any iterator) and simulates an
|
52
|
+
unbounded-foreach instead of a bounded foreach.
|
53
|
+
"""
|
47
54
|
def __init__(self, iterable):
|
48
55
|
...
|
49
56
|
def __iter__(self):
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.668079 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -26,6 +26,27 @@ class TimeoutException(metaflow.exception.MetaflowException, metaclass=type):
|
|
26
26
|
...
|
27
27
|
|
28
28
|
class TimeoutDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
29
|
+
"""
|
30
|
+
Specifies a timeout for your step.
|
31
|
+
|
32
|
+
This decorator is useful if this step may hang indefinitely.
|
33
|
+
|
34
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
35
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
36
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
37
|
+
|
38
|
+
Note that all the values specified in parameters are added together so if you specify
|
39
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
40
|
+
|
41
|
+
Parameters
|
42
|
+
----------
|
43
|
+
seconds : int, default 0
|
44
|
+
Number of seconds to wait prior to timing out.
|
45
|
+
minutes : int, default 0
|
46
|
+
Number of minutes to wait prior to timing out.
|
47
|
+
hours : int, default 0
|
48
|
+
Number of hours to wait prior to timing out.
|
49
|
+
"""
|
29
50
|
def __init__(self, *args, **kwargs):
|
30
51
|
...
|
31
52
|
def step_init(self, flow, graph, step, decos, environment, flow_datastore, logger):
|
metaflow-stubs/procpoll.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.652549 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.625299 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.652150 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,7 +1,7 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.638301 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,145 +1,25 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.24.1+obcheckpoint(0.0.11);ob(v1) #
|
4
|
+
# Generated on 2024-10-04T10:13:10.650677 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.runner.subprocess_manager
|
12
|
-
import metaflow.exception
|
13
11
|
import metaflow.runner.deployer
|
12
|
+
import metaflow.exception
|
13
|
+
import metaflow.runner.subprocess_manager
|
14
14
|
|
15
15
|
class MetaflowNotFound(metaflow.exception.MetaflowException, metaclass=type):
|
16
16
|
...
|
17
17
|
|
18
|
-
class CommandManager(object, metaclass=type):
|
19
|
-
def __init__(self, command: typing.List[str], env: typing.Optional[typing.Dict[str, str]] = None, cwd: typing.Optional[str] = None):
|
20
|
-
"""
|
21
|
-
Create a new CommandManager object.
|
22
|
-
This does not run the process itself but sets it up.
|
23
|
-
|
24
|
-
Parameters
|
25
|
-
----------
|
26
|
-
command : List[str]
|
27
|
-
The command to run in List form.
|
28
|
-
env : Optional[Dict[str, str]], default None
|
29
|
-
Environment variables to set for the subprocess; if not specified,
|
30
|
-
the current enviornment variables are used.
|
31
|
-
cwd : Optional[str], default None
|
32
|
-
The directory to run the subprocess in; if not specified, the current
|
33
|
-
directory is used.
|
34
|
-
"""
|
35
|
-
...
|
36
|
-
def __aenter__(self) -> metaflow.runner.subprocess_manager.CommandManager:
|
37
|
-
...
|
38
|
-
def __aexit__(self, exc_type, exc_value, traceback):
|
39
|
-
...
|
40
|
-
def wait(self, timeout: typing.Optional[float] = None, stream: typing.Optional[str] = None):
|
41
|
-
"""
|
42
|
-
Wait for the subprocess to finish, optionally with a timeout
|
43
|
-
and optionally streaming its output.
|
44
|
-
|
45
|
-
You can only call `wait` if `async_run` has already been called.
|
46
|
-
|
47
|
-
Parameters
|
48
|
-
----------
|
49
|
-
timeout : Optional[float], default None
|
50
|
-
The maximum time to wait for the subprocess to finish.
|
51
|
-
If the timeout is reached, the subprocess is killed.
|
52
|
-
stream : Optional[str], default None
|
53
|
-
If specified, the specified stream is printed to stdout. `stream` can
|
54
|
-
be one of `stdout` or `stderr`.
|
55
|
-
"""
|
56
|
-
...
|
57
|
-
def run(self, show_output: bool = False):
|
58
|
-
"""
|
59
|
-
Run the subprocess synchronously. This can only be called once.
|
60
|
-
|
61
|
-
This also waits on the process implicitly.
|
62
|
-
|
63
|
-
Parameters
|
64
|
-
----------
|
65
|
-
show_output : bool, default False
|
66
|
-
Suppress the 'stdout' and 'stderr' to the console by default.
|
67
|
-
They can be accessed later by reading the files present in:
|
68
|
-
- self.log_files["stdout"]
|
69
|
-
- self.log_files["stderr"]
|
70
|
-
"""
|
71
|
-
...
|
72
|
-
def async_run(self):
|
73
|
-
"""
|
74
|
-
Run the subprocess asynchronously. This can only be called once.
|
75
|
-
|
76
|
-
Once this is called, you can then wait on the process (using `wait`), stream
|
77
|
-
logs (using `stream_logs`) or kill it (using `kill`).
|
78
|
-
"""
|
79
|
-
...
|
80
|
-
def stream_log(self, stream: str, position: typing.Optional[int] = None, timeout_per_line: typing.Optional[float] = None, log_write_delay: float = 0.01) -> typing.Iterator[typing.Tuple[int, str]]:
|
81
|
-
"""
|
82
|
-
Stream logs from the subprocess line by line.
|
83
|
-
|
84
|
-
Parameters
|
85
|
-
----------
|
86
|
-
stream : str
|
87
|
-
The stream to stream logs from. Can be one of "stdout" or "stderr".
|
88
|
-
position : Optional[int], default None
|
89
|
-
The position in the log file to start streaming from. If None, it starts
|
90
|
-
from the beginning of the log file. This allows resuming streaming from
|
91
|
-
a previously known position
|
92
|
-
timeout_per_line : Optional[float], default None
|
93
|
-
The time to wait for a line to be read from the log file. If None, it
|
94
|
-
waits indefinitely. If the timeout is reached, a LogReadTimeoutError
|
95
|
-
is raised. Note that this timeout is *per line* and not cumulative so this
|
96
|
-
function may take significantly more time than `timeout_per_line`
|
97
|
-
log_write_delay : float, default 0.01
|
98
|
-
Improves the probability of getting whole lines. This setting is for
|
99
|
-
advanced use cases.
|
100
|
-
|
101
|
-
Yields
|
102
|
-
------
|
103
|
-
Tuple[int, str]
|
104
|
-
A tuple containing the position in the log file and the line read. The
|
105
|
-
position returned can be used to feed into another `stream_logs` call
|
106
|
-
for example.
|
107
|
-
"""
|
108
|
-
...
|
109
|
-
def emit_logs(self, stream: str = "stdout", custom_logger: typing.Callable[..., None] = print):
|
110
|
-
"""
|
111
|
-
Helper function that can easily emit all the logs for a given stream.
|
112
|
-
|
113
|
-
This function will only terminate when all the log has been printed.
|
114
|
-
|
115
|
-
Parameters
|
116
|
-
----------
|
117
|
-
stream : str, default "stdout"
|
118
|
-
The stream to emit logs for. Can be one of "stdout" or "stderr".
|
119
|
-
custom_logger : Callable[..., None], default print
|
120
|
-
A custom logger function that takes in a string and "emits" it. By default,
|
121
|
-
the log is printed to stdout.
|
122
|
-
"""
|
123
|
-
...
|
124
|
-
def cleanup(self):
|
125
|
-
"""
|
126
|
-
Clean up log files for a running subprocesses.
|
127
|
-
"""
|
128
|
-
...
|
129
|
-
def kill(self, termination_timeout: float = 5):
|
130
|
-
"""
|
131
|
-
Kill the subprocess and its descendants.
|
132
|
-
|
133
|
-
Parameters
|
134
|
-
----------
|
135
|
-
termination_timeout : float, default 5
|
136
|
-
The time to wait after sending a SIGTERM to the process and its descendants
|
137
|
-
before sending a SIGKILL.
|
138
|
-
"""
|
139
|
-
...
|
140
|
-
...
|
141
|
-
|
142
18
|
class SubprocessManager(object, metaclass=type):
|
19
|
+
"""
|
20
|
+
A manager for subprocesses. The subprocess manager manages one or more
|
21
|
+
CommandManager objects, each of which manages an individual subprocess.
|
22
|
+
"""
|
143
23
|
def __init__(self):
|
144
24
|
...
|
145
25
|
def __aenter__(self) -> metaflow.runner.subprocess_manager.SubprocessManager:
|
@@ -215,10 +95,7 @@ class SubprocessManager(object, metaclass=type):
|
|
215
95
|
...
|
216
96
|
...
|
217
97
|
|
218
|
-
def
|
219
|
-
...
|
220
|
-
|
221
|
-
def handle_timeout(tfp_runner_attribute, command_obj: metaflow.runner.subprocess_manager.CommandManager, file_read_timeout: int):
|
98
|
+
def handle_timeout(tfp_runner_attribute, command_obj: "CommandManager", file_read_timeout: int):
|
222
99
|
"""
|
223
100
|
Handle the timeout for a running subprocess command that reads a file
|
224
101
|
and raises an error with appropriate logs if a TimeoutError occurs.
|
@@ -273,6 +150,30 @@ def get_lower_level_group(api, top_level_kwargs: typing.Dict, _type: typing.Opti
|
|
273
150
|
...
|
274
151
|
|
275
152
|
class Deployer(object, metaclass=type):
|
153
|
+
"""
|
154
|
+
Use the `Deployer` class to configure and access one of the production
|
155
|
+
orchestrators supported by Metaflow.
|
156
|
+
|
157
|
+
Parameters
|
158
|
+
----------
|
159
|
+
flow_file : str
|
160
|
+
Path to the flow file to deploy.
|
161
|
+
show_output : bool, default True
|
162
|
+
Show the 'stdout' and 'stderr' to the console by default.
|
163
|
+
profile : Optional[str], default None
|
164
|
+
Metaflow profile to use for the deployment. If not specified, the default
|
165
|
+
profile is used.
|
166
|
+
env : Optional[Dict[str, str]], default None
|
167
|
+
Additional environment variables to set for the deployment.
|
168
|
+
cwd : Optional[str], default None
|
169
|
+
The directory to run the subprocess in; if not specified, the current
|
170
|
+
directory is used.
|
171
|
+
file_read_timeout : int, default 3600
|
172
|
+
The timeout until which we try to read the deployer attribute file.
|
173
|
+
**kwargs : Any
|
174
|
+
Additional arguments that you would pass to `python myflow.py` before
|
175
|
+
the deployment command.
|
176
|
+
"""
|
276
177
|
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):
|
277
178
|
...
|
278
179
|
def _Deployer__make_function(self, deployer_class):
|
@@ -293,6 +194,12 @@ class Deployer(object, metaclass=type):
|
|
293
194
|
...
|
294
195
|
|
295
196
|
class TriggeredRun(object, metaclass=type):
|
197
|
+
"""
|
198
|
+
TriggeredRun class represents a run that has been triggered on a production orchestrator.
|
199
|
+
|
200
|
+
Only when the `start` task starts running, the `run` object corresponding to the run
|
201
|
+
becomes available.
|
202
|
+
"""
|
296
203
|
def __init__(self, deployer: DeployerImpl, content: str):
|
297
204
|
...
|
298
205
|
def wait_for_run(self, timeout = None):
|
@@ -327,11 +234,43 @@ class TriggeredRun(object, metaclass=type):
|
|
327
234
|
...
|
328
235
|
|
329
236
|
class DeployedFlow(object, metaclass=type):
|
237
|
+
"""
|
238
|
+
DeployedFlow class represents a flow that has been deployed.
|
239
|
+
|
240
|
+
Parameters
|
241
|
+
----------
|
242
|
+
deployer : DeployerImpl
|
243
|
+
Instance of the deployer implementation.
|
244
|
+
"""
|
330
245
|
def __init__(self, deployer: DeployerImpl):
|
331
246
|
...
|
332
247
|
...
|
333
248
|
|
334
249
|
class DeployerImpl(object, metaclass=type):
|
250
|
+
"""
|
251
|
+
Base class for deployer implementations. Each implementation should define a TYPE
|
252
|
+
class variable that matches the name of the CLI group.
|
253
|
+
|
254
|
+
Parameters
|
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.
|
273
|
+
"""
|
335
274
|
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):
|
336
275
|
...
|
337
276
|
def __enter__(self) -> DeployerImpl:
|