ob-metaflow-stubs 6.0.3.112rc0__py2.py3-none-any.whl → 6.0.3.114__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 +620 -617
  2. metaflow-stubs/cards.pyi +5 -5
  3. metaflow-stubs/cli.pyi +3 -3
  4. metaflow-stubs/client/__init__.pyi +3 -3
  5. metaflow-stubs/client/core.pyi +7 -7
  6. metaflow-stubs/client/filecache.pyi +3 -3
  7. metaflow-stubs/clone_util.pyi +2 -2
  8. metaflow-stubs/events.pyi +3 -3
  9. metaflow-stubs/exception.pyi +2 -2
  10. metaflow-stubs/flowspec.pyi +5 -5
  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 +2 -2
  15. metaflow-stubs/metadata/util.pyi +2 -2
  16. metaflow-stubs/metaflow_config.pyi +2 -2
  17. metaflow-stubs/metaflow_current.pyi +73 -72
  18. metaflow-stubs/mflog/mflog.pyi +2 -2
  19. metaflow-stubs/multicore_utils.pyi +2 -2
  20. metaflow-stubs/parameters.pyi +5 -5
  21. metaflow-stubs/plugins/__init__.pyi +3 -3
  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 +9 -6
  34. metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +7 -7
  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 +5 -5
  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 +3 -3
  65. metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
  66. metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
  67. metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
  68. metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
  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 +3 -3
  72. metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
  73. metaflow-stubs/plugins/cards/component_serializer.pyi +4 -4
  74. metaflow-stubs/plugins/cards/exception.pyi +2 -2
  75. metaflow-stubs/plugins/catch_decorator.pyi +4 -4
  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 +5 -5
  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 +3 -3
  86. metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
  87. metaflow-stubs/plugins/frameworks/pytorch.pyi +8 -7
  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 +4 -4
  102. metaflow-stubs/plugins/package_cli.pyi +2 -2
  103. metaflow-stubs/plugins/parallel_decorator.pyi +8 -7
  104. metaflow-stubs/plugins/perimeters.pyi +2 -2
  105. metaflow-stubs/plugins/project_decorator.pyi +3 -3
  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 +2 -2
  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 +5 -5
  119. metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
  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 +4 -4
  126. metaflow-stubs/runner/metaflow_runner.pyi +5 -8
  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.112rc0.dist-info → ob_metaflow_stubs-6.0.3.114.dist-info}/METADATA +1 -1
  137. ob_metaflow_stubs-6.0.3.114.dist-info/RECORD +140 -0
  138. ob_metaflow_stubs-6.0.3.112rc0.dist-info/RECORD +0 -140
  139. {ob_metaflow_stubs-6.0.3.112rc0.dist-info → ob_metaflow_stubs-6.0.3.114.dist-info}/WHEEL +0 -0
  140. {ob_metaflow_stubs-6.0.3.112rc0.dist-info → ob_metaflow_stubs-6.0.3.114.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.0);ob(v1) #
4
- # Generated on 2024-10-21T18:58:32.974120 #
3
+ # MF version: 2.12.26.1+obcheckpoint(0.1.1);ob(v1) #
4
+ # Generated on 2024-10-23T20:57:01.122821 #
5
5
  ##################################################################################
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
9
  import typing
10
10
  if typing.TYPE_CHECKING:
11
- import metaflow.metaflow_current
12
- import metaflow.parameters
13
- import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
14
11
  import metaflow.flowspec
15
- import typing
12
+ import metaflow_extensions.obcheckpoint.plugins.machine_learning_utilities.datastructures
13
+ import metaflow.datastore.inputs
14
+ import metaflow.parameters
16
15
  import metaflow.events
17
- import datetime
16
+ import metaflow.runner.metaflow_runner
18
17
  import metaflow.client.core
19
- import metaflow.datastore.inputs
18
+ import metaflow.metaflow_current
19
+ import datetime
20
20
  import metaflow._vendor.click.types
21
- import metaflow.runner.metaflow_runner
21
+ import typing
22
22
  FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
23
23
  StepFlag = typing.NewType("StepFlag", bool)
24
24
 
@@ -512,116 +512,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
512
512
  """
513
513
  ...
514
514
 
515
- @typing.overload
516
- 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]]]:
517
- """
518
- Specifies a timeout for your step.
519
-
520
- This decorator is useful if this step may hang indefinitely.
521
-
522
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
523
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
524
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
525
-
526
- Note that all the values specified in parameters are added together so if you specify
527
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
528
-
529
- Parameters
530
- ----------
531
- seconds : int, default 0
532
- Number of seconds to wait prior to timing out.
533
- minutes : int, default 0
534
- Number of minutes to wait prior to timing out.
535
- hours : int, default 0
536
- Number of hours to wait prior to timing out.
537
- """
538
- ...
539
-
540
- @typing.overload
541
- def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
542
- ...
543
-
544
- @typing.overload
545
- def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
546
- ...
547
-
548
- 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):
549
- """
550
- Specifies a timeout for your step.
551
-
552
- This decorator is useful if this step may hang indefinitely.
553
-
554
- This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
555
- A timeout is considered to be an exception thrown by the step. It will cause the step to be
556
- retried if needed and the exception will be caught by the `@catch` decorator, if present.
557
-
558
- Note that all the values specified in parameters are added together so if you specify
559
- 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
560
-
561
- Parameters
562
- ----------
563
- seconds : int, default 0
564
- Number of seconds to wait prior to timing out.
565
- minutes : int, default 0
566
- Number of minutes to wait prior to timing out.
567
- hours : int, default 0
568
- Number of hours to wait prior to timing out.
569
- """
570
- ...
571
-
572
- @typing.overload
573
- 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]]]:
574
- """
575
- Specifies the number of times the task corresponding
576
- to a step needs to be retried.
577
-
578
- This decorator is useful for handling transient errors, such as networking issues.
579
- If your task contains operations that can't be retried safely, e.g. database updates,
580
- it is advisable to annotate it with `@retry(times=0)`.
581
-
582
- This can be used in conjunction with the `@catch` decorator. The `@catch`
583
- decorator will execute a no-op task after all retries have been exhausted,
584
- ensuring that the flow execution can continue.
585
-
586
- Parameters
587
- ----------
588
- times : int, default 3
589
- Number of times to retry this task.
590
- minutes_between_retries : int, default 2
591
- Number of minutes between retries.
592
- """
593
- ...
594
-
595
- @typing.overload
596
- def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
597
- ...
598
-
599
- @typing.overload
600
- def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
601
- ...
602
-
603
- 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):
604
- """
605
- Specifies the number of times the task corresponding
606
- to a step needs to be retried.
607
-
608
- This decorator is useful for handling transient errors, such as networking issues.
609
- If your task contains operations that can't be retried safely, e.g. database updates,
610
- it is advisable to annotate it with `@retry(times=0)`.
611
-
612
- This can be used in conjunction with the `@catch` decorator. The `@catch`
613
- decorator will execute a no-op task after all retries have been exhausted,
614
- ensuring that the flow execution can continue.
615
-
616
- Parameters
617
- ----------
618
- times : int, default 3
619
- Number of times to retry this task.
620
- minutes_between_retries : int, default 2
621
- Number of minutes between retries.
622
- """
623
- ...
624
-
625
515
  @typing.overload
626
516
  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]]]:
627
517
  """
@@ -684,135 +574,111 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
684
574
  ...
685
575
 
686
576
  @typing.overload
687
- 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]]]:
577
+ 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]]]:
688
578
  """
689
- Specifies the resources needed when executing this step.
690
-
691
- Use `@resources` to specify the resource requirements
692
- independently of the specific compute layer (`@batch`, `@kubernetes`).
693
-
694
- You can choose the compute layer on the command line by executing e.g.
695
- ```
696
- python myflow.py run --with batch
697
- ```
698
- or
699
- ```
700
- python myflow.py run --with kubernetes
701
- ```
702
- which executes the flow on the desired system using the
703
- requirements specified in `@resources`.
579
+ Specifies secrets to be retrieved and injected as environment variables prior to
580
+ the execution of a step.
704
581
 
705
582
  Parameters
706
583
  ----------
707
- cpu : int, default 1
708
- Number of CPUs required for this step.
709
- gpu : int, default 0
710
- Number of GPUs required for this step.
711
- disk : int, optional, default None
712
- Disk size (in MB) required for this step. Only applies on Kubernetes.
713
- memory : int, default 4096
714
- Memory size (in MB) required for this step.
715
- shared_memory : int, optional, default None
716
- The value for the size (in MiB) of the /dev/shm volume for this step.
717
- This parameter maps to the `--shm-size` option in Docker.
584
+ sources : List[Union[str, Dict[str, Any]]], default: []
585
+ List of secret specs, defining how the secrets are to be retrieved
718
586
  """
719
587
  ...
720
588
 
721
589
  @typing.overload
722
- def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
590
+ def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
723
591
  ...
724
592
 
725
593
  @typing.overload
726
- def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
594
+ def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
727
595
  ...
728
596
 
729
- 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):
597
+ 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]]] = []):
730
598
  """
731
- Specifies the resources needed when executing this step.
732
-
733
- Use `@resources` to specify the resource requirements
734
- independently of the specific compute layer (`@batch`, `@kubernetes`).
599
+ Specifies secrets to be retrieved and injected as environment variables prior to
600
+ the execution of a step.
735
601
 
736
- You can choose the compute layer on the command line by executing e.g.
737
- ```
738
- python myflow.py run --with batch
739
- ```
740
- or
741
- ```
742
- python myflow.py run --with kubernetes
743
- ```
744
- which executes the flow on the desired system using the
745
- requirements specified in `@resources`.
602
+ Parameters
603
+ ----------
604
+ sources : List[Union[str, Dict[str, Any]]], default: []
605
+ List of secret specs, defining how the secrets are to be retrieved
606
+ """
607
+ ...
608
+
609
+ 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]]]:
610
+ """
611
+ Specifies that this step should execute on Kubernetes.
746
612
 
747
613
  Parameters
748
614
  ----------
749
615
  cpu : int, default 1
750
- Number of CPUs required for this step.
751
- gpu : int, default 0
752
- Number of GPUs required for this step.
753
- disk : int, optional, default None
754
- Disk size (in MB) required for this step. Only applies on Kubernetes.
616
+ Number of CPUs required for this step. If `@resources` is
617
+ also present, the maximum value from all decorators is used.
755
618
  memory : int, default 4096
756
- Memory size (in MB) required for this step.
757
- shared_memory : int, optional, default None
758
- The value for the size (in MiB) of the /dev/shm volume for this step.
759
- This parameter maps to the `--shm-size` option in Docker.
619
+ Memory size (in MB) required for this step. If
620
+ `@resources` is also present, the maximum value from all decorators is
621
+ used.
622
+ disk : int, default 10240
623
+ Disk size (in MB) required for this step. If
624
+ `@resources` is also present, the maximum value from all decorators is
625
+ used.
626
+ image : str, optional, default None
627
+ Docker image to use when launching on Kubernetes. If not specified, and
628
+ METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
629
+ not, a default Docker image mapping to the current version of Python is used.
630
+ image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
631
+ If given, the imagePullPolicy to be applied to the Docker image of the step.
632
+ service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
633
+ Kubernetes service account to use when launching pod in Kubernetes.
634
+ secrets : List[str], optional, default None
635
+ Kubernetes secrets to use when launching pod in Kubernetes. These
636
+ secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
637
+ in Metaflow configuration.
638
+ node_selector: Union[Dict[str,str], str], optional, default None
639
+ Kubernetes node selector(s) to apply to the pod running the task.
640
+ Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
641
+ or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
642
+ namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
643
+ Kubernetes namespace to use when launching pod in Kubernetes.
644
+ gpu : int, optional, default None
645
+ Number of GPUs required for this step. A value of zero implies that
646
+ the scheduled node should not have GPUs.
647
+ gpu_vendor : str, default KUBERNETES_GPU_VENDOR
648
+ The vendor of the GPUs to be used for this step.
649
+ tolerations : List[str], default []
650
+ The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
651
+ Kubernetes tolerations to use when launching pod in Kubernetes.
652
+ use_tmpfs : bool, default False
653
+ This enables an explicit tmpfs mount for this step.
654
+ tmpfs_tempdir : bool, default True
655
+ sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
656
+ tmpfs_size : int, optional, default: None
657
+ The value for the size (in MiB) of the tmpfs mount for this step.
658
+ This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
659
+ memory allocated for this step.
660
+ tmpfs_path : str, optional, default /metaflow_temp
661
+ Path to tmpfs mount for this step.
662
+ persistent_volume_claims : Dict[str, str], optional, default None
663
+ A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
664
+ volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
665
+ shared_memory: int, optional
666
+ Shared memory size (in MiB) required for this step
667
+ port: int, optional
668
+ Port number to specify in the Kubernetes job object
669
+ compute_pool : str, optional, default None
670
+ Compute pool to be used for for this step.
671
+ If not specified, any accessible compute pool within the perimeter is used.
672
+ hostname_resolution_timeout: int, default 10 * 60
673
+ Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
674
+ Only applicable when @parallel is used.
760
675
  """
761
676
  ...
762
677
 
763
678
  @typing.overload
764
- 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]]]:
679
+ 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]]]:
765
680
  """
766
- Specifies the PyPI packages for the step.
767
-
768
- Information in this decorator will augment any
769
- attributes set in the `@pyi_base` flow-level decorator. Hence,
770
- you can use `@pypi_base` to set packages required by all
771
- steps and use `@pypi` to specify step-specific overrides.
772
-
773
- Parameters
774
- ----------
775
- packages : Dict[str, str], default: {}
776
- Packages to use for this step. The key is the name of the package
777
- and the value is the version to use.
778
- python : str, optional, default: None
779
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
780
- that the version used will correspond to the version of the Python interpreter used to start the run.
781
- """
782
- ...
783
-
784
- @typing.overload
785
- def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
786
- ...
787
-
788
- @typing.overload
789
- def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
790
- ...
791
-
792
- 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):
793
- """
794
- Specifies the PyPI packages for the step.
795
-
796
- Information in this decorator will augment any
797
- attributes set in the `@pyi_base` flow-level decorator. Hence,
798
- you can use `@pypi_base` to set packages required by all
799
- steps and use `@pypi` to specify step-specific overrides.
800
-
801
- Parameters
802
- ----------
803
- packages : Dict[str, str], default: {}
804
- Packages to use for this step. The key is the name of the package
805
- and the value is the version to use.
806
- python : str, optional, default: None
807
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
808
- that the version used will correspond to the version of the Python interpreter used to start the run.
809
- """
810
- ...
811
-
812
- @typing.overload
813
- 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]]]:
814
- """
815
- Specifies the Conda environment for the step.
681
+ Specifies the Conda environment for the step.
816
682
 
817
683
  Information in this decorator will augment any
818
684
  attributes set in the `@conda_base` flow-level decorator. Hence,
@@ -867,243 +733,272 @@ def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
867
733
  ...
868
734
 
869
735
  @typing.overload
870
- 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]]]:
736
+ 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]]]:
871
737
  """
872
- Creates a human-readable report, a Metaflow Card, after this step completes.
738
+ Specifies a timeout for your step.
873
739
 
874
- Note that you may add multiple `@card` decorators in a step with different parameters.
740
+ This decorator is useful if this step may hang indefinitely.
875
741
 
876
- Parameters
877
- ----------
878
- type : str, default 'default'
879
- Card type.
880
- id : str, optional, default None
881
- If multiple cards are present, use this id to identify this card.
882
- options : Dict[str, Any], default {}
883
- Options passed to the card. The contents depend on the card type.
884
- timeout : int, default 45
885
- Interrupt reporting if it takes more than this many seconds.
742
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
743
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
744
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
886
745
 
746
+ Note that all the values specified in parameters are added together so if you specify
747
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
887
748
 
749
+ Parameters
750
+ ----------
751
+ seconds : int, default 0
752
+ Number of seconds to wait prior to timing out.
753
+ minutes : int, default 0
754
+ Number of minutes to wait prior to timing out.
755
+ hours : int, default 0
756
+ Number of hours to wait prior to timing out.
888
757
  """
889
758
  ...
890
759
 
891
760
  @typing.overload
892
- def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
761
+ def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
893
762
  ...
894
763
 
895
764
  @typing.overload
896
- def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
765
+ def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
897
766
  ...
898
767
 
899
- 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):
768
+ 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):
900
769
  """
901
- Creates a human-readable report, a Metaflow Card, after this step completes.
770
+ Specifies a timeout for your step.
902
771
 
903
- Note that you may add multiple `@card` decorators in a step with different parameters.
772
+ This decorator is useful if this step may hang indefinitely.
904
773
 
905
- Parameters
906
- ----------
907
- type : str, default 'default'
908
- Card type.
909
- id : str, optional, default None
910
- If multiple cards are present, use this id to identify this card.
911
- options : Dict[str, Any], default {}
912
- Options passed to the card. The contents depend on the card type.
913
- timeout : int, default 45
914
- Interrupt reporting if it takes more than this many seconds.
774
+ This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
775
+ A timeout is considered to be an exception thrown by the step. It will cause the step to be
776
+ retried if needed and the exception will be caught by the `@catch` decorator, if present.
915
777
 
778
+ Note that all the values specified in parameters are added together so if you specify
779
+ 60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
916
780
 
781
+ Parameters
782
+ ----------
783
+ seconds : int, default 0
784
+ Number of seconds to wait prior to timing out.
785
+ minutes : int, default 0
786
+ Number of minutes to wait prior to timing out.
787
+ hours : int, default 0
788
+ Number of hours to wait prior to timing out.
917
789
  """
918
790
  ...
919
791
 
920
792
  @typing.overload
921
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
793
+ 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]]]:
922
794
  """
923
- Internal decorator to support Fast bakery
795
+ Specifies the resources needed when executing this step.
796
+
797
+ Use `@resources` to specify the resource requirements
798
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
799
+
800
+ You can choose the compute layer on the command line by executing e.g.
801
+ ```
802
+ python myflow.py run --with batch
803
+ ```
804
+ or
805
+ ```
806
+ python myflow.py run --with kubernetes
807
+ ```
808
+ which executes the flow on the desired system using the
809
+ requirements specified in `@resources`.
810
+
811
+ Parameters
812
+ ----------
813
+ cpu : int, default 1
814
+ Number of CPUs required for this step.
815
+ gpu : int, default 0
816
+ Number of GPUs required for this step.
817
+ disk : int, optional, default None
818
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
819
+ memory : int, default 4096
820
+ Memory size (in MB) required for this step.
821
+ shared_memory : int, optional, default None
822
+ The value for the size (in MiB) of the /dev/shm volume for this step.
823
+ This parameter maps to the `--shm-size` option in Docker.
924
824
  """
925
825
  ...
926
826
 
927
827
  @typing.overload
928
- def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
828
+ def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
929
829
  ...
930
830
 
931
- def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
932
- """
933
- Internal decorator to support Fast bakery
934
- """
831
+ @typing.overload
832
+ def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
935
833
  ...
936
834
 
937
- 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]]]:
835
+ 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):
938
836
  """
939
- Specifies that this step should execute on Kubernetes.
837
+ Specifies the resources needed when executing this step.
838
+
839
+ Use `@resources` to specify the resource requirements
840
+ independently of the specific compute layer (`@batch`, `@kubernetes`).
841
+
842
+ You can choose the compute layer on the command line by executing e.g.
843
+ ```
844
+ python myflow.py run --with batch
845
+ ```
846
+ or
847
+ ```
848
+ python myflow.py run --with kubernetes
849
+ ```
850
+ which executes the flow on the desired system using the
851
+ requirements specified in `@resources`.
940
852
 
941
853
  Parameters
942
854
  ----------
943
855
  cpu : int, default 1
944
- Number of CPUs required for this step. If `@resources` is
945
- also present, the maximum value from all decorators is used.
856
+ Number of CPUs required for this step.
857
+ gpu : int, default 0
858
+ Number of GPUs required for this step.
859
+ disk : int, optional, default None
860
+ Disk size (in MB) required for this step. Only applies on Kubernetes.
946
861
  memory : int, default 4096
947
- Memory size (in MB) required for this step. If
948
- `@resources` is also present, the maximum value from all decorators is
949
- used.
950
- disk : int, default 10240
951
- Disk size (in MB) required for this step. If
952
- `@resources` is also present, the maximum value from all decorators is
953
- used.
954
- image : str, optional, default None
955
- Docker image to use when launching on Kubernetes. If not specified, and
956
- METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
957
- not, a default Docker image mapping to the current version of Python is used.
958
- image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
959
- If given, the imagePullPolicy to be applied to the Docker image of the step.
960
- service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
961
- Kubernetes service account to use when launching pod in Kubernetes.
962
- secrets : List[str], optional, default None
963
- Kubernetes secrets to use when launching pod in Kubernetes. These
964
- secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
965
- in Metaflow configuration.
966
- node_selector: Union[Dict[str,str], str], optional, default None
967
- Kubernetes node selector(s) to apply to the pod running the task.
968
- Can be passed in as a comma separated string of values e.g. "kubernetes.io/os=linux,kubernetes.io/arch=amd64"
969
- or as a dictionary {"kubernetes.io/os": "linux", "kubernetes.io/arch": "amd64"}
970
- namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
971
- Kubernetes namespace to use when launching pod in Kubernetes.
972
- gpu : int, optional, default None
973
- Number of GPUs required for this step. A value of zero implies that
974
- the scheduled node should not have GPUs.
975
- gpu_vendor : str, default KUBERNETES_GPU_VENDOR
976
- The vendor of the GPUs to be used for this step.
977
- tolerations : List[str], default []
978
- The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
979
- Kubernetes tolerations to use when launching pod in Kubernetes.
980
- use_tmpfs : bool, default False
981
- This enables an explicit tmpfs mount for this step.
982
- tmpfs_tempdir : bool, default True
983
- sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
984
- tmpfs_size : int, optional, default: None
985
- The value for the size (in MiB) of the tmpfs mount for this step.
986
- This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
987
- memory allocated for this step.
988
- tmpfs_path : str, optional, default /metaflow_temp
989
- Path to tmpfs mount for this step.
990
- persistent_volume_claims : Dict[str, str], optional, default None
991
- A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
992
- volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
993
- shared_memory: int, optional
994
- Shared memory size (in MiB) required for this step
995
- port: int, optional
996
- Port number to specify in the Kubernetes job object
997
- compute_pool : str, optional, default None
998
- Compute pool to be used for for this step.
999
- If not specified, any accessible compute pool within the perimeter is used.
862
+ Memory size (in MB) required for this step.
863
+ shared_memory : int, optional, default None
864
+ The value for the size (in MiB) of the /dev/shm volume for this step.
865
+ This parameter maps to the `--shm-size` option in Docker.
1000
866
  """
1001
867
  ...
1002
868
 
1003
869
  @typing.overload
1004
- def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
870
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1005
871
  """
1006
- Enables loading / saving of models within a step.
872
+ Internal decorator to support Fast bakery
873
+ """
874
+ ...
875
+
876
+ @typing.overload
877
+ def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
878
+ ...
879
+
880
+ def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
881
+ """
882
+ Internal decorator to support Fast bakery
883
+ """
884
+ ...
885
+
886
+ @typing.overload
887
+ 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]]]:
888
+ """
889
+ Specifies that the step will success under all circumstances.
1007
890
 
891
+ The decorator will create an optional artifact, specified by `var`, which
892
+ contains the exception raised. You can use it to detect the presence
893
+ of errors, indicating that all happy-path artifacts produced by the step
894
+ are missing.
1008
895
 
1009
896
  Parameters
1010
897
  ----------
1011
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
1012
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
1013
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
1014
- - `current.checkpoint`
1015
- - `current.model`
1016
- - `current.huggingface_hub`
1017
-
1018
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
1019
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
1020
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
1021
-
1022
- temp_dir_root : str, default: None
1023
- The root directory under which `current.model.loaded` will store loaded models
1024
-
1025
-
1026
-
898
+ var : str, optional, default None
899
+ Name of the artifact in which to store the caught exception.
900
+ If not specified, the exception is not stored.
901
+ print_exception : bool, default True
902
+ Determines whether or not the exception is printed to
903
+ stdout when caught.
1027
904
  """
1028
905
  ...
1029
906
 
1030
907
  @typing.overload
1031
- def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
908
+ def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1032
909
  ...
1033
910
 
1034
911
  @typing.overload
1035
- def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
912
+ def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1036
913
  ...
1037
914
 
1038
- def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
915
+ 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):
1039
916
  """
1040
- Enables loading / saving of models within a step.
917
+ Specifies that the step will success under all circumstances.
1041
918
 
919
+ The decorator will create an optional artifact, specified by `var`, which
920
+ contains the exception raised. You can use it to detect the presence
921
+ of errors, indicating that all happy-path artifacts produced by the step
922
+ are missing.
1042
923
 
1043
924
  Parameters
1044
925
  ----------
1045
- load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
1046
- Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
1047
- These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
1048
- - `current.checkpoint`
1049
- - `current.model`
1050
- - `current.huggingface_hub`
1051
-
1052
- If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
1053
- the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
1054
- If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
1055
-
1056
- temp_dir_root : str, default: None
1057
- The root directory under which `current.model.loaded` will store loaded models
1058
-
1059
-
1060
-
926
+ var : str, optional, default None
927
+ Name of the artifact in which to store the caught exception.
928
+ If not specified, the exception is not stored.
929
+ print_exception : bool, default True
930
+ Determines whether or not the exception is printed to
931
+ stdout when caught.
1061
932
  """
1062
933
  ...
1063
934
 
1064
- 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]]]:
935
+ @typing.overload
936
+ 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]]]:
1065
937
  """
1066
- Decorator that helps cache, version and store models/datasets from huggingface hub.
938
+ Creates a human-readable report, a Metaflow Card, after this step completes.
939
+
940
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1067
941
 
1068
942
  Parameters
1069
943
  ----------
1070
- temp_dir_root : str, optional
1071
- The root directory that will hold the temporary directory where objects will be downloaded.
944
+ type : str, default 'default'
945
+ Card type.
946
+ id : str, optional, default None
947
+ If multiple cards are present, use this id to identify this card.
948
+ options : Dict[str, Any], default {}
949
+ Options passed to the card. The contents depend on the card type.
950
+ timeout : int, default 45
951
+ Interrupt reporting if it takes more than this many seconds.
1072
952
 
1073
953
 
1074
954
  """
1075
955
  ...
1076
956
 
1077
957
  @typing.overload
1078
- 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]]]:
958
+ def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
959
+ ...
960
+
961
+ @typing.overload
962
+ def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
963
+ ...
964
+
965
+ 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):
1079
966
  """
1080
- Specifies secrets to be retrieved and injected as environment variables prior to
1081
- the execution of a step.
967
+ Creates a human-readable report, a Metaflow Card, after this step completes.
968
+
969
+ Note that you may add multiple `@card` decorators in a step with different parameters.
1082
970
 
1083
971
  Parameters
1084
972
  ----------
1085
- sources : List[Union[str, Dict[str, Any]]], default: []
1086
- List of secret specs, defining how the secrets are to be retrieved
973
+ type : str, default 'default'
974
+ Card type.
975
+ id : str, optional, default None
976
+ If multiple cards are present, use this id to identify this card.
977
+ options : Dict[str, Any], default {}
978
+ Options passed to the card. The contents depend on the card type.
979
+ timeout : int, default 45
980
+ Interrupt reporting if it takes more than this many seconds.
981
+
982
+
1087
983
  """
1088
984
  ...
1089
985
 
1090
986
  @typing.overload
1091
- def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
987
+ def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
988
+ """
989
+ Decorator prototype for all step decorators. This function gets specialized
990
+ and imported for all decorators types by _import_plugin_decorators().
991
+ """
1092
992
  ...
1093
993
 
1094
994
  @typing.overload
1095
- def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
995
+ def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1096
996
  ...
1097
997
 
1098
- 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]]] = []):
998
+ def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1099
999
  """
1100
- Specifies secrets to be retrieved and injected as environment variables prior to
1101
- the execution of a step.
1102
-
1103
- Parameters
1104
- ----------
1105
- sources : List[Union[str, Dict[str, Any]]], default: []
1106
- List of secret specs, defining how the secrets are to be retrieved
1000
+ Decorator prototype for all step decorators. This function gets specialized
1001
+ and imported for all decorators types by _import_plugin_decorators().
1107
1002
  """
1108
1003
  ...
1109
1004
 
@@ -1139,254 +1034,176 @@ def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], Non
1139
1034
  ...
1140
1035
 
1141
1036
  @typing.overload
1142
- 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]]]:
1037
+ 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]]]:
1143
1038
  """
1144
- Specifies that the step will success under all circumstances.
1039
+ Specifies the PyPI packages for the step.
1145
1040
 
1146
- The decorator will create an optional artifact, specified by `var`, which
1147
- contains the exception raised. You can use it to detect the presence
1148
- of errors, indicating that all happy-path artifacts produced by the step
1149
- are missing.
1041
+ Information in this decorator will augment any
1042
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1043
+ you can use `@pypi_base` to set packages required by all
1044
+ steps and use `@pypi` to specify step-specific overrides.
1150
1045
 
1151
1046
  Parameters
1152
1047
  ----------
1153
- var : str, optional, default None
1154
- Name of the artifact in which to store the caught exception.
1155
- If not specified, the exception is not stored.
1156
- print_exception : bool, default True
1157
- Determines whether or not the exception is printed to
1158
- stdout when caught.
1048
+ packages : Dict[str, str], default: {}
1049
+ Packages to use for this step. The key is the name of the package
1050
+ and the value is the version to use.
1051
+ python : str, optional, default: None
1052
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1053
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1159
1054
  """
1160
1055
  ...
1161
1056
 
1162
1057
  @typing.overload
1163
- def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1058
+ def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1164
1059
  ...
1165
1060
 
1166
1061
  @typing.overload
1167
- def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1062
+ def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1168
1063
  ...
1169
1064
 
1170
- 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):
1065
+ 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):
1171
1066
  """
1172
- Specifies that the step will success under all circumstances.
1067
+ Specifies the PyPI packages for the step.
1173
1068
 
1174
- The decorator will create an optional artifact, specified by `var`, which
1175
- contains the exception raised. You can use it to detect the presence
1176
- of errors, indicating that all happy-path artifacts produced by the step
1177
- are missing.
1069
+ Information in this decorator will augment any
1070
+ attributes set in the `@pyi_base` flow-level decorator. Hence,
1071
+ you can use `@pypi_base` to set packages required by all
1072
+ steps and use `@pypi` to specify step-specific overrides.
1178
1073
 
1179
1074
  Parameters
1180
1075
  ----------
1181
- var : str, optional, default None
1182
- Name of the artifact in which to store the caught exception.
1183
- If not specified, the exception is not stored.
1184
- print_exception : bool, default True
1185
- Determines whether or not the exception is printed to
1186
- stdout when caught.
1187
- """
1188
- ...
1189
-
1190
- @typing.overload
1191
- def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1192
- """
1193
- Decorator prototype for all step decorators. This function gets specialized
1194
- and imported for all decorators types by _import_plugin_decorators().
1195
- """
1196
- ...
1197
-
1198
- @typing.overload
1199
- def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1200
- ...
1201
-
1202
- def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
1203
- """
1204
- Decorator prototype for all step decorators. This function gets specialized
1205
- and imported for all decorators types by _import_plugin_decorators().
1076
+ packages : Dict[str, str], default: {}
1077
+ Packages to use for this step. The key is the name of the package
1078
+ and the value is the version to use.
1079
+ python : str, optional, default: None
1080
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1081
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1206
1082
  """
1207
1083
  ...
1208
-
1209
- def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1210
- """
1211
- Specifies what flows belong to the same project.
1212
-
1213
- A project-specific namespace is created for all flows that
1214
- use the same `@project(name)`.
1084
+
1085
+ 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]]]:
1086
+ """
1087
+ Decorator that helps cache, version and store models/datasets from huggingface hub.
1215
1088
 
1216
1089
  Parameters
1217
1090
  ----------
1218
- name : str
1219
- Project name. Make sure that the name is unique amongst all
1220
- projects that use the same production scheduler. The name may
1221
- contain only lowercase alphanumeric characters and underscores.
1091
+ temp_dir_root : str, optional
1092
+ The root directory that will hold the temporary directory where objects will be downloaded.
1222
1093
 
1223
1094
 
1224
1095
  """
1225
1096
  ...
1226
1097
 
1227
- 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]]:
1098
+ @typing.overload
1099
+ 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]]]:
1228
1100
  """
1229
- 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.
1230
- 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.
1101
+ Specifies the number of times the task corresponding
1102
+ to a step needs to be retried.
1103
+
1104
+ This decorator is useful for handling transient errors, such as networking issues.
1105
+ If your task contains operations that can't be retried safely, e.g. database updates,
1106
+ it is advisable to annotate it with `@retry(times=0)`.
1107
+
1108
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1109
+ decorator will execute a no-op task after all retries have been exhausted,
1110
+ ensuring that the flow execution can continue.
1231
1111
 
1232
1112
  Parameters
1233
1113
  ----------
1234
- timeout : int
1235
- Time, in seconds before the task times out and fails. (Default: 3600)
1236
- poke_interval : int
1237
- Time in seconds that the job should wait in between each try. (Default: 60)
1238
- mode : str
1239
- How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1240
- exponential_backoff : bool
1241
- allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1242
- pool : str
1243
- the slot pool this task should run in,
1244
- slot pools are a way to limit concurrency for certain tasks. (Default:None)
1245
- soft_fail : bool
1246
- Set to true to mark the task as SKIPPED on failure. (Default: False)
1247
- name : str
1248
- Name of the sensor on Airflow
1249
- description : str
1250
- Description of sensor in the Airflow UI
1251
- external_dag_id : str
1252
- The dag_id that contains the task you want to wait for.
1253
- external_task_ids : List[str]
1254
- The list of task_ids that you want to wait for.
1255
- If None (default value) the sensor waits for the DAG. (Default: None)
1256
- allowed_states : List[str]
1257
- Iterable of allowed states, (Default: ['success'])
1258
- failed_states : List[str]
1259
- Iterable of failed or dis-allowed states. (Default: None)
1260
- execution_delta : datetime.timedelta
1261
- time difference with the previous execution to look at,
1262
- the default is the same logical date as the current task or DAG. (Default: None)
1263
- check_existence: bool
1264
- Set to True to check if the external task exists or check if
1265
- the DAG to wait for exists. (Default: True)
1114
+ times : int, default 3
1115
+ Number of times to retry this task.
1116
+ minutes_between_retries : int, default 2
1117
+ Number of minutes between retries.
1266
1118
  """
1267
1119
  ...
1268
1120
 
1269
- def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1121
+ @typing.overload
1122
+ def retry(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1123
+ ...
1124
+
1125
+ @typing.overload
1126
+ def retry(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1127
+ ...
1128
+
1129
+ 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):
1270
1130
  """
1271
- This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1272
-
1273
- User code call
1274
- -----------
1275
- @nim(
1276
- models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1277
- backend='managed'
1278
- )
1131
+ Specifies the number of times the task corresponding
1132
+ to a step needs to be retried.
1279
1133
 
1280
- Valid backend options
1281
- ---------------------
1282
- - 'managed': Outerbounds selects a compute provider based on the model.
1283
- - 🚧 'dataplane': Run in your account.
1134
+ This decorator is useful for handling transient errors, such as networking issues.
1135
+ If your task contains operations that can't be retried safely, e.g. database updates,
1136
+ it is advisable to annotate it with `@retry(times=0)`.
1284
1137
 
1285
- Valid model options
1286
- ----------------
1287
- - 'meta/llama3-8b-instruct': 8B parameter model
1288
- - 'meta/llama3-70b-instruct': 70B parameter model
1289
- - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1138
+ This can be used in conjunction with the `@catch` decorator. The `@catch`
1139
+ decorator will execute a no-op task after all retries have been exhausted,
1140
+ ensuring that the flow execution can continue.
1290
1141
 
1291
1142
  Parameters
1292
1143
  ----------
1293
- models: list[NIM]
1294
- List of NIM containers running models in sidecars.
1295
- backend: str
1296
- Compute provider to run the NIM container.
1144
+ times : int, default 3
1145
+ Number of times to retry this task.
1146
+ minutes_between_retries : int, default 2
1147
+ Number of minutes between retries.
1297
1148
  """
1298
1149
  ...
1299
1150
 
1300
1151
  @typing.overload
1301
- def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1152
+ def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
1302
1153
  """
1303
- Specifies the event(s) that this flow depends on.
1304
-
1305
- ```
1306
- @trigger(event='foo')
1307
- ```
1308
- or
1309
- ```
1310
- @trigger(events=['foo', 'bar'])
1311
- ```
1312
-
1313
- Additionally, you can specify the parameter mappings
1314
- to map event payload to Metaflow parameters for the flow.
1315
- ```
1316
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1317
- ```
1318
- or
1319
- ```
1320
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1321
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1322
- ```
1154
+ Enables loading / saving of models within a step.
1323
1155
 
1324
- 'parameters' can also be a list of strings and tuples like so:
1325
- ```
1326
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1327
- ```
1328
- This is equivalent to:
1329
- ```
1330
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1331
- ```
1332
1156
 
1333
1157
  Parameters
1334
1158
  ----------
1335
- event : Union[str, Dict[str, Any]], optional, default None
1336
- Event dependency for this flow.
1337
- events : List[Union[str, Dict[str, Any]]], default []
1338
- Events dependency for this flow.
1339
- options : Dict[str, Any], default {}
1340
- Backend-specific configuration for tuning eventing behavior.
1159
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
1160
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
1161
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
1162
+ - `current.checkpoint`
1163
+ - `current.model`
1164
+ - `current.huggingface_hub`
1165
+
1166
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
1167
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
1168
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
1169
+
1170
+ temp_dir_root : str, default: None
1171
+ The root directory under which `current.model.loaded` will store loaded models
1172
+
1341
1173
 
1342
1174
 
1343
1175
  """
1344
1176
  ...
1345
1177
 
1346
1178
  @typing.overload
1347
- def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1179
+ def model(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
1348
1180
  ...
1349
1181
 
1350
- def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1182
+ @typing.overload
1183
+ def model(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
1184
+ ...
1185
+
1186
+ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None):
1351
1187
  """
1352
- Specifies the event(s) that this flow depends on.
1353
-
1354
- ```
1355
- @trigger(event='foo')
1356
- ```
1357
- or
1358
- ```
1359
- @trigger(events=['foo', 'bar'])
1360
- ```
1361
-
1362
- Additionally, you can specify the parameter mappings
1363
- to map event payload to Metaflow parameters for the flow.
1364
- ```
1365
- @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1366
- ```
1367
- or
1368
- ```
1369
- @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1370
- {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1371
- ```
1188
+ Enables loading / saving of models within a step.
1372
1189
 
1373
- 'parameters' can also be a list of strings and tuples like so:
1374
- ```
1375
- @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1376
- ```
1377
- This is equivalent to:
1378
- ```
1379
- @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1380
- ```
1381
1190
 
1382
1191
  Parameters
1383
1192
  ----------
1384
- event : Union[str, Dict[str, Any]], optional, default None
1385
- Event dependency for this flow.
1386
- events : List[Union[str, Dict[str, Any]]], default []
1387
- Events dependency for this flow.
1388
- options : Dict[str, Any], default {}
1389
- Backend-specific configuration for tuning eventing behavior.
1193
+ load : Union[List[str],str,List[Tuple[str,Union[str,None]]]], default: None
1194
+ Artifact name/s referencing the models/checkpoints to load. Artifact names refer to the names of the instance variables set to `self`.
1195
+ These artifact names give to `load` be reference objects or reference `key` string's from objects created by:
1196
+ - `current.checkpoint`
1197
+ - `current.model`
1198
+ - `current.huggingface_hub`
1199
+
1200
+ If a list of tuples is provided, the first element is the artifact name and the second element is the path the artifact needs be unpacked on
1201
+ the local filesystem. If the second element is None, the artifact will be unpacked in the current working directory.
1202
+ If a string is provided, then the artifact corresponding to that name will be loaded in the current working directory.
1203
+
1204
+ temp_dir_root : str, default: None
1205
+ The root directory under which `current.model.loaded` will store loaded models
1206
+
1390
1207
 
1391
1208
 
1392
1209
  """
@@ -1470,28 +1287,119 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
1470
1287
  @trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
1471
1288
  ```
1472
1289
 
1473
- You can also specify just the project or project branch (other values will be
1474
- inferred from the current project or project branch):
1475
- ```
1476
- @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1477
- ```
1290
+ You can also specify just the project or project branch (other values will be
1291
+ inferred from the current project or project branch):
1292
+ ```
1293
+ @trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
1294
+ ```
1295
+
1296
+ Note that `branch` is typically one of:
1297
+ - `prod`
1298
+ - `user.bob`
1299
+ - `test.my_experiment`
1300
+ - `prod.staging`
1301
+
1302
+ Parameters
1303
+ ----------
1304
+ flow : Union[str, Dict[str, str]], optional, default None
1305
+ Upstream flow dependency for this flow.
1306
+ flows : List[Union[str, Dict[str, str]]], default []
1307
+ Upstream flow dependencies for this flow.
1308
+ options : Dict[str, Any], default {}
1309
+ Backend-specific configuration for tuning eventing behavior.
1310
+
1311
+
1312
+ """
1313
+ ...
1314
+
1315
+ def nim(*, models: "list[NIM]", backend: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1316
+ """
1317
+ This decorator is used to run NIM containers in Metaflow tasks as sidecars.
1318
+
1319
+ User code call
1320
+ -----------
1321
+ @nim(
1322
+ models=['meta/llama3-8b-instruct', 'meta/llama3-70b-instruct'],
1323
+ backend='managed'
1324
+ )
1325
+
1326
+ Valid backend options
1327
+ ---------------------
1328
+ - 'managed': Outerbounds selects a compute provider based on the model.
1329
+ - 🚧 'dataplane': Run in your account.
1330
+
1331
+ Valid model options
1332
+ ----------------
1333
+ - 'meta/llama3-8b-instruct': 8B parameter model
1334
+ - 'meta/llama3-70b-instruct': 70B parameter model
1335
+ - Upon request, any model here: https://nvcf.ngc.nvidia.com/functions?filter=nvidia-functions
1336
+
1337
+ Parameters
1338
+ ----------
1339
+ models: list[NIM]
1340
+ List of NIM containers running models in sidecars.
1341
+ backend: str
1342
+ Compute provider to run the NIM container.
1343
+ """
1344
+ ...
1345
+
1346
+ def project(*, name: str) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1347
+ """
1348
+ Specifies what flows belong to the same project.
1478
1349
 
1479
- Note that `branch` is typically one of:
1480
- - `prod`
1481
- - `user.bob`
1482
- - `test.my_experiment`
1483
- - `prod.staging`
1350
+ A project-specific namespace is created for all flows that
1351
+ use the same `@project(name)`.
1484
1352
 
1485
1353
  Parameters
1486
1354
  ----------
1487
- flow : Union[str, Dict[str, str]], optional, default None
1488
- Upstream flow dependency for this flow.
1489
- flows : List[Union[str, Dict[str, str]]], default []
1490
- Upstream flow dependencies for this flow.
1491
- options : Dict[str, Any], default {}
1492
- Backend-specific configuration for tuning eventing behavior.
1355
+ name : str
1356
+ Project name. Make sure that the name is unique amongst all
1357
+ projects that use the same production scheduler. The name may
1358
+ contain only lowercase alphanumeric characters and underscores.
1359
+
1493
1360
 
1361
+ """
1362
+ ...
1363
+
1364
+ 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]]:
1365
+ """
1366
+ 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.
1367
+ 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.
1494
1368
 
1369
+ Parameters
1370
+ ----------
1371
+ timeout : int
1372
+ Time, in seconds before the task times out and fails. (Default: 3600)
1373
+ poke_interval : int
1374
+ Time in seconds that the job should wait in between each try. (Default: 60)
1375
+ mode : str
1376
+ How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
1377
+ exponential_backoff : bool
1378
+ allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
1379
+ pool : str
1380
+ the slot pool this task should run in,
1381
+ slot pools are a way to limit concurrency for certain tasks. (Default:None)
1382
+ soft_fail : bool
1383
+ Set to true to mark the task as SKIPPED on failure. (Default: False)
1384
+ name : str
1385
+ Name of the sensor on Airflow
1386
+ description : str
1387
+ Description of sensor in the Airflow UI
1388
+ external_dag_id : str
1389
+ The dag_id that contains the task you want to wait for.
1390
+ external_task_ids : List[str]
1391
+ The list of task_ids that you want to wait for.
1392
+ If None (default value) the sensor waits for the DAG. (Default: None)
1393
+ allowed_states : List[str]
1394
+ Iterable of allowed states, (Default: ['success'])
1395
+ failed_states : List[str]
1396
+ Iterable of failed or dis-allowed states. (Default: None)
1397
+ execution_delta : datetime.timedelta
1398
+ time difference with the previous execution to look at,
1399
+ the default is the same logical date as the current task or DAG. (Default: None)
1400
+ check_existence: bool
1401
+ Set to True to check if the external task exists or check if
1402
+ the DAG to wait for exists. (Default: True)
1495
1403
  """
1496
1404
  ...
1497
1405
 
@@ -1544,45 +1452,6 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
1544
1452
  """
1545
1453
  ...
1546
1454
 
1547
- @typing.overload
1548
- def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1549
- """
1550
- Specifies the PyPI packages for all steps of the flow.
1551
-
1552
- Use `@pypi_base` to set common packages required by all
1553
- steps and use `@pypi` to specify step-specific overrides.
1554
- Parameters
1555
- ----------
1556
- packages : Dict[str, str], default: {}
1557
- Packages to use for this flow. The key is the name of the package
1558
- and the value is the version to use.
1559
- python : str, optional, default: None
1560
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1561
- that the version used will correspond to the version of the Python interpreter used to start the run.
1562
- """
1563
- ...
1564
-
1565
- @typing.overload
1566
- def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1567
- ...
1568
-
1569
- def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1570
- """
1571
- Specifies the PyPI packages for all steps of the flow.
1572
-
1573
- Use `@pypi_base` to set common packages required by all
1574
- steps and use `@pypi` to specify step-specific overrides.
1575
- Parameters
1576
- ----------
1577
- packages : Dict[str, str], default: {}
1578
- Packages to use for this flow. The key is the name of the package
1579
- and the value is the version to use.
1580
- python : str, optional, default: None
1581
- Version of Python to use, e.g. '3.7.4'. A default value of None implies
1582
- that the version used will correspond to the version of the Python interpreter used to start the run.
1583
- """
1584
- ...
1585
-
1586
1455
  @typing.overload
1587
1456
  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]]:
1588
1457
  """
@@ -1632,6 +1501,45 @@ def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly:
1632
1501
  """
1633
1502
  ...
1634
1503
 
1504
+ @typing.overload
1505
+ def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1506
+ """
1507
+ Specifies the PyPI packages for all steps of the flow.
1508
+
1509
+ Use `@pypi_base` to set common packages required by all
1510
+ steps and use `@pypi` to specify step-specific overrides.
1511
+ Parameters
1512
+ ----------
1513
+ packages : Dict[str, str], default: {}
1514
+ Packages to use for this flow. The key is the name of the package
1515
+ and the value is the version to use.
1516
+ python : str, optional, default: None
1517
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1518
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1519
+ """
1520
+ ...
1521
+
1522
+ @typing.overload
1523
+ def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1524
+ ...
1525
+
1526
+ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
1527
+ """
1528
+ Specifies the PyPI packages for all steps of the flow.
1529
+
1530
+ Use `@pypi_base` to set common packages required by all
1531
+ steps and use `@pypi` to specify step-specific overrides.
1532
+ Parameters
1533
+ ----------
1534
+ packages : Dict[str, str], default: {}
1535
+ Packages to use for this flow. The key is the name of the package
1536
+ and the value is the version to use.
1537
+ python : str, optional, default: None
1538
+ Version of Python to use, e.g. '3.7.4'. A default value of None implies
1539
+ that the version used will correspond to the version of the Python interpreter used to start the run.
1540
+ """
1541
+ ...
1542
+
1635
1543
  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]]:
1636
1544
  """
1637
1545
  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)
@@ -1674,6 +1582,101 @@ def airflow_s3_key_sensor(*, timeout: int, poke_interval: int, mode: str, expone
1674
1582
  """
1675
1583
  ...
1676
1584
 
1585
+ @typing.overload
1586
+ def trigger(*, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
1587
+ """
1588
+ Specifies the event(s) that this flow depends on.
1589
+
1590
+ ```
1591
+ @trigger(event='foo')
1592
+ ```
1593
+ or
1594
+ ```
1595
+ @trigger(events=['foo', 'bar'])
1596
+ ```
1597
+
1598
+ Additionally, you can specify the parameter mappings
1599
+ to map event payload to Metaflow parameters for the flow.
1600
+ ```
1601
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1602
+ ```
1603
+ or
1604
+ ```
1605
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1606
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1607
+ ```
1608
+
1609
+ 'parameters' can also be a list of strings and tuples like so:
1610
+ ```
1611
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1612
+ ```
1613
+ This is equivalent to:
1614
+ ```
1615
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1616
+ ```
1617
+
1618
+ Parameters
1619
+ ----------
1620
+ event : Union[str, Dict[str, Any]], optional, default None
1621
+ Event dependency for this flow.
1622
+ events : List[Union[str, Dict[str, Any]]], default []
1623
+ Events dependency for this flow.
1624
+ options : Dict[str, Any], default {}
1625
+ Backend-specific configuration for tuning eventing behavior.
1626
+
1627
+
1628
+ """
1629
+ ...
1630
+
1631
+ @typing.overload
1632
+ def trigger(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
1633
+ ...
1634
+
1635
+ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: typing.Union[str, typing.Dict[str, typing.Any], None] = None, events: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], options: typing.Dict[str, typing.Any] = {}):
1636
+ """
1637
+ Specifies the event(s) that this flow depends on.
1638
+
1639
+ ```
1640
+ @trigger(event='foo')
1641
+ ```
1642
+ or
1643
+ ```
1644
+ @trigger(events=['foo', 'bar'])
1645
+ ```
1646
+
1647
+ Additionally, you can specify the parameter mappings
1648
+ to map event payload to Metaflow parameters for the flow.
1649
+ ```
1650
+ @trigger(event={'name':'foo', 'parameters':{'flow_param': 'event_field'}})
1651
+ ```
1652
+ or
1653
+ ```
1654
+ @trigger(events=[{'name':'foo', 'parameters':{'flow_param_1': 'event_field_1'},
1655
+ {'name':'bar', 'parameters':{'flow_param_2': 'event_field_2'}])
1656
+ ```
1657
+
1658
+ 'parameters' can also be a list of strings and tuples like so:
1659
+ ```
1660
+ @trigger(event={'name':'foo', 'parameters':['common_name', ('flow_param', 'event_field')]})
1661
+ ```
1662
+ This is equivalent to:
1663
+ ```
1664
+ @trigger(event={'name':'foo', 'parameters':{'common_name': 'common_name', 'flow_param': 'event_field'}})
1665
+ ```
1666
+
1667
+ Parameters
1668
+ ----------
1669
+ event : Union[str, Dict[str, Any]], optional, default None
1670
+ Event dependency for this flow.
1671
+ events : List[Union[str, Dict[str, Any]]], default []
1672
+ Events dependency for this flow.
1673
+ options : Dict[str, Any], default {}
1674
+ Backend-specific configuration for tuning eventing behavior.
1675
+
1676
+
1677
+ """
1678
+ ...
1679
+
1677
1680
  def namespace(ns: typing.Optional[str]) -> typing.Optional[str]:
1678
1681
  """
1679
1682
  Switch namespace to the one provided.
@@ -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
  """