ob-metaflow-stubs 6.0.3.113__py2.py3-none-any.whl → 6.0.3.115__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 +602 -599
  2. metaflow-stubs/cards.pyi +5 -5
  3. metaflow-stubs/cli.pyi +3 -3
  4. metaflow-stubs/client/__init__.pyi +5 -5
  5. metaflow-stubs/client/core.pyi +11 -9
  6. metaflow-stubs/client/filecache.pyi +2 -2
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +2 -2
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +6 -6
  11. metaflow-stubs/generated_for.txt +1 -1
  12. metaflow-stubs/includefile.pyi +4 -4
  13. metaflow-stubs/info_file.pyi +2 -2
  14. metaflow-stubs/metadata/metadata.pyi +5 -2
  15. metaflow-stubs/metadata/util.pyi +2 -2
  16. metaflow-stubs/metaflow_config.pyi +2 -2
  17. metaflow-stubs/metaflow_current.pyi +91 -90
  18. metaflow-stubs/mflog/mflog.pyi +2 -2
  19. metaflow-stubs/multicore_utils.pyi +2 -2
  20. metaflow-stubs/parameters.pyi +3 -3
  21. metaflow-stubs/plugins/__init__.pyi +2 -2
  22. metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
  23. metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
  24. metaflow-stubs/plugins/airflow/exception.pyi +2 -2
  25. metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
  26. metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +3 -3
  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 +2 -2
  30. metaflow-stubs/plugins/argo/argo_client.pyi +11 -2
  31. metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
  32. metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
  33. metaflow-stubs/plugins/argo/argo_workflows_cli.pyi +7 -4
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +6 -6
  35. metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +3 -3
  36. metaflow-stubs/plugins/aws/__init__.pyi +2 -2
  37. metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
  38. metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
  39. metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
  40. metaflow-stubs/plugins/aws/batch/batch.pyi +2 -2
  41. metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
  42. metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +4 -4
  43. metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
  44. metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
  45. metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
  46. metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
  47. metaflow-stubs/plugins/aws/step_functions/production_token.pyi +2 -2
  48. metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
  49. metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +2 -2
  50. metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
  51. metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +2 -2
  52. metaflow-stubs/plugins/azure/__init__.pyi +2 -2
  53. metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
  54. metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
  55. metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
  56. metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
  57. metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
  58. metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
  59. metaflow-stubs/plugins/cards/__init__.pyi +2 -2
  60. metaflow-stubs/plugins/cards/card_cli.pyi +3 -3
  61. metaflow-stubs/plugins/cards/card_client.pyi +3 -3
  62. metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
  63. metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
  64. metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
  65. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_modules/basic.pyi +2 -2
  67. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_modules/components.pyi +3 -3
  69. metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
  70. metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
  71. metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
  72. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  73. metaflow-stubs/plugins/cards/component_serializer.pyi +3 -3
  74. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  75. metaflow-stubs/plugins/catch_decorator.pyi +3 -3
  76. metaflow-stubs/plugins/datatools/__init__.pyi +3 -3
  77. metaflow-stubs/plugins/datatools/local.pyi +2 -2
  78. metaflow-stubs/plugins/datatools/s3/__init__.pyi +3 -3
  79. metaflow-stubs/plugins/datatools/s3/s3.pyi +6 -6
  80. metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
  81. metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
  82. metaflow-stubs/plugins/debug_logger.pyi +2 -2
  83. metaflow-stubs/plugins/debug_monitor.pyi +2 -2
  84. metaflow-stubs/plugins/environment_decorator.pyi +2 -2
  85. metaflow-stubs/plugins/events_decorator.pyi +2 -2
  86. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  87. metaflow-stubs/plugins/frameworks/pytorch.pyi +7 -6
  88. metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
  89. metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
  90. metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
  91. metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
  92. metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
  93. metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
  94. metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
  95. metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
  96. metaflow-stubs/plugins/kubernetes/kubernetes.pyi +3 -3
  97. metaflow-stubs/plugins/kubernetes/kubernetes_cli.pyi +6 -3
  98. metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
  99. metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +7 -4
  100. metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
  101. metaflow-stubs/plugins/logs_cli.pyi +3 -3
  102. metaflow-stubs/plugins/package_cli.pyi +2 -2
  103. metaflow-stubs/plugins/parallel_decorator.pyi +7 -6
  104. metaflow-stubs/plugins/perimeters.pyi +2 -2
  105. metaflow-stubs/plugins/project_decorator.pyi +2 -2
  106. metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
  107. metaflow-stubs/plugins/pypi/conda_decorator.pyi +2 -2
  108. metaflow-stubs/plugins/pypi/conda_environment.pyi +4 -4
  109. metaflow-stubs/plugins/pypi/pypi_decorator.pyi +2 -2
  110. metaflow-stubs/plugins/pypi/pypi_environment.pyi +3 -3
  111. metaflow-stubs/plugins/pypi/utils.pyi +2 -2
  112. metaflow-stubs/plugins/resources_decorator.pyi +3 -3
  113. metaflow-stubs/plugins/retry_decorator.pyi +2 -2
  114. metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
  115. metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
  116. metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
  117. metaflow-stubs/plugins/storage_executor.pyi +2 -2
  118. metaflow-stubs/plugins/tag_cli.pyi +4 -4
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +2 -2
  120. metaflow-stubs/plugins/timeout_decorator.pyi +3 -3
  121. metaflow-stubs/procpoll.pyi +2 -2
  122. metaflow-stubs/profilers/__init__.pyi +2 -2
  123. metaflow-stubs/pylint_wrapper.pyi +2 -2
  124. metaflow-stubs/runner/__init__.pyi +2 -2
  125. metaflow-stubs/runner/deployer.pyi +3 -3
  126. metaflow-stubs/runner/metaflow_runner.pyi +4 -35
  127. metaflow-stubs/runner/nbdeploy.pyi +5 -7
  128. metaflow-stubs/runner/nbrun.pyi +5 -7
  129. metaflow-stubs/runner/subprocess_manager.pyi +2 -2
  130. metaflow-stubs/runner/utils.pyi +2 -6
  131. metaflow-stubs/system/__init__.pyi +3 -3
  132. metaflow-stubs/system/system_logger.pyi +3 -3
  133. metaflow-stubs/system/system_monitor.pyi +3 -3
  134. metaflow-stubs/tagging_util.pyi +2 -2
  135. metaflow-stubs/tuple_util.pyi +2 -2
  136. {ob_metaflow_stubs-6.0.3.113.dist-info → ob_metaflow_stubs-6.0.3.115.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-6.0.3.115.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-6.0.3.113.dist-info/RECORD +0 -140
  139. {ob_metaflow_stubs-6.0.3.113.dist-info → ob_metaflow_stubs-6.0.3.115.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-6.0.3.113.dist-info → ob_metaflow_stubs-6.0.3.115.dist-info}/top_level.txt +0 -0
@@ -1,24 +1,24 @@
1
1
  ##################################################################################
2
2
  # Auto-generated Metaflow stub file #
3
- # MF version: 2.12.25.2+obcheckpoint(0.1.1);ob(v1) #
4
- # Generated on 2024-10-22T22:37:22.374436 #
3
+ # MF version: 2.12.27.1+obcheckpoint(0.1.1);ob(v1) #
4
+ # Generated on 2024-10-25T21:39:54.730102 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import datetime
12
- import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
13
- import metaflow.datastore.inputs
14
- import metaflow.parameters
15
- import metaflow.flowspec
16
11
  import typing
17
- import metaflow._vendor.click.types
18
- import metaflow.client.core
19
12
  import metaflow.metaflow_current
13
+ import datetime
14
+ import metaflow._vendor.click.types
20
15
  import metaflow.runner.metaflow_runner
16
+ import metaflow.parameters
21
17
  import metaflow.events
18
+ import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
19
+ import metaflow.client.core
20
+ import metaflow.datastore.inputs
21
+ import metaflow.flowspec
22
22
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
23
23
  StepFlag = typing.NewType("StepFlag", bool)
24
24
 
@@ -513,174 +513,113 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
513
513
  ...
514
514
 
515
515
  @typing.overload
516
- 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]]]:
516
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
517
517
  """
518
- Specifies that the step will success under all circumstances.
519
-
520
- The decorator will create an optional artifact, specified by `var`, which
521
- contains the exception raised. You can use it to detect the presence
522
- of errors, indicating that all happy-path artifacts produced by the step
523
- are missing.
524
-
525
- Parameters
526
- ----------
527
- var : str, optional, default None
528
- Name of the artifact in which to store the caught exception.
529
- If not specified, the exception is not stored.
530
- print_exception : bool, default True
531
- Determines whether or not the exception is printed to
532
- stdout when caught.
518
+ Internal decorator to support Fast bakery
533
519
  """
534
520
  ...
535
521
 
536
522
  @typing.overload
537
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
538
- ...
539
-
540
- @typing.overload
541
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
523
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
542
524
  ...
543
525
 
544
- 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):
526
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
545
527
  """
546
- Specifies that the step will success under all circumstances.
547
-
548
- The decorator will create an optional artifact, specified by `var`, which
549
- contains the exception raised. You can use it to detect the presence
550
- of errors, indicating that all happy-path artifacts produced by the step
551
- are missing.
552
-
553
- Parameters
554
- ----------
555
- var : str, optional, default None
556
- Name of the artifact in which to store the caught exception.
557
- If not specified, the exception is not stored.
558
- print_exception : bool, default True
559
- Determines whether or not the exception is printed to
560
- stdout when caught.
528
+ Internal decorator to support Fast bakery
561
529
  """
562
530
  ...
563
531
 
564
532
  @typing.overload
565
- def card(*, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
533
+ 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]]]:
566
534
  """
567
- Creates a human-readable report, a Metaflow Card, after this step completes.
568
-
569
- Note that you may add multiple `@card` decorators in a step with different parameters.
535
+ Specifies secrets to be retrieved and injected as environment variables prior to
536
+ the execution of a step.
570
537
 
571
538
  Parameters
572
539
  ----------
573
- type : str, default 'default'
574
- Card type.
575
- id : str, optional, default None
576
- If multiple cards are present, use this id to identify this card.
577
- options : Dict[str, Any], default {}
578
- Options passed to the card. The contents depend on the card type.
579
- timeout : int, default 45
580
- Interrupt reporting if it takes more than this many seconds.
581
-
582
-
540
+ sources : List[Union[str, Dict[str, Any]]], default: []
541
+ List of secret specs, defining how the secrets are to be retrieved
583
542
  """
584
543
  ...
585
544
 
586
545
  @typing.overload
587
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
546
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
588
547
  ...
589
548
 
590
549
  @typing.overload
591
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
550
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
592
551
  ...
593
552
 
594
- def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
553
+ 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]]] = []):
595
554
  """
596
- Creates a human-readable report, a Metaflow Card, after this step completes.
597
-
598
- Note that you may add multiple `@card` decorators in a step with different parameters.
555
+ Specifies secrets to be retrieved and injected as environment variables prior to
556
+ the execution of a step.
599
557
 
600
558
  Parameters
601
559
  ----------
602
- type : str, default 'default'
603
- Card type.
604
- id : str, optional, default None
605
- If multiple cards are present, use this id to identify this card.
606
- options : Dict[str, Any], default {}
607
- Options passed to the card. The contents depend on the card type.
608
- timeout : int, default 45
609
- Interrupt reporting if it takes more than this many seconds.
610
-
611
-
560
+ sources : List[Union[str, Dict[str, Any]]], default: []
561
+ List of secret specs, defining how the secrets are to be retrieved
612
562
  """
613
563
  ...
614
564
 
615
565
  @typing.overload
616
- 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]]]:
566
+ def checkpoint(*, load_policy: str = "fresh", 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]]]:
617
567
  """
618
- Specifies the number of times the task corresponding
619
- to a step needs to be retried.
620
-
621
- This decorator is useful for handling transient errors, such as networking issues.
622
- If your task contains operations that can't be retried safely, e.g. database updates,
623
- it is advisable to annotate it with `@retry(times=0)`.
568
+ Enables checkpointing for a step.
624
569
 
625
- This can be used in conjunction with the `@catch` decorator. The `@catch`
626
- decorator will execute a no-op task after all retries have been exhausted,
627
- ensuring that the flow execution can continue.
628
570
 
629
571
  Parameters
630
572
  ----------
631
- times : int, default 3
632
- Number of times to retry this task.
633
- minutes_between_retries : int, default 2
634
- Number of minutes between retries.
573
+ load_policy : str, default: "fresh"
574
+ The policy for loading the checkpoint. The following policies are supported:
575
+ - "eager": Loads the the latest available checkpoint within the namespace.
576
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
577
+ will be loaded at the start of the task.
578
+ - "none": Do not load any checkpoint
579
+ - "fresh": Loads the lastest checkpoint created within the running Task.
580
+ This mode helps loading checkpoints across various retry attempts of the same task.
581
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
582
+ created within the task will be loaded when the task is retries execution on failure.
583
+
584
+ temp_dir_root : str, default: None
585
+ The root directory under which `current.checkpoint.directory` will be created.
586
+
587
+
588
+
635
589
  """
636
590
  ...
637
591
 
638
592
  @typing.overload
639
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
593
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
640
594
  ...
641
595
 
642
596
  @typing.overload
643
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
597
+ def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
644
598
  ...
645
599
 
646
- 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):
600
+ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = "fresh", temp_dir_root: str = None):
647
601
  """
648
- Specifies the number of times the task corresponding
649
- to a step needs to be retried.
650
-
651
- This decorator is useful for handling transient errors, such as networking issues.
652
- If your task contains operations that can't be retried safely, e.g. database updates,
653
- it is advisable to annotate it with `@retry(times=0)`.
602
+ Enables checkpointing for a step.
654
603
 
655
- This can be used in conjunction with the `@catch` decorator. The `@catch`
656
- decorator will execute a no-op task after all retries have been exhausted,
657
- ensuring that the flow execution can continue.
658
604
 
659
605
  Parameters
660
606
  ----------
661
- times : int, default 3
662
- Number of times to retry this task.
663
- minutes_between_retries : int, default 2
664
- Number of minutes between retries.
665
- """
666
- ...
667
-
668
- @typing.overload
669
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
670
- """
671
- Decorator prototype for all step decorators. This function gets specialized
672
- and imported for all decorators types by _import_plugin_decorators().
673
- """
674
- ...
675
-
676
- @typing.overload
677
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
678
- ...
679
-
680
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
681
- """
682
- Decorator prototype for all step decorators. This function gets specialized
683
- and imported for all decorators types by _import_plugin_decorators().
607
+ load_policy : str, default: "fresh"
608
+ The policy for loading the checkpoint. The following policies are supported:
609
+ - "eager": Loads the the latest available checkpoint within the namespace.
610
+ With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
611
+ will be loaded at the start of the task.
612
+ - "none": Do not load any checkpoint
613
+ - "fresh": Loads the lastest checkpoint created within the running Task.
614
+ This mode helps loading checkpoints across various retry attempts of the same task.
615
+ With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
616
+ created within the task will be loaded when the task is retries execution on failure.
617
+
618
+ temp_dir_root : str, default: None
619
+ The root directory under which `current.checkpoint.directory` will be created.
620
+
621
+
622
+
684
623
  """
685
624
  ...
686
625
 
@@ -746,207 +685,187 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
746
685
  ...
747
686
 
748
687
  @typing.overload
749
- 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]]]:
688
+ def card(*, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
750
689
  """
751
- Specifies the PyPI packages for the step.
690
+ Creates a human-readable report, a Metaflow Card, after this step completes.
752
691
 
753
- Information in this decorator will augment any
754
- attributes set in the `@pyi_base` flow-level decorator. Hence,
755
- you can use `@pypi_base` to set packages required by all
756
- steps and use `@pypi` to specify step-specific overrides.
692
+ Note that you may add multiple `@card` decorators in a step with different parameters.
757
693
 
758
694
  Parameters
759
695
  ----------
760
- packages : Dict[str, str], default: {}
761
- Packages to use for this step. The key is the name of the package
762
- and the value is the version to use.
763
- python : str, optional, default: None
764
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
765
- that the version used will correspond to the version of the Python interpreter used to start the run.
696
+ type : str, default 'default'
697
+ Card type.
698
+ id : str, optional, default None
699
+ If multiple cards are present, use this id to identify this card.
700
+ options : Dict[str, Any], default {}
701
+ Options passed to the card. The contents depend on the card type.
702
+ timeout : int, default 45
703
+ Interrupt reporting if it takes more than this many seconds.
704
+
705
+
766
706
  """
767
707
  ...
768
708
 
769
709
  @typing.overload
770
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
710
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
771
711
  ...
772
712
 
773
713
  @typing.overload
774
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
714
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
775
715
  ...
776
716
 
777
- 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):
717
+ def card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, type: str = "default", id: typing.Optional[str] = None, options: typing.Dict[str, typing.Any] = {}, timeout: int = 45):
778
718
  """
779
- Specifies the PyPI packages for the step.
719
+ Creates a human-readable report, a Metaflow Card, after this step completes.
780
720
 
781
- Information in this decorator will augment any
782
- attributes set in the `@pyi_base` flow-level decorator. Hence,
783
- you can use `@pypi_base` to set packages required by all
784
- steps and use `@pypi` to specify step-specific overrides.
721
+ Note that you may add multiple `@card` decorators in a step with different parameters.
785
722
 
786
723
  Parameters
787
724
  ----------
788
- packages : Dict[str, str], default: {}
789
- Packages to use for this step. The key is the name of the package
790
- and the value is the version to use.
791
- python : str, optional, default: None
792
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
793
- that the version used will correspond to the version of the Python interpreter used to start the run.
725
+ type : str, default 'default'
726
+ Card type.
727
+ id : str, optional, default None
728
+ If multiple cards are present, use this id to identify this card.
729
+ options : Dict[str, Any], default {}
730
+ Options passed to the card. The contents depend on the card type.
731
+ timeout : int, default 45
732
+ Interrupt reporting if it takes more than this many seconds.
733
+
734
+
794
735
  """
795
736
  ...
796
737
 
797
738
  @typing.overload
798
- 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]]]:
739
+ def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
799
740
  """
800
- Specifies secrets to be retrieved and injected as environment variables prior to
801
- the execution of a step.
741
+ Specifies the resources needed when executing this step.
802
742
 
803
- Parameters
804
- ----------
805
- sources : List[Union[str, Dict[str, Any]]], default: []
806
- List of secret specs, defining how the secrets are to be retrieved
807
- """
808
- ...
809
-
810
- @typing.overload
811
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
812
- ...
813
-
814
- @typing.overload
815
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
816
- ...
817
-
818
- 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]]] = []):
819
- """
820
- Specifies secrets to be retrieved and injected as environment variables prior to
821
- the execution of a step.
743
+ Use `@resources` to specify the resource requirements
744
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
745
+
746
+ You can choose the compute layer on the command line by executing e.g.
747
+ ```
748
+ python myflow.py run --with batch
749
+ ```
750
+ or
751
+ ```
752
+ python myflow.py run --with kubernetes
753
+ ```
754
+ which executes the flow on the desired system using the
755
+ requirements specified in `@resources`.
822
756
 
823
757
  Parameters
824
758
  ----------
825
- sources : List[Union[str, Dict[str, Any]]], default: []
826
- List of secret specs, defining how the secrets are to be retrieved
759
+ cpu : int, default 1
760
+ Number of CPUs required for this step.
761
+ gpu : int, optional, default None
762
+ Number of GPUs required for this step.
763
+ disk : int, optional, default None
764
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
765
+ memory : int, default 4096
766
+ Memory size (in MB) required for this step.
767
+ shared_memory : int, optional, default None
768
+ The value for the size (in MiB) of the /dev/shm volume for this step.
769
+ This parameter maps to the `--shm-size` option in Docker.
827
770
  """
828
771
  ...
829
772
 
830
773
  @typing.overload
831
- 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]]]:
774
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
775
+ ...
776
+
777
+ @typing.overload
778
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
779
+ ...
780
+
781
+ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
832
782
  """
833
- Specifies a timeout for your step.
834
-
835
- This decorator is useful if this step may hang indefinitely.
783
+ Specifies the resources needed when executing this step.
836
784
 
837
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
838
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
839
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
785
+ Use `@resources` to specify the resource requirements
786
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
840
787
 
841
- Note that all the values specified in parameters are added together so if you specify
842
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
788
+ You can choose the compute layer on the command line by executing e.g.
789
+ ```
790
+ python myflow.py run --with batch
791
+ ```
792
+ or
793
+ ```
794
+ python myflow.py run --with kubernetes
795
+ ```
796
+ which executes the flow on the desired system using the
797
+ requirements specified in `@resources`.
843
798
 
844
799
  Parameters
845
800
  ----------
846
- seconds : int, default 0
847
- Number of seconds to wait prior to timing out.
848
- minutes : int, default 0
849
- Number of minutes to wait prior to timing out.
850
- hours : int, default 0
851
- Number of hours to wait prior to timing out.
801
+ cpu : int, default 1
802
+ Number of CPUs required for this step.
803
+ gpu : int, optional, default None
804
+ Number of GPUs required for this step.
805
+ disk : int, optional, default None
806
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
807
+ memory : int, default 4096
808
+ Memory size (in MB) required for this step.
809
+ shared_memory : int, optional, default None
810
+ The value for the size (in MiB) of the /dev/shm volume for this step.
811
+ This parameter maps to the `--shm-size` option in Docker.
852
812
  """
853
813
  ...
854
814
 
855
815
  @typing.overload
856
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
857
- ...
858
-
859
- @typing.overload
860
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
861
- ...
862
-
863
- 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):
816
+ 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]]]:
864
817
  """
865
- Specifies a timeout for your step.
866
-
867
- This decorator is useful if this step may hang indefinitely.
868
-
869
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
870
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
871
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
818
+ Specifies the Conda environment for the step.
872
819
 
873
- Note that all the values specified in parameters are added together so if you specify
874
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
820
+ Information in this decorator will augment any
821
+ attributes set in the `@conda_base` flow-level decorator. Hence,
822
+ you can use `@conda_base` to set packages required by all
823
+ steps and use `@conda` to specify step-specific overrides.
875
824
 
876
825
  Parameters
877
826
  ----------
878
- seconds : int, default 0
879
- Number of seconds to wait prior to timing out.
880
- minutes : int, default 0
881
- Number of minutes to wait prior to timing out.
882
- hours : int, default 0
883
- Number of hours to wait prior to timing out.
827
+ packages : Dict[str, str], default {}
828
+ Packages to use for this step. The key is the name of the package
829
+ and the value is the version to use.
830
+ libraries : Dict[str, str], default {}
831
+ Supported for backward compatibility. When used with packages, packages will take precedence.
832
+ python : str, optional, default None
833
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
834
+ that the version used will correspond to the version of the Python interpreter used to start the run.
835
+ disabled : bool, default False
836
+ If set to True, disables @conda.
884
837
  """
885
838
  ...
886
839
 
887
- 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]]]:
840
+ @typing.overload
841
+ def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
842
+ ...
843
+
844
+ @typing.overload
845
+ def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
846
+ ...
847
+
848
+ 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):
888
849
  """
889
- Specifies that this step should execute on Kubernetes.
850
+ Specifies the Conda environment for the step.
851
+
852
+ Information in this decorator will augment any
853
+ attributes set in the `@conda_base` flow-level decorator. Hence,
854
+ you can use `@conda_base` to set packages required by all
855
+ steps and use `@conda` to specify step-specific overrides.
890
856
 
891
857
  Parameters
892
858
  ----------
893
- cpu : int, default 1
894
- Number of CPUs required for this step. If `@resources` is
895
- also present, the maximum value from all decorators is used.
896
- memory : int, default 4096
897
- Memory size (in MB) required for this step. If
898
- `@resources` is also present, the maximum value from all decorators is
899
- used.
900
- disk : int, default 10240
901
- Disk size (in MB) required for this step. If
902
- `@resources` is also present, the maximum value from all decorators is
903
- used.
904
- image : str, optional, default None
905
- Docker image to use when launching on Kubernetes. If not specified, and
906
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
907
- not, a default Docker image mapping to the current version of Python is used.
908
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
909
- If given, the imagePullPolicy to be applied to the Docker image of the step.
910
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
911
- Kubernetes service account to use when launching pod in Kubernetes.
912
- secrets : List[str], optional, default None
913
- Kubernetes secrets to use when launching pod in Kubernetes. These
914
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
915
- in Metaflow configuration.
916
- node_selector: Union[Dict[str,str], str], optional, default None
917
- Kubernetes node selector(s) to apply to the pod running the task.
918
- Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
919
- or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
920
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
921
- Kubernetes namespace to use when launching pod in Kubernetes.
922
- gpu : int, optional, default None
923
- Number of GPUs required for this step. A value of zero implies that
924
- the scheduled node should not have GPUs.
925
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
926
- The vendor of the GPUs to be used for this step.
927
- tolerations : List[str], default []
928
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
929
- Kubernetes tolerations to use when launching pod in Kubernetes.
930
- use_tmpfs : bool, default False
931
- This enables an explicit tmpfs mount for this step.
932
- tmpfs_tempdir : bool, default True
933
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
934
- tmpfs_size : int, optional, default: None
935
- The value for the size (in MiB) of the tmpfs mount for this step.
936
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
937
- memory allocated for this step.
938
- tmpfs_path : str, optional, default /metaflow_temp
939
- Path to tmpfs mount for this step.
940
- persistent_volume_claims : Dict[str, str], optional, default None
941
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
942
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
943
- shared_memory: int, optional
944
- Shared memory size (in MiB) required for this step
945
- port: int, optional
946
- Port number to specify in the Kubernetes job object
947
- compute_pool : str, optional, default None
948
- Compute pool to be used for for this step.
949
- If not specified, any accessible compute pool within the perimeter is used.
859
+ packages : Dict[str, str], default {}
860
+ Packages to use for this step. The key is the name of the package
861
+ and the value is the version to use.
862
+ libraries : Dict[str, str], default {}
863
+ Supported for backward compatibility. When used with packages, packages will take precedence.
864
+ python : str, optional, default None
865
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
866
+ that the version used will correspond to the version of the Python interpreter used to start the run.
867
+ disabled : bool, default False
868
+ If set to True, disables @conda.
950
869
  """
951
870
  ...
952
871
 
@@ -982,227 +901,342 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
982
901
  ...
983
902
 
984
903
  @typing.overload
985
- 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]]]:
904
+ 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]]]:
986
905
  """
987
- Specifies the Conda environment for the step.
906
+ Specifies that the step will success under all circumstances.
907
+
908
+ The decorator will create an optional artifact, specified by `var`, which
909
+ contains the exception raised. You can use it to detect the presence
910
+ of errors, indicating that all happy-path artifacts produced by the step
911
+ are missing.
912
+
913
+ Parameters
914
+ ----------
915
+ var : str, optional, default None
916
+ Name of the artifact in which to store the caught exception.
917
+ If not specified, the exception is not stored.
918
+ print_exception : bool, default True
919
+ Determines whether or not the exception is printed to
920
+ stdout when caught.
921
+ """
922
+ ...
923
+
924
+ @typing.overload
925
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
926
+ ...
927
+
928
+ @typing.overload
929
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
930
+ ...
931
+
932
+ 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):
933
+ """
934
+ Specifies that the step will success under all circumstances.
935
+
936
+ The decorator will create an optional artifact, specified by `var`, which
937
+ contains the exception raised. You can use it to detect the presence
938
+ of errors, indicating that all happy-path artifacts produced by the step
939
+ are missing.
940
+
941
+ Parameters
942
+ ----------
943
+ var : str, optional, default None
944
+ Name of the artifact in which to store the caught exception.
945
+ If not specified, the exception is not stored.
946
+ print_exception : bool, default True
947
+ Determines whether or not the exception is printed to
948
+ stdout when caught.
949
+ """
950
+ ...
951
+
952
+ @typing.overload
953
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
954
+ """
955
+ Decorator prototype for all step decorators. This function gets specialized
956
+ and imported for all decorators types by _import_plugin_decorators().
957
+ """
958
+ ...
959
+
960
+ @typing.overload
961
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
962
+ ...
963
+
964
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
965
+ """
966
+ Decorator prototype for all step decorators. This function gets specialized
967
+ and imported for all decorators types by _import_plugin_decorators().
968
+ """
969
+ ...
970
+
971
+ @typing.overload
972
+ 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]]]:
973
+ """
974
+ Specifies the PyPI packages for the step.
988
975
 
989
976
  Information in this decorator will augment any
990
- attributes set in the `@conda_base` flow-level decorator. Hence,
991
- you can use `@conda_base` to set packages required by all
992
- steps and use `@conda` to specify step-specific overrides.
977
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
978
+ you can use `@pypi_base` to set packages required by all
979
+ steps and use `@pypi` to specify step-specific overrides.
993
980
 
994
981
  Parameters
995
982
  ----------
996
- packages : Dict[str, str], default {}
983
+ packages : Dict[str, str], default: {}
997
984
  Packages to use for this step. The key is the name of the package
998
985
  and the value is the version to use.
999
- libraries : Dict[str, str], default {}
1000
- Supported for backward compatibility. When used with packages, packages will take precedence.
1001
- python : str, optional, default None
986
+ python : str, optional, default: None
1002
987
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1003
988
  that the version used will correspond to the version of the Python interpreter used to start the run.
1004
- disabled : bool, default False
1005
- If set to True, disables @conda.
1006
989
  """
1007
990
  ...
1008
991
 
1009
992
  @typing.overload
1010
- def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
993
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1011
994
  ...
1012
995
 
1013
996
  @typing.overload
1014
- def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
997
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1015
998
  ...
1016
999
 
1017
- 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):
1000
+ 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):
1018
1001
  """
1019
- Specifies the Conda environment for the step.
1002
+ Specifies the PyPI packages for the step.
1020
1003
 
1021
1004
  Information in this decorator will augment any
1022
- attributes set in the `@conda_base` flow-level decorator. Hence,
1023
- you can use `@conda_base` to set packages required by all
1024
- steps and use `@conda` to specify step-specific overrides.
1005
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1006
+ you can use `@pypi_base` to set packages required by all
1007
+ steps and use `@pypi` to specify step-specific overrides.
1025
1008
 
1026
1009
  Parameters
1027
1010
  ----------
1028
- packages : Dict[str, str], default {}
1011
+ packages : Dict[str, str], default: {}
1029
1012
  Packages to use for this step. The key is the name of the package
1030
1013
  and the value is the version to use.
1031
- libraries : Dict[str, str], default {}
1032
- Supported for backward compatibility. When used with packages, packages will take precedence.
1033
- python : str, optional, default None
1014
+ python : str, optional, default: None
1034
1015
  Version of Python to use, e.g. '3.7.4'. A default value of None implies
1035
1016
  that the version used will correspond to the version of the Python interpreter used to start the run.
1036
- disabled : bool, default False
1037
- If set to True, disables @conda.
1038
1017
  """
1039
1018
  ...
1040
1019
 
1041
1020
  @typing.overload
1042
- def checkpoint(*, load_policy: str = "fresh", 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]]]:
1021
+ 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]]]:
1043
1022
  """
1044
- Enables checkpointing for a step.
1023
+ Specifies a timeout for your step.
1045
1024
 
1025
+ This decorator is useful if this step may hang indefinitely.
1026
+
1027
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1028
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1029
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1030
+
1031
+ Note that all the values specified in parameters are added together so if you specify
1032
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1046
1033
 
1047
1034
  Parameters
1048
1035
  ----------
1049
- load_policy : str, default: "fresh"
1050
- The policy for loading the checkpoint. The following policies are supported:
1051
- - "eager": Loads the the latest available checkpoint within the namespace.
1052
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
1053
- will be loaded at the start of the task.
1054
- - "none": Do not load any checkpoint
1055
- - "fresh": Loads the lastest checkpoint created within the running Task.
1056
- This mode helps loading checkpoints across various retry attempts of the same task.
1057
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
1058
- created within the task will be loaded when the task is retries execution on failure.
1036
+ seconds : int, default 0
1037
+ Number of seconds to wait prior to timing out.
1038
+ minutes : int, default 0
1039
+ Number of minutes to wait prior to timing out.
1040
+ hours : int, default 0
1041
+ Number of hours to wait prior to timing out.
1042
+ """
1043
+ ...
1044
+
1045
+ @typing.overload
1046
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1047
+ ...
1048
+
1049
+ @typing.overload
1050
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1051
+ ...
1052
+
1053
+ 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):
1054
+ """
1055
+ Specifies a timeout for your step.
1059
1056
 
1060
- temp_dir_root : str, default: None
1061
- The root directory under which `current.checkpoint.directory` will be created.
1057
+ This decorator is useful if this step may hang indefinitely.
1058
+
1059
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
1060
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
1061
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
1062
1062
 
1063
+ Note that all the values specified in parameters are added together so if you specify
1064
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
1063
1065
 
1066
+ Parameters
1067
+ ----------
1068
+ seconds : int, default 0
1069
+ Number of seconds to wait prior to timing out.
1070
+ minutes : int, default 0
1071
+ Number of minutes to wait prior to timing out.
1072
+ hours : int, default 0
1073
+ Number of hours to wait prior to timing out.
1074
+ """
1075
+ ...
1076
+
1077
+ 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, hostname_resolution_timeout: int = 600) -> 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]]]:
1078
+ """
1079
+ Specifies that this step should execute on Kubernetes.
1064
1080
 
1081
+ Parameters
1082
+ ----------
1083
+ cpu : int, default 1
1084
+ Number of CPUs required for this step. If `@resources` is
1085
+ also present, the maximum value from all decorators is used.
1086
+ memory : int, default 4096
1087
+ Memory size (in MB) required for this step. If
1088
+ `@resources` is also present, the maximum value from all decorators is
1089
+ used.
1090
+ disk : int, default 10240
1091
+ Disk size (in MB) required for this step. If
1092
+ `@resources` is also present, the maximum value from all decorators is
1093
+ used.
1094
+ image : str, optional, default None
1095
+ Docker image to use when launching on Kubernetes. If not specified, and
1096
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
1097
+ not, a default Docker image mapping to the current version of Python is used.
1098
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
1099
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
1100
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
1101
+ Kubernetes service account to use when launching pod in Kubernetes.
1102
+ secrets : List[str], optional, default None
1103
+ Kubernetes secrets to use when launching pod in Kubernetes. These
1104
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
1105
+ in Metaflow configuration.
1106
+ node_selector: Union[Dict[str,str], str], optional, default None
1107
+ Kubernetes node selector(s) to apply to the pod running the task.
1108
+ Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
1109
+ or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
1110
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
1111
+ Kubernetes namespace to use when launching pod in Kubernetes.
1112
+ gpu : int, optional, default None
1113
+ Number of GPUs required for this step. A value of zero implies that
1114
+ the scheduled node should not have GPUs.
1115
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
1116
+ The vendor of the GPUs to be used for this step.
1117
+ tolerations : List[str], default []
1118
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
1119
+ Kubernetes tolerations to use when launching pod in Kubernetes.
1120
+ use_tmpfs : bool, default False
1121
+ This enables an explicit tmpfs mount for this step.
1122
+ tmpfs_tempdir : bool, default True
1123
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
1124
+ tmpfs_size : int, optional, default: None
1125
+ The value for the size (in MiB) of the tmpfs mount for this step.
1126
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
1127
+ memory allocated for this step.
1128
+ tmpfs_path : str, optional, default /metaflow_temp
1129
+ Path to tmpfs mount for this step.
1130
+ persistent_volume_claims : Dict[str, str], optional, default None
1131
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
1132
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
1133
+ shared_memory: int, optional
1134
+ Shared memory size (in MiB) required for this step
1135
+ port: int, optional
1136
+ Port number to specify in the Kubernetes job object
1137
+ compute_pool : str, optional, default None
1138
+ Compute pool to be used for for this step.
1139
+ If not specified, any accessible compute pool within the perimeter is used.
1140
+ hostname_resolution_timeout: int, default 10 * 60
1141
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
1142
+ Only applicable when @parallel is used.
1065
1143
  """
1066
1144
  ...
1067
1145
 
1068
- @typing.overload
1069
- def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1070
- ...
1071
-
1072
- @typing.overload
1073
- def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1074
- ...
1075
-
1076
- def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = "fresh", temp_dir_root: str = None):
1146
+ def huggingface_hub(*, temp_dir_root: 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]]]:
1077
1147
  """
1078
- Enables checkpointing for a step.
1079
-
1148
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
1080
1149
 
1081
1150
  Parameters
1082
1151
  ----------
1083
- load_policy : str, default: "fresh"
1084
- The policy for loading the checkpoint. The following policies are supported:
1085
- - "eager": Loads the the latest available checkpoint within the namespace.
1086
- With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
1087
- will be loaded at the start of the task.
1088
- - "none": Do not load any checkpoint
1089
- - "fresh": Loads the lastest checkpoint created within the running Task.
1090
- This mode helps loading checkpoints across various retry attempts of the same task.
1091
- With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
1092
- created within the task will be loaded when the task is retries execution on failure.
1093
-
1094
- temp_dir_root : str, default: None
1095
- The root directory under which `current.checkpoint.directory` will be created.
1096
-
1152
+ temp_dir_root : str, optional
1153
+ The root directory that will hold the temporary directory where objects will be downloaded.
1097
1154
 
1098
1155
 
1099
1156
  """
1100
1157
  ...
1101
1158
 
1102
1159
  @typing.overload
1103
- 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]]]:
1160
+ 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]]]:
1104
1161
  """
1105
- Specifies the resources needed when executing this step.
1162
+ Specifies the number of times the task corresponding
1163
+ to a step needs to be retried.
1106
1164
 
1107
- Use `@resources` to specify the resource requirements
1108
- independently of the specific compute layer (`@batch`, `@kubernetes`).
1165
+ This decorator is useful for handling transient errors, such as networking issues.
1166
+ If your task contains operations that can't be retried safely, e.g. database updates,
1167
+ it is advisable to annotate it with `@retry(times=0)`.
1109
1168
 
1110
- You can choose the compute layer on the command line by executing e.g.
1111
- ```
1112
- python myflow.py run --with batch
1113
- ```
1114
- or
1115
- ```
1116
- python myflow.py run --with kubernetes
1117
- ```
1118
- which executes the flow on the desired system using the
1119
- requirements specified in `@resources`.
1169
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1170
+ decorator will execute a no-op task after all retries have been exhausted,
1171
+ ensuring that the flow execution can continue.
1120
1172
 
1121
1173
  Parameters
1122
1174
  ----------
1123
- cpu : int, default 1
1124
- Number of CPUs required for this step.
1125
- gpu : int, default 0
1126
- Number of GPUs required for this step.
1127
- disk : int, optional, default None
1128
- Disk size (in MB) required for this step. Only applies on Kubernetes.
1129
- memory : int, default 4096
1130
- Memory size (in MB) required for this step.
1131
- shared_memory : int, optional, default None
1132
- The value for the size (in MiB) of the /dev/shm volume for this step.
1133
- This parameter maps to the `--shm-size` option in Docker.
1175
+ times : int, default 3
1176
+ Number of times to retry this task.
1177
+ minutes_between_retries : int, default 2
1178
+ Number of minutes between retries.
1134
1179
  """
1135
1180
  ...
1136
1181
 
1137
1182
  @typing.overload
1138
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1183
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1139
1184
  ...
1140
1185
 
1141
1186
  @typing.overload
1142
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1187
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1143
1188
  ...
1144
1189
 
1145
- 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):
1190
+ 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):
1146
1191
  """
1147
- Specifies the resources needed when executing this step.
1192
+ Specifies the number of times the task corresponding
1193
+ to a step needs to be retried.
1148
1194
 
1149
- Use `@resources` to specify the resource requirements
1150
- independently of the specific compute layer (`@batch`, `@kubernetes`).
1195
+ This decorator is useful for handling transient errors, such as networking issues.
1196
+ If your task contains operations that can't be retried safely, e.g. database updates,
1197
+ it is advisable to annotate it with `@retry(times=0)`.
1151
1198
 
1152
- You can choose the compute layer on the command line by executing e.g.
1153
- ```
1154
- python myflow.py run --with batch
1155
- ```
1156
- or
1157
- ```
1158
- python myflow.py run --with kubernetes
1159
- ```
1160
- which executes the flow on the desired system using the
1161
- requirements specified in `@resources`.
1199
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1200
+ decorator will execute a no-op task after all retries have been exhausted,
1201
+ ensuring that the flow execution can continue.
1162
1202
 
1163
1203
  Parameters
1164
1204
  ----------
1165
- cpu : int, default 1
1166
- Number of CPUs required for this step.
1167
- gpu : int, default 0
1168
- Number of GPUs required for this step.
1169
- disk : int, optional, default None
1170
- Disk size (in MB) required for this step. Only applies on Kubernetes.
1171
- memory : int, default 4096
1172
- Memory size (in MB) required for this step.
1173
- shared_memory : int, optional, default None
1174
- The value for the size (in MiB) of the /dev/shm volume for this step.
1175
- This parameter maps to the `--shm-size` option in Docker.
1205
+ times : int, default 3
1206
+ Number of times to retry this task.
1207
+ minutes_between_retries : int, default 2
1208
+ Number of minutes between retries.
1176
1209
  """
1177
1210
  ...
1178
1211
 
1179
- def huggingface_hub(*, temp_dir_root: 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]]]:
1212
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1180
1213
  """
1181
- Decorator that helps cache, version and store models/datasets from huggingface hub.
1214
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1182
1215
 
1183
- Parameters
1184
- ----------
1185
- temp_dir_root : str, optional
1186
- The root directory that will hold the temporary directory where objects will be downloaded.
1216
+ User code call
1217
+ -----------
1218
+ @nim(
1219
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1220
+ backend='managed'
1221
+ )
1187
1222
 
1223
+ Valid backend options
1224
+ ---------------------
1225
+ - 'managed': Outerbounds selects a compute provider based on the model.
1226
+ - 🚧 'dataplane': Run in your account.
1188
1227
 
1189
- """
1190
- ...
1191
-
1192
- @typing.overload
1193
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1194
- """
1195
- Internal decorator to support Fast bakery
1196
- """
1197
- ...
1198
-
1199
- @typing.overload
1200
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1201
- ...
1202
-
1203
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1204
- """
1205
- Internal decorator to support Fast bakery
1228
+ Valid model options
1229
+ ----------------
1230
+ - 'meta/llama3-8b-instruct': 8B parameter model
1231
+ - 'meta/llama3-70b-instruct': 70B parameter model
1232
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1233
+
1234
+ Parameters
1235
+ ----------
1236
+ models: list[NIM]
1237
+ List of NIM containers running models in sidecars.
1238
+ backend: str
1239
+ Compute provider to run the NIM container.
1206
1240
  """
1207
1241
  ...
1208
1242
 
@@ -1309,6 +1343,87 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1309
1343
  """
1310
1344
  ...
1311
1345
 
1346
+ 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]]:
1347
+ """
1348
+ 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.
1349
+ 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.
1350
+
1351
+ Parameters
1352
+ ----------
1353
+ timeout : int
1354
+ Time, in seconds before the task times out and fails. (Default: 3600)
1355
+ poke_interval : int
1356
+ Time in seconds that the job should wait in between each try. (Default: 60)
1357
+ mode : str
1358
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1359
+ exponential_backoff : bool
1360
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1361
+ pool : str
1362
+ the slot pool this task should run in,
1363
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1364
+ soft_fail : bool
1365
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1366
+ name : str
1367
+ Name of the sensor on Airflow
1368
+ description : str
1369
+ Description of sensor in the Airflow UI
1370
+ external_dag_id : str
1371
+ The dag_id that contains the task you want to wait for.
1372
+ external_task_ids : List[str]
1373
+ The list of task_ids that you want to wait for.
1374
+ If None (default value) the sensor waits for the DAG. (Default: None)
1375
+ allowed_states : List[str]
1376
+ Iterable of allowed states, (Default: ['success'])
1377
+ failed_states : List[str]
1378
+ Iterable of failed or dis-allowed states. (Default: None)
1379
+ execution_delta : datetime.timedelta
1380
+ time difference with the previous execution to look at,
1381
+ the default is the same logical date as the current task or DAG. (Default: None)
1382
+ check_existence: bool
1383
+ Set to True to check if the external task exists or check if
1384
+ the DAG to wait for exists. (Default: True)
1385
+ """
1386
+ ...
1387
+
1388
+ @typing.overload
1389
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1390
+ """
1391
+ Specifies the PyPI packages for all steps of the flow.
1392
+
1393
+ Use `@pypi_base` to set common packages required by all
1394
+ steps and use `@pypi` to specify step-specific overrides.
1395
+ Parameters
1396
+ ----------
1397
+ packages : Dict[str, str], default: {}
1398
+ Packages to use for this flow. The key is the name of the package
1399
+ and the value is the version to use.
1400
+ python : str, optional, default: None
1401
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1402
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1403
+ """
1404
+ ...
1405
+
1406
+ @typing.overload
1407
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1408
+ ...
1409
+
1410
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1411
+ """
1412
+ Specifies the PyPI packages for all steps of the flow.
1413
+
1414
+ Use `@pypi_base` to set common packages required by all
1415
+ steps and use `@pypi` to specify step-specific overrides.
1416
+ Parameters
1417
+ ----------
1418
+ packages : Dict[str, str], default: {}
1419
+ Packages to use for this flow. The key is the name of the package
1420
+ and the value is the version to use.
1421
+ python : str, optional, default: None
1422
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1423
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1424
+ """
1425
+ ...
1426
+
1312
1427
  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]]:
1313
1428
  """
1314
1429
  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)
@@ -1352,51 +1467,51 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1352
1467
  ...
1353
1468
 
1354
1469
  @typing.overload
1355
- 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]]:
1470
+ 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]]:
1356
1471
  """
1357
- Specifies the times when the flow should be run when running on a
1358
- production scheduler.
1472
+ Specifies the Conda environment for all steps of the flow.
1473
+
1474
+ Use `@conda_base` to set common libraries required by all
1475
+ steps and use `@conda` to specify step-specific additions.
1359
1476
 
1360
1477
  Parameters
1361
1478
  ----------
1362
- hourly : bool, default False
1363
- Run the workflow hourly.
1364
- daily : bool, default True
1365
- Run the workflow daily.
1366
- weekly : bool, default False
1367
- Run the workflow weekly.
1368
- cron : str, optional, default None
1369
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1370
- specified by this expression.
1371
- timezone : str, optional, default None
1372
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1373
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1479
+ packages : Dict[str, str], default {}
1480
+ Packages to use for this flow. The key is the name of the package
1481
+ and the value is the version to use.
1482
+ libraries : Dict[str, str], default {}
1483
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1484
+ python : str, optional, default None
1485
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1486
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1487
+ disabled : bool, default False
1488
+ If set to True, disables Conda.
1374
1489
  """
1375
1490
  ...
1376
1491
 
1377
1492
  @typing.overload
1378
- def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1493
+ def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1379
1494
  ...
1380
1495
 
1381
- 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):
1496
+ 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):
1382
1497
  """
1383
- Specifies the times when the flow should be run when running on a
1384
- production scheduler.
1498
+ Specifies the Conda environment for all steps of the flow.
1499
+
1500
+ Use `@conda_base` to set common libraries required by all
1501
+ steps and use `@conda` to specify step-specific additions.
1385
1502
 
1386
1503
  Parameters
1387
1504
  ----------
1388
- hourly : bool, default False
1389
- Run the workflow hourly.
1390
- daily : bool, default True
1391
- Run the workflow daily.
1392
- weekly : bool, default False
1393
- Run the workflow weekly.
1394
- cron : str, optional, default None
1395
- Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1396
- specified by this expression.
1397
- timezone : str, optional, default None
1398
- Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1399
- which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1505
+ packages : Dict[str, str], default {}
1506
+ Packages to use for this flow. The key is the name of the package
1507
+ and the value is the version to use.
1508
+ libraries : Dict[str, str], default {}
1509
+ Supported for backward compatibility. When used with packages, packages will take precedence.
1510
+ python : str, optional, default None
1511
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1512
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1513
+ disabled : bool, default False
1514
+ If set to True, disables Conda.
1400
1515
  """
1401
1516
  ...
1402
1517
 
@@ -1495,182 +1610,70 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
1495
1610
  """
1496
1611
  ...
1497
1612
 
1498
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1613
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1499
1614
  """
1500
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1501
-
1502
- User code call
1503
- -----------
1504
- @nim(
1505
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1506
- backend='managed'
1507
- )
1508
-
1509
- Valid backend options
1510
- ---------------------
1511
- - 'managed': Outerbounds selects a compute provider based on the model.
1512
- - 🚧 'dataplane': Run in your account.
1513
-
1514
- Valid model options
1515
- ----------------
1516
- - 'meta/llama3-8b-instruct': 8B parameter model
1517
- - 'meta/llama3-70b-instruct': 70B parameter model
1518
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1615
+ Specifies what flows belong to the same project.
1519
1616
 
1520
- Parameters
1521
- ----------
1522
- models: list[NIM]
1523
- List of NIM containers running models in sidecars.
1524
- backend: str
1525
- Compute provider to run the NIM container.
1526
- """
1527
- ...
1528
-
1529
- @typing.overload
1530
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1531
- """
1532
- Specifies the PyPI packages for all steps of the flow.
1617
+ A project-specific namespace is created for all flows that
1618
+ use the same `@project(name)`.
1533
1619
 
1534
- Use `@pypi_base` to set common packages required by all
1535
- steps and use `@pypi` to specify step-specific overrides.
1536
1620
  Parameters
1537
1621
  ----------
1538
- packages : Dict[str, str], default: {}
1539
- Packages to use for this flow. The key is the name of the package
1540
- and the value is the version to use.
1541
- python : str, optional, default: None
1542
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1543
- that the version used will correspond to the version of the Python interpreter used to start the run.
1544
- """
1545
- ...
1546
-
1547
- @typing.overload
1548
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1549
- ...
1550
-
1551
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1552
- """
1553
- Specifies the PyPI packages for all steps of the flow.
1622
+ name : str
1623
+ Project name. Make sure that the name is unique amongst all
1624
+ projects that use the same production scheduler. The name may
1625
+ contain only lowercase alphanumeric characters and underscores.
1554
1626
 
1555
- Use `@pypi_base` to set common packages required by all
1556
- steps and use `@pypi` to specify step-specific overrides.
1557
- Parameters
1558
- ----------
1559
- packages : Dict[str, str], default: {}
1560
- Packages to use for this flow. The key is the name of the package
1561
- and the value is the version to use.
1562
- python : str, optional, default: None
1563
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1564
- that the version used will correspond to the version of the Python interpreter used to start the run.
1565
- """
1566
- ...
1567
-
1568
- 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]]:
1569
- """
1570
- 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.
1571
- 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.
1572
1627
 
1573
- Parameters
1574
- ----------
1575
- timeout : int
1576
- Time, in seconds before the task times out and fails. (Default: 3600)
1577
- poke_interval : int
1578
- Time in seconds that the job should wait in between each try. (Default: 60)
1579
- mode : str
1580
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1581
- exponential_backoff : bool
1582
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1583
- pool : str
1584
- the slot pool this task should run in,
1585
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1586
- soft_fail : bool
1587
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1588
- name : str
1589
- Name of the sensor on Airflow
1590
- description : str
1591
- Description of sensor in the Airflow UI
1592
- external_dag_id : str
1593
- The dag_id that contains the task you want to wait for.
1594
- external_task_ids : List[str]
1595
- The list of task_ids that you want to wait for.
1596
- If None (default value) the sensor waits for the DAG. (Default: None)
1597
- allowed_states : List[str]
1598
- Iterable of allowed states, (Default: ['success'])
1599
- failed_states : List[str]
1600
- Iterable of failed or dis-allowed states. (Default: None)
1601
- execution_delta : datetime.timedelta
1602
- time difference with the previous execution to look at,
1603
- the default is the same logical date as the current task or DAG. (Default: None)
1604
- check_existence: bool
1605
- Set to True to check if the external task exists or check if
1606
- the DAG to wait for exists. (Default: True)
1607
1628
  """
1608
1629
  ...
1609
1630
 
1610
1631
  @typing.overload
1611
- 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]]:
1632
+ 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]]:
1612
1633
  """
1613
- Specifies the Conda environment for all steps of the flow.
1614
-
1615
- Use `@conda_base` to set common libraries required by all
1616
- steps and use `@conda` to specify step-specific additions.
1634
+ Specifies the times when the flow should be run when running on a
1635
+ production scheduler.
1617
1636
 
1618
1637
  Parameters
1619
1638
  ----------
1620
- packages : Dict[str, str], default {}
1621
- Packages to use for this flow. The key is the name of the package
1622
- and the value is the version to use.
1623
- libraries : Dict[str, str], default {}
1624
- Supported for backward compatibility. When used with packages, packages will take precedence.
1625
- python : str, optional, default None
1626
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1627
- that the version used will correspond to the version of the Python interpreter used to start the run.
1628
- disabled : bool, default False
1629
- If set to True, disables Conda.
1639
+ hourly : bool, default False
1640
+ Run the workflow hourly.
1641
+ daily : bool, default True
1642
+ Run the workflow daily.
1643
+ weekly : bool, default False
1644
+ Run the workflow weekly.
1645
+ cron : str, optional, default None
1646
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1647
+ specified by this expression.
1648
+ timezone : str, optional, default None
1649
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1650
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1630
1651
  """
1631
1652
  ...
1632
1653
 
1633
1654
  @typing.overload
1634
- def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1635
- ...
1636
-
1637
- 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):
1638
- """
1639
- Specifies the Conda environment for all steps of the flow.
1640
-
1641
- Use `@conda_base` to set common libraries required by all
1642
- steps and use `@conda` to specify step-specific additions.
1643
-
1644
- Parameters
1645
- ----------
1646
- packages : Dict[str, str], default {}
1647
- Packages to use for this flow. The key is the name of the package
1648
- and the value is the version to use.
1649
- libraries : Dict[str, str], default {}
1650
- Supported for backward compatibility. When used with packages, packages will take precedence.
1651
- python : str, optional, default None
1652
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1653
- that the version used will correspond to the version of the Python interpreter used to start the run.
1654
- disabled : bool, default False
1655
- If set to True, disables Conda.
1656
- """
1655
+ def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1657
1656
  ...
1658
1657
 
1659
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1658
+ 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):
1660
1659
  """
1661
- Specifies what flows belong to the same project.
1662
-
1663
- A project-specific namespace is created for all flows that
1664
- use the same `@project(name)`.
1660
+ Specifies the times when the flow should be run when running on a
1661
+ production scheduler.
1665
1662
 
1666
1663
  Parameters
1667
1664
  ----------
1668
- name : str
1669
- Project name. Make sure that the name is unique amongst all
1670
- projects that use the same production scheduler. The name may
1671
- contain only lowercase alphanumeric characters and underscores.
1672
-
1673
-
1665
+ hourly : bool, default False
1666
+ Run the workflow hourly.
1667
+ daily : bool, default True
1668
+ Run the workflow daily.
1669
+ weekly : bool, default False
1670
+ Run the workflow weekly.
1671
+ cron : str, optional, default None
1672
+ Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
1673
+ specified by this expression.
1674
+ timezone : str, optional, default None
1675
+ Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
1676
+ which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
1674
1677
  """
1675
1678
  ...
1676
1679
 
@@ -1765,7 +1768,7 @@ class Metaflow(object, metaclass=type):
1765
1768
  flows present in the current namespace will be returned. A `Flow` is present in a namespace
1766
1769
  if it has at least one run in the namespace.
1767
1770
  """
1768
- def __init__(self):
1771
+ def __init__(self, _current_metadata: typing.Optional[str] = None):
1769
1772
  ...
1770
1773
  @property
1771
1774
  def flows(self) -> typing.List[metaflow.client.core.Flow]:
@@ -2908,15 +2911,15 @@ class NBRunner(object, metaclass=type):
2908
2911
  Additional environment variables to set for the Run. This overrides the
2909
2912
  environment set for this process.
2910
2913
  base_dir : Optional[str], default None
2911
- The directory to run the subprocess in; if not specified, a temporary
2912
- directory is used.
2914
+ The directory to run the subprocess in; if not specified, the current
2915
+ working directory is used.
2913
2916
  file_read_timeout : int, default 3600
2914
2917
  The timeout until which we try to read the runner attribute file.
2915
2918
  **kwargs : Any
2916
2919
  Additional arguments that you would pass to `python myflow.py` before
2917
2920
  the `run` command.
2918
2921
  """
2919
- def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", file_read_timeout: int = 3600, **kwargs):
2922
+ def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
2920
2923
  ...
2921
2924
  def nbrun(self, **kwargs):
2922
2925
  """
@@ -3097,13 +3100,13 @@ class NBDeployer(object, metaclass=type):
3097
3100
  Additional environment variables to set. This overrides the
3098
3101
  environment set for this process.
3099
3102
  base_dir : Optional[str], default None
3100
- The directory to run the subprocess in; if not specified, a temporary
3101
- directory is used.
3103
+ The directory to run the subprocess in; if not specified, the current
3104
+ working directory is used.
3102
3105
  **kwargs : Any
3103
3106
  Additional arguments that you would pass to `python myflow.py` i.e. options
3104
3107
  listed in `python myflow.py --help`
3105
3108
  """
3106
- def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: str = "/tmp", file_read_timeout: int = 3600, **kwargs):
3109
+ def __init__(self, flow, show_output: bool = True, profile: typing.Optional[str] = None, env: typing.Optional[typing.Dict] = None, base_dir: typing.Optional[str] = None, file_read_timeout: int = 3600, **kwargs):
3107
3110
  ...
3108
3111
  def cleanup(self):
3109
3112
  """