metaflow-stubs 2.15.17__py2.py3-none-any.whl → 2.15.18__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 +369 -369
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +2 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +3 -3
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +4 -4
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- metaflow-stubs/info_file.pyi +2 -2
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +3 -3
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -4
- metaflow-stubs/metaflow_current.pyi +22 -22
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +10 -10
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_decorator.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 +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -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 +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +5 -5
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +4 -4
- metaflow-stubs/plugins/aws/__init__.pyi +3 -3
- 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 +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -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/schedule_decorator.pyi +2 -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_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
- 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 +3 -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_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -4
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
- 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 +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -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 +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_job.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
- metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -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 +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/plugins/uv/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/uv_environment.pyi +3 -3
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +31 -31
- metaflow-stubs/runner/deployer_impl.pyi +3 -3
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +2 -2
- metaflow-stubs/runner/utils.pyi +4 -4
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -2
- metaflow-stubs/user_configs/config_decorators.pyi +6 -6
- metaflow-stubs/user_configs/config_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +5 -5
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.15.17.dist-info → metaflow_stubs-2.15.18.dist-info}/METADATA +2 -2
- metaflow_stubs-2.15.18.dist-info/RECORD +149 -0
- metaflow_stubs-2.15.17.dist-info/RECORD +0 -149
- {metaflow_stubs-2.15.17.dist-info → metaflow_stubs-2.15.18.dist-info}/WHEEL +0 -0
- {metaflow_stubs-2.15.17.dist-info → metaflow_stubs-2.15.18.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.15.
|
4
|
-
# Generated on 2025-06-
|
3
|
+
# MF version: 2.15.18 #
|
4
|
+
# Generated on 2025-06-19T23:01:30.833215 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import datetime
|
12
11
|
import typing
|
12
|
+
import datetime
|
13
13
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
14
14
|
StepFlag = typing.NewType("StepFlag", bool)
|
15
15
|
|
@@ -44,8 +44,8 @@ from .plugins.datatools.s3.s3 import S3 as S3
|
|
44
44
|
from . import includefile as includefile
|
45
45
|
from .includefile import IncludeFile as IncludeFile
|
46
46
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
47
|
-
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
48
47
|
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
48
|
+
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
49
49
|
from . import cards as cards
|
50
50
|
from . import client as client
|
51
51
|
from .client.core import namespace as namespace
|
@@ -146,192 +146,36 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
146
146
|
"""
|
147
147
|
...
|
148
148
|
|
149
|
-
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
150
|
-
"""
|
151
|
-
Specifies that this step should execute on Kubernetes.
|
152
|
-
|
153
|
-
|
154
|
-
Parameters
|
155
|
-
----------
|
156
|
-
cpu : int, default 1
|
157
|
-
Number of CPUs required for this step. If `@resources` is
|
158
|
-
also present, the maximum value from all decorators is used.
|
159
|
-
memory : int, default 4096
|
160
|
-
Memory size (in MB) required for this step. If
|
161
|
-
`@resources` is also present, the maximum value from all decorators is
|
162
|
-
used.
|
163
|
-
disk : int, default 10240
|
164
|
-
Disk size (in MB) required for this step. If
|
165
|
-
`@resources` is also present, the maximum value from all decorators is
|
166
|
-
used.
|
167
|
-
image : str, optional, default None
|
168
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
169
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
170
|
-
not, a default Docker image mapping to the current version of Python is used.
|
171
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
172
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
173
|
-
image_pull_secrets: List[str], default []
|
174
|
-
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
175
|
-
Kubernetes image pull secrets to use when pulling container images
|
176
|
-
in Kubernetes.
|
177
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
178
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
179
|
-
secrets : List[str], optional, default None
|
180
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
181
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
182
|
-
in Metaflow configuration.
|
183
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
184
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
185
|
-
Can be passed in as a comma separated string of values e.g.
|
186
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
187
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
188
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
189
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
190
|
-
gpu : int, optional, default None
|
191
|
-
Number of GPUs required for this step. A value of zero implies that
|
192
|
-
the scheduled node should not have GPUs.
|
193
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
194
|
-
The vendor of the GPUs to be used for this step.
|
195
|
-
tolerations : List[str], default []
|
196
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
197
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
198
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
199
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
200
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
201
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
202
|
-
use_tmpfs : bool, default False
|
203
|
-
This enables an explicit tmpfs mount for this step.
|
204
|
-
tmpfs_tempdir : bool, default True
|
205
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
206
|
-
tmpfs_size : int, optional, default: None
|
207
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
208
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
209
|
-
memory allocated for this step.
|
210
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
211
|
-
Path to tmpfs mount for this step.
|
212
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
213
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
214
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
215
|
-
shared_memory: int, optional
|
216
|
-
Shared memory size (in MiB) required for this step
|
217
|
-
port: int, optional
|
218
|
-
Port number to specify in the Kubernetes job object
|
219
|
-
compute_pool : str, optional, default None
|
220
|
-
Compute pool to be used for for this step.
|
221
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
222
|
-
hostname_resolution_timeout: int, default 10 * 60
|
223
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
224
|
-
Only applicable when @parallel is used.
|
225
|
-
qos: str, default: Burstable
|
226
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
227
|
-
|
228
|
-
security_context: Dict[str, Any], optional, default None
|
229
|
-
Container security context. Applies to the task container. Allows the following keys:
|
230
|
-
- privileged: bool, optional, default None
|
231
|
-
- allow_privilege_escalation: bool, optional, default None
|
232
|
-
- run_as_user: int, optional, default None
|
233
|
-
- run_as_group: int, optional, default None
|
234
|
-
- run_as_non_root: bool, optional, default None
|
235
|
-
"""
|
236
|
-
...
|
237
|
-
|
238
|
-
@typing.overload
|
239
|
-
def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
240
|
-
"""
|
241
|
-
Specifies the PyPI packages for the step.
|
242
|
-
|
243
|
-
Information in this decorator will augment any
|
244
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
245
|
-
you can use `@pypi_base` to set packages required by all
|
246
|
-
steps and use `@pypi` to specify step-specific overrides.
|
247
|
-
|
248
|
-
|
249
|
-
Parameters
|
250
|
-
----------
|
251
|
-
packages : Dict[str, str], default: {}
|
252
|
-
Packages to use for this step. The key is the name of the package
|
253
|
-
and the value is the version to use.
|
254
|
-
python : str, optional, default: None
|
255
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
256
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
257
|
-
"""
|
258
|
-
...
|
259
|
-
|
260
149
|
@typing.overload
|
261
|
-
def
|
262
|
-
...
|
263
|
-
|
264
|
-
@typing.overload
|
265
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
266
|
-
...
|
267
|
-
|
268
|
-
def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
269
|
-
"""
|
270
|
-
Specifies the PyPI packages for the step.
|
271
|
-
|
272
|
-
Information in this decorator will augment any
|
273
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
274
|
-
you can use `@pypi_base` to set packages required by all
|
275
|
-
steps and use `@pypi` to specify step-specific overrides.
|
276
|
-
|
277
|
-
|
278
|
-
Parameters
|
279
|
-
----------
|
280
|
-
packages : Dict[str, str], default: {}
|
281
|
-
Packages to use for this step. The key is the name of the package
|
282
|
-
and the value is the version to use.
|
283
|
-
python : str, optional, default: None
|
284
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
285
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
286
|
-
"""
|
287
|
-
...
|
288
|
-
|
289
|
-
@typing.overload
|
290
|
-
def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
150
|
+
def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
291
151
|
"""
|
292
|
-
|
293
|
-
|
294
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
152
|
+
Specifies environment variables to be set prior to the execution of a step.
|
295
153
|
|
296
154
|
|
297
155
|
Parameters
|
298
156
|
----------
|
299
|
-
|
300
|
-
|
301
|
-
id : str, optional, default None
|
302
|
-
If multiple cards are present, use this id to identify this card.
|
303
|
-
options : Dict[str, Any], default {}
|
304
|
-
Options passed to the card. The contents depend on the card type.
|
305
|
-
timeout : int, default 45
|
306
|
-
Interrupt reporting if it takes more than this many seconds.
|
157
|
+
vars : Dict[str, str], default {}
|
158
|
+
Dictionary of environment variables to set.
|
307
159
|
"""
|
308
160
|
...
|
309
161
|
|
310
162
|
@typing.overload
|
311
|
-
def
|
163
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
312
164
|
...
|
313
165
|
|
314
166
|
@typing.overload
|
315
|
-
def
|
167
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
316
168
|
...
|
317
169
|
|
318
|
-
def
|
170
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
319
171
|
"""
|
320
|
-
|
321
|
-
|
322
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
172
|
+
Specifies environment variables to be set prior to the execution of a step.
|
323
173
|
|
324
174
|
|
325
175
|
Parameters
|
326
176
|
----------
|
327
|
-
|
328
|
-
|
329
|
-
id : str, optional, default None
|
330
|
-
If multiple cards are present, use this id to identify this card.
|
331
|
-
options : Dict[str, Any], default {}
|
332
|
-
Options passed to the card. The contents depend on the card type.
|
333
|
-
timeout : int, default 45
|
334
|
-
Interrupt reporting if it takes more than this many seconds.
|
177
|
+
vars : Dict[str, str], default {}
|
178
|
+
Dictionary of environment variables to set.
|
335
179
|
"""
|
336
180
|
...
|
337
181
|
|
@@ -391,89 +235,252 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
391
235
|
...
|
392
236
|
|
393
237
|
@typing.overload
|
394
|
-
def
|
238
|
+
def pypi(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
395
239
|
"""
|
396
|
-
Specifies
|
240
|
+
Specifies the PyPI packages for the step.
|
241
|
+
|
242
|
+
Information in this decorator will augment any
|
243
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
244
|
+
you can use `@pypi_base` to set packages required by all
|
245
|
+
steps and use `@pypi` to specify step-specific overrides.
|
397
246
|
|
398
247
|
|
399
248
|
Parameters
|
400
249
|
----------
|
401
|
-
|
402
|
-
|
250
|
+
packages : Dict[str, str], default: {}
|
251
|
+
Packages to use for this step. The key is the name of the package
|
252
|
+
and the value is the version to use.
|
253
|
+
python : str, optional, default: None
|
254
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
255
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
403
256
|
"""
|
404
257
|
...
|
405
258
|
|
406
259
|
@typing.overload
|
407
|
-
def
|
260
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
408
261
|
...
|
409
262
|
|
410
263
|
@typing.overload
|
411
|
-
def
|
264
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
412
265
|
...
|
413
266
|
|
414
|
-
def
|
267
|
+
def pypi(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
415
268
|
"""
|
416
|
-
Specifies
|
269
|
+
Specifies the PyPI packages for the step.
|
270
|
+
|
271
|
+
Information in this decorator will augment any
|
272
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
273
|
+
you can use `@pypi_base` to set packages required by all
|
274
|
+
steps and use `@pypi` to specify step-specific overrides.
|
417
275
|
|
418
276
|
|
419
277
|
Parameters
|
420
278
|
----------
|
421
|
-
|
422
|
-
|
279
|
+
packages : Dict[str, str], default: {}
|
280
|
+
Packages to use for this step. The key is the name of the package
|
281
|
+
and the value is the version to use.
|
282
|
+
python : str, optional, default: None
|
283
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
284
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
423
285
|
"""
|
424
286
|
...
|
425
287
|
|
426
288
|
@typing.overload
|
427
|
-
def
|
289
|
+
def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
428
290
|
"""
|
429
|
-
Specifies
|
430
|
-
|
291
|
+
Specifies that the step will success under all circumstances.
|
292
|
+
|
293
|
+
The decorator will create an optional artifact, specified by `var`, which
|
294
|
+
contains the exception raised. You can use it to detect the presence
|
295
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
296
|
+
are missing.
|
431
297
|
|
432
298
|
|
433
299
|
Parameters
|
434
300
|
----------
|
435
|
-
|
436
|
-
|
301
|
+
var : str, optional, default None
|
302
|
+
Name of the artifact in which to store the caught exception.
|
303
|
+
If not specified, the exception is not stored.
|
304
|
+
print_exception : bool, default True
|
305
|
+
Determines whether or not the exception is printed to
|
306
|
+
stdout when caught.
|
437
307
|
"""
|
438
308
|
...
|
439
309
|
|
440
310
|
@typing.overload
|
441
|
-
def
|
311
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
442
312
|
...
|
443
313
|
|
444
314
|
@typing.overload
|
445
|
-
def
|
315
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
446
316
|
...
|
447
317
|
|
448
|
-
def
|
318
|
+
def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
|
449
319
|
"""
|
450
|
-
Specifies
|
451
|
-
|
320
|
+
Specifies that the step will success under all circumstances.
|
321
|
+
|
322
|
+
The decorator will create an optional artifact, specified by `var`, which
|
323
|
+
contains the exception raised. You can use it to detect the presence
|
324
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
325
|
+
are missing.
|
452
326
|
|
453
327
|
|
454
328
|
Parameters
|
455
329
|
----------
|
456
|
-
|
457
|
-
|
330
|
+
var : str, optional, default None
|
331
|
+
Name of the artifact in which to store the caught exception.
|
332
|
+
If not specified, the exception is not stored.
|
333
|
+
print_exception : bool, default True
|
334
|
+
Determines whether or not the exception is printed to
|
335
|
+
stdout when caught.
|
336
|
+
"""
|
337
|
+
...
|
338
|
+
|
339
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[str] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
340
|
+
"""
|
341
|
+
Specifies that this step should execute on Kubernetes.
|
342
|
+
|
343
|
+
|
344
|
+
Parameters
|
345
|
+
----------
|
346
|
+
cpu : int, default 1
|
347
|
+
Number of CPUs required for this step. If `@resources` is
|
348
|
+
also present, the maximum value from all decorators is used.
|
349
|
+
memory : int, default 4096
|
350
|
+
Memory size (in MB) required for this step. If
|
351
|
+
`@resources` is also present, the maximum value from all decorators is
|
352
|
+
used.
|
353
|
+
disk : int, default 10240
|
354
|
+
Disk size (in MB) required for this step. If
|
355
|
+
`@resources` is also present, the maximum value from all decorators is
|
356
|
+
used.
|
357
|
+
image : str, optional, default None
|
358
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
359
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
360
|
+
not, a default Docker image mapping to the current version of Python is used.
|
361
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
362
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
363
|
+
image_pull_secrets: List[str], default []
|
364
|
+
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
365
|
+
Kubernetes image pull secrets to use when pulling container images
|
366
|
+
in Kubernetes.
|
367
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
368
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
369
|
+
secrets : List[str], optional, default None
|
370
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
371
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
372
|
+
in Metaflow configuration.
|
373
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
374
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
375
|
+
Can be passed in as a comma separated string of values e.g.
|
376
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
377
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
378
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
379
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
380
|
+
gpu : int, optional, default None
|
381
|
+
Number of GPUs required for this step. A value of zero implies that
|
382
|
+
the scheduled node should not have GPUs.
|
383
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
384
|
+
The vendor of the GPUs to be used for this step.
|
385
|
+
tolerations : List[str], default []
|
386
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
387
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
388
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
389
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
390
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
391
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
392
|
+
use_tmpfs : bool, default False
|
393
|
+
This enables an explicit tmpfs mount for this step.
|
394
|
+
tmpfs_tempdir : bool, default True
|
395
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
396
|
+
tmpfs_size : int, optional, default: None
|
397
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
398
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
399
|
+
memory allocated for this step.
|
400
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
401
|
+
Path to tmpfs mount for this step.
|
402
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
403
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
404
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
405
|
+
shared_memory: int, optional
|
406
|
+
Shared memory size (in MiB) required for this step
|
407
|
+
port: int, optional
|
408
|
+
Port number to specify in the Kubernetes job object
|
409
|
+
compute_pool : str, optional, default None
|
410
|
+
Compute pool to be used for for this step.
|
411
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
412
|
+
hostname_resolution_timeout: int, default 10 * 60
|
413
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
414
|
+
Only applicable when @parallel is used.
|
415
|
+
qos: str, default: Burstable
|
416
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
417
|
+
|
418
|
+
security_context: Dict[str, Any], optional, default None
|
419
|
+
Container security context. Applies to the task container. Allows the following keys:
|
420
|
+
- privileged: bool, optional, default None
|
421
|
+
- allow_privilege_escalation: bool, optional, default None
|
422
|
+
- run_as_user: int, optional, default None
|
423
|
+
- run_as_group: int, optional, default None
|
424
|
+
- run_as_non_root: bool, optional, default None
|
458
425
|
"""
|
459
426
|
...
|
460
427
|
|
461
428
|
@typing.overload
|
462
|
-
def
|
429
|
+
def timeout(*, seconds: int = 0, minutes: int = 0, hours: int = 0) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
463
430
|
"""
|
464
|
-
|
465
|
-
|
431
|
+
Specifies a timeout for your step.
|
432
|
+
|
433
|
+
This decorator is useful if this step may hang indefinitely.
|
434
|
+
|
435
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
436
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
437
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
438
|
+
|
439
|
+
Note that all the values specified in parameters are added together so if you specify
|
440
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
441
|
+
|
442
|
+
|
443
|
+
Parameters
|
444
|
+
----------
|
445
|
+
seconds : int, default 0
|
446
|
+
Number of seconds to wait prior to timing out.
|
447
|
+
minutes : int, default 0
|
448
|
+
Number of minutes to wait prior to timing out.
|
449
|
+
hours : int, default 0
|
450
|
+
Number of hours to wait prior to timing out.
|
466
451
|
"""
|
467
452
|
...
|
468
453
|
|
469
454
|
@typing.overload
|
470
|
-
def
|
455
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
471
456
|
...
|
472
457
|
|
473
|
-
|
458
|
+
@typing.overload
|
459
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
460
|
+
...
|
461
|
+
|
462
|
+
def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
|
474
463
|
"""
|
475
|
-
|
476
|
-
|
464
|
+
Specifies a timeout for your step.
|
465
|
+
|
466
|
+
This decorator is useful if this step may hang indefinitely.
|
467
|
+
|
468
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
469
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
470
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
471
|
+
|
472
|
+
Note that all the values specified in parameters are added together so if you specify
|
473
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
474
|
+
|
475
|
+
|
476
|
+
Parameters
|
477
|
+
----------
|
478
|
+
seconds : int, default 0
|
479
|
+
Number of seconds to wait prior to timing out.
|
480
|
+
minutes : int, default 0
|
481
|
+
Number of minutes to wait prior to timing out.
|
482
|
+
hours : int, default 0
|
483
|
+
Number of hours to wait prior to timing out.
|
477
484
|
"""
|
478
485
|
...
|
479
486
|
|
@@ -705,6 +712,60 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
705
712
|
"""
|
706
713
|
...
|
707
714
|
|
715
|
+
@typing.overload
|
716
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
717
|
+
"""
|
718
|
+
Decorator prototype for all step decorators. This function gets specialized
|
719
|
+
and imported for all decorators types by _import_plugin_decorators().
|
720
|
+
"""
|
721
|
+
...
|
722
|
+
|
723
|
+
@typing.overload
|
724
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
725
|
+
...
|
726
|
+
|
727
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
728
|
+
"""
|
729
|
+
Decorator prototype for all step decorators. This function gets specialized
|
730
|
+
and imported for all decorators types by _import_plugin_decorators().
|
731
|
+
"""
|
732
|
+
...
|
733
|
+
|
734
|
+
@typing.overload
|
735
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
736
|
+
"""
|
737
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
738
|
+
the execution of a step.
|
739
|
+
|
740
|
+
|
741
|
+
Parameters
|
742
|
+
----------
|
743
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
744
|
+
List of secret specs, defining how the secrets are to be retrieved
|
745
|
+
"""
|
746
|
+
...
|
747
|
+
|
748
|
+
@typing.overload
|
749
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
750
|
+
...
|
751
|
+
|
752
|
+
@typing.overload
|
753
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
754
|
+
...
|
755
|
+
|
756
|
+
def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = []):
|
757
|
+
"""
|
758
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
759
|
+
the execution of a step.
|
760
|
+
|
761
|
+
|
762
|
+
Parameters
|
763
|
+
----------
|
764
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
765
|
+
List of secret specs, defining how the secrets are to be retrieved
|
766
|
+
"""
|
767
|
+
...
|
768
|
+
|
708
769
|
@typing.overload
|
709
770
|
def conda(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
710
771
|
"""
|
@@ -765,112 +826,102 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
765
826
|
...
|
766
827
|
|
767
828
|
@typing.overload
|
768
|
-
def
|
829
|
+
def card(*, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
769
830
|
"""
|
770
|
-
|
771
|
-
|
772
|
-
This decorator is useful if this step may hang indefinitely.
|
773
|
-
|
774
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
775
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
776
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
831
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
777
832
|
|
778
|
-
Note that
|
779
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
833
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
780
834
|
|
781
835
|
|
782
836
|
Parameters
|
783
837
|
----------
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
838
|
+
type : str, default 'default'
|
839
|
+
Card type.
|
840
|
+
id : str, optional, default None
|
841
|
+
If multiple cards are present, use this id to identify this card.
|
842
|
+
options : Dict[str, Any], default {}
|
843
|
+
Options passed to the card. The contents depend on the card type.
|
844
|
+
timeout : int, default 45
|
845
|
+
Interrupt reporting if it takes more than this many seconds.
|
790
846
|
"""
|
791
847
|
...
|
792
848
|
|
793
849
|
@typing.overload
|
794
|
-
def
|
850
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
795
851
|
...
|
796
852
|
|
797
853
|
@typing.overload
|
798
|
-
def
|
854
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
799
855
|
...
|
800
856
|
|
801
|
-
def
|
857
|
+
def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = 'default', id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
|
802
858
|
"""
|
803
|
-
|
804
|
-
|
805
|
-
This decorator is useful if this step may hang indefinitely.
|
806
|
-
|
807
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
808
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
809
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
859
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
810
860
|
|
811
|
-
Note that
|
812
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
861
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
813
862
|
|
814
863
|
|
815
864
|
Parameters
|
816
865
|
----------
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
866
|
+
type : str, default 'default'
|
867
|
+
Card type.
|
868
|
+
id : str, optional, default None
|
869
|
+
If multiple cards are present, use this id to identify this card.
|
870
|
+
options : Dict[str, Any], default {}
|
871
|
+
Options passed to the card. The contents depend on the card type.
|
872
|
+
timeout : int, default 45
|
873
|
+
Interrupt reporting if it takes more than this many seconds.
|
823
874
|
"""
|
824
875
|
...
|
825
876
|
|
826
877
|
@typing.overload
|
827
|
-
def
|
878
|
+
def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
828
879
|
"""
|
829
|
-
Specifies
|
880
|
+
Specifies the Conda environment for all steps of the flow.
|
830
881
|
|
831
|
-
|
832
|
-
|
833
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
834
|
-
are missing.
|
882
|
+
Use `@conda_base` to set common libraries required by all
|
883
|
+
steps and use `@conda` to specify step-specific additions.
|
835
884
|
|
836
885
|
|
837
886
|
Parameters
|
838
887
|
----------
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
888
|
+
packages : Dict[str, str], default {}
|
889
|
+
Packages to use for this flow. The key is the name of the package
|
890
|
+
and the value is the version to use.
|
891
|
+
libraries : Dict[str, str], default {}
|
892
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
893
|
+
python : str, optional, default None
|
894
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
895
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
896
|
+
disabled : bool, default False
|
897
|
+
If set to True, disables Conda.
|
845
898
|
"""
|
846
899
|
...
|
847
900
|
|
848
901
|
@typing.overload
|
849
|
-
def
|
850
|
-
...
|
851
|
-
|
852
|
-
@typing.overload
|
853
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
902
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
854
903
|
...
|
855
904
|
|
856
|
-
def
|
905
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
857
906
|
"""
|
858
|
-
Specifies
|
907
|
+
Specifies the Conda environment for all steps of the flow.
|
859
908
|
|
860
|
-
|
861
|
-
|
862
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
863
|
-
are missing.
|
909
|
+
Use `@conda_base` to set common libraries required by all
|
910
|
+
steps and use `@conda` to specify step-specific additions.
|
864
911
|
|
865
912
|
|
866
913
|
Parameters
|
867
914
|
----------
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
915
|
+
packages : Dict[str, str], default {}
|
916
|
+
Packages to use for this flow. The key is the name of the package
|
917
|
+
and the value is the version to use.
|
918
|
+
libraries : Dict[str, str], default {}
|
919
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
920
|
+
python : str, optional, default None
|
921
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
922
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
923
|
+
disabled : bool, default False
|
924
|
+
If set to True, disables Conda.
|
874
925
|
"""
|
875
926
|
...
|
876
927
|
|
@@ -967,49 +1018,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
967
1018
|
"""
|
968
1019
|
...
|
969
1020
|
|
970
|
-
def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
971
|
-
"""
|
972
|
-
The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
|
973
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
974
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
975
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
976
|
-
starts only after all sensors finish.
|
977
|
-
|
978
|
-
|
979
|
-
Parameters
|
980
|
-
----------
|
981
|
-
timeout : int
|
982
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
983
|
-
poke_interval : int
|
984
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
985
|
-
mode : str
|
986
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
987
|
-
exponential_backoff : bool
|
988
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
989
|
-
pool : str
|
990
|
-
the slot pool this task should run in,
|
991
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
992
|
-
soft_fail : bool
|
993
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
994
|
-
name : str
|
995
|
-
Name of the sensor on Airflow
|
996
|
-
description : str
|
997
|
-
Description of sensor in the Airflow UI
|
998
|
-
bucket_key : Union[str, List[str]]
|
999
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1000
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1001
|
-
bucket_name : str
|
1002
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1003
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1004
|
-
wildcard_match : bool
|
1005
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1006
|
-
aws_conn_id : str
|
1007
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1008
|
-
verify : bool
|
1009
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1010
|
-
"""
|
1011
|
-
...
|
1012
|
-
|
1013
1021
|
@typing.overload
|
1014
1022
|
def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1015
1023
|
"""
|
@@ -1147,53 +1155,43 @@ def project(*, name: str, branch: typing.Optional[str] = None, production: bool
|
|
1147
1155
|
...
|
1148
1156
|
|
1149
1157
|
@typing.overload
|
1150
|
-
def
|
1158
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1151
1159
|
"""
|
1152
|
-
Specifies the
|
1153
|
-
|
1154
|
-
Use `@conda_base` to set common libraries required by all
|
1155
|
-
steps and use `@conda` to specify step-specific additions.
|
1160
|
+
Specifies the PyPI packages for all steps of the flow.
|
1156
1161
|
|
1162
|
+
Use `@pypi_base` to set common packages required by all
|
1163
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1157
1164
|
|
1158
1165
|
Parameters
|
1159
1166
|
----------
|
1160
|
-
packages : Dict[str, str], default {}
|
1167
|
+
packages : Dict[str, str], default: {}
|
1161
1168
|
Packages to use for this flow. The key is the name of the package
|
1162
1169
|
and the value is the version to use.
|
1163
|
-
|
1164
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1165
|
-
python : str, optional, default None
|
1170
|
+
python : str, optional, default: None
|
1166
1171
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1167
1172
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1168
|
-
disabled : bool, default False
|
1169
|
-
If set to True, disables Conda.
|
1170
1173
|
"""
|
1171
1174
|
...
|
1172
1175
|
|
1173
1176
|
@typing.overload
|
1174
|
-
def
|
1177
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1175
1178
|
...
|
1176
1179
|
|
1177
|
-
def
|
1180
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1178
1181
|
"""
|
1179
|
-
Specifies the
|
1180
|
-
|
1181
|
-
Use `@conda_base` to set common libraries required by all
|
1182
|
-
steps and use `@conda` to specify step-specific additions.
|
1182
|
+
Specifies the PyPI packages for all steps of the flow.
|
1183
1183
|
|
1184
|
+
Use `@pypi_base` to set common packages required by all
|
1185
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1184
1186
|
|
1185
1187
|
Parameters
|
1186
1188
|
----------
|
1187
|
-
packages : Dict[str, str], default {}
|
1189
|
+
packages : Dict[str, str], default: {}
|
1188
1190
|
Packages to use for this flow. The key is the name of the package
|
1189
1191
|
and the value is the version to use.
|
1190
|
-
|
1191
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1192
|
-
python : str, optional, default None
|
1192
|
+
python : str, optional, default: None
|
1193
1193
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1194
1194
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1195
|
-
disabled : bool, default False
|
1196
|
-
If set to True, disables Conda.
|
1197
1195
|
"""
|
1198
1196
|
...
|
1199
1197
|
|
@@ -1248,47 +1246,6 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1248
1246
|
"""
|
1249
1247
|
...
|
1250
1248
|
|
1251
|
-
@typing.overload
|
1252
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1253
|
-
"""
|
1254
|
-
Specifies the PyPI packages for all steps of the flow.
|
1255
|
-
|
1256
|
-
Use `@pypi_base` to set common packages required by all
|
1257
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1258
|
-
|
1259
|
-
Parameters
|
1260
|
-
----------
|
1261
|
-
packages : Dict[str, str], default: {}
|
1262
|
-
Packages to use for this flow. The key is the name of the package
|
1263
|
-
and the value is the version to use.
|
1264
|
-
python : str, optional, default: None
|
1265
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1266
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1267
|
-
"""
|
1268
|
-
...
|
1269
|
-
|
1270
|
-
@typing.overload
|
1271
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1272
|
-
...
|
1273
|
-
|
1274
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1275
|
-
"""
|
1276
|
-
Specifies the PyPI packages for all steps of the flow.
|
1277
|
-
|
1278
|
-
Use `@pypi_base` to set common packages required by all
|
1279
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1280
|
-
|
1281
|
-
Parameters
|
1282
|
-
----------
|
1283
|
-
packages : Dict[str, str], default: {}
|
1284
|
-
Packages to use for this flow. The key is the name of the package
|
1285
|
-
and the value is the version to use.
|
1286
|
-
python : str, optional, default: None
|
1287
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1288
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1289
|
-
"""
|
1290
|
-
...
|
1291
|
-
|
1292
1249
|
def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, external_dag_id: str, external_task_ids: typing.List[str], allowed_states: typing.List[str], failed_states: typing.List[str], execution_delta: "datetime.timedelta", check_existence: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1293
1250
|
"""
|
1294
1251
|
The `@airflow_external_task_sensor` decorator attaches a Airflow [ExternalTaskSensor](https://airflow.apache.org/docs/apache-airflow/stable/_api/airflow/sensors/external_task/index.html#airflow.sensors.external_task.ExternalTaskSensor) before the start step of the flow.
|
@@ -1332,3 +1289,46 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1332
1289
|
"""
|
1333
1290
|
...
|
1334
1291
|
|
1292
|
+
def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, exponential_backoff: bool, pool: str, soft_fail: bool, name: str, description: str, bucket_key: typing.Union[str, typing.List[str]], bucket_name: str, wildcard_match: bool, aws_conn_id: str, verify: bool) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1293
|
+
"""
|
1294
|
+
The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-providers-amazon/stable/_api/airflow/providers/amazon/aws/sensors/s3/index.html#airflow.providers.amazon.aws.sensors.s3.S3KeySensor)
|
1295
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1296
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1297
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1298
|
+
starts only after all sensors finish.
|
1299
|
+
|
1300
|
+
|
1301
|
+
Parameters
|
1302
|
+
----------
|
1303
|
+
timeout : int
|
1304
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1305
|
+
poke_interval : int
|
1306
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1307
|
+
mode : str
|
1308
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1309
|
+
exponential_backoff : bool
|
1310
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1311
|
+
pool : str
|
1312
|
+
the slot pool this task should run in,
|
1313
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1314
|
+
soft_fail : bool
|
1315
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1316
|
+
name : str
|
1317
|
+
Name of the sensor on Airflow
|
1318
|
+
description : str
|
1319
|
+
Description of sensor in the Airflow UI
|
1320
|
+
bucket_key : Union[str, List[str]]
|
1321
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1322
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1323
|
+
bucket_name : str
|
1324
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1325
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1326
|
+
wildcard_match : bool
|
1327
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1328
|
+
aws_conn_id : str
|
1329
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1330
|
+
verify : bool
|
1331
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1332
|
+
"""
|
1333
|
+
...
|
1334
|
+
|