ob-metaflow-stubs 5.6__py2.py3-none-any.whl → 5.7.1__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 +383 -673
- metaflow-stubs/cards.pyi +6 -6
- metaflow-stubs/cli.pyi +3 -3
- metaflow-stubs/client/__init__.pyi +4 -4
- metaflow-stubs/client/core.pyi +6 -6
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/clone_util.pyi +2 -2
- metaflow-stubs/events.pyi +2 -2
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +5 -5
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- metaflow-stubs/metadata/metadata.pyi +3 -3
- metaflow-stubs/metadata/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +6 -2
- metaflow-stubs/metaflow_current.pyi +5 -5
- metaflow-stubs/mflog/mflog.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +3 -3
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +3 -3
- 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 +7 -5
- metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +6 -6
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +5 -5
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
- 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/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +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_deployer.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 +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_cli.pyi +4 -4
- 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 +3 -3
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +3 -3
- metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
- 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 +3 -3
- 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/kubernetes.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +4 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/logs_cli.pyi +2 -2
- metaflow-stubs/plugins/package_cli.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
- metaflow-stubs/plugins/perimeters.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/pypi_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
- 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 +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/tag_cli.pyi +4 -4
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
- metaflow-stubs/procpoll.pyi +2 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +4 -4
- 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 +2 -2
- metaflow-stubs/system/__init__.pyi +3 -3
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +3 -3
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- {ob_metaflow_stubs-5.6.dist-info → ob_metaflow_stubs-5.7.1.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-5.7.1.dist-info/RECORD +138 -0
- ob_metaflow_stubs-5.6.dist-info/RECORD +0 -138
- {ob_metaflow_stubs-5.6.dist-info → ob_metaflow_stubs-5.7.1.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-5.6.dist-info → ob_metaflow_stubs-5.7.1.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,24 +1,22 @@
|
|
1
1
|
##################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.12.18.
|
4
|
-
# Generated on 2024-08-
|
3
|
+
# MF version: 2.12.18.2+ob(v1) #
|
4
|
+
# Generated on 2024-08-30T00:31:57.693984 #
|
5
5
|
##################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import metaflow.
|
11
|
+
import metaflow._vendor.click.types
|
12
12
|
import metaflow.datastore.inputs
|
13
|
-
import metaflow.flowspec
|
14
|
-
import io
|
15
|
-
import metaflow.client.core
|
16
|
-
import metaflow.plugins.datatools.s3.s3
|
17
|
-
import typing
|
18
13
|
import metaflow.metaflow_current
|
19
|
-
import metaflow._vendor.click.types
|
20
14
|
import metaflow.events
|
21
15
|
import datetime
|
16
|
+
import metaflow.parameters
|
17
|
+
import metaflow.flowspec
|
18
|
+
import metaflow.client.core
|
19
|
+
import typing
|
22
20
|
import metaflow.runner.metaflow_runner
|
23
21
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
24
22
|
StepFlag = typing.NewType("StepFlag", bool)
|
@@ -356,295 +354,7 @@ class JSONTypeClass(metaflow._vendor.click.types.ParamType, metaclass=type):
|
|
356
354
|
|
357
355
|
JSONType: metaflow.parameters.JSONTypeClass
|
358
356
|
|
359
|
-
|
360
|
-
@classmethod
|
361
|
-
def get_root_from_config(cls, echo, create_on_absent = True):
|
362
|
-
...
|
363
|
-
def __enter__(self) -> metaflow.plugins.datatools.s3.s3.S3:
|
364
|
-
...
|
365
|
-
def __exit__(self, *args):
|
366
|
-
...
|
367
|
-
def close(self):
|
368
|
-
"""
|
369
|
-
Delete all temporary files downloaded in this context.
|
370
|
-
"""
|
371
|
-
...
|
372
|
-
def list_paths(self, keys: typing.Optional[typing.Iterable[str]] = None) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
|
373
|
-
"""
|
374
|
-
List the next level of paths in S3.
|
375
|
-
|
376
|
-
If multiple keys are specified, listings are done in parallel. The returned
|
377
|
-
S3Objects have `.exists == False` if the path refers to a prefix, not an
|
378
|
-
existing S3 object.
|
379
|
-
|
380
|
-
For instance, if the directory hierarchy is
|
381
|
-
```
|
382
|
-
a/0.txt
|
383
|
-
a/b/1.txt
|
384
|
-
a/c/2.txt
|
385
|
-
a/d/e/3.txt
|
386
|
-
f/4.txt
|
387
|
-
```
|
388
|
-
The `list_paths(['a', 'f'])` call returns
|
389
|
-
```
|
390
|
-
a/0.txt (exists == True)
|
391
|
-
a/b/ (exists == False)
|
392
|
-
a/c/ (exists == False)
|
393
|
-
a/d/ (exists == False)
|
394
|
-
f/4.txt (exists == True)
|
395
|
-
```
|
396
|
-
|
397
|
-
Parameters
|
398
|
-
----------
|
399
|
-
keys : Iterable[str], optional, default None
|
400
|
-
List of paths.
|
401
|
-
|
402
|
-
Returns
|
403
|
-
-------
|
404
|
-
List[S3Object]
|
405
|
-
S3Objects under the given paths, including prefixes (directories) that
|
406
|
-
do not correspond to leaf objects.
|
407
|
-
"""
|
408
|
-
...
|
409
|
-
def list_recursive(self, keys: typing.Optional[typing.Iterable[str]] = None) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
|
410
|
-
"""
|
411
|
-
List all objects recursively under the given prefixes.
|
412
|
-
|
413
|
-
If multiple keys are specified, listings are done in parallel. All objects
|
414
|
-
returned have `.exists == True` as this call always returns leaf objects.
|
415
|
-
|
416
|
-
For instance, if the directory hierarchy is
|
417
|
-
```
|
418
|
-
a/0.txt
|
419
|
-
a/b/1.txt
|
420
|
-
a/c/2.txt
|
421
|
-
a/d/e/3.txt
|
422
|
-
f/4.txt
|
423
|
-
```
|
424
|
-
The `list_paths(['a', 'f'])` call returns
|
425
|
-
```
|
426
|
-
a/0.txt (exists == True)
|
427
|
-
a/b/1.txt (exists == True)
|
428
|
-
a/c/2.txt (exists == True)
|
429
|
-
a/d/e/3.txt (exists == True)
|
430
|
-
f/4.txt (exists == True)
|
431
|
-
```
|
432
|
-
|
433
|
-
Parameters
|
434
|
-
----------
|
435
|
-
keys : Iterable[str], optional, default None
|
436
|
-
List of paths.
|
437
|
-
|
438
|
-
Returns
|
439
|
-
-------
|
440
|
-
List[S3Object]
|
441
|
-
S3Objects under the given paths.
|
442
|
-
"""
|
443
|
-
...
|
444
|
-
def info(self, key: typing.Optional[str] = None, return_missing: bool = False) -> metaflow.plugins.datatools.s3.s3.S3Object:
|
445
|
-
"""
|
446
|
-
Get metadata about a single object in S3.
|
447
|
-
|
448
|
-
This call makes a single `HEAD` request to S3 which can be
|
449
|
-
much faster than downloading all data with `get`.
|
450
|
-
|
451
|
-
Parameters
|
452
|
-
----------
|
453
|
-
key : str, optional, default None
|
454
|
-
Object to query. It can be an S3 url or a path suffix.
|
455
|
-
return_missing : bool, default False
|
456
|
-
If set to True, do not raise an exception for a missing key but
|
457
|
-
return it as an `S3Object` with `.exists == False`.
|
458
|
-
|
459
|
-
Returns
|
460
|
-
-------
|
461
|
-
S3Object
|
462
|
-
An S3Object corresponding to the object requested. The object
|
463
|
-
will have `.downloaded == False`.
|
464
|
-
"""
|
465
|
-
...
|
466
|
-
def info_many(self, keys: typing.Iterable[str], return_missing: bool = False) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
|
467
|
-
"""
|
468
|
-
Get metadata about many objects in S3 in parallel.
|
469
|
-
|
470
|
-
This call makes a single `HEAD` request to S3 which can be
|
471
|
-
much faster than downloading all data with `get`.
|
472
|
-
|
473
|
-
Parameters
|
474
|
-
----------
|
475
|
-
keys : Iterable[str]
|
476
|
-
Objects to query. Each key can be an S3 url or a path suffix.
|
477
|
-
return_missing : bool, default False
|
478
|
-
If set to True, do not raise an exception for a missing key but
|
479
|
-
return it as an `S3Object` with `.exists == False`.
|
480
|
-
|
481
|
-
Returns
|
482
|
-
-------
|
483
|
-
List[S3Object]
|
484
|
-
A list of S3Objects corresponding to the paths requested. The
|
485
|
-
objects will have `.downloaded == False`.
|
486
|
-
"""
|
487
|
-
...
|
488
|
-
def get(self, key: typing.Union[str, metaflow.plugins.datatools.s3.s3.S3GetObject, None] = None, return_missing: bool = False, return_info: bool = True) -> metaflow.plugins.datatools.s3.s3.S3Object:
|
489
|
-
"""
|
490
|
-
Get a single object from S3.
|
491
|
-
|
492
|
-
Parameters
|
493
|
-
----------
|
494
|
-
key : Union[str, S3GetObject], optional, default None
|
495
|
-
Object to download. It can be an S3 url, a path suffix, or
|
496
|
-
an S3GetObject that defines a range of data to download. If None, or
|
497
|
-
not provided, gets the S3 root.
|
498
|
-
return_missing : bool, default False
|
499
|
-
If set to True, do not raise an exception for a missing key but
|
500
|
-
return it as an `S3Object` with `.exists == False`.
|
501
|
-
return_info : bool, default True
|
502
|
-
If set to True, fetch the content-type and user metadata associated
|
503
|
-
with the object at no extra cost, included for symmetry with `get_many`
|
504
|
-
|
505
|
-
Returns
|
506
|
-
-------
|
507
|
-
S3Object
|
508
|
-
An S3Object corresponding to the object requested.
|
509
|
-
"""
|
510
|
-
...
|
511
|
-
def get_many(self, keys: typing.Iterable[typing.Union[str, metaflow.plugins.datatools.s3.s3.S3GetObject]], return_missing: bool = False, return_info: bool = True) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
|
512
|
-
"""
|
513
|
-
Get many objects from S3 in parallel.
|
514
|
-
|
515
|
-
Parameters
|
516
|
-
----------
|
517
|
-
keys : Iterable[Union[str, S3GetObject]]
|
518
|
-
Objects to download. Each object can be an S3 url, a path suffix, or
|
519
|
-
an S3GetObject that defines a range of data to download.
|
520
|
-
return_missing : bool, default False
|
521
|
-
If set to True, do not raise an exception for a missing key but
|
522
|
-
return it as an `S3Object` with `.exists == False`.
|
523
|
-
return_info : bool, default True
|
524
|
-
If set to True, fetch the content-type and user metadata associated
|
525
|
-
with the object at no extra cost, included for symmetry with `get_many`.
|
526
|
-
|
527
|
-
Returns
|
528
|
-
-------
|
529
|
-
List[S3Object]
|
530
|
-
S3Objects corresponding to the objects requested.
|
531
|
-
"""
|
532
|
-
...
|
533
|
-
def get_recursive(self, keys: typing.Iterable[str], return_info: bool = False) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
|
534
|
-
"""
|
535
|
-
Get many objects from S3 recursively in parallel.
|
536
|
-
|
537
|
-
Parameters
|
538
|
-
----------
|
539
|
-
keys : Iterable[str]
|
540
|
-
Prefixes to download recursively. Each prefix can be an S3 url or a path suffix
|
541
|
-
which define the root prefix under which all objects are downloaded.
|
542
|
-
return_info : bool, default False
|
543
|
-
If set to True, fetch the content-type and user metadata associated
|
544
|
-
with the object.
|
545
|
-
|
546
|
-
Returns
|
547
|
-
-------
|
548
|
-
List[S3Object]
|
549
|
-
S3Objects stored under the given prefixes.
|
550
|
-
"""
|
551
|
-
...
|
552
|
-
def get_all(self, return_info: bool = False) -> typing.List[metaflow.plugins.datatools.s3.s3.S3Object]:
|
553
|
-
"""
|
554
|
-
Get all objects under the prefix set in the `S3` constructor.
|
555
|
-
|
556
|
-
This method requires that the `S3` object is initialized either with `run` or
|
557
|
-
`s3root`.
|
558
|
-
|
559
|
-
Parameters
|
560
|
-
----------
|
561
|
-
return_info : bool, default False
|
562
|
-
If set to True, fetch the content-type and user metadata associated
|
563
|
-
with the object.
|
564
|
-
|
565
|
-
Returns
|
566
|
-
-------
|
567
|
-
Iterable[S3Object]
|
568
|
-
S3Objects stored under the main prefix.
|
569
|
-
"""
|
570
|
-
...
|
571
|
-
def put(self, key: typing.Union[str, metaflow.plugins.datatools.s3.s3.S3PutObject], obj: typing.Union[io.RawIOBase, io.BufferedIOBase, str, bytes], overwrite: bool = True, content_type: typing.Optional[str] = None, metadata: typing.Optional[typing.Dict[str, str]] = None) -> str:
|
572
|
-
"""
|
573
|
-
Upload a single object to S3.
|
574
|
-
|
575
|
-
Parameters
|
576
|
-
----------
|
577
|
-
key : Union[str, S3PutObject]
|
578
|
-
Object path. It can be an S3 url or a path suffix.
|
579
|
-
obj : PutValue
|
580
|
-
An object to store in S3. Strings are converted to UTF-8 encoding.
|
581
|
-
overwrite : bool, default True
|
582
|
-
Overwrite the object if it exists. If set to False, the operation
|
583
|
-
succeeds without uploading anything if the key already exists.
|
584
|
-
content_type : str, optional, default None
|
585
|
-
Optional MIME type for the object.
|
586
|
-
metadata : Dict[str, str], optional, default None
|
587
|
-
A JSON-encodable dictionary of additional headers to be stored
|
588
|
-
as metadata with the object.
|
589
|
-
|
590
|
-
Returns
|
591
|
-
-------
|
592
|
-
str
|
593
|
-
URL of the object stored.
|
594
|
-
"""
|
595
|
-
...
|
596
|
-
def put_many(self, key_objs: typing.List[typing.Union[typing.Tuple[str, typing.Union[io.RawIOBase, io.BufferedIOBase, str, bytes]], metaflow.plugins.datatools.s3.s3.S3PutObject]], overwrite: bool = True) -> typing.List[typing.Tuple[str, str]]:
|
597
|
-
"""
|
598
|
-
Upload many objects to S3.
|
599
|
-
|
600
|
-
Each object to be uploaded can be specified in two ways:
|
601
|
-
|
602
|
-
1. As a `(key, obj)` tuple where `key` is a string specifying
|
603
|
-
the path and `obj` is a string or a bytes object.
|
604
|
-
|
605
|
-
2. As a `S3PutObject` which contains additional metadata to be
|
606
|
-
stored with the object.
|
607
|
-
|
608
|
-
Parameters
|
609
|
-
----------
|
610
|
-
key_objs : List[Union[Tuple[str, PutValue], S3PutObject]]
|
611
|
-
List of key-object pairs to upload.
|
612
|
-
overwrite : bool, default True
|
613
|
-
Overwrite the object if it exists. If set to False, the operation
|
614
|
-
succeeds without uploading anything if the key already exists.
|
615
|
-
|
616
|
-
Returns
|
617
|
-
-------
|
618
|
-
List[Tuple[str, str]]
|
619
|
-
List of `(key, url)` pairs corresponding to the objects uploaded.
|
620
|
-
"""
|
621
|
-
...
|
622
|
-
def put_files(self, key_paths: typing.List[typing.Union[typing.Tuple[str, typing.Union[io.RawIOBase, io.BufferedIOBase, str, bytes]], metaflow.plugins.datatools.s3.s3.S3PutObject]], overwrite: bool = True) -> typing.List[typing.Tuple[str, str]]:
|
623
|
-
"""
|
624
|
-
Upload many local files to S3.
|
625
|
-
|
626
|
-
Each file to be uploaded can be specified in two ways:
|
627
|
-
|
628
|
-
1. As a `(key, path)` tuple where `key` is a string specifying
|
629
|
-
the S3 path and `path` is the path to a local file.
|
630
|
-
|
631
|
-
2. As a `S3PutObject` which contains additional metadata to be
|
632
|
-
stored with the file.
|
633
|
-
|
634
|
-
Parameters
|
635
|
-
----------
|
636
|
-
key_paths : List[Union[Tuple[str, PutValue], S3PutObject]]
|
637
|
-
List of files to upload.
|
638
|
-
overwrite : bool, default True
|
639
|
-
Overwrite the object if it exists. If set to False, the operation
|
640
|
-
succeeds without uploading anything if the key already exists.
|
641
|
-
|
642
|
-
Returns
|
643
|
-
-------
|
644
|
-
List[Tuple[str, str]]
|
645
|
-
List of `(key, url)` pairs corresponding to the files uploaded.
|
646
|
-
"""
|
647
|
-
...
|
357
|
+
def S3(*args, **kwargs):
|
648
358
|
...
|
649
359
|
|
650
360
|
class IncludeFile(metaflow.parameters.Parameter, metaclass=type):
|
@@ -727,25 +437,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
727
437
|
"""
|
728
438
|
...
|
729
439
|
|
730
|
-
@typing.overload
|
731
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
732
|
-
"""
|
733
|
-
Decorator prototype for all step decorators. This function gets specialized
|
734
|
-
and imported for all decorators types by _import_plugin_decorators().
|
735
|
-
"""
|
736
|
-
...
|
737
|
-
|
738
|
-
@typing.overload
|
739
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
740
|
-
...
|
741
|
-
|
742
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
743
|
-
"""
|
744
|
-
Decorator prototype for all step decorators. This function gets specialized
|
745
|
-
and imported for all decorators types by _import_plugin_decorators().
|
746
|
-
"""
|
747
|
-
...
|
748
|
-
|
749
440
|
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, namespace: str = "METAFLOW_KUBERNETES_NAMESPACE", gpu: typing.Optional[int] = None, gpu_vendor: str = "KUBERNETES_GPU_VENDOR", tolerations: typing.List[str] = [], 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) -> 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]]]:
|
750
441
|
"""
|
751
442
|
Specifies that this step should execute on Kubernetes.
|
@@ -809,96 +500,243 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
809
500
|
...
|
810
501
|
|
811
502
|
@typing.overload
|
812
|
-
def
|
503
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
813
504
|
"""
|
814
|
-
|
815
|
-
|
816
|
-
Information in this decorator will augment any
|
817
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
818
|
-
you can use `@pypi_base` to set packages required by all
|
819
|
-
steps and use `@pypi` to specify step-specific overrides.
|
820
|
-
|
821
|
-
Parameters
|
822
|
-
----------
|
823
|
-
packages : Dict[str, str], default: {}
|
824
|
-
Packages to use for this step. The key is the name of the package
|
825
|
-
and the value is the version to use.
|
826
|
-
python : str, optional, default: None
|
827
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
828
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
505
|
+
Decorator prototype for all step decorators. This function gets specialized
|
506
|
+
and imported for all decorators types by _import_plugin_decorators().
|
829
507
|
"""
|
830
508
|
...
|
831
509
|
|
832
510
|
@typing.overload
|
833
|
-
def
|
834
|
-
...
|
835
|
-
|
836
|
-
@typing.overload
|
837
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
511
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
838
512
|
...
|
839
513
|
|
840
|
-
def
|
514
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
841
515
|
"""
|
842
|
-
|
843
|
-
|
844
|
-
Information in this decorator will augment any
|
845
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
846
|
-
you can use `@pypi_base` to set packages required by all
|
847
|
-
steps and use `@pypi` to specify step-specific overrides.
|
848
|
-
|
849
|
-
Parameters
|
850
|
-
----------
|
851
|
-
packages : Dict[str, str], default: {}
|
852
|
-
Packages to use for this step. The key is the name of the package
|
853
|
-
and the value is the version to use.
|
854
|
-
python : str, optional, default: None
|
855
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
856
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
516
|
+
Decorator prototype for all step decorators. This function gets specialized
|
517
|
+
and imported for all decorators types by _import_plugin_decorators().
|
857
518
|
"""
|
858
519
|
...
|
859
520
|
|
860
521
|
@typing.overload
|
861
|
-
def
|
522
|
+
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]]]:
|
862
523
|
"""
|
863
|
-
Specifies
|
524
|
+
Specifies a timeout for your step.
|
525
|
+
|
526
|
+
This decorator is useful if this step may hang indefinitely.
|
527
|
+
|
528
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
529
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
530
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
531
|
+
|
532
|
+
Note that all the values specified in parameters are added together so if you specify
|
533
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
864
534
|
|
865
535
|
Parameters
|
866
536
|
----------
|
867
|
-
|
868
|
-
|
537
|
+
seconds : int, default 0
|
538
|
+
Number of seconds to wait prior to timing out.
|
539
|
+
minutes : int, default 0
|
540
|
+
Number of minutes to wait prior to timing out.
|
541
|
+
hours : int, default 0
|
542
|
+
Number of hours to wait prior to timing out.
|
869
543
|
"""
|
870
544
|
...
|
871
545
|
|
872
546
|
@typing.overload
|
873
|
-
def
|
547
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
874
548
|
...
|
875
549
|
|
876
550
|
@typing.overload
|
877
|
-
def
|
551
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
878
552
|
...
|
879
553
|
|
880
|
-
def
|
554
|
+
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):
|
881
555
|
"""
|
882
|
-
Specifies
|
556
|
+
Specifies a timeout for your step.
|
557
|
+
|
558
|
+
This decorator is useful if this step may hang indefinitely.
|
559
|
+
|
560
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
561
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
562
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
563
|
+
|
564
|
+
Note that all the values specified in parameters are added together so if you specify
|
565
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
883
566
|
|
884
567
|
Parameters
|
885
568
|
----------
|
886
|
-
|
887
|
-
|
569
|
+
seconds : int, default 0
|
570
|
+
Number of seconds to wait prior to timing out.
|
571
|
+
minutes : int, default 0
|
572
|
+
Number of minutes to wait prior to timing out.
|
573
|
+
hours : int, default 0
|
574
|
+
Number of hours to wait prior to timing out.
|
888
575
|
"""
|
889
576
|
...
|
890
577
|
|
891
578
|
@typing.overload
|
892
|
-
def
|
579
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
893
580
|
"""
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
901
|
-
|
581
|
+
Internal decorator to support Fast bakery
|
582
|
+
"""
|
583
|
+
...
|
584
|
+
|
585
|
+
@typing.overload
|
586
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
587
|
+
...
|
588
|
+
|
589
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
590
|
+
"""
|
591
|
+
Internal decorator to support Fast bakery
|
592
|
+
"""
|
593
|
+
...
|
594
|
+
|
595
|
+
@typing.overload
|
596
|
+
def resources(*, cpu: int = 1, gpu: int = 0, 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]]]:
|
597
|
+
"""
|
598
|
+
Specifies the resources needed when executing this step.
|
599
|
+
|
600
|
+
Use `@resources` to specify the resource requirements
|
601
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
602
|
+
|
603
|
+
You can choose the compute layer on the command line by executing e.g.
|
604
|
+
```
|
605
|
+
python myflow.py run --with batch
|
606
|
+
```
|
607
|
+
or
|
608
|
+
```
|
609
|
+
python myflow.py run --with kubernetes
|
610
|
+
```
|
611
|
+
which executes the flow on the desired system using the
|
612
|
+
requirements specified in `@resources`.
|
613
|
+
|
614
|
+
Parameters
|
615
|
+
----------
|
616
|
+
cpu : int, default 1
|
617
|
+
Number of CPUs required for this step.
|
618
|
+
gpu : int, default 0
|
619
|
+
Number of GPUs required for this step.
|
620
|
+
disk : int, optional, default None
|
621
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
622
|
+
memory : int, default 4096
|
623
|
+
Memory size (in MB) required for this step.
|
624
|
+
shared_memory : int, optional, default None
|
625
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
626
|
+
This parameter maps to the `--shm-size` option in Docker.
|
627
|
+
"""
|
628
|
+
...
|
629
|
+
|
630
|
+
@typing.overload
|
631
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
632
|
+
...
|
633
|
+
|
634
|
+
@typing.overload
|
635
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
636
|
+
...
|
637
|
+
|
638
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
639
|
+
"""
|
640
|
+
Specifies the resources needed when executing this step.
|
641
|
+
|
642
|
+
Use `@resources` to specify the resource requirements
|
643
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
644
|
+
|
645
|
+
You can choose the compute layer on the command line by executing e.g.
|
646
|
+
```
|
647
|
+
python myflow.py run --with batch
|
648
|
+
```
|
649
|
+
or
|
650
|
+
```
|
651
|
+
python myflow.py run --with kubernetes
|
652
|
+
```
|
653
|
+
which executes the flow on the desired system using the
|
654
|
+
requirements specified in `@resources`.
|
655
|
+
|
656
|
+
Parameters
|
657
|
+
----------
|
658
|
+
cpu : int, default 1
|
659
|
+
Number of CPUs required for this step.
|
660
|
+
gpu : int, default 0
|
661
|
+
Number of GPUs required for this step.
|
662
|
+
disk : int, optional, default None
|
663
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
664
|
+
memory : int, default 4096
|
665
|
+
Memory size (in MB) required for this step.
|
666
|
+
shared_memory : int, optional, default None
|
667
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
668
|
+
This parameter maps to the `--shm-size` option in Docker.
|
669
|
+
"""
|
670
|
+
...
|
671
|
+
|
672
|
+
@typing.overload
|
673
|
+
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]]]:
|
674
|
+
"""
|
675
|
+
Specifies the Conda environment for the step.
|
676
|
+
|
677
|
+
Information in this decorator will augment any
|
678
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
679
|
+
you can use `@conda_base` to set packages required by all
|
680
|
+
steps and use `@conda` to specify step-specific overrides.
|
681
|
+
|
682
|
+
Parameters
|
683
|
+
----------
|
684
|
+
packages : Dict[str, str], default {}
|
685
|
+
Packages to use for this step. The key is the name of the package
|
686
|
+
and the value is the version to use.
|
687
|
+
libraries : Dict[str, str], default {}
|
688
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
689
|
+
python : str, optional, default None
|
690
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
691
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
692
|
+
disabled : bool, default False
|
693
|
+
If set to True, disables @conda.
|
694
|
+
"""
|
695
|
+
...
|
696
|
+
|
697
|
+
@typing.overload
|
698
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
699
|
+
...
|
700
|
+
|
701
|
+
@typing.overload
|
702
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
703
|
+
...
|
704
|
+
|
705
|
+
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):
|
706
|
+
"""
|
707
|
+
Specifies the Conda environment for the step.
|
708
|
+
|
709
|
+
Information in this decorator will augment any
|
710
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
711
|
+
you can use `@conda_base` to set packages required by all
|
712
|
+
steps and use `@conda` to specify step-specific overrides.
|
713
|
+
|
714
|
+
Parameters
|
715
|
+
----------
|
716
|
+
packages : Dict[str, str], default {}
|
717
|
+
Packages to use for this step. The key is the name of the package
|
718
|
+
and the value is the version to use.
|
719
|
+
libraries : Dict[str, str], default {}
|
720
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
721
|
+
python : str, optional, default None
|
722
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
723
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
724
|
+
disabled : bool, default False
|
725
|
+
If set to True, disables @conda.
|
726
|
+
"""
|
727
|
+
...
|
728
|
+
|
729
|
+
@typing.overload
|
730
|
+
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]]]:
|
731
|
+
"""
|
732
|
+
Specifies the number of times the task corresponding
|
733
|
+
to a step needs to be retried.
|
734
|
+
|
735
|
+
This decorator is useful for handling transient errors, such as networking issues.
|
736
|
+
If your task contains operations that can't be retried safely, e.g. database updates,
|
737
|
+
it is advisable to annotate it with `@retry(times=0)`.
|
738
|
+
|
739
|
+
This can be used in conjunction with the `@catch` decorator. The `@catch`
|
902
740
|
decorator will execute a no-op task after all retries have been exhausted,
|
903
741
|
ensuring that the flow execution can continue.
|
904
742
|
|
@@ -991,92 +829,66 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
991
829
|
...
|
992
830
|
|
993
831
|
@typing.overload
|
994
|
-
def
|
832
|
+
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]]]:
|
995
833
|
"""
|
996
|
-
Specifies
|
997
|
-
|
998
|
-
This decorator is useful if this step may hang indefinitely.
|
999
|
-
|
1000
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1001
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1002
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1003
|
-
|
1004
|
-
Note that all the values specified in parameters are added together so if you specify
|
1005
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
834
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
835
|
+
the execution of a step.
|
1006
836
|
|
1007
837
|
Parameters
|
1008
838
|
----------
|
1009
|
-
|
1010
|
-
|
1011
|
-
minutes : int, default 0
|
1012
|
-
Number of minutes to wait prior to timing out.
|
1013
|
-
hours : int, default 0
|
1014
|
-
Number of hours to wait prior to timing out.
|
839
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
840
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1015
841
|
"""
|
1016
842
|
...
|
1017
843
|
|
1018
844
|
@typing.overload
|
1019
|
-
def
|
845
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1020
846
|
...
|
1021
847
|
|
1022
848
|
@typing.overload
|
1023
|
-
def
|
849
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1024
850
|
...
|
1025
851
|
|
1026
|
-
def
|
852
|
+
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]]] = []):
|
1027
853
|
"""
|
1028
|
-
Specifies
|
1029
|
-
|
1030
|
-
This decorator is useful if this step may hang indefinitely.
|
1031
|
-
|
1032
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1033
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1034
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1035
|
-
|
1036
|
-
Note that all the values specified in parameters are added together so if you specify
|
1037
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
854
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
855
|
+
the execution of a step.
|
1038
856
|
|
1039
857
|
Parameters
|
1040
858
|
----------
|
1041
|
-
|
1042
|
-
|
1043
|
-
minutes : int, default 0
|
1044
|
-
Number of minutes to wait prior to timing out.
|
1045
|
-
hours : int, default 0
|
1046
|
-
Number of hours to wait prior to timing out.
|
859
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
860
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1047
861
|
"""
|
1048
862
|
...
|
1049
863
|
|
1050
864
|
@typing.overload
|
1051
|
-
def
|
865
|
+
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]]]:
|
1052
866
|
"""
|
1053
|
-
Specifies
|
1054
|
-
the execution of a step.
|
867
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1055
868
|
|
1056
869
|
Parameters
|
1057
870
|
----------
|
1058
|
-
|
1059
|
-
|
871
|
+
vars : Dict[str, str], default {}
|
872
|
+
Dictionary of environment variables to set.
|
1060
873
|
"""
|
1061
874
|
...
|
1062
875
|
|
1063
876
|
@typing.overload
|
1064
|
-
def
|
877
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1065
878
|
...
|
1066
879
|
|
1067
880
|
@typing.overload
|
1068
|
-
def
|
881
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1069
882
|
...
|
1070
883
|
|
1071
|
-
def
|
884
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1072
885
|
"""
|
1073
|
-
Specifies
|
1074
|
-
the execution of a step.
|
886
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1075
887
|
|
1076
888
|
Parameters
|
1077
889
|
----------
|
1078
|
-
|
1079
|
-
|
890
|
+
vars : Dict[str, str], default {}
|
891
|
+
Dictionary of environment variables to set.
|
1080
892
|
"""
|
1081
893
|
...
|
1082
894
|
|
@@ -1132,192 +944,100 @@ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typ
|
|
1132
944
|
...
|
1133
945
|
|
1134
946
|
@typing.overload
|
1135
|
-
def
|
947
|
+
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]]]:
|
1136
948
|
"""
|
1137
|
-
Specifies the
|
949
|
+
Specifies the PyPI packages for the step.
|
1138
950
|
|
1139
951
|
Information in this decorator will augment any
|
1140
|
-
attributes set in the `@
|
1141
|
-
you can use `@
|
1142
|
-
steps and use `@
|
952
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
953
|
+
you can use `@pypi_base` to set packages required by all
|
954
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1143
955
|
|
1144
956
|
Parameters
|
1145
957
|
----------
|
1146
|
-
packages : Dict[str, str], default {}
|
958
|
+
packages : Dict[str, str], default: {}
|
1147
959
|
Packages to use for this step. The key is the name of the package
|
1148
960
|
and the value is the version to use.
|
1149
|
-
|
1150
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1151
|
-
python : str, optional, default None
|
961
|
+
python : str, optional, default: None
|
1152
962
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1153
963
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1154
|
-
disabled : bool, default False
|
1155
|
-
If set to True, disables @conda.
|
1156
964
|
"""
|
1157
965
|
...
|
1158
966
|
|
1159
967
|
@typing.overload
|
1160
|
-
def
|
968
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1161
969
|
...
|
1162
970
|
|
1163
971
|
@typing.overload
|
1164
|
-
def
|
972
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1165
973
|
...
|
1166
974
|
|
1167
|
-
def
|
975
|
+
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):
|
1168
976
|
"""
|
1169
|
-
Specifies the
|
977
|
+
Specifies the PyPI packages for the step.
|
1170
978
|
|
1171
979
|
Information in this decorator will augment any
|
1172
|
-
attributes set in the `@
|
1173
|
-
you can use `@
|
1174
|
-
steps and use `@
|
980
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
981
|
+
you can use `@pypi_base` to set packages required by all
|
982
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1175
983
|
|
1176
984
|
Parameters
|
1177
985
|
----------
|
1178
|
-
packages : Dict[str, str], default {}
|
986
|
+
packages : Dict[str, str], default: {}
|
1179
987
|
Packages to use for this step. The key is the name of the package
|
1180
988
|
and the value is the version to use.
|
1181
|
-
|
1182
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1183
|
-
python : str, optional, default None
|
989
|
+
python : str, optional, default: None
|
1184
990
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1185
991
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1186
|
-
disabled : bool, default False
|
1187
|
-
If set to True, disables @conda.
|
1188
992
|
"""
|
1189
993
|
...
|
1190
994
|
|
1191
995
|
@typing.overload
|
1192
|
-
def
|
1193
|
-
"""
|
1194
|
-
Internal decorator to support Fast bakery
|
1195
|
-
"""
|
1196
|
-
...
|
1197
|
-
|
1198
|
-
@typing.overload
|
1199
|
-
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1200
|
-
...
|
1201
|
-
|
1202
|
-
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
1203
|
-
"""
|
1204
|
-
Internal decorator to support Fast bakery
|
1205
|
-
"""
|
1206
|
-
...
|
1207
|
-
|
1208
|
-
@typing.overload
|
1209
|
-
def resources(*, cpu: int = 1, gpu: int = 0, 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]]]:
|
1210
|
-
"""
|
1211
|
-
Specifies the resources needed when executing this step.
|
1212
|
-
|
1213
|
-
Use `@resources` to specify the resource requirements
|
1214
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
1215
|
-
|
1216
|
-
You can choose the compute layer on the command line by executing e.g.
|
1217
|
-
```
|
1218
|
-
python myflow.py run --with batch
|
1219
|
-
```
|
1220
|
-
or
|
1221
|
-
```
|
1222
|
-
python myflow.py run --with kubernetes
|
1223
|
-
```
|
1224
|
-
which executes the flow on the desired system using the
|
1225
|
-
requirements specified in `@resources`.
|
1226
|
-
|
1227
|
-
Parameters
|
1228
|
-
----------
|
1229
|
-
cpu : int, default 1
|
1230
|
-
Number of CPUs required for this step.
|
1231
|
-
gpu : int, default 0
|
1232
|
-
Number of GPUs required for this step.
|
1233
|
-
disk : int, optional, default None
|
1234
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1235
|
-
memory : int, default 4096
|
1236
|
-
Memory size (in MB) required for this step.
|
1237
|
-
shared_memory : int, optional, default None
|
1238
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1239
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1240
|
-
"""
|
1241
|
-
...
|
1242
|
-
|
1243
|
-
@typing.overload
|
1244
|
-
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1245
|
-
...
|
1246
|
-
|
1247
|
-
@typing.overload
|
1248
|
-
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1249
|
-
...
|
1250
|
-
|
1251
|
-
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: int = 0, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
996
|
+
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]]:
|
1252
997
|
"""
|
1253
|
-
Specifies the
|
1254
|
-
|
1255
|
-
Use `@resources` to specify the resource requirements
|
1256
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
1257
|
-
|
1258
|
-
You can choose the compute layer on the command line by executing e.g.
|
1259
|
-
```
|
1260
|
-
python myflow.py run --with batch
|
1261
|
-
```
|
1262
|
-
or
|
1263
|
-
```
|
1264
|
-
python myflow.py run --with kubernetes
|
1265
|
-
```
|
1266
|
-
which executes the flow on the desired system using the
|
1267
|
-
requirements specified in `@resources`.
|
998
|
+
Specifies the Conda environment for all steps of the flow.
|
1268
999
|
|
1269
|
-
|
1270
|
-
|
1271
|
-
cpu : int, default 1
|
1272
|
-
Number of CPUs required for this step.
|
1273
|
-
gpu : int, default 0
|
1274
|
-
Number of GPUs required for this step.
|
1275
|
-
disk : int, optional, default None
|
1276
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1277
|
-
memory : int, default 4096
|
1278
|
-
Memory size (in MB) required for this step.
|
1279
|
-
shared_memory : int, optional, default None
|
1280
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1281
|
-
This parameter maps to the `--shm-size` option in Docker.
|
1282
|
-
"""
|
1283
|
-
...
|
1284
|
-
|
1285
|
-
@typing.overload
|
1286
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1287
|
-
"""
|
1288
|
-
Specifies the PyPI packages for all steps of the flow.
|
1000
|
+
Use `@conda_base` to set common libraries required by all
|
1001
|
+
steps and use `@conda` to specify step-specific additions.
|
1289
1002
|
|
1290
|
-
Use `@pypi_base` to set common packages required by all
|
1291
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1292
1003
|
Parameters
|
1293
1004
|
----------
|
1294
|
-
packages : Dict[str, str], default
|
1005
|
+
packages : Dict[str, str], default {}
|
1295
1006
|
Packages to use for this flow. The key is the name of the package
|
1296
1007
|
and the value is the version to use.
|
1297
|
-
|
1008
|
+
libraries : Dict[str, str], default {}
|
1009
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1010
|
+
python : str, optional, default None
|
1298
1011
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1299
1012
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1013
|
+
disabled : bool, default False
|
1014
|
+
If set to True, disables Conda.
|
1300
1015
|
"""
|
1301
1016
|
...
|
1302
1017
|
|
1303
1018
|
@typing.overload
|
1304
|
-
def
|
1019
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1305
1020
|
...
|
1306
1021
|
|
1307
|
-
def
|
1022
|
+
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):
|
1308
1023
|
"""
|
1309
|
-
Specifies the
|
1024
|
+
Specifies the Conda environment for all steps of the flow.
|
1025
|
+
|
1026
|
+
Use `@conda_base` to set common libraries required by all
|
1027
|
+
steps and use `@conda` to specify step-specific additions.
|
1310
1028
|
|
1311
|
-
Use `@pypi_base` to set common packages required by all
|
1312
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1313
1029
|
Parameters
|
1314
1030
|
----------
|
1315
|
-
packages : Dict[str, str], default
|
1031
|
+
packages : Dict[str, str], default {}
|
1316
1032
|
Packages to use for this flow. The key is the name of the package
|
1317
1033
|
and the value is the version to use.
|
1318
|
-
|
1034
|
+
libraries : Dict[str, str], default {}
|
1035
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1036
|
+
python : str, optional, default None
|
1319
1037
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1320
1038
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1039
|
+
disabled : bool, default False
|
1040
|
+
If set to True, disables Conda.
|
1321
1041
|
"""
|
1322
1042
|
...
|
1323
1043
|
|
@@ -1424,6 +1144,76 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1424
1144
|
"""
|
1425
1145
|
...
|
1426
1146
|
|
1147
|
+
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1148
|
+
"""
|
1149
|
+
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1150
|
+
|
1151
|
+
User code call
|
1152
|
+
-----------
|
1153
|
+
@nim(
|
1154
|
+
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1155
|
+
backend='managed'
|
1156
|
+
)
|
1157
|
+
|
1158
|
+
Valid backend options
|
1159
|
+
---------------------
|
1160
|
+
- 'managed': Outerbounds selects a compute provider based on the model.
|
1161
|
+
- 🚧 'dataplane': Run in your account.
|
1162
|
+
|
1163
|
+
Valid model options
|
1164
|
+
----------------
|
1165
|
+
- 'meta/llama3-8b-instruct': 8B parameter model
|
1166
|
+
- 'meta/llama3-70b-instruct': 70B parameter model
|
1167
|
+
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1168
|
+
|
1169
|
+
Parameters
|
1170
|
+
----------
|
1171
|
+
models: list[NIM]
|
1172
|
+
List of NIM containers running models in sidecars.
|
1173
|
+
backend: str
|
1174
|
+
Compute provider to run the NIM container.
|
1175
|
+
"""
|
1176
|
+
...
|
1177
|
+
|
1178
|
+
@typing.overload
|
1179
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1180
|
+
"""
|
1181
|
+
Specifies the PyPI packages for all steps of the flow.
|
1182
|
+
|
1183
|
+
Use `@pypi_base` to set common packages required by all
|
1184
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1185
|
+
Parameters
|
1186
|
+
----------
|
1187
|
+
packages : Dict[str, str], default: {}
|
1188
|
+
Packages to use for this flow. The key is the name of the package
|
1189
|
+
and the value is the version to use.
|
1190
|
+
python : str, optional, default: None
|
1191
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1192
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1193
|
+
"""
|
1194
|
+
...
|
1195
|
+
|
1196
|
+
@typing.overload
|
1197
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1198
|
+
...
|
1199
|
+
|
1200
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1201
|
+
"""
|
1202
|
+
Specifies the PyPI packages for all steps of the flow.
|
1203
|
+
|
1204
|
+
Use `@pypi_base` to set common packages required by all
|
1205
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1206
|
+
Parameters
|
1207
|
+
----------
|
1208
|
+
packages : Dict[str, str], default: {}
|
1209
|
+
Packages to use for this flow. The key is the name of the package
|
1210
|
+
and the value is the version to use.
|
1211
|
+
python : str, optional, default: None
|
1212
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1213
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1214
|
+
"""
|
1215
|
+
...
|
1216
|
+
|
1427
1217
|
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]]:
|
1428
1218
|
"""
|
1429
1219
|
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.
|
@@ -1466,125 +1256,21 @@ def airflow_external_task_sensor(*, timeout: int, poke_interval: int, mode: str,
|
|
1466
1256
|
"""
|
1467
1257
|
...
|
1468
1258
|
|
1469
|
-
def
|
1470
|
-
"""
|
1471
|
-
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)
|
1472
|
-
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1473
|
-
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1474
|
-
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1475
|
-
starts only after all sensors finish.
|
1476
|
-
|
1477
|
-
Parameters
|
1478
|
-
----------
|
1479
|
-
timeout : int
|
1480
|
-
Time, in seconds before the task times out and fails. (Default: 3600)
|
1481
|
-
poke_interval : int
|
1482
|
-
Time in seconds that the job should wait in between each try. (Default: 60)
|
1483
|
-
mode : str
|
1484
|
-
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1485
|
-
exponential_backoff : bool
|
1486
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1487
|
-
pool : str
|
1488
|
-
the slot pool this task should run in,
|
1489
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1490
|
-
soft_fail : bool
|
1491
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1492
|
-
name : str
|
1493
|
-
Name of the sensor on Airflow
|
1494
|
-
description : str
|
1495
|
-
Description of sensor in the Airflow UI
|
1496
|
-
bucket_key : Union[str, List[str]]
|
1497
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1498
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1499
|
-
bucket_name : str
|
1500
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1501
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1502
|
-
wildcard_match : bool
|
1503
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1504
|
-
aws_conn_id : str
|
1505
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1506
|
-
verify : bool
|
1507
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1508
|
-
"""
|
1509
|
-
...
|
1510
|
-
|
1511
|
-
@typing.overload
|
1512
|
-
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]]:
|
1513
|
-
"""
|
1514
|
-
Specifies the Conda environment for all steps of the flow.
|
1515
|
-
|
1516
|
-
Use `@conda_base` to set common libraries required by all
|
1517
|
-
steps and use `@conda` to specify step-specific additions.
|
1518
|
-
|
1519
|
-
Parameters
|
1520
|
-
----------
|
1521
|
-
packages : Dict[str, str], default {}
|
1522
|
-
Packages to use for this flow. The key is the name of the package
|
1523
|
-
and the value is the version to use.
|
1524
|
-
libraries : Dict[str, str], default {}
|
1525
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1526
|
-
python : str, optional, default None
|
1527
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1528
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1529
|
-
disabled : bool, default False
|
1530
|
-
If set to True, disables Conda.
|
1531
|
-
"""
|
1532
|
-
...
|
1533
|
-
|
1534
|
-
@typing.overload
|
1535
|
-
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1536
|
-
...
|
1537
|
-
|
1538
|
-
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):
|
1259
|
+
def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1539
1260
|
"""
|
1540
|
-
Specifies
|
1261
|
+
Specifies what flows belong to the same project.
|
1541
1262
|
|
1542
|
-
|
1543
|
-
|
1263
|
+
A project-specific namespace is created for all flows that
|
1264
|
+
use the same `@project(name)`.
|
1544
1265
|
|
1545
1266
|
Parameters
|
1546
1267
|
----------
|
1547
|
-
|
1548
|
-
|
1549
|
-
|
1550
|
-
|
1551
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1552
|
-
python : str, optional, default None
|
1553
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1554
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1555
|
-
disabled : bool, default False
|
1556
|
-
If set to True, disables Conda.
|
1557
|
-
"""
|
1558
|
-
...
|
1559
|
-
|
1560
|
-
def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1561
|
-
"""
|
1562
|
-
This decorator is used to run NIM containers in Metaflow tasks as sidecars.
|
1563
|
-
|
1564
|
-
User code call
|
1565
|
-
-----------
|
1566
|
-
@nim(
|
1567
|
-
models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
|
1568
|
-
backend='managed'
|
1569
|
-
)
|
1570
|
-
|
1571
|
-
Valid backend options
|
1572
|
-
---------------------
|
1573
|
-
- 'managed': Outerbounds selects a compute provider based on the model.
|
1574
|
-
- 🚧 'dataplane': Run in your account.
|
1268
|
+
name : str
|
1269
|
+
Project name. Make sure that the name is unique amongst all
|
1270
|
+
projects that use the same production scheduler. The name may
|
1271
|
+
contain only lowercase alphanumeric characters and underscores.
|
1575
1272
|
|
1576
|
-
Valid model options
|
1577
|
-
----------------
|
1578
|
-
- 'meta/llama3-8b-instruct': 8B parameter model
|
1579
|
-
- 'meta/llama3-70b-instruct': 70B parameter model
|
1580
|
-
- Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
|
1581
1273
|
|
1582
|
-
Parameters
|
1583
|
-
----------
|
1584
|
-
models: list[NIM]
|
1585
|
-
List of NIM containers running models in sidecars.
|
1586
|
-
backend: str
|
1587
|
-
Compute provider to run the NIM container.
|
1588
1274
|
"""
|
1589
1275
|
...
|
1590
1276
|
|
@@ -1732,21 +1418,45 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
|
|
1732
1418
|
"""
|
1733
1419
|
...
|
1734
1420
|
|
1735
|
-
def
|
1421
|
+
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]]:
|
1736
1422
|
"""
|
1737
|
-
|
1738
|
-
|
1739
|
-
|
1740
|
-
|
1423
|
+
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)
|
1424
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1425
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1426
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1427
|
+
starts only after all sensors finish.
|
1741
1428
|
|
1742
1429
|
Parameters
|
1743
1430
|
----------
|
1431
|
+
timeout : int
|
1432
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1433
|
+
poke_interval : int
|
1434
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1435
|
+
mode : str
|
1436
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1437
|
+
exponential_backoff : bool
|
1438
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1439
|
+
pool : str
|
1440
|
+
the slot pool this task should run in,
|
1441
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1442
|
+
soft_fail : bool
|
1443
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1744
1444
|
name : str
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1445
|
+
Name of the sensor on Airflow
|
1446
|
+
description : str
|
1447
|
+
Description of sensor in the Airflow UI
|
1448
|
+
bucket_key : Union[str, List[str]]
|
1449
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1450
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1451
|
+
bucket_name : str
|
1452
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1453
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1454
|
+
wildcard_match : bool
|
1455
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1456
|
+
aws_conn_id : str
|
1457
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1458
|
+
verify : bool
|
1459
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1750
1460
|
"""
|
1751
1461
|
...
|
1752
1462
|
|