ob-metaflow-stubs 6.0.3.102rc7__py2.py3-none-any.whl → 6.0.3.102rc8__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. metaflow-stubs/__init__.pyi +537 -537
  2. metaflow-stubs/cards.pyi +4 -4
  3. metaflow-stubs/cli.pyi +2 -2
  4. metaflow-stubs/client/__init__.pyi +2 -2
  5. metaflow-stubs/client/core.pyi +5 -5
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +1 -1
  8. metaflow-stubs/events.pyi +1 -1
  9. metaflow-stubs/exception.pyi +1 -1
  10. metaflow-stubs/flowspec.pyi +4 -4
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +3 -3
  13. metaflow-stubs/info_file.pyi +1 -1
  14. metaflow-stubs/metadata/metadata.pyi +1 -1
  15. metaflow-stubs/metadata/util.pyi +1 -1
  16. metaflow-stubs/metaflow_config.pyi +1 -1
  17. metaflow-stubs/metaflow_current.pyi +64 -64
  18. metaflow-stubs/mflog/mflog.pyi +1 -1
  19. metaflow-stubs/multicore_utils.pyi +1 -1
  20. metaflow-stubs/parameters.pyi +3 -3
  21. metaflow-stubs/plugins/__init__.pyi +1 -1
  22. metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
  23. metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
  24. metaflow-stubs/plugins/airflow/exception.pyi +1 -1
  25. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
  26. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
  27. metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +3 -3
  28. metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +3 -3
  29. metaflow-stubs/plugins/argo/__init__.pyi +1 -1
  30. metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
  31. metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
  32. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  33. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +6 -6
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +5 -5
  35. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
  36. metaflow-stubs/plugins/aws/__init__.pyi +1 -1
  37. metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
  41. metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
  42. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +3 -3
  43. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
  44. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  45. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
  46. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
  47. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +1 -1
  48. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
  49. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
  50. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
  51. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  52. metaflow-stubs/plugins/azure/__init__.pyi +1 -1
  53. metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
  54. metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
  55. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  56. metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
  57. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
  58. metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
  59. metaflow-stubs/plugins/cards/__init__.pyi +1 -1
  60. metaflow-stubs/plugins/cards/card_cli.pyi +3 -3
  61. metaflow-stubs/plugins/cards/card_client.pyi +2 -2
  62. metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
  63. metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
  64. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
  66. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
  68. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  69. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
  70. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
  71. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
  72. metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
  73. metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
  74. metaflow-stubs/plugins/cards/exception.pyi +1 -1
  75. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  76. metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
  77. metaflow-stubs/plugins/datatools/local.pyi +1 -1
  78. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  79. metaflow-stubs/plugins/datatools/s3/s3.pyi +4 -4
  80. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
  81. metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
  82. metaflow-stubs/plugins/debug_logger.pyi +1 -1
  83. metaflow-stubs/plugins/debug_monitor.pyi +1 -1
  84. metaflow-stubs/plugins/environment_decorator.pyi +1 -1
  85. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  86. metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
  87. metaflow-stubs/plugins/frameworks/pytorch.pyi +3 -3
  88. metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
  89. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  90. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
  91. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
  92. metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
  93. metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
  94. metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
  95. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +1 -1
  96. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +2 -2
  97. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +2 -2
  98. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
  99. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +3 -3
  100. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
  101. metaflow-stubs/plugins/logs_cli.pyi +2 -2
  102. metaflow-stubs/plugins/package_cli.pyi +1 -1
  103. metaflow-stubs/plugins/parallel_decorator.pyi +2 -2
  104. metaflow-stubs/plugins/perimeters.pyi +1 -1
  105. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/pypi/__init__.pyi +1 -1
  107. metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
  108. metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
  109. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
  110. metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
  111. metaflow-stubs/plugins/pypi/utils.pyi +1 -1
  112. metaflow-stubs/plugins/resources_decorator.pyi +1 -1
  113. metaflow-stubs/plugins/retry_decorator.pyi +1 -1
  114. metaflow-stubs/plugins/secrets/__init__.pyi +1 -1
  115. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
  116. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
  117. metaflow-stubs/plugins/storage_executor.pyi +1 -1
  118. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
  120. metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
  121. metaflow-stubs/procpoll.pyi +1 -1
  122. metaflow-stubs/profilers/__init__.pyi +1 -1
  123. metaflow-stubs/pylint_wrapper.pyi +1 -1
  124. metaflow-stubs/runner/__init__.pyi +1 -1
  125. metaflow-stubs/runner/deployer.pyi +2 -2
  126. metaflow-stubs/runner/metaflow_runner.pyi +4 -4
  127. metaflow-stubs/runner/nbdeploy.pyi +1 -1
  128. metaflow-stubs/runner/nbrun.pyi +1 -1
  129. metaflow-stubs/runner/subprocess_manager.pyi +1 -1
  130. metaflow-stubs/runner/utils.pyi +1 -1
  131. metaflow-stubs/system/__init__.pyi +2 -2
  132. metaflow-stubs/system/system_logger.pyi +1 -1
  133. metaflow-stubs/system/system_monitor.pyi +2 -2
  134. metaflow-stubs/tagging_util.pyi +1 -1
  135. metaflow-stubs/tuple_util.pyi +1 -1
  136. {ob_metaflow_stubs-6.0.3.102rc7.dist-info → ob_metaflow_stubs-6.0.3.102rc8.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-6.0.3.102rc8.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-6.0.3.102rc7.dist-info/RECORD +0 -140
  139. {ob_metaflow_stubs-6.0.3.102rc7.dist-info → ob_metaflow_stubs-6.0.3.102rc8.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-6.0.3.102rc7.dist-info → ob_metaflow_stubs-6.0.3.102rc8.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,24 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
3
  # MF version: 2.12.22.1+obcheckpoint(0.0.10);ob(v1) #
4
- # Generated on 2024-09-20T19:26:01.310999 #
4
+ # Generated on 2024-09-20T19:35:46.753101 #
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.client.core
12
+ import metaflow.metaflow_current
11
13
  import typing
12
14
  import metaflow.flowspec
13
- import metaflow._vendor.click.types
14
- import metaflow.parameters
15
15
  import datetime
16
- import metaflow.events
17
16
  import metaflow.runner.metaflow_runner
18
- import metaflow.client.core
19
- import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
20
- import metaflow.metaflow_current
21
17
  import metaflow.datastore.inputs
18
+ import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
19
+ import metaflow._vendor.click.types
20
+ import metaflow.parameters
21
+ import metaflow.events
22
22
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
23
23
  StepFlag = typing.NewType("StepFlag", bool)
24
24
 
@@ -435,35 +435,212 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
435
435
  ...
436
436
 
437
437
  @typing.overload
438
- 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]]]:
438
+ def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: 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]]]:
439
439
  """
440
- Specifies secrets to be retrieved and injected as environment variables prior to
441
- the execution of a step.
440
+ Enables loading / saving of models within a step.
441
+
442
442
 
443
443
  Parameters
444
444
  ----------
445
- sources : List[Union[str, Dict[str, Any]]], default: []
446
- List of secret specs, defining how the secrets are to be retrieved
445
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
446
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
447
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
448
+ - `current.checkpoint`
449
+ - `current.model`
450
+ - `current.huggingface_hub`
451
+
452
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
453
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
454
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
455
+
456
+ temp_dir_root : str, default: None
457
+ The root directory under which `current.model.loaded` will store loaded models
458
+
459
+
460
+
447
461
  """
448
462
  ...
449
463
 
450
464
  @typing.overload
451
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
465
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
452
466
  ...
453
467
 
454
468
  @typing.overload
455
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
469
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
456
470
  ...
457
471
 
458
- 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]]] = []):
472
+ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
459
473
  """
460
- Specifies secrets to be retrieved and injected as environment variables prior to
461
- the execution of a step.
474
+ Enables loading / saving of models within a step.
475
+
462
476
 
463
477
  Parameters
464
478
  ----------
465
- sources : List[Union[str, Dict[str, Any]]], default: []
466
- List of secret specs, defining how the secrets are to be retrieved
479
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
480
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
481
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
482
+ - `current.checkpoint`
483
+ - `current.model`
484
+ - `current.huggingface_hub`
485
+
486
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
487
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
488
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
489
+
490
+ temp_dir_root : str, default: None
491
+ The root directory under which `current.model.loaded` will store loaded models
492
+
493
+
494
+
495
+ """
496
+ ...
497
+
498
+ @typing.overload
499
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
500
+ """
501
+ Decorator prototype for all step decorators. This function gets specialized
502
+ and imported for all decorators types by _import_plugin_decorators().
503
+ """
504
+ ...
505
+
506
+ @typing.overload
507
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
508
+ ...
509
+
510
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
511
+ """
512
+ Decorator prototype for all step decorators. This function gets specialized
513
+ and imported for all decorators types by _import_plugin_decorators().
514
+ """
515
+ ...
516
+
517
+ @typing.overload
518
+ 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]]]:
519
+ """
520
+ Specifies the number of times the task corresponding
521
+ to a step needs to be retried.
522
+
523
+ This decorator is useful for handling transient errors, such as networking issues.
524
+ If your task contains operations that can't be retried safely, e.g. database updates,
525
+ it is advisable to annotate it with `@retry(times=0)`.
526
+
527
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
528
+ decorator will execute a no-op task after all retries have been exhausted,
529
+ ensuring that the flow execution can continue.
530
+
531
+ Parameters
532
+ ----------
533
+ times : int, default 3
534
+ Number of times to retry this task.
535
+ minutes_between_retries : int, default 2
536
+ Number of minutes between retries.
537
+ """
538
+ ...
539
+
540
+ @typing.overload
541
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
542
+ ...
543
+
544
+ @typing.overload
545
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
546
+ ...
547
+
548
+ 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):
549
+ """
550
+ Specifies the number of times the task corresponding
551
+ to a step needs to be retried.
552
+
553
+ This decorator is useful for handling transient errors, such as networking issues.
554
+ If your task contains operations that can't be retried safely, e.g. database updates,
555
+ it is advisable to annotate it with `@retry(times=0)`.
556
+
557
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
558
+ decorator will execute a no-op task after all retries have been exhausted,
559
+ ensuring that the flow execution can continue.
560
+
561
+ Parameters
562
+ ----------
563
+ times : int, default 3
564
+ Number of times to retry this task.
565
+ minutes_between_retries : int, default 2
566
+ Number of minutes between retries.
567
+ """
568
+ ...
569
+
570
+ @typing.overload
571
+ 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]]]:
572
+ """
573
+ Specifies the resources needed when executing this step.
574
+
575
+ Use `@resources` to specify the resource requirements
576
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
577
+
578
+ You can choose the compute layer on the command line by executing e.g.
579
+ ```
580
+ python myflow.py run --with batch
581
+ ```
582
+ or
583
+ ```
584
+ python myflow.py run --with kubernetes
585
+ ```
586
+ which executes the flow on the desired system using the
587
+ requirements specified in `@resources`.
588
+
589
+ Parameters
590
+ ----------
591
+ cpu : int, default 1
592
+ Number of CPUs required for this step.
593
+ gpu : int, default 0
594
+ Number of GPUs required for this step.
595
+ disk : int, optional, default None
596
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
597
+ memory : int, default 4096
598
+ Memory size (in MB) required for this step.
599
+ shared_memory : int, optional, default None
600
+ The value for the size (in MiB) of the /dev/shm volume for this step.
601
+ This parameter maps to the `--shm-size` option in Docker.
602
+ """
603
+ ...
604
+
605
+ @typing.overload
606
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
607
+ ...
608
+
609
+ @typing.overload
610
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
611
+ ...
612
+
613
+ 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):
614
+ """
615
+ Specifies the resources needed when executing this step.
616
+
617
+ Use `@resources` to specify the resource requirements
618
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
619
+
620
+ You can choose the compute layer on the command line by executing e.g.
621
+ ```
622
+ python myflow.py run --with batch
623
+ ```
624
+ or
625
+ ```
626
+ python myflow.py run --with kubernetes
627
+ ```
628
+ which executes the flow on the desired system using the
629
+ requirements specified in `@resources`.
630
+
631
+ Parameters
632
+ ----------
633
+ cpu : int, default 1
634
+ Number of CPUs required for this step.
635
+ gpu : int, default 0
636
+ Number of GPUs required for this step.
637
+ disk : int, optional, default None
638
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
639
+ memory : int, default 4096
640
+ Memory size (in MB) required for this step.
641
+ shared_memory : int, optional, default None
642
+ The value for the size (in MiB) of the /dev/shm volume for this step.
643
+ This parameter maps to the `--shm-size` option in Docker.
467
644
  """
468
645
  ...
469
646
 
@@ -549,25 +726,6 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
549
726
  """
550
727
  ...
551
728
 
552
- @typing.overload
553
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
554
- """
555
- Decorator prototype for all step decorators. This function gets specialized
556
- and imported for all decorators types by _import_plugin_decorators().
557
- """
558
- ...
559
-
560
- @typing.overload
561
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
562
- ...
563
-
564
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
565
- """
566
- Decorator prototype for all step decorators. This function gets specialized
567
- and imported for all decorators types by _import_plugin_decorators().
568
- """
569
- ...
570
-
571
729
  @typing.overload
572
730
  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]]]:
573
731
  """
@@ -625,26 +783,83 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
625
783
  """
626
784
  ...
627
785
 
628
- 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] = [], 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]]]:
786
+ @typing.overload
787
+ 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]]]:
629
788
  """
630
- Specifies that this step should execute on Kubernetes.
789
+ Specifies the Conda environment for the step.
790
+
791
+ Information in this decorator will augment any
792
+ attributes set in the `@conda_base` flow-level decorator. Hence,
793
+ you can use `@conda_base` to set packages required by all
794
+ steps and use `@conda` to specify step-specific overrides.
631
795
 
632
796
  Parameters
633
797
  ----------
634
- cpu : int, default 1
635
- Number of CPUs required for this step. If `@resources` is
636
- also present, the maximum value from all decorators is used.
637
- memory : int, default 4096
638
- Memory size (in MB) required for this step. If
639
- `@resources` is also present, the maximum value from all decorators is
640
- used.
641
- disk : int, default 10240
642
- Disk size (in MB) required for this step. If
643
- `@resources` is also present, the maximum value from all decorators is
644
- used.
645
- image : str, optional, default None
646
- Docker image to use when launching on Kubernetes. If not specified, and
647
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
798
+ packages : Dict[str, str], default {}
799
+ Packages to use for this step. The key is the name of the package
800
+ and the value is the version to use.
801
+ libraries : Dict[str, str], default {}
802
+ Supported for backward compatibility. When used with packages, packages will take precedence.
803
+ python : str, optional, default None
804
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
805
+ that the version used will correspond to the version of the Python interpreter used to start the run.
806
+ disabled : bool, default False
807
+ If set to True, disables @conda.
808
+ """
809
+ ...
810
+
811
+ @typing.overload
812
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
813
+ ...
814
+
815
+ @typing.overload
816
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
817
+ ...
818
+
819
+ 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):
820
+ """
821
+ Specifies the Conda environment for the step.
822
+
823
+ Information in this decorator will augment any
824
+ attributes set in the `@conda_base` flow-level decorator. Hence,
825
+ you can use `@conda_base` to set packages required by all
826
+ steps and use `@conda` to specify step-specific overrides.
827
+
828
+ Parameters
829
+ ----------
830
+ packages : Dict[str, str], default {}
831
+ Packages to use for this step. The key is the name of the package
832
+ and the value is the version to use.
833
+ libraries : Dict[str, str], default {}
834
+ Supported for backward compatibility. When used with packages, packages will take precedence.
835
+ python : str, optional, default None
836
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
837
+ that the version used will correspond to the version of the Python interpreter used to start the run.
838
+ disabled : bool, default False
839
+ If set to True, disables @conda.
840
+ """
841
+ ...
842
+
843
+ 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] = [], 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]]]:
844
+ """
845
+ Specifies that this step should execute on Kubernetes.
846
+
847
+ Parameters
848
+ ----------
849
+ cpu : int, default 1
850
+ Number of CPUs required for this step. If `@resources` is
851
+ also present, the maximum value from all decorators is used.
852
+ memory : int, default 4096
853
+ Memory size (in MB) required for this step. If
854
+ `@resources` is also present, the maximum value from all decorators is
855
+ used.
856
+ disk : int, default 10240
857
+ Disk size (in MB) required for this step. If
858
+ `@resources` is also present, the maximum value from all decorators is
859
+ used.
860
+ image : str, optional, default None
861
+ Docker image to use when launching on Kubernetes. If not specified, and
862
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
648
863
  not, a default Docker image mapping to the current version of Python is used.
649
864
  image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
650
865
  If given, the imagePullPolicy to be applied to the Docker image of the step.
@@ -692,116 +907,150 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
692
907
  ...
693
908
 
694
909
  @typing.overload
695
- def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: 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]]]:
910
+ 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]]]:
696
911
  """
697
- Enables loading / saving of models within a step.
912
+ Specifies the PyPI packages for the step.
698
913
 
914
+ Information in this decorator will augment any
915
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
916
+ you can use `@pypi_base` to set packages required by all
917
+ steps and use `@pypi` to specify step-specific overrides.
699
918
 
700
919
  Parameters
701
920
  ----------
702
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
703
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
704
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
705
- - `current.checkpoint`
706
- - `current.model`
707
- - `current.huggingface_hub`
708
-
709
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
710
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
711
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
712
-
713
- temp_dir_root : str, default: None
714
- The root directory under which `current.model.loaded` will store loaded models
715
-
716
-
717
-
921
+ packages : Dict[str, str], default: {}
922
+ Packages to use for this step. The key is the name of the package
923
+ and the value is the version to use.
924
+ python : str, optional, default: None
925
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
926
+ that the version used will correspond to the version of the Python interpreter used to start the run.
718
927
  """
719
928
  ...
720
929
 
721
930
  @typing.overload
722
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
931
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
723
932
  ...
724
933
 
725
934
  @typing.overload
726
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
935
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
727
936
  ...
728
937
 
729
- def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
938
+ 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):
730
939
  """
731
- Enables loading / saving of models within a step.
940
+ Specifies the PyPI packages for the step.
732
941
 
942
+ Information in this decorator will augment any
943
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
944
+ you can use `@pypi_base` to set packages required by all
945
+ steps and use `@pypi` to specify step-specific overrides.
733
946
 
734
947
  Parameters
735
948
  ----------
736
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
737
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
738
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
739
- - `current.checkpoint`
740
- - `current.model`
741
- - `current.huggingface_hub`
742
-
743
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
744
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
745
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
746
-
747
- temp_dir_root : str, default: None
748
- The root directory under which `current.model.loaded` will store loaded models
749
-
949
+ packages : Dict[str, str], default: {}
950
+ Packages to use for this step. The key is the name of the package
951
+ and the value is the version to use.
952
+ python : str, optional, default: None
953
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
954
+ that the version used will correspond to the version of the Python interpreter used to start the run.
955
+ """
956
+ ...
957
+
958
+ @typing.overload
959
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
960
+ """
961
+ Internal decorator to support Fast bakery
962
+ """
963
+ ...
964
+
965
+ @typing.overload
966
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
967
+ ...
968
+
969
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
970
+ """
971
+ Internal decorator to support Fast bakery
972
+ """
973
+ ...
974
+
975
+ @typing.overload
976
+ def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
977
+ """
978
+ Specifies that the step will success under all circumstances.
750
979
 
980
+ The decorator will create an optional artifact, specified by `var`, which
981
+ contains the exception raised. You can use it to detect the presence
982
+ of errors, indicating that all happy-path artifacts produced by the step
983
+ are missing.
751
984
 
985
+ Parameters
986
+ ----------
987
+ var : str, optional, default None
988
+ Name of the artifact in which to store the caught exception.
989
+ If not specified, the exception is not stored.
990
+ print_exception : bool, default True
991
+ Determines whether or not the exception is printed to
992
+ stdout when caught.
752
993
  """
753
994
  ...
754
995
 
755
996
  @typing.overload
756
- 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]]]:
997
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
998
+ ...
999
+
1000
+ @typing.overload
1001
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1002
+ ...
1003
+
1004
+ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
757
1005
  """
758
- Specifies the number of times the task corresponding
759
- to a step needs to be retried.
1006
+ Specifies that the step will success under all circumstances.
760
1007
 
761
- This decorator is useful for handling transient errors, such as networking issues.
762
- If your task contains operations that can't be retried safely, e.g. database updates,
763
- it is advisable to annotate it with `@retry(times=0)`.
1008
+ The decorator will create an optional artifact, specified by `var`, which
1009
+ contains the exception raised. You can use it to detect the presence
1010
+ of errors, indicating that all happy-path artifacts produced by the step
1011
+ are missing.
764
1012
 
765
- This can be used in conjunction with the `@catch` decorator. The `@catch`
766
- decorator will execute a no-op task after all retries have been exhausted,
767
- ensuring that the flow execution can continue.
1013
+ Parameters
1014
+ ----------
1015
+ var : str, optional, default None
1016
+ Name of the artifact in which to store the caught exception.
1017
+ If not specified, the exception is not stored.
1018
+ print_exception : bool, default True
1019
+ Determines whether or not the exception is printed to
1020
+ stdout when caught.
1021
+ """
1022
+ ...
1023
+
1024
+ @typing.overload
1025
+ 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]]]:
1026
+ """
1027
+ Specifies secrets to be retrieved and injected as environment variables prior to
1028
+ the execution of a step.
768
1029
 
769
1030
  Parameters
770
1031
  ----------
771
- times : int, default 3
772
- Number of times to retry this task.
773
- minutes_between_retries : int, default 2
774
- Number of minutes between retries.
1032
+ sources : List[Union[str, Dict[str, Any]]], default: []
1033
+ List of secret specs, defining how the secrets are to be retrieved
775
1034
  """
776
1035
  ...
777
1036
 
778
1037
  @typing.overload
779
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1038
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
780
1039
  ...
781
1040
 
782
1041
  @typing.overload
783
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1042
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
784
1043
  ...
785
1044
 
786
- 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):
1045
+ 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]]] = []):
787
1046
  """
788
- Specifies the number of times the task corresponding
789
- to a step needs to be retried.
790
-
791
- This decorator is useful for handling transient errors, such as networking issues.
792
- If your task contains operations that can't be retried safely, e.g. database updates,
793
- it is advisable to annotate it with `@retry(times=0)`.
794
-
795
- This can be used in conjunction with the `@catch` decorator. The `@catch`
796
- decorator will execute a no-op task after all retries have been exhausted,
797
- ensuring that the flow execution can continue.
1047
+ Specifies secrets to be retrieved and injected as environment variables prior to
1048
+ the execution of a step.
798
1049
 
799
1050
  Parameters
800
1051
  ----------
801
- times : int, default 3
802
- Number of times to retry this task.
803
- minutes_between_retries : int, default 2
804
- Number of minutes between retries.
1052
+ sources : List[Union[str, Dict[str, Any]]], default: []
1053
+ List of secret specs, defining how the secrets are to be retrieved
805
1054
  """
806
1055
  ...
807
1056
 
@@ -866,301 +1115,87 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
866
1115
  """
867
1116
  ...
868
1117
 
869
- @typing.overload
870
- 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]]]:
1118
+ 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]]:
871
1119
  """
872
- Specifies the Conda environment for the step.
873
-
874
- Information in this decorator will augment any
875
- attributes set in the `@conda_base` flow-level decorator. Hence,
876
- you can use `@conda_base` to set packages required by all
877
- steps and use `@conda` to specify step-specific overrides.
1120
+ 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)
1121
+ before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1122
+ and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1123
+ added as a flow decorators. Adding more than one decorator will ensure that `start` step
1124
+ starts only after all sensors finish.
878
1125
 
879
1126
  Parameters
880
1127
  ----------
881
- packages : Dict[str, str], default {}
882
- Packages to use for this step. The key is the name of the package
883
- and the value is the version to use.
884
- libraries : Dict[str, str], default {}
885
- Supported for backward compatibility. When used with packages, packages will take precedence.
886
- python : str, optional, default None
887
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
888
- that the version used will correspond to the version of the Python interpreter used to start the run.
889
- disabled : bool, default False
890
- If set to True, disables @conda.
891
- """
892
- ...
893
-
894
- @typing.overload
895
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
896
- ...
897
-
898
- @typing.overload
899
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
900
- ...
901
-
902
- 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):
903
- """
904
- Specifies the Conda environment for the step.
905
-
906
- Information in this decorator will augment any
907
- attributes set in the `@conda_base` flow-level decorator. Hence,
908
- you can use `@conda_base` to set packages required by all
909
- steps and use `@conda` to specify step-specific overrides.
910
-
911
- Parameters
912
- ----------
913
- packages : Dict[str, str], default {}
914
- Packages to use for this step. The key is the name of the package
915
- and the value is the version to use.
916
- libraries : Dict[str, str], default {}
917
- Supported for backward compatibility. When used with packages, packages will take precedence.
918
- python : str, optional, default None
919
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
920
- that the version used will correspond to the version of the Python interpreter used to start the run.
921
- disabled : bool, default False
922
- If set to True, disables @conda.
923
- """
924
- ...
925
-
926
- @typing.overload
927
- 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]]]:
928
- """
929
- Specifies the PyPI packages for the step.
930
-
931
- Information in this decorator will augment any
932
- attributes set in the `@pyi_base` flow-level decorator. Hence,
933
- you can use `@pypi_base` to set packages required by all
934
- steps and use `@pypi` to specify step-specific overrides.
935
-
936
- Parameters
937
- ----------
938
- packages : Dict[str, str], default: {}
939
- Packages to use for this step. The key is the name of the package
940
- and the value is the version to use.
941
- python : str, optional, default: None
942
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
943
- that the version used will correspond to the version of the Python interpreter used to start the run.
944
- """
945
- ...
946
-
947
- @typing.overload
948
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
949
- ...
950
-
951
- @typing.overload
952
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
953
- ...
954
-
955
- 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):
956
- """
957
- Specifies the PyPI packages for the step.
958
-
959
- Information in this decorator will augment any
960
- attributes set in the `@pyi_base` flow-level decorator. Hence,
961
- you can use `@pypi_base` to set packages required by all
962
- steps and use `@pypi` to specify step-specific overrides.
963
-
964
- Parameters
965
- ----------
966
- packages : Dict[str, str], default: {}
967
- Packages to use for this step. The key is the name of the package
968
- and the value is the version to use.
969
- python : str, optional, default: None
970
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
971
- that the version used will correspond to the version of the Python interpreter used to start the run.
972
- """
973
- ...
974
-
975
- @typing.overload
976
- def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
977
- """
978
- Specifies that the step will success under all circumstances.
979
-
980
- The decorator will create an optional artifact, specified by `var`, which
981
- contains the exception raised. You can use it to detect the presence
982
- of errors, indicating that all happy-path artifacts produced by the step
983
- are missing.
984
-
985
- Parameters
986
- ----------
987
- var : str, optional, default None
988
- Name of the artifact in which to store the caught exception.
989
- If not specified, the exception is not stored.
990
- print_exception : bool, default True
991
- Determines whether or not the exception is printed to
992
- stdout when caught.
993
- """
994
- ...
995
-
996
- @typing.overload
997
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
998
- ...
999
-
1000
- @typing.overload
1001
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1002
- ...
1003
-
1004
- def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
1005
- """
1006
- Specifies that the step will success under all circumstances.
1007
-
1008
- The decorator will create an optional artifact, specified by `var`, which
1009
- contains the exception raised. You can use it to detect the presence
1010
- of errors, indicating that all happy-path artifacts produced by the step
1011
- are missing.
1012
-
1013
- Parameters
1014
- ----------
1015
- var : str, optional, default None
1016
- Name of the artifact in which to store the caught exception.
1017
- If not specified, the exception is not stored.
1018
- print_exception : bool, default True
1019
- Determines whether or not the exception is printed to
1020
- stdout when caught.
1021
- """
1022
- ...
1023
-
1024
- @typing.overload
1025
- 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]]]:
1026
- """
1027
- Specifies the resources needed when executing this step.
1028
-
1029
- Use `@resources` to specify the resource requirements
1030
- independently of the specific compute layer (`@batch`, `@kubernetes`).
1031
-
1032
- You can choose the compute layer on the command line by executing e.g.
1033
- ```
1034
- python myflow.py run --with batch
1035
- ```
1036
- or
1037
- ```
1038
- python myflow.py run --with kubernetes
1039
- ```
1040
- which executes the flow on the desired system using the
1041
- requirements specified in `@resources`.
1042
-
1043
- Parameters
1044
- ----------
1045
- cpu : int, default 1
1046
- Number of CPUs required for this step.
1047
- gpu : int, default 0
1048
- Number of GPUs required for this step.
1049
- disk : int, optional, default None
1050
- Disk size (in MB) required for this step. Only applies on Kubernetes.
1051
- memory : int, default 4096
1052
- Memory size (in MB) required for this step.
1053
- shared_memory : int, optional, default None
1054
- The value for the size (in MiB) of the /dev/shm volume for this step.
1055
- This parameter maps to the `--shm-size` option in Docker.
1056
- """
1057
- ...
1058
-
1059
- @typing.overload
1060
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1061
- ...
1062
-
1063
- @typing.overload
1064
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1065
- ...
1066
-
1067
- 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):
1068
- """
1069
- Specifies the resources needed when executing this step.
1070
-
1071
- Use `@resources` to specify the resource requirements
1072
- independently of the specific compute layer (`@batch`, `@kubernetes`).
1073
-
1074
- You can choose the compute layer on the command line by executing e.g.
1075
- ```
1076
- python myflow.py run --with batch
1077
- ```
1078
- or
1079
- ```
1080
- python myflow.py run --with kubernetes
1081
- ```
1082
- which executes the flow on the desired system using the
1083
- requirements specified in `@resources`.
1084
-
1085
- Parameters
1086
- ----------
1087
- cpu : int, default 1
1088
- Number of CPUs required for this step.
1089
- gpu : int, default 0
1090
- Number of GPUs required for this step.
1091
- disk : int, optional, default None
1092
- Disk size (in MB) required for this step. Only applies on Kubernetes.
1093
- memory : int, default 4096
1094
- Memory size (in MB) required for this step.
1095
- shared_memory : int, optional, default None
1096
- The value for the size (in MiB) of the /dev/shm volume for this step.
1097
- This parameter maps to the `--shm-size` option in Docker.
1098
- """
1099
- ...
1100
-
1101
- @typing.overload
1102
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1103
- """
1104
- Internal decorator to support Fast bakery
1105
- """
1106
- ...
1107
-
1108
- @typing.overload
1109
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1110
- ...
1111
-
1112
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1113
- """
1114
- Internal decorator to support Fast bakery
1115
- """
1116
- ...
1117
-
1118
- @typing.overload
1119
- def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1120
- """
1121
- Specifies the times when the flow should be run when running on a
1122
- production scheduler.
1123
-
1124
- Parameters
1125
- ----------
1126
- hourly : bool, default False
1127
- Run the workflow hourly.
1128
- daily : bool, default True
1129
- Run the workflow daily.
1130
- weekly : bool, default False
1131
- Run the workflow weekly.
1132
- cron : str, optional, default None
1133
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1134
- specified by this expression.
1135
- timezone : str, optional, default None
1136
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1137
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1128
+ timeout : int
1129
+ Time, in seconds before the task times out and fails. (Default: 3600)
1130
+ poke_interval : int
1131
+ Time in seconds that the job should wait in between each try. (Default: 60)
1132
+ mode : str
1133
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1134
+ exponential_backoff : bool
1135
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1136
+ pool : str
1137
+ the slot pool this task should run in,
1138
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1139
+ soft_fail : bool
1140
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1141
+ name : str
1142
+ Name of the sensor on Airflow
1143
+ description : str
1144
+ Description of sensor in the Airflow UI
1145
+ bucket_key : Union[str, List[str]]
1146
+ The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1147
+ When it's specified as a full s3:// url, please leave `bucket_name` as None
1148
+ bucket_name : str
1149
+ Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1150
+ When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1151
+ wildcard_match : bool
1152
+ whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1153
+ aws_conn_id : str
1154
+ a reference to the s3 connection on Airflow. (Default: None)
1155
+ verify : bool
1156
+ Whether or not to verify SSL certificates for S3 connection. (Default: None)
1138
1157
  """
1139
1158
  ...
1140
1159
 
1141
- @typing.overload
1142
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1143
- ...
1144
-
1145
- def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1160
+ 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]]:
1146
1161
  """
1147
- Specifies the times when the flow should be run when running on a
1148
- production scheduler.
1162
+ 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.
1163
+ This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1149
1164
 
1150
1165
  Parameters
1151
1166
  ----------
1152
- hourly : bool, default False
1153
- Run the workflow hourly.
1154
- daily : bool, default True
1155
- Run the workflow daily.
1156
- weekly : bool, default False
1157
- Run the workflow weekly.
1158
- cron : str, optional, default None
1159
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1160
- specified by this expression.
1161
- timezone : str, optional, default None
1162
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1163
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1167
+ timeout : int
1168
+ Time, in seconds before the task times out and fails. (Default: 3600)
1169
+ poke_interval : int
1170
+ Time in seconds that the job should wait in between each try. (Default: 60)
1171
+ mode : str
1172
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1173
+ exponential_backoff : bool
1174
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1175
+ pool : str
1176
+ the slot pool this task should run in,
1177
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1178
+ soft_fail : bool
1179
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1180
+ name : str
1181
+ Name of the sensor on Airflow
1182
+ description : str
1183
+ Description of sensor in the Airflow UI
1184
+ external_dag_id : str
1185
+ The dag_id that contains the task you want to wait for.
1186
+ external_task_ids : List[str]
1187
+ The list of task_ids that you want to wait for.
1188
+ If None (default value) the sensor waits for the DAG. (Default: None)
1189
+ allowed_states : List[str]
1190
+ Iterable of allowed states, (Default: ['success'])
1191
+ failed_states : List[str]
1192
+ Iterable of failed or dis-allowed states. (Default: None)
1193
+ execution_delta : datetime.timedelta
1194
+ time difference with the previous execution to look at,
1195
+ the default is the same logical date as the current task or DAG. (Default: None)
1196
+ check_existence: bool
1197
+ Set to True to check if the external task exists or check if
1198
+ the DAG to wait for exists. (Default: True)
1164
1199
  """
1165
1200
  ...
1166
1201
 
@@ -1252,6 +1287,104 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
1252
1287
  """
1253
1288
  ...
1254
1289
 
1290
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1291
+ """
1292
+ Specifies what flows belong to the same project.
1293
+
1294
+ A project-specific namespace is created for all flows that
1295
+ use the same `@project(name)`.
1296
+
1297
+ Parameters
1298
+ ----------
1299
+ name : str
1300
+ Project name. Make sure that the name is unique amongst all
1301
+ projects that use the same production scheduler. The name may
1302
+ contain only lowercase alphanumeric characters and underscores.
1303
+
1304
+
1305
+ """
1306
+ ...
1307
+
1308
+ @typing.overload
1309
+ def schedule(*, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1310
+ """
1311
+ Specifies the times when the flow should be run when running on a
1312
+ production scheduler.
1313
+
1314
+ Parameters
1315
+ ----------
1316
+ hourly : bool, default False
1317
+ Run the workflow hourly.
1318
+ daily : bool, default True
1319
+ Run the workflow daily.
1320
+ weekly : bool, default False
1321
+ Run the workflow weekly.
1322
+ cron : str, optional, default None
1323
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1324
+ specified by this expression.
1325
+ timezone : str, optional, default None
1326
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1327
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1328
+ """
1329
+ ...
1330
+
1331
+ @typing.overload
1332
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1333
+ ...
1334
+
1335
+ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
1336
+ """
1337
+ Specifies the times when the flow should be run when running on a
1338
+ production scheduler.
1339
+
1340
+ Parameters
1341
+ ----------
1342
+ hourly : bool, default False
1343
+ Run the workflow hourly.
1344
+ daily : bool, default True
1345
+ Run the workflow daily.
1346
+ weekly : bool, default False
1347
+ Run the workflow weekly.
1348
+ cron : str, optional, default None
1349
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1350
+ specified by this expression.
1351
+ timezone : str, optional, default None
1352
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1353
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1354
+ """
1355
+ ...
1356
+
1357
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1358
+ """
1359
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1360
+
1361
+ User code call
1362
+ -----------
1363
+ @nim(
1364
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1365
+ backend='managed'
1366
+ )
1367
+
1368
+ Valid backend options
1369
+ ---------------------
1370
+ - 'managed': Outerbounds selects a compute provider based on the model.
1371
+ - 🚧 'dataplane': Run in your account.
1372
+
1373
+ Valid model options
1374
+ ----------------
1375
+ - 'meta/llama3-8b-instruct': 8B parameter model
1376
+ - 'meta/llama3-70b-instruct': 70B parameter model
1377
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1378
+
1379
+ Parameters
1380
+ ----------
1381
+ models: list[NIM]
1382
+ List of NIM containers running models in sidecars.
1383
+ backend: str
1384
+ Compute provider to run the NIM container.
1385
+ """
1386
+ ...
1387
+
1255
1388
  @typing.overload
1256
1389
  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]]:
1257
1390
  """
@@ -1347,48 +1480,6 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1347
1480
  """
1348
1481
  ...
1349
1482
 
1350
- 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]]:
1351
- """
1352
- 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)
1353
- before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
1354
- and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
1355
- added as a flow decorators. Adding more than one decorator will ensure that `start` step
1356
- starts only after all sensors finish.
1357
-
1358
- Parameters
1359
- ----------
1360
- timeout : int
1361
- Time, in seconds before the task times out and fails. (Default: 3600)
1362
- poke_interval : int
1363
- Time in seconds that the job should wait in between each try. (Default: 60)
1364
- mode : str
1365
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1366
- exponential_backoff : bool
1367
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1368
- pool : str
1369
- the slot pool this task should run in,
1370
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1371
- soft_fail : bool
1372
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1373
- name : str
1374
- Name of the sensor on Airflow
1375
- description : str
1376
- Description of sensor in the Airflow UI
1377
- bucket_key : Union[str, List[str]]
1378
- The key(s) being waited on. Supports full s3:// style url or relative path from root level.
1379
- When it's specified as a full s3:// url, please leave `bucket_name` as None
1380
- bucket_name : str
1381
- Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
1382
- When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
1383
- wildcard_match : bool
1384
- whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
1385
- aws_conn_id : str
1386
- a reference to the s3 connection on Airflow. (Default: None)
1387
- verify : bool
1388
- Whether or not to verify SSL certificates for S3 connection. (Default: None)
1389
- """
1390
- ...
1391
-
1392
1483
  @typing.overload
1393
1484
  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]]:
1394
1485
  """
@@ -1492,97 +1583,6 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1492
1583
  """
1493
1584
  ...
1494
1585
 
1495
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1496
- """
1497
- Specifies what flows belong to the same project.
1498
-
1499
- A project-specific namespace is created for all flows that
1500
- use the same `@project(name)`.
1501
-
1502
- Parameters
1503
- ----------
1504
- name : str
1505
- Project name. Make sure that the name is unique amongst all
1506
- projects that use the same production scheduler. The name may
1507
- contain only lowercase alphanumeric characters and underscores.
1508
-
1509
-
1510
- """
1511
- ...
1512
-
1513
- 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]]:
1514
- """
1515
- 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.
1516
- This decorator only works when a flow is scheduled on Airflow and is compiled using `airflow create`. More than one `@airflow_external_task_sensor` can be added as a flow decorators. Adding more than one decorator will ensure that `start` step starts only after all sensors finish.
1517
-
1518
- Parameters
1519
- ----------
1520
- timeout : int
1521
- Time, in seconds before the task times out and fails. (Default: 3600)
1522
- poke_interval : int
1523
- Time in seconds that the job should wait in between each try. (Default: 60)
1524
- mode : str
1525
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1526
- exponential_backoff : bool
1527
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1528
- pool : str
1529
- the slot pool this task should run in,
1530
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1531
- soft_fail : bool
1532
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1533
- name : str
1534
- Name of the sensor on Airflow
1535
- description : str
1536
- Description of sensor in the Airflow UI
1537
- external_dag_id : str
1538
- The dag_id that contains the task you want to wait for.
1539
- external_task_ids : List[str]
1540
- The list of task_ids that you want to wait for.
1541
- If None (default value) the sensor waits for the DAG. (Default: None)
1542
- allowed_states : List[str]
1543
- Iterable of allowed states, (Default: ['success'])
1544
- failed_states : List[str]
1545
- Iterable of failed or dis-allowed states. (Default: None)
1546
- execution_delta : datetime.timedelta
1547
- time difference with the previous execution to look at,
1548
- the default is the same logical date as the current task or DAG. (Default: None)
1549
- check_existence: bool
1550
- Set to True to check if the external task exists or check if
1551
- the DAG to wait for exists. (Default: True)
1552
- """
1553
- ...
1554
-
1555
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1556
- """
1557
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1558
-
1559
- User code call
1560
- -----------
1561
- @nim(
1562
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1563
- backend='managed'
1564
- )
1565
-
1566
- Valid backend options
1567
- ---------------------
1568
- - 'managed': Outerbounds selects a compute provider based on the model.
1569
- - 🚧 'dataplane': Run in your account.
1570
-
1571
- Valid model options
1572
- ----------------
1573
- - 'meta/llama3-8b-instruct': 8B parameter model
1574
- - 'meta/llama3-70b-instruct': 70B parameter model
1575
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1576
-
1577
- Parameters
1578
- ----------
1579
- models: list[NIM]
1580
- List of NIM containers running models in sidecars.
1581
- backend: str
1582
- Compute provider to run the NIM container.
1583
- """
1584
- ...
1585
-
1586
1586
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1587
1587
  """
1588
1588
  Switch namespace to the one provided.