metaflow-stubs 2.15.5__py2.py3-none-any.whl → 2.15.7__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 +435 -435
- 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 +2 -2
- 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 +3 -3
- 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 +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +2 -2
- metaflow-stubs/metaflow_current.pyi +22 -22
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- 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 +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +3 -3
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 -2
- 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 +2 -2
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
- 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 +2 -2
- 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 +2 -2
- 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 +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 +5 -5
- 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 +3 -3
- 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 +2 -2
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +29 -29
- 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 +2 -2
- metaflow-stubs/user_configs/config_parameters.pyi +6 -6
- metaflow-stubs/version.pyi +2 -2
- {metaflow_stubs-2.15.5.dist-info → metaflow_stubs-2.15.7.dist-info}/METADATA +3 -3
- metaflow_stubs-2.15.7.dist-info/RECORD +146 -0
- {metaflow_stubs-2.15.5.dist-info → metaflow_stubs-2.15.7.dist-info}/WHEEL +1 -1
- metaflow_stubs-2.15.5.dist-info/RECORD +0 -146
- {metaflow_stubs-2.15.5.dist-info → metaflow_stubs-2.15.7.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-03-
|
3
|
+
# MF version: 2.15.7 #
|
4
|
+
# Generated on 2025-03-29T00:30:30.645150 #
|
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
|
|
@@ -42,8 +42,8 @@ from . import plugins as plugins
|
|
42
42
|
from .plugins.datatools.s3.s3 import S3 as S3
|
43
43
|
from . import includefile as includefile
|
44
44
|
from .includefile import IncludeFile as IncludeFile
|
45
|
-
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
46
45
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
46
|
+
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
47
47
|
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
48
48
|
from . import cards as cards
|
49
49
|
from . import client as client
|
@@ -146,266 +146,135 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
146
146
|
...
|
147
147
|
|
148
148
|
@typing.overload
|
149
|
-
def
|
149
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
150
150
|
"""
|
151
|
-
|
152
|
-
|
153
|
-
Information in this decorator will augment any
|
154
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
155
|
-
you can use `@conda_base` to set packages required by all
|
156
|
-
steps and use `@conda` to specify step-specific overrides.
|
157
|
-
|
158
|
-
|
159
|
-
Parameters
|
160
|
-
----------
|
161
|
-
packages : Dict[str, str], default {}
|
162
|
-
Packages to use for this step. The key is the name of the package
|
163
|
-
and the value is the version to use.
|
164
|
-
libraries : Dict[str, str], default {}
|
165
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
166
|
-
python : str, optional, default None
|
167
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
168
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
169
|
-
disabled : bool, default False
|
170
|
-
If set to True, disables @conda.
|
151
|
+
Decorator prototype for all step decorators. This function gets specialized
|
152
|
+
and imported for all decorators types by _import_plugin_decorators().
|
171
153
|
"""
|
172
154
|
...
|
173
155
|
|
174
156
|
@typing.overload
|
175
|
-
def
|
176
|
-
...
|
177
|
-
|
178
|
-
@typing.overload
|
179
|
-
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
157
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
180
158
|
...
|
181
159
|
|
182
|
-
def
|
160
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
183
161
|
"""
|
184
|
-
|
185
|
-
|
186
|
-
Information in this decorator will augment any
|
187
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
188
|
-
you can use `@conda_base` to set packages required by all
|
189
|
-
steps and use `@conda` to specify step-specific overrides.
|
190
|
-
|
191
|
-
|
192
|
-
Parameters
|
193
|
-
----------
|
194
|
-
packages : Dict[str, str], default {}
|
195
|
-
Packages to use for this step. The key is the name of the package
|
196
|
-
and the value is the version to use.
|
197
|
-
libraries : Dict[str, str], default {}
|
198
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
199
|
-
python : str, optional, default None
|
200
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
201
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
202
|
-
disabled : bool, default False
|
203
|
-
If set to True, disables @conda.
|
162
|
+
Decorator prototype for all step decorators. This function gets specialized
|
163
|
+
and imported for all decorators types by _import_plugin_decorators().
|
204
164
|
"""
|
205
165
|
...
|
206
166
|
|
207
|
-
|
167
|
+
@typing.overload
|
168
|
+
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]]]:
|
208
169
|
"""
|
209
|
-
Specifies
|
170
|
+
Specifies a timeout for your step.
|
210
171
|
|
172
|
+
This decorator is useful if this step may hang indefinitely.
|
211
173
|
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
Number of CPUs required for this step. If `@resources` is
|
216
|
-
also present, the maximum value from all decorators is used.
|
217
|
-
memory : int, default 4096
|
218
|
-
Memory size (in MB) required for this step. If
|
219
|
-
`@resources` is also present, the maximum value from all decorators is
|
220
|
-
used.
|
221
|
-
disk : int, default 10240
|
222
|
-
Disk size (in MB) required for this step. If
|
223
|
-
`@resources` is also present, the maximum value from all decorators is
|
224
|
-
used.
|
225
|
-
image : str, optional, default None
|
226
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
227
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
228
|
-
not, a default Docker image mapping to the current version of Python is used.
|
229
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
230
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
231
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
232
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
233
|
-
secrets : List[str], optional, default None
|
234
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
235
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
236
|
-
in Metaflow configuration.
|
237
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
238
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
239
|
-
Can be passed in as a comma separated string of values e.g.
|
240
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
241
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
242
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
243
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
244
|
-
gpu : int, optional, default None
|
245
|
-
Number of GPUs required for this step. A value of zero implies that
|
246
|
-
the scheduled node should not have GPUs.
|
247
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
248
|
-
The vendor of the GPUs to be used for this step.
|
249
|
-
tolerations : List[str], default []
|
250
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
251
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
252
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
253
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
254
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
255
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
256
|
-
use_tmpfs : bool, default False
|
257
|
-
This enables an explicit tmpfs mount for this step.
|
258
|
-
tmpfs_tempdir : bool, default True
|
259
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
260
|
-
tmpfs_size : int, optional, default: None
|
261
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
262
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
263
|
-
memory allocated for this step.
|
264
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
265
|
-
Path to tmpfs mount for this step.
|
266
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
267
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
268
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
269
|
-
shared_memory: int, optional
|
270
|
-
Shared memory size (in MiB) required for this step
|
271
|
-
port: int, optional
|
272
|
-
Port number to specify in the Kubernetes job object
|
273
|
-
compute_pool : str, optional, default None
|
274
|
-
Compute pool to be used for for this step.
|
275
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
276
|
-
hostname_resolution_timeout: int, default 10 * 60
|
277
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
278
|
-
Only applicable when @parallel is used.
|
279
|
-
qos: str, default: Burstable
|
280
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
281
|
-
"""
|
282
|
-
...
|
283
|
-
|
284
|
-
@typing.overload
|
285
|
-
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]]]:
|
286
|
-
"""
|
287
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
174
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
175
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
176
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
288
177
|
|
289
|
-
Note that
|
178
|
+
Note that all the values specified in parameters are added together so if you specify
|
179
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
290
180
|
|
291
181
|
|
292
182
|
Parameters
|
293
183
|
----------
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
timeout : int, default 45
|
301
|
-
Interrupt reporting if it takes more than this many seconds.
|
184
|
+
seconds : int, default 0
|
185
|
+
Number of seconds to wait prior to timing out.
|
186
|
+
minutes : int, default 0
|
187
|
+
Number of minutes to wait prior to timing out.
|
188
|
+
hours : int, default 0
|
189
|
+
Number of hours to wait prior to timing out.
|
302
190
|
"""
|
303
191
|
...
|
304
192
|
|
305
193
|
@typing.overload
|
306
|
-
def
|
194
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
307
195
|
...
|
308
196
|
|
309
197
|
@typing.overload
|
310
|
-
def
|
198
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
311
199
|
...
|
312
200
|
|
313
|
-
def
|
201
|
+
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):
|
314
202
|
"""
|
315
|
-
|
203
|
+
Specifies a timeout for your step.
|
316
204
|
|
317
|
-
|
205
|
+
This decorator is useful if this step may hang indefinitely.
|
206
|
+
|
207
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
208
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
209
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
210
|
+
|
211
|
+
Note that all the values specified in parameters are added together so if you specify
|
212
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
318
213
|
|
319
214
|
|
320
215
|
Parameters
|
321
216
|
----------
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
timeout : int, default 45
|
329
|
-
Interrupt reporting if it takes more than this many seconds.
|
217
|
+
seconds : int, default 0
|
218
|
+
Number of seconds to wait prior to timing out.
|
219
|
+
minutes : int, default 0
|
220
|
+
Number of minutes to wait prior to timing out.
|
221
|
+
hours : int, default 0
|
222
|
+
Number of hours to wait prior to timing out.
|
330
223
|
"""
|
331
224
|
...
|
332
225
|
|
333
226
|
@typing.overload
|
334
|
-
def
|
227
|
+
def retry(*, times: int = 3, minutes_between_retries: int = 2) -> 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]]]:
|
335
228
|
"""
|
336
|
-
Specifies the
|
229
|
+
Specifies the number of times the task corresponding
|
230
|
+
to a step needs to be retried.
|
337
231
|
|
338
|
-
|
339
|
-
|
232
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
233
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
234
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
340
235
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
```
|
345
|
-
or
|
346
|
-
```
|
347
|
-
python myflow.py run --with kubernetes
|
348
|
-
```
|
349
|
-
which executes the flow on the desired system using the
|
350
|
-
requirements specified in `@resources`.
|
236
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
237
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
238
|
+
ensuring that the flow execution can continue.
|
351
239
|
|
352
240
|
|
353
241
|
Parameters
|
354
242
|
----------
|
355
|
-
|
356
|
-
Number of
|
357
|
-
|
358
|
-
Number of
|
359
|
-
disk : int, optional, default None
|
360
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
361
|
-
memory : int, default 4096
|
362
|
-
Memory size (in MB) required for this step.
|
363
|
-
shared_memory : int, optional, default None
|
364
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
365
|
-
This parameter maps to the `--shm-size` option in Docker.
|
243
|
+
times : int, default 3
|
244
|
+
Number of times to retry this task.
|
245
|
+
minutes_between_retries : int, default 2
|
246
|
+
Number of minutes between retries.
|
366
247
|
"""
|
367
248
|
...
|
368
249
|
|
369
250
|
@typing.overload
|
370
|
-
def
|
251
|
+
def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
371
252
|
...
|
372
253
|
|
373
254
|
@typing.overload
|
374
|
-
def
|
255
|
+
def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
375
256
|
...
|
376
257
|
|
377
|
-
def
|
258
|
+
def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, times: int = 3, minutes_between_retries: int = 2):
|
378
259
|
"""
|
379
|
-
Specifies the
|
260
|
+
Specifies the number of times the task corresponding
|
261
|
+
to a step needs to be retried.
|
380
262
|
|
381
|
-
|
382
|
-
|
263
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
264
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
265
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
383
266
|
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
```
|
388
|
-
or
|
389
|
-
```
|
390
|
-
python myflow.py run --with kubernetes
|
391
|
-
```
|
392
|
-
which executes the flow on the desired system using the
|
393
|
-
requirements specified in `@resources`.
|
267
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
268
|
+
decorator will execute a no-op task after all retries have been exhausted,
|
269
|
+
ensuring that the flow execution can continue.
|
394
270
|
|
395
271
|
|
396
272
|
Parameters
|
397
273
|
----------
|
398
|
-
|
399
|
-
Number of
|
400
|
-
|
401
|
-
Number of
|
402
|
-
disk : int, optional, default None
|
403
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
404
|
-
memory : int, default 4096
|
405
|
-
Memory size (in MB) required for this step.
|
406
|
-
shared_memory : int, optional, default None
|
407
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
408
|
-
This parameter maps to the `--shm-size` option in Docker.
|
274
|
+
times : int, default 3
|
275
|
+
Number of times to retry this task.
|
276
|
+
minutes_between_retries : int, default 2
|
277
|
+
Number of minutes between retries.
|
409
278
|
"""
|
410
279
|
...
|
411
280
|
|
@@ -559,61 +428,61 @@ def batch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
559
428
|
...
|
560
429
|
|
561
430
|
@typing.overload
|
562
|
-
def
|
431
|
+
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]]]:
|
563
432
|
"""
|
564
|
-
Specifies
|
565
|
-
|
566
|
-
This decorator is useful if this step may hang indefinitely.
|
567
|
-
|
568
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
569
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
570
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
433
|
+
Specifies the Conda environment for the step.
|
571
434
|
|
572
|
-
|
573
|
-
|
435
|
+
Information in this decorator will augment any
|
436
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
437
|
+
you can use `@conda_base` to set packages required by all
|
438
|
+
steps and use `@conda` to specify step-specific overrides.
|
574
439
|
|
575
440
|
|
576
441
|
Parameters
|
577
442
|
----------
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
443
|
+
packages : Dict[str, str], default {}
|
444
|
+
Packages to use for this step. The key is the name of the package
|
445
|
+
and the value is the version to use.
|
446
|
+
libraries : Dict[str, str], default {}
|
447
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
448
|
+
python : str, optional, default None
|
449
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
450
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
451
|
+
disabled : bool, default False
|
452
|
+
If set to True, disables @conda.
|
584
453
|
"""
|
585
454
|
...
|
586
455
|
|
587
456
|
@typing.overload
|
588
|
-
def
|
457
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
589
458
|
...
|
590
459
|
|
591
460
|
@typing.overload
|
592
|
-
def
|
461
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
593
462
|
...
|
594
463
|
|
595
|
-
def
|
464
|
+
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
596
465
|
"""
|
597
|
-
Specifies
|
598
|
-
|
599
|
-
This decorator is useful if this step may hang indefinitely.
|
600
|
-
|
601
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
602
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
603
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
466
|
+
Specifies the Conda environment for the step.
|
604
467
|
|
605
|
-
|
606
|
-
|
468
|
+
Information in this decorator will augment any
|
469
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
470
|
+
you can use `@conda_base` to set packages required by all
|
471
|
+
steps and use `@conda` to specify step-specific overrides.
|
607
472
|
|
608
473
|
|
609
474
|
Parameters
|
610
475
|
----------
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
476
|
+
packages : Dict[str, str], default {}
|
477
|
+
Packages to use for this step. The key is the name of the package
|
478
|
+
and the value is the version to use.
|
479
|
+
libraries : Dict[str, str], default {}
|
480
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
481
|
+
python : str, optional, default None
|
482
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
483
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
484
|
+
disabled : bool, default False
|
485
|
+
If set to True, disables @conda.
|
617
486
|
"""
|
618
487
|
...
|
619
488
|
|
@@ -669,90 +538,84 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
669
538
|
...
|
670
539
|
|
671
540
|
@typing.overload
|
672
|
-
def
|
541
|
+
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]]]:
|
673
542
|
"""
|
674
|
-
Specifies
|
675
|
-
to a step needs to be retried.
|
676
|
-
|
677
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
678
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
679
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
680
|
-
|
681
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
682
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
683
|
-
ensuring that the flow execution can continue.
|
543
|
+
Specifies environment variables to be set prior to the execution of a step.
|
684
544
|
|
685
545
|
|
686
546
|
Parameters
|
687
547
|
----------
|
688
|
-
|
689
|
-
|
690
|
-
minutes_between_retries : int, default 2
|
691
|
-
Number of minutes between retries.
|
548
|
+
vars : Dict[str, str], default {}
|
549
|
+
Dictionary of environment variables to set.
|
692
550
|
"""
|
693
551
|
...
|
694
552
|
|
695
553
|
@typing.overload
|
696
|
-
def
|
554
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
697
555
|
...
|
698
556
|
|
699
557
|
@typing.overload
|
700
|
-
def
|
558
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
701
559
|
...
|
702
560
|
|
703
|
-
def
|
561
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
704
562
|
"""
|
705
|
-
Specifies
|
706
|
-
to a step needs to be retried.
|
707
|
-
|
708
|
-
This decorator is useful for handling transient errors, such as networking issues.
|
709
|
-
If your task contains operations that can't be retried safely, e.g. database updates,
|
710
|
-
it is advisable to annotate it with `@retry(times=0)`.
|
711
|
-
|
712
|
-
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
713
|
-
decorator will execute a no-op task after all retries have been exhausted,
|
714
|
-
ensuring that the flow execution can continue.
|
563
|
+
Specifies environment variables to be set prior to the execution of a step.
|
715
564
|
|
716
565
|
|
717
566
|
Parameters
|
718
567
|
----------
|
719
|
-
|
720
|
-
|
721
|
-
minutes_between_retries : int, default 2
|
722
|
-
Number of minutes between retries.
|
568
|
+
vars : Dict[str, str], default {}
|
569
|
+
Dictionary of environment variables to set.
|
723
570
|
"""
|
724
571
|
...
|
725
572
|
|
726
573
|
@typing.overload
|
727
|
-
def
|
574
|
+
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]]]:
|
728
575
|
"""
|
729
|
-
|
576
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
577
|
+
|
578
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
730
579
|
|
731
580
|
|
732
581
|
Parameters
|
733
582
|
----------
|
734
|
-
|
735
|
-
|
583
|
+
type : str, default 'default'
|
584
|
+
Card type.
|
585
|
+
id : str, optional, default None
|
586
|
+
If multiple cards are present, use this id to identify this card.
|
587
|
+
options : Dict[str, Any], default {}
|
588
|
+
Options passed to the card. The contents depend on the card type.
|
589
|
+
timeout : int, default 45
|
590
|
+
Interrupt reporting if it takes more than this many seconds.
|
736
591
|
"""
|
737
592
|
...
|
738
593
|
|
739
594
|
@typing.overload
|
740
|
-
def
|
595
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
741
596
|
...
|
742
597
|
|
743
598
|
@typing.overload
|
744
|
-
def
|
599
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
745
600
|
...
|
746
601
|
|
747
|
-
def
|
602
|
+
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):
|
748
603
|
"""
|
749
|
-
|
604
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
605
|
+
|
606
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
750
607
|
|
751
608
|
|
752
609
|
Parameters
|
753
610
|
----------
|
754
|
-
|
755
|
-
|
611
|
+
type : str, default 'default'
|
612
|
+
Card type.
|
613
|
+
id : str, optional, default None
|
614
|
+
If multiple cards are present, use this id to identify this card.
|
615
|
+
options : Dict[str, Any], default {}
|
616
|
+
Options passed to the card. The contents depend on the card type.
|
617
|
+
timeout : int, default 45
|
618
|
+
Interrupt reporting if it takes more than this many seconds.
|
756
619
|
"""
|
757
620
|
...
|
758
621
|
|
@@ -842,115 +705,159 @@ def secrets(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
842
705
|
"""
|
843
706
|
...
|
844
707
|
|
845
|
-
|
846
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
847
|
-
"""
|
848
|
-
Decorator prototype for all step decorators. This function gets specialized
|
849
|
-
and imported for all decorators types by _import_plugin_decorators().
|
850
|
-
"""
|
851
|
-
...
|
852
|
-
|
853
|
-
@typing.overload
|
854
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
855
|
-
...
|
856
|
-
|
857
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
708
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', 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') -> 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]]]:
|
858
709
|
"""
|
859
|
-
|
860
|
-
|
710
|
+
Specifies that this step should execute on Kubernetes.
|
711
|
+
|
712
|
+
|
713
|
+
Parameters
|
714
|
+
----------
|
715
|
+
cpu : int, default 1
|
716
|
+
Number of CPUs required for this step. If `@resources` is
|
717
|
+
also present, the maximum value from all decorators is used.
|
718
|
+
memory : int, default 4096
|
719
|
+
Memory size (in MB) required for this step. If
|
720
|
+
`@resources` is also present, the maximum value from all decorators is
|
721
|
+
used.
|
722
|
+
disk : int, default 10240
|
723
|
+
Disk size (in MB) required for this step. If
|
724
|
+
`@resources` is also present, the maximum value from all decorators is
|
725
|
+
used.
|
726
|
+
image : str, optional, default None
|
727
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
728
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
729
|
+
not, a default Docker image mapping to the current version of Python is used.
|
730
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
731
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
732
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
733
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
734
|
+
secrets : List[str], optional, default None
|
735
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
736
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
737
|
+
in Metaflow configuration.
|
738
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
739
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
740
|
+
Can be passed in as a comma separated string of values e.g.
|
741
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
742
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
743
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
744
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
745
|
+
gpu : int, optional, default None
|
746
|
+
Number of GPUs required for this step. A value of zero implies that
|
747
|
+
the scheduled node should not have GPUs.
|
748
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
749
|
+
The vendor of the GPUs to be used for this step.
|
750
|
+
tolerations : List[str], default []
|
751
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
752
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
753
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
754
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
755
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
756
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
757
|
+
use_tmpfs : bool, default False
|
758
|
+
This enables an explicit tmpfs mount for this step.
|
759
|
+
tmpfs_tempdir : bool, default True
|
760
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
761
|
+
tmpfs_size : int, optional, default: None
|
762
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
763
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
764
|
+
memory allocated for this step.
|
765
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
766
|
+
Path to tmpfs mount for this step.
|
767
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
768
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
769
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
770
|
+
shared_memory: int, optional
|
771
|
+
Shared memory size (in MiB) required for this step
|
772
|
+
port: int, optional
|
773
|
+
Port number to specify in the Kubernetes job object
|
774
|
+
compute_pool : str, optional, default None
|
775
|
+
Compute pool to be used for for this step.
|
776
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
777
|
+
hostname_resolution_timeout: int, default 10 * 60
|
778
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
779
|
+
Only applicable when @parallel is used.
|
780
|
+
qos: str, default: Burstable
|
781
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
861
782
|
"""
|
862
783
|
...
|
863
784
|
|
864
785
|
@typing.overload
|
865
|
-
def
|
786
|
+
def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = 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]]]:
|
866
787
|
"""
|
867
|
-
Specifies the
|
788
|
+
Specifies the resources needed when executing this step.
|
868
789
|
|
869
|
-
|
870
|
-
|
871
|
-
```
|
872
|
-
or
|
873
|
-
```
|
874
|
-
@trigger(events=['foo', 'bar'])
|
875
|
-
```
|
790
|
+
Use `@resources` to specify the resource requirements
|
791
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
876
792
|
|
877
|
-
|
878
|
-
to map event payload to Metaflow parameters for the flow.
|
793
|
+
You can choose the compute layer on the command line by executing e.g.
|
879
794
|
```
|
880
|
-
|
795
|
+
python myflow.py run --with batch
|
881
796
|
```
|
882
797
|
or
|
883
798
|
```
|
884
|
-
|
885
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
886
|
-
```
|
887
|
-
|
888
|
-
'parameters' can also be a list of strings and tuples like so:
|
889
|
-
```
|
890
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
891
|
-
```
|
892
|
-
This is equivalent to:
|
893
|
-
```
|
894
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
799
|
+
python myflow.py run --with kubernetes
|
895
800
|
```
|
801
|
+
which executes the flow on the desired system using the
|
802
|
+
requirements specified in `@resources`.
|
896
803
|
|
897
804
|
|
898
805
|
Parameters
|
899
806
|
----------
|
900
|
-
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
807
|
+
cpu : int, default 1
|
808
|
+
Number of CPUs required for this step.
|
809
|
+
gpu : int, optional, default None
|
810
|
+
Number of GPUs required for this step.
|
811
|
+
disk : int, optional, default None
|
812
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
813
|
+
memory : int, default 4096
|
814
|
+
Memory size (in MB) required for this step.
|
815
|
+
shared_memory : int, optional, default None
|
816
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
817
|
+
This parameter maps to the `--shm-size` option in Docker.
|
906
818
|
"""
|
907
819
|
...
|
908
820
|
|
909
821
|
@typing.overload
|
910
|
-
def
|
822
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
911
823
|
...
|
912
824
|
|
913
|
-
|
825
|
+
@typing.overload
|
826
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
827
|
+
...
|
828
|
+
|
829
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
914
830
|
"""
|
915
|
-
Specifies the
|
831
|
+
Specifies the resources needed when executing this step.
|
916
832
|
|
917
|
-
|
918
|
-
|
919
|
-
```
|
920
|
-
or
|
921
|
-
```
|
922
|
-
@trigger(events=['foo', 'bar'])
|
923
|
-
```
|
833
|
+
Use `@resources` to specify the resource requirements
|
834
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
924
835
|
|
925
|
-
|
926
|
-
to map event payload to Metaflow parameters for the flow.
|
836
|
+
You can choose the compute layer on the command line by executing e.g.
|
927
837
|
```
|
928
|
-
|
838
|
+
python myflow.py run --with batch
|
929
839
|
```
|
930
840
|
or
|
931
841
|
```
|
932
|
-
|
933
|
-
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
934
|
-
```
|
935
|
-
|
936
|
-
'parameters' can also be a list of strings and tuples like so:
|
937
|
-
```
|
938
|
-
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
939
|
-
```
|
940
|
-
This is equivalent to:
|
941
|
-
```
|
942
|
-
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
842
|
+
python myflow.py run --with kubernetes
|
943
843
|
```
|
844
|
+
which executes the flow on the desired system using the
|
845
|
+
requirements specified in `@resources`.
|
944
846
|
|
945
847
|
|
946
848
|
Parameters
|
947
849
|
----------
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
850
|
+
cpu : int, default 1
|
851
|
+
Number of CPUs required for this step.
|
852
|
+
gpu : int, optional, default None
|
853
|
+
Number of GPUs required for this step.
|
854
|
+
disk : int, optional, default None
|
855
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
856
|
+
memory : int, default 4096
|
857
|
+
Memory size (in MB) required for this step.
|
858
|
+
shared_memory : int, optional, default None
|
859
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
860
|
+
This parameter maps to the `--shm-size` option in Docker.
|
954
861
|
"""
|
955
862
|
...
|
956
863
|
|
@@ -1049,141 +956,98 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1049
956
|
...
|
1050
957
|
|
1051
958
|
@typing.overload
|
1052
|
-
def
|
959
|
+
def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1053
960
|
"""
|
1054
|
-
Specifies the
|
961
|
+
Specifies the event(s) that this flow depends on.
|
1055
962
|
|
1056
963
|
```
|
1057
|
-
@
|
964
|
+
@trigger(event='foo')
|
1058
965
|
```
|
1059
966
|
or
|
1060
967
|
```
|
1061
|
-
@
|
968
|
+
@trigger(events=['foo', 'bar'])
|
1062
969
|
```
|
1063
|
-
This decorator respects the @project decorator and triggers the flow
|
1064
|
-
when upstream runs within the same namespace complete successfully
|
1065
970
|
|
1066
|
-
Additionally, you can specify
|
1067
|
-
|
971
|
+
Additionally, you can specify the parameter mappings
|
972
|
+
to map event payload to Metaflow parameters for the flow.
|
1068
973
|
```
|
1069
|
-
@
|
974
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1070
975
|
```
|
1071
976
|
or
|
1072
977
|
```
|
1073
|
-
@
|
978
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
979
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1074
980
|
```
|
1075
981
|
|
1076
|
-
|
1077
|
-
inferred from the current project or project branch):
|
982
|
+
'parameters' can also be a list of strings and tuples like so:
|
1078
983
|
```
|
1079
|
-
@
|
984
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
985
|
+
```
|
986
|
+
This is equivalent to:
|
987
|
+
```
|
988
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1080
989
|
```
|
1081
|
-
|
1082
|
-
Note that `branch` is typically one of:
|
1083
|
-
- `prod`
|
1084
|
-
- `user.bob`
|
1085
|
-
- `test.my_experiment`
|
1086
|
-
- `prod.staging`
|
1087
990
|
|
1088
991
|
|
1089
992
|
Parameters
|
1090
993
|
----------
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
994
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
995
|
+
Event dependency for this flow.
|
996
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
997
|
+
Events dependency for this flow.
|
1095
998
|
options : Dict[str, Any], default {}
|
1096
999
|
Backend-specific configuration for tuning eventing behavior.
|
1097
1000
|
"""
|
1098
1001
|
...
|
1099
1002
|
|
1100
1003
|
@typing.overload
|
1101
|
-
def
|
1004
|
+
def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1102
1005
|
...
|
1103
1006
|
|
1104
|
-
def
|
1007
|
+
def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
1105
1008
|
"""
|
1106
|
-
Specifies the
|
1009
|
+
Specifies the event(s) that this flow depends on.
|
1107
1010
|
|
1108
1011
|
```
|
1109
|
-
@
|
1012
|
+
@trigger(event='foo')
|
1110
1013
|
```
|
1111
1014
|
or
|
1112
1015
|
```
|
1113
|
-
@
|
1016
|
+
@trigger(events=['foo', 'bar'])
|
1114
1017
|
```
|
1115
|
-
This decorator respects the @project decorator and triggers the flow
|
1116
|
-
when upstream runs within the same namespace complete successfully
|
1117
1018
|
|
1118
|
-
Additionally, you can specify
|
1119
|
-
|
1019
|
+
Additionally, you can specify the parameter mappings
|
1020
|
+
to map event payload to Metaflow parameters for the flow.
|
1120
1021
|
```
|
1121
|
-
@
|
1022
|
+
@trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
|
1122
1023
|
```
|
1123
1024
|
or
|
1124
1025
|
```
|
1125
|
-
@
|
1026
|
+
@trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
|
1027
|
+
{'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
|
1126
1028
|
```
|
1127
1029
|
|
1128
|
-
|
1129
|
-
inferred from the current project or project branch):
|
1030
|
+
'parameters' can also be a list of strings and tuples like so:
|
1130
1031
|
```
|
1131
|
-
@
|
1032
|
+
@trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
|
1033
|
+
```
|
1034
|
+
This is equivalent to:
|
1035
|
+
```
|
1036
|
+
@trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
|
1132
1037
|
```
|
1133
|
-
|
1134
|
-
Note that `branch` is typically one of:
|
1135
|
-
- `prod`
|
1136
|
-
- `user.bob`
|
1137
|
-
- `test.my_experiment`
|
1138
|
-
- `prod.staging`
|
1139
1038
|
|
1140
1039
|
|
1141
1040
|
Parameters
|
1142
1041
|
----------
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1042
|
+
event : Union[str, Dict[str, Any]], optional, default None
|
1043
|
+
Event dependency for this flow.
|
1044
|
+
events : List[Union[str, Dict[str, Any]]], default []
|
1045
|
+
Events dependency for this flow.
|
1147
1046
|
options : Dict[str, Any], default {}
|
1148
1047
|
Backend-specific configuration for tuning eventing behavior.
|
1149
1048
|
"""
|
1150
1049
|
...
|
1151
1050
|
|
1152
|
-
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1153
|
-
"""
|
1154
|
-
Specifies what flows belong to the same project.
|
1155
|
-
|
1156
|
-
A project-specific namespace is created for all flows that
|
1157
|
-
use the same `@project(name)`.
|
1158
|
-
|
1159
|
-
|
1160
|
-
Parameters
|
1161
|
-
----------
|
1162
|
-
name : str
|
1163
|
-
Project name. Make sure that the name is unique amongst all
|
1164
|
-
projects that use the same production scheduler. The name may
|
1165
|
-
contain only lowercase alphanumeric characters and underscores.
|
1166
|
-
|
1167
|
-
branch : Optional[str], default None
|
1168
|
-
The branch to use. If not specified, the branch is set to
|
1169
|
-
`user.<username>` unless `production` is set to `True`. This can
|
1170
|
-
also be set on the command line using `--branch` as a top-level option.
|
1171
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
1172
|
-
|
1173
|
-
production : bool, default False
|
1174
|
-
Whether or not the branch is the production branch. This can also be set on the
|
1175
|
-
command line using `--production` as a top-level option. It is an error to specify
|
1176
|
-
`production` in the decorator and on the command line.
|
1177
|
-
The project branch name will be:
|
1178
|
-
- if `branch` is specified:
|
1179
|
-
- if `production` is True: `prod.<branch>`
|
1180
|
-
- if `production` is False: `test.<branch>`
|
1181
|
-
- if `branch` is not specified:
|
1182
|
-
- if `production` is True: `prod`
|
1183
|
-
- if `production` is False: `user.<username>`
|
1184
|
-
"""
|
1185
|
-
...
|
1186
|
-
|
1187
1051
|
@typing.overload
|
1188
1052
|
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1189
1053
|
"""
|
@@ -1276,6 +1140,107 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1276
1140
|
"""
|
1277
1141
|
...
|
1278
1142
|
|
1143
|
+
@typing.overload
|
1144
|
+
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]]:
|
1145
|
+
"""
|
1146
|
+
Specifies the flow(s) that this flow depends on.
|
1147
|
+
|
1148
|
+
```
|
1149
|
+
@trigger_on_finish(flow='FooFlow')
|
1150
|
+
```
|
1151
|
+
or
|
1152
|
+
```
|
1153
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1154
|
+
```
|
1155
|
+
This decorator respects the @project decorator and triggers the flow
|
1156
|
+
when upstream runs within the same namespace complete successfully
|
1157
|
+
|
1158
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1159
|
+
by specifying the fully qualified project_flow_name.
|
1160
|
+
```
|
1161
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1162
|
+
```
|
1163
|
+
or
|
1164
|
+
```
|
1165
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1166
|
+
```
|
1167
|
+
|
1168
|
+
You can also specify just the project or project branch (other values will be
|
1169
|
+
inferred from the current project or project branch):
|
1170
|
+
```
|
1171
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1172
|
+
```
|
1173
|
+
|
1174
|
+
Note that `branch` is typically one of:
|
1175
|
+
- `prod`
|
1176
|
+
- `user.bob`
|
1177
|
+
- `test.my_experiment`
|
1178
|
+
- `prod.staging`
|
1179
|
+
|
1180
|
+
|
1181
|
+
Parameters
|
1182
|
+
----------
|
1183
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1184
|
+
Upstream flow dependency for this flow.
|
1185
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1186
|
+
Upstream flow dependencies for this flow.
|
1187
|
+
options : Dict[str, Any], default {}
|
1188
|
+
Backend-specific configuration for tuning eventing behavior.
|
1189
|
+
"""
|
1190
|
+
...
|
1191
|
+
|
1192
|
+
@typing.overload
|
1193
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1194
|
+
...
|
1195
|
+
|
1196
|
+
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, 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] = {}):
|
1197
|
+
"""
|
1198
|
+
Specifies the flow(s) that this flow depends on.
|
1199
|
+
|
1200
|
+
```
|
1201
|
+
@trigger_on_finish(flow='FooFlow')
|
1202
|
+
```
|
1203
|
+
or
|
1204
|
+
```
|
1205
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1206
|
+
```
|
1207
|
+
This decorator respects the @project decorator and triggers the flow
|
1208
|
+
when upstream runs within the same namespace complete successfully
|
1209
|
+
|
1210
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1211
|
+
by specifying the fully qualified project_flow_name.
|
1212
|
+
```
|
1213
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1214
|
+
```
|
1215
|
+
or
|
1216
|
+
```
|
1217
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1218
|
+
```
|
1219
|
+
|
1220
|
+
You can also specify just the project or project branch (other values will be
|
1221
|
+
inferred from the current project or project branch):
|
1222
|
+
```
|
1223
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1224
|
+
```
|
1225
|
+
|
1226
|
+
Note that `branch` is typically one of:
|
1227
|
+
- `prod`
|
1228
|
+
- `user.bob`
|
1229
|
+
- `test.my_experiment`
|
1230
|
+
- `prod.staging`
|
1231
|
+
|
1232
|
+
|
1233
|
+
Parameters
|
1234
|
+
----------
|
1235
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1236
|
+
Upstream flow dependency for this flow.
|
1237
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1238
|
+
Upstream flow dependencies for this flow.
|
1239
|
+
options : Dict[str, Any], default {}
|
1240
|
+
Backend-specific configuration for tuning eventing behavior.
|
1241
|
+
"""
|
1242
|
+
...
|
1243
|
+
|
1279
1244
|
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]]:
|
1280
1245
|
"""
|
1281
1246
|
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)
|
@@ -1319,3 +1284,38 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
|
|
1319
1284
|
"""
|
1320
1285
|
...
|
1321
1286
|
|
1287
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1288
|
+
"""
|
1289
|
+
Specifies what flows belong to the same project.
|
1290
|
+
|
1291
|
+
A project-specific namespace is created for all flows that
|
1292
|
+
use the same `@project(name)`.
|
1293
|
+
|
1294
|
+
|
1295
|
+
Parameters
|
1296
|
+
----------
|
1297
|
+
name : str
|
1298
|
+
Project name. Make sure that the name is unique amongst all
|
1299
|
+
projects that use the same production scheduler. The name may
|
1300
|
+
contain only lowercase alphanumeric characters and underscores.
|
1301
|
+
|
1302
|
+
branch : Optional[str], default None
|
1303
|
+
The branch to use. If not specified, the branch is set to
|
1304
|
+
`user.<username>` unless `production` is set to `True`. This can
|
1305
|
+
also be set on the command line using `--branch` as a top-level option.
|
1306
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
1307
|
+
|
1308
|
+
production : bool, default False
|
1309
|
+
Whether or not the branch is the production branch. This can also be set on the
|
1310
|
+
command line using `--production` as a top-level option. It is an error to specify
|
1311
|
+
`production` in the decorator and on the command line.
|
1312
|
+
The project branch name will be:
|
1313
|
+
- if `branch` is specified:
|
1314
|
+
- if `production` is True: `prod.<branch>`
|
1315
|
+
- if `production` is False: `test.<branch>`
|
1316
|
+
- if `branch` is not specified:
|
1317
|
+
- if `production` is True: `prod`
|
1318
|
+
- if `production` is False: `user.<username>`
|
1319
|
+
"""
|
1320
|
+
...
|
1321
|
+
|