metaflow-stubs 2.12.22__py2.py3-none-any.whl → 2.12.23__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 +1029 -638
- metaflow-stubs/cards.pyi +211 -5
- metaflow-stubs/cli.pyi +23 -3
- metaflow-stubs/client/__init__.pyi +128 -3
- metaflow-stubs/client/core.pyi +227 -7
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/clone_util.pyi +5 -2
- metaflow-stubs/events.pyi +20 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +71 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +158 -5
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata/metadata.pyi +9 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +26 -23
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +69 -3
- metaflow-stubs/plugins/__init__.pyi +14 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow.pyi +15 -3
- metaflow-stubs/plugins/airflow/airflow_cli.pyi +66 -3
- metaflow-stubs/plugins/airflow/airflow_decorator.pyi +5 -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 +44 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +44 -2
- 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 +6 -4
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +97 -6
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +34 -6
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +49 -4
- 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_cli.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/dynamo_db_client.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_cli.pyi +69 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_decorator.pyi +5 -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 +41 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +28 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/main.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/metadata.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/renderer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/chevron/tokenizer.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +184 -4
- 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 +35 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +57 -4
- metaflow-stubs/plugins/cards/exception.pyi +8 -2
- metaflow-stubs/plugins/catch_decorator.pyi +20 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +62 -2
- 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 +24 -3
- 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 +3 -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_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +5 -2
- metaflow-stubs/plugins/logs_cli.pyi +2 -2
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +29 -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 +35 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +10 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +23 -2
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +70 -131
- 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 +4 -4
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +3 -3
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.12.22.dist-info → metaflow_stubs-2.12.23.dist-info}/METADATA +2 -2
- metaflow_stubs-2.12.23.dist-info/RECORD +152 -0
- metaflow_stubs-2.12.22.dist-info/RECORD +0 -152
- {metaflow_stubs-2.12.22.dist-info → metaflow_stubs-2.12.23.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.12.22.dist-info → metaflow_stubs-2.12.23.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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.061757 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -9,8 +9,8 @@ from __future__ import annotations
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
11
|
import abc
|
12
|
-
import metaflow.plugins.secrets
|
13
12
|
import metaflow.exception
|
13
|
+
import metaflow.plugins.secrets
|
14
14
|
|
15
15
|
class MetaflowException(Exception, metaclass=type):
|
16
16
|
def __init__(self, msg = "", lineno = None):
|
@@ -34,15 +34,27 @@ def get_credentials(scopes, *args, **kwargs):
|
|
34
34
|
GCP_SECRET_MANAGER_PREFIX: None
|
35
35
|
|
36
36
|
class MetaflowGcpSecretsManagerBadResponse(metaflow.exception.MetaflowException, metaclass=type):
|
37
|
+
"""
|
38
|
+
Raised when the response from GCP Secrets Manager is not valid in some way
|
39
|
+
"""
|
37
40
|
...
|
38
41
|
|
39
42
|
class MetaflowGcpSecretsManagerDuplicateKey(metaflow.exception.MetaflowException, metaclass=type):
|
43
|
+
"""
|
44
|
+
Raised when the response from GCP Secrets Manager contains duplicate keys
|
45
|
+
"""
|
40
46
|
...
|
41
47
|
|
42
48
|
class MetaflowGcpSecretsManagerJSONParseError(metaflow.exception.MetaflowException, metaclass=type):
|
49
|
+
"""
|
50
|
+
Raised when the SecretString response from GCP Secrets Manager is not valid JSON
|
51
|
+
"""
|
43
52
|
...
|
44
53
|
|
45
54
|
class MetaflowGcpSecretsManagerNotJSONObject(metaflow.exception.MetaflowException, metaclass=type):
|
55
|
+
"""
|
56
|
+
Raised when the SecretString response from GCP Secrets Manager is not valid JSON dictionary
|
57
|
+
"""
|
46
58
|
...
|
47
59
|
|
48
60
|
class GcpSecretManagerSecretsProvider(metaflow.plugins.secrets.SecretsProvider, metaclass=abc.ABCMeta):
|
@@ -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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.060845 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.060634 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.061224 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:39.990780 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:39.994613 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.027960 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,15 +1,15 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.026286 #
|
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
11
|
import metaflow.metaflow_current
|
12
|
+
import metaflow.exception
|
13
13
|
|
14
14
|
current: metaflow.metaflow_current.Current
|
15
15
|
|
@@ -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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.029412 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -86,6 +86,69 @@ def parse_kube_keyvalue_list(items: typing.List[str], requires_both: bool = True
|
|
86
86
|
...
|
87
87
|
|
88
88
|
class KubernetesDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
89
|
+
"""
|
90
|
+
Specifies that this step should execute on Kubernetes.
|
91
|
+
|
92
|
+
Parameters
|
93
|
+
----------
|
94
|
+
cpu : int, default 1
|
95
|
+
Number of CPUs required for this step. If `@resources` is
|
96
|
+
also present, the maximum value from all decorators is used.
|
97
|
+
memory : int, default 4096
|
98
|
+
Memory size (in MB) required for this step. If
|
99
|
+
`@resources` is also present, the maximum value from all decorators is
|
100
|
+
used.
|
101
|
+
disk : int, default 10240
|
102
|
+
Disk size (in MB) required for this step. If
|
103
|
+
`@resources` is also present, the maximum value from all decorators is
|
104
|
+
used.
|
105
|
+
image : str, optional, default None
|
106
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
107
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
108
|
+
not, a default Docker image mapping to the current version of Python is used.
|
109
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
110
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
111
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
112
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
113
|
+
secrets : List[str], optional, default None
|
114
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
115
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
116
|
+
in Metaflow configuration.
|
117
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
118
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
119
|
+
Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
|
120
|
+
or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
|
121
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
122
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
123
|
+
gpu : int, optional, default None
|
124
|
+
Number of GPUs required for this step. A value of zero implies that
|
125
|
+
the scheduled node should not have GPUs.
|
126
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
127
|
+
The vendor of the GPUs to be used for this step.
|
128
|
+
tolerations : List[str], default []
|
129
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
130
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
131
|
+
use_tmpfs : bool, default False
|
132
|
+
This enables an explicit tmpfs mount for this step.
|
133
|
+
tmpfs_tempdir : bool, default True
|
134
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
135
|
+
tmpfs_size : int, optional, default: None
|
136
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
137
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
138
|
+
memory allocated for this step.
|
139
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
140
|
+
Path to tmpfs mount for this step.
|
141
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
142
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
143
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
144
|
+
shared_memory: int, optional
|
145
|
+
Shared memory size (in MiB) required for this step
|
146
|
+
port: int, optional
|
147
|
+
Port number to specify in the Kubernetes job object
|
148
|
+
compute_pool : str, optional, default None
|
149
|
+
Compute pool to be used for for this step.
|
150
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
151
|
+
"""
|
89
152
|
def __init__(self, attributes = None, statically_defined = False):
|
90
153
|
...
|
91
154
|
def step_init(self, flow, graph, step, decos, environment, flow_datastore, logger):
|
@@ -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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.024858 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -1,15 +1,15 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.027734 #
|
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
11
|
import metaflow.metaflow_current
|
12
|
+
import metaflow.exception
|
13
13
|
import metaflow.decorators
|
14
14
|
|
15
15
|
current: metaflow.metaflow_current.Current
|
@@ -22,6 +22,9 @@ class MetaflowException(Exception, metaclass=type):
|
|
22
22
|
...
|
23
23
|
|
24
24
|
class MetaDatum(tuple, metaclass=type):
|
25
|
+
"""
|
26
|
+
MetaDatum(field, value, type, tags)
|
27
|
+
"""
|
25
28
|
@staticmethod
|
26
29
|
def __new__(_cls, field, value, type, tags):
|
27
30
|
"""
|
@@ -76,6 +79,37 @@ KUBERNETES_SHARED_MEMORY: None
|
|
76
79
|
KUBERNETES_TOLERATIONS: str
|
77
80
|
|
78
81
|
class ResourcesDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
82
|
+
"""
|
83
|
+
Specifies the resources needed when executing this step.
|
84
|
+
|
85
|
+
Use `@resources` to specify the resource requirements
|
86
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
87
|
+
|
88
|
+
You can choose the compute layer on the command line by executing e.g.
|
89
|
+
```
|
90
|
+
python myflow.py run --with batch
|
91
|
+
```
|
92
|
+
or
|
93
|
+
```
|
94
|
+
python myflow.py run --with kubernetes
|
95
|
+
```
|
96
|
+
which executes the flow on the desired system using the
|
97
|
+
requirements specified in `@resources`.
|
98
|
+
|
99
|
+
Parameters
|
100
|
+
----------
|
101
|
+
cpu : int, default 1
|
102
|
+
Number of CPUs required for this step.
|
103
|
+
gpu : int, default 0
|
104
|
+
Number of GPUs required for this step.
|
105
|
+
disk : int, optional, default None
|
106
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
107
|
+
memory : int, default 4096
|
108
|
+
Memory size (in MB) required for this step.
|
109
|
+
shared_memory : int, optional, default None
|
110
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
111
|
+
This parameter maps to the `--shm-size` option in Docker.
|
112
|
+
"""
|
79
113
|
...
|
80
114
|
|
81
115
|
def get_run_time_limit_for_task(step_decos):
|
@@ -147,6 +181,69 @@ def parse_kube_keyvalue_list(items: typing.List[str], requires_both: bool = True
|
|
147
181
|
...
|
148
182
|
|
149
183
|
class KubernetesDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
184
|
+
"""
|
185
|
+
Specifies that this step should execute on Kubernetes.
|
186
|
+
|
187
|
+
Parameters
|
188
|
+
----------
|
189
|
+
cpu : int, default 1
|
190
|
+
Number of CPUs required for this step. If `@resources` is
|
191
|
+
also present, the maximum value from all decorators is used.
|
192
|
+
memory : int, default 4096
|
193
|
+
Memory size (in MB) required for this step. If
|
194
|
+
`@resources` is also present, the maximum value from all decorators is
|
195
|
+
used.
|
196
|
+
disk : int, default 10240
|
197
|
+
Disk size (in MB) required for this step. If
|
198
|
+
`@resources` is also present, the maximum value from all decorators is
|
199
|
+
used.
|
200
|
+
image : str, optional, default None
|
201
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
202
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
203
|
+
not, a default Docker image mapping to the current version of Python is used.
|
204
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
205
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
206
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
207
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
208
|
+
secrets : List[str], optional, default None
|
209
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
210
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
211
|
+
in Metaflow configuration.
|
212
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
213
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
214
|
+
Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
|
215
|
+
or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
|
216
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
217
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
218
|
+
gpu : int, optional, default None
|
219
|
+
Number of GPUs required for this step. A value of zero implies that
|
220
|
+
the scheduled node should not have GPUs.
|
221
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
222
|
+
The vendor of the GPUs to be used for this step.
|
223
|
+
tolerations : List[str], default []
|
224
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
225
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
226
|
+
use_tmpfs : bool, default False
|
227
|
+
This enables an explicit tmpfs mount for this step.
|
228
|
+
tmpfs_tempdir : bool, default True
|
229
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
230
|
+
tmpfs_size : int, optional, default: None
|
231
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
232
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
233
|
+
memory allocated for this step.
|
234
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
235
|
+
Path to tmpfs mount for this step.
|
236
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
237
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
238
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
239
|
+
shared_memory: int, optional
|
240
|
+
Shared memory size (in MiB) required for this step
|
241
|
+
port: int, optional
|
242
|
+
Port number to specify in the Kubernetes job object
|
243
|
+
compute_pool : str, optional, default None
|
244
|
+
Compute pool to be used for for this step.
|
245
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
246
|
+
"""
|
150
247
|
def __init__(self, attributes = None, statically_defined = False):
|
151
248
|
...
|
152
249
|
def step_init(self, flow, graph, step, decos, environment, flow_datastore, logger):
|
@@ -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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.023876 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.022691 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -30,6 +30,9 @@ def k8s_retry(deadline_seconds = 60, max_backoff = 32):
|
|
30
30
|
...
|
31
31
|
|
32
32
|
class JobsetStatus(tuple, metaclass=type):
|
33
|
+
"""
|
34
|
+
JobsetStatus(control_pod_failed, control_exit_code, control_pod_status, control_started, control_completed, worker_pods_failed, workers_are_suspended, workers_have_started, all_jobs_are_suspended, jobset_finished, jobset_failed, status_unknown, jobset_was_terminated, some_jobs_are_running)
|
35
|
+
"""
|
33
36
|
@staticmethod
|
34
37
|
def __new__(_cls, control_pod_failed, control_exit_code, control_pod_status, control_started, control_completed, worker_pods_failed, workers_are_suspended, workers_have_started, all_jobs_are_suspended, jobset_finished, jobset_failed, status_unknown, jobset_was_terminated, some_jobs_are_running):
|
35
38
|
"""
|
@@ -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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.005484 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.005673 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:39.995599 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -23,6 +23,9 @@ class MetaflowException(Exception, metaclass=type):
|
|
23
23
|
...
|
24
24
|
|
25
25
|
class MetaDatum(tuple, metaclass=type):
|
26
|
+
"""
|
27
|
+
MetaDatum(field, value, type, tags)
|
28
|
+
"""
|
26
29
|
@staticmethod
|
27
30
|
def __new__(_cls, field, value, type, tags):
|
28
31
|
"""
|
@@ -44,6 +47,9 @@ class MetaDatum(tuple, metaclass=type):
|
|
44
47
|
current: metaflow.metaflow_current.Current
|
45
48
|
|
46
49
|
class Parallel(tuple, metaclass=type):
|
50
|
+
"""
|
51
|
+
Parallel(main_ip, num_nodes, node_index, control_task_id)
|
52
|
+
"""
|
47
53
|
@staticmethod
|
48
54
|
def __new__(_cls, main_ip, num_nodes, node_index, control_task_id):
|
49
55
|
"""
|
@@ -63,6 +69,27 @@ class Parallel(tuple, metaclass=type):
|
|
63
69
|
...
|
64
70
|
|
65
71
|
class ParallelDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
72
|
+
"""
|
73
|
+
MF Add To Current
|
74
|
+
-----------------
|
75
|
+
parallel -> metaflow.metaflow_current.Parallel
|
76
|
+
|
77
|
+
@@ Returns
|
78
|
+
-------
|
79
|
+
Parallel
|
80
|
+
`namedtuple` with the following fields:
|
81
|
+
- main_ip : str
|
82
|
+
The IP address of the control task.
|
83
|
+
- num_nodes : int
|
84
|
+
The total number of tasks created by @parallel
|
85
|
+
- node_index : int
|
86
|
+
The index of the current task in all the @parallel tasks.
|
87
|
+
- control_task_id : Optional[str]
|
88
|
+
The task ID of the control task. Available to all tasks.
|
89
|
+
|
90
|
+
is_parallel -> bool
|
91
|
+
True if the current step is a @parallel step.
|
92
|
+
"""
|
66
93
|
def __init__(self, attributes = None, statically_defined = False):
|
67
94
|
...
|
68
95
|
def runtime_step_cli(self, cli_args, retry_count, max_user_code_retries, ubf_context):
|
@@ -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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:39.998007 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -25,6 +25,63 @@ VALID_NAME_RE: str
|
|
25
25
|
VALID_NAME_LEN: int
|
26
26
|
|
27
27
|
class ProjectDecorator(metaflow.decorators.FlowDecorator, metaclass=type):
|
28
|
+
"""
|
29
|
+
Specifies what flows belong to the same project.
|
30
|
+
|
31
|
+
A project-specific namespace is created for all flows that
|
32
|
+
use the same `@project(name)`.
|
33
|
+
|
34
|
+
Parameters
|
35
|
+
----------
|
36
|
+
name : str
|
37
|
+
Project name. Make sure that the name is unique amongst all
|
38
|
+
projects that use the same production scheduler. The name may
|
39
|
+
contain only lowercase alphanumeric characters and underscores.
|
40
|
+
|
41
|
+
MF Add To Current
|
42
|
+
-----------------
|
43
|
+
project_name -> str
|
44
|
+
The name of the project assigned to this flow, i.e. `X` in `@project(name=X)`.
|
45
|
+
|
46
|
+
@@ Returns
|
47
|
+
-------
|
48
|
+
str
|
49
|
+
Project name.
|
50
|
+
|
51
|
+
project_flow_name -> str
|
52
|
+
The flow name prefixed with the current project and branch. This name identifies
|
53
|
+
the deployment on a production scheduler.
|
54
|
+
|
55
|
+
@@ Returns
|
56
|
+
-------
|
57
|
+
str
|
58
|
+
Flow name prefixed with project information.
|
59
|
+
|
60
|
+
branch_name -> str
|
61
|
+
The current branch, i.e. `X` in `--branch=X` set during deployment or run.
|
62
|
+
|
63
|
+
@@ Returns
|
64
|
+
-------
|
65
|
+
str
|
66
|
+
Branch name.
|
67
|
+
|
68
|
+
is_user_branch -> bool
|
69
|
+
True if the flow is deployed without a specific `--branch` or a `--production`
|
70
|
+
flag.
|
71
|
+
|
72
|
+
@@ Returns
|
73
|
+
-------
|
74
|
+
bool
|
75
|
+
True if the deployment does not correspond to a specific branch.
|
76
|
+
|
77
|
+
is_production -> bool
|
78
|
+
True if the flow is deployed with the `--production` flag
|
79
|
+
|
80
|
+
@@ Returns
|
81
|
+
-------
|
82
|
+
bool
|
83
|
+
True if the flow is deployed with `--production`.
|
84
|
+
"""
|
28
85
|
def flow_init(self, flow, graph, environment, flow_datastore, metadata, logger, echo, options):
|
29
86
|
...
|
30
87
|
def get_top_level_options(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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:39.994290 #
|
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.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.019095 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -13,6 +13,9 @@ if typing.TYPE_CHECKING:
|
|
13
13
|
EXT_PKG: str
|
14
14
|
|
15
15
|
class MetaDatum(tuple, metaclass=type):
|
16
|
+
"""
|
17
|
+
MetaDatum(field, value, type, tags)
|
18
|
+
"""
|
16
19
|
@staticmethod
|
17
20
|
def __new__(_cls, field, value, type, tags):
|
18
21
|
"""
|
@@ -34,6 +37,27 @@ class MetaDatum(tuple, metaclass=type):
|
|
34
37
|
INFO_FILE: str
|
35
38
|
|
36
39
|
class CondaStepDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
40
|
+
"""
|
41
|
+
Specifies the Conda environment for the step.
|
42
|
+
|
43
|
+
Information in this decorator will augment any
|
44
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
45
|
+
you can use `@conda_base` to set packages required by all
|
46
|
+
steps and use `@conda` to specify step-specific overrides.
|
47
|
+
|
48
|
+
Parameters
|
49
|
+
----------
|
50
|
+
packages : Dict[str, str], default {}
|
51
|
+
Packages to use for this step. The key is the name of the package
|
52
|
+
and the value is the version to use.
|
53
|
+
libraries : Dict[str, str], default {}
|
54
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
55
|
+
python : str, optional, default None
|
56
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
57
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
58
|
+
disabled : bool, default False
|
59
|
+
If set to True, disables @conda.
|
60
|
+
"""
|
37
61
|
def __init__(self, attributes = None, statically_defined = False):
|
38
62
|
...
|
39
63
|
def is_attribute_user_defined(self, name):
|
@@ -53,6 +77,25 @@ class CondaStepDecorator(metaflow.decorators.StepDecorator, metaclass=type):
|
|
53
77
|
...
|
54
78
|
|
55
79
|
class CondaFlowDecorator(metaflow.decorators.FlowDecorator, metaclass=type):
|
80
|
+
"""
|
81
|
+
Specifies the Conda environment for all steps of the flow.
|
82
|
+
|
83
|
+
Use `@conda_base` to set common libraries required by all
|
84
|
+
steps and use `@conda` to specify step-specific additions.
|
85
|
+
|
86
|
+
Parameters
|
87
|
+
----------
|
88
|
+
packages : Dict[str, str], default {}
|
89
|
+
Packages to use for this flow. The key is the name of the package
|
90
|
+
and the value is the version to use.
|
91
|
+
libraries : Dict[str, str], default {}
|
92
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
93
|
+
python : str, optional, default None
|
94
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
95
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
96
|
+
disabled : bool, default False
|
97
|
+
If set to True, disables Conda.
|
98
|
+
"""
|
56
99
|
def __init__(self, attributes = None, statically_defined = False):
|
57
100
|
...
|
58
101
|
def is_attribute_user_defined(self, name):
|
@@ -1,17 +1,17 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.
|
4
|
-
# Generated on 2024-
|
3
|
+
# MF version: 2.12.23 #
|
4
|
+
# Generated on 2024-10-01T14:32:40.020564 #
|
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.metaflow_environment
|
12
|
-
import metaflow.exception
|
13
11
|
import abc
|
12
|
+
import metaflow.exception
|
14
13
|
import io
|
14
|
+
import metaflow.metaflow_environment
|
15
15
|
|
16
16
|
class MetaflowException(Exception, metaclass=type):
|
17
17
|
def __init__(self, msg = "", lineno = None):
|