ob-metaflow-stubs 6.0.4.5__py2.py3-none-any.whl → 6.0.4.6rc0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- metaflow-stubs/__init__.pyi +781 -781
- metaflow-stubs/cards.pyi +1 -1
- metaflow-stubs/cli.pyi +1 -1
- metaflow-stubs/cli_components/__init__.pyi +1 -1
- metaflow-stubs/cli_components/utils.pyi +1 -1
- metaflow-stubs/client/__init__.pyi +1 -1
- metaflow-stubs/client/core.pyi +5 -5
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +1 -1
- metaflow-stubs/exception.pyi +1 -1
- metaflow-stubs/flowspec.pyi +3 -3
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +3 -3
- metaflow-stubs/info_file.pyi +1 -1
- metaflow-stubs/metadata_provider/__init__.pyi +1 -1
- metaflow-stubs/metadata_provider/heartbeat.pyi +1 -1
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +1 -1
- metaflow-stubs/metaflow_config.pyi +1 -1
- metaflow-stubs/metaflow_current.pyi +53 -53
- metaflow-stubs/metaflow_git.pyi +1 -1
- metaflow-stubs/mf_extensions/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/async_cards.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/deco_injection_mixin.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/checkpoint_lister.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/lineage_card.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/core.pyi +4 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/decorator.pyi +4 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/context.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/core.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/decorator.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/model_storage.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/identity_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +1 -1
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/tar.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/tar_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_state_machine.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/spinners.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_cli.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_config.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/capsule.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/click_importer.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/code_packager.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/cli_generator.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/config_utils.pyi +4 -4
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/schema_export.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/typed_configs.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/unified_config.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/dependencies.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/deployer.pyi +5 -5
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/experimental/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/perimeters.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/utils.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/plugins/aws/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/aws/assume_role_decorator.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/async_cards.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/baker.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/docker_environment.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/fast_bakery.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/pod_killer.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/constants.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/exceptions.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/status_card.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +1 -1
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +1 -1
- metaflow-stubs/multicore_utils.pyi +1 -1
- metaflow-stubs/ob_internal.pyi +1 -1
- metaflow-stubs/parameters.pyi +3 -3
- metaflow-stubs/plugins/__init__.pyi +11 -11
- metaflow-stubs/plugins/airflow/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +1 -1
- metaflow-stubs/plugins/airflow/exception.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +1 -1
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +1 -1
- metaflow-stubs/plugins/argo/__init__.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_client.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_events.pyi +1 -1
- metaflow-stubs/plugins/argo/argo_workflows.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +2 -2
- metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/aws_client.pyi +1 -1
- metaflow-stubs/plugins/aws/aws_utils.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +1 -1
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +1 -1
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +1 -1
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +3 -3
- metaflow-stubs/plugins/azure/__init__.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_credential.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +1 -1
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/azure/azure_utils.pyi +1 -1
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +1 -1
- metaflow-stubs/plugins/azure/includefile_support.pyi +1 -1
- metaflow-stubs/plugins/cards/__init__.pyi +1 -1
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +1 -1
- metaflow-stubs/plugins/cards/card_datastore.pyi +1 -1
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/card.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/components.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +1 -1
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +1 -1
- metaflow-stubs/plugins/cards/card_resolver.pyi +1 -1
- metaflow-stubs/plugins/cards/component_serializer.pyi +1 -1
- metaflow-stubs/plugins/cards/exception.pyi +1 -1
- metaflow-stubs/plugins/catch_decorator.pyi +1 -1
- metaflow-stubs/plugins/datatools/__init__.pyi +1 -1
- metaflow-stubs/plugins/datatools/local.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +1 -1
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +1 -1
- metaflow-stubs/plugins/debug_logger.pyi +1 -1
- metaflow-stubs/plugins/debug_monitor.pyi +1 -1
- metaflow-stubs/plugins/environment_decorator.pyi +1 -1
- metaflow-stubs/plugins/events_decorator.pyi +1 -1
- metaflow-stubs/plugins/exit_hook/__init__.pyi +1 -1
- metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +1 -1
- metaflow-stubs/plugins/frameworks/__init__.pyi +1 -1
- metaflow-stubs/plugins/frameworks/pytorch.pyi +1 -1
- metaflow-stubs/plugins/gcp/__init__.pyi +1 -1
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +1 -1
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +1 -1
- metaflow-stubs/plugins/gcp/gs_utils.pyi +1 -1
- metaflow-stubs/plugins/gcp/includefile_support.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/__init__.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +1 -1
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +1 -1
- metaflow-stubs/plugins/ollama/__init__.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +1 -1
- metaflow-stubs/plugins/perimeters.pyi +1 -1
- metaflow-stubs/plugins/project_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/conda_environment.pyi +3 -3
- metaflow-stubs/plugins/pypi/parsers.pyi +1 -1
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +1 -1
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +1 -1
- metaflow-stubs/plugins/pypi/utils.pyi +1 -1
- metaflow-stubs/plugins/resources_decorator.pyi +1 -1
- metaflow-stubs/plugins/retry_decorator.pyi +1 -1
- metaflow-stubs/plugins/secrets/__init__.pyi +2 -2
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +1 -1
- metaflow-stubs/plugins/secrets/secrets_func.pyi +1 -1
- metaflow-stubs/plugins/secrets/secrets_spec.pyi +1 -1
- metaflow-stubs/plugins/secrets/utils.pyi +1 -1
- metaflow-stubs/plugins/snowflake/__init__.pyi +1 -1
- metaflow-stubs/plugins/storage_executor.pyi +1 -1
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +1 -1
- metaflow-stubs/plugins/timeout_decorator.pyi +1 -1
- metaflow-stubs/plugins/torchtune/__init__.pyi +1 -1
- metaflow-stubs/plugins/uv/__init__.pyi +1 -1
- metaflow-stubs/plugins/uv/uv_environment.pyi +1 -1
- metaflow-stubs/profilers/__init__.pyi +1 -1
- metaflow-stubs/pylint_wrapper.pyi +1 -1
- metaflow-stubs/runner/__init__.pyi +1 -1
- metaflow-stubs/runner/deployer.pyi +28 -28
- metaflow-stubs/runner/deployer_impl.pyi +1 -1
- metaflow-stubs/runner/metaflow_runner.pyi +4 -4
- metaflow-stubs/runner/nbdeploy.pyi +1 -1
- metaflow-stubs/runner/nbrun.pyi +1 -1
- metaflow-stubs/runner/subprocess_manager.pyi +1 -1
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +1 -1
- metaflow-stubs/system/system_logger.pyi +1 -1
- metaflow-stubs/system/system_monitor.pyi +1 -1
- metaflow-stubs/tagging_util.pyi +1 -1
- metaflow-stubs/tuple_util.pyi +1 -1
- metaflow-stubs/user_configs/__init__.pyi +1 -1
- metaflow-stubs/user_configs/config_decorators.pyi +3 -3
- metaflow-stubs/user_configs/config_options.pyi +3 -3
- metaflow-stubs/user_configs/config_parameters.pyi +6 -6
- {ob_metaflow_stubs-6.0.4.5.dist-info → ob_metaflow_stubs-6.0.4.6rc0.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.4.6rc0.dist-info/RECORD +249 -0
- ob_metaflow_stubs-6.0.4.5.dist-info/RECORD +0 -249
- {ob_metaflow_stubs-6.0.4.5.dist-info → ob_metaflow_stubs-6.0.4.6rc0.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.4.5.dist-info → ob_metaflow_stubs-6.0.4.6rc0.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
3
|
# MF version: 2.15.21.2+obcheckpoint(0.2.4);ob(v1) #
|
4
|
-
# Generated on 2025-07-
|
4
|
+
# Generated on 2025-07-16T22:08:50.283182 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
@@ -35,17 +35,17 @@ from .user_configs.config_parameters import ConfigValue as ConfigValue
|
|
35
35
|
from .user_configs.config_parameters import config_expr as config_expr
|
36
36
|
from .user_configs.config_decorators import CustomFlowDecorator as CustomFlowDecorator
|
37
37
|
from .user_configs.config_decorators import CustomStepDecorator as CustomStepDecorator
|
38
|
+
from . import events as events
|
39
|
+
from . import metaflow_git as metaflow_git
|
38
40
|
from . import cards as cards
|
39
41
|
from . import tuple_util as tuple_util
|
40
|
-
from . import metaflow_git as metaflow_git
|
41
|
-
from . import events as events
|
42
42
|
from . import runner as runner
|
43
43
|
from . import plugins as plugins
|
44
44
|
from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
|
45
45
|
from . import includefile as includefile
|
46
46
|
from .includefile import IncludeFile as IncludeFile
|
47
|
-
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
48
47
|
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
48
|
+
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
49
49
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
50
50
|
from . import client as client
|
51
51
|
from .client.core import namespace as namespace
|
@@ -156,25 +156,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
156
156
|
"""
|
157
157
|
...
|
158
158
|
|
159
|
-
@typing.overload
|
160
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
161
|
-
"""
|
162
|
-
Decorator prototype for all step decorators. This function gets specialized
|
163
|
-
and imported for all decorators types by _import_plugin_decorators().
|
164
|
-
"""
|
165
|
-
...
|
166
|
-
|
167
|
-
@typing.overload
|
168
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
169
|
-
...
|
170
|
-
|
171
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
172
|
-
"""
|
173
|
-
Decorator prototype for all step decorators. This function gets specialized
|
174
|
-
and imported for all decorators types by _import_plugin_decorators().
|
175
|
-
"""
|
176
|
-
...
|
177
|
-
|
178
159
|
@typing.overload
|
179
160
|
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]]]:
|
180
161
|
"""
|
@@ -234,447 +215,186 @@ def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None],
|
|
234
215
|
"""
|
235
216
|
...
|
236
217
|
|
237
|
-
|
238
|
-
def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
218
|
+
def nvct(*, gpu: int, gpu_type: str) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
239
219
|
"""
|
240
|
-
Specifies
|
241
|
-
|
242
|
-
Use `@resources` to specify the resource requirements
|
243
|
-
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
244
|
-
|
245
|
-
You can choose the compute layer on the command line by executing e.g.
|
246
|
-
```
|
247
|
-
python myflow.py run --with batch
|
248
|
-
```
|
249
|
-
or
|
250
|
-
```
|
251
|
-
python myflow.py run --with kubernetes
|
252
|
-
```
|
253
|
-
which executes the flow on the desired system using the
|
254
|
-
requirements specified in `@resources`.
|
220
|
+
Specifies that this step should execute on DGX cloud.
|
255
221
|
|
256
222
|
|
257
223
|
Parameters
|
258
224
|
----------
|
259
|
-
|
260
|
-
Number of
|
261
|
-
|
262
|
-
|
263
|
-
disk : int, optional, default None
|
264
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
265
|
-
memory : int, default 4096
|
266
|
-
Memory size (in MB) required for this step.
|
267
|
-
shared_memory : int, optional, default None
|
268
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
269
|
-
This parameter maps to the `--shm-size` option in Docker.
|
225
|
+
gpu : int
|
226
|
+
Number of GPUs to use.
|
227
|
+
gpu_type : str
|
228
|
+
Type of Nvidia GPU to use.
|
270
229
|
"""
|
271
230
|
...
|
272
231
|
|
273
232
|
@typing.overload
|
274
|
-
def
|
233
|
+
def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
234
|
+
"""
|
235
|
+
Decorator prototype for all step decorators. This function gets specialized
|
236
|
+
and imported for all decorators types by _import_plugin_decorators().
|
237
|
+
"""
|
275
238
|
...
|
276
239
|
|
277
240
|
@typing.overload
|
278
|
-
def
|
241
|
+
def app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
279
242
|
...
|
280
243
|
|
281
|
-
def
|
244
|
+
def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
282
245
|
"""
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
```
|
294
|
-
python myflow.py run --with kubernetes
|
295
|
-
```
|
296
|
-
which executes the flow on the desired system using the
|
297
|
-
requirements specified in `@resources`.
|
246
|
+
Decorator prototype for all step decorators. This function gets specialized
|
247
|
+
and imported for all decorators types by _import_plugin_decorators().
|
248
|
+
"""
|
249
|
+
...
|
250
|
+
|
251
|
+
@typing.overload
|
252
|
+
def secrets(*, sources: typing.List[typing.Union[str, typing.Dict[str, typing.Any]]] = [], role: 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]]]:
|
253
|
+
"""
|
254
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
255
|
+
the execution of a step.
|
298
256
|
|
299
257
|
|
300
258
|
Parameters
|
301
259
|
----------
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
disk : int, optional, default None
|
307
|
-
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
308
|
-
memory : int, default 4096
|
309
|
-
Memory size (in MB) required for this step.
|
310
|
-
shared_memory : int, optional, default None
|
311
|
-
The value for the size (in MiB) of the /dev/shm volume for this step.
|
312
|
-
This parameter maps to the `--shm-size` option in Docker.
|
260
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
261
|
+
List of secret specs, defining how the secrets are to be retrieved
|
262
|
+
role : str, optional, default: None
|
263
|
+
Role to use for fetching secrets
|
313
264
|
"""
|
314
265
|
...
|
315
266
|
|
316
|
-
|
267
|
+
@typing.overload
|
268
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
269
|
+
...
|
270
|
+
|
271
|
+
@typing.overload
|
272
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
273
|
+
...
|
274
|
+
|
275
|
+
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]]] = [], role: typing.Optional[str] = None):
|
317
276
|
"""
|
318
|
-
|
319
|
-
|
320
|
-
> Examples
|
321
|
-
|
322
|
-
**Usage: creating references of models from huggingface that may be loaded in downstream steps**
|
323
|
-
```python
|
324
|
-
@huggingface_hub
|
325
|
-
@step
|
326
|
-
def pull_model_from_huggingface(self):
|
327
|
-
# `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
|
328
|
-
# and saves it in the backend storage based on the model's `repo_id`. If there exists a model
|
329
|
-
# with the same `repo_id` in the backend storage, it will not download the model again. The return
|
330
|
-
# value of the function is a reference to the model in the backend storage.
|
331
|
-
# This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
|
332
|
-
|
333
|
-
self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
|
334
|
-
self.llama_model = current.huggingface_hub.snapshot_download(
|
335
|
-
repo_id=self.model_id,
|
336
|
-
allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
|
337
|
-
)
|
338
|
-
self.next(self.train)
|
339
|
-
```
|
340
|
-
|
341
|
-
**Usage: loading models directly from huggingface hub or from cache (from metaflow's datastore)**
|
342
|
-
```python
|
343
|
-
@huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
|
344
|
-
@step
|
345
|
-
def pull_model_from_huggingface(self):
|
346
|
-
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
347
|
-
```
|
348
|
-
|
349
|
-
```python
|
350
|
-
@huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora, "/my-lora-directory")])
|
351
|
-
@step
|
352
|
-
def finetune_model(self):
|
353
|
-
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
354
|
-
# path_to_model will be /my-directory
|
355
|
-
```
|
356
|
-
|
357
|
-
```python
|
358
|
-
# Takes all the arguments passed to `snapshot_download`
|
359
|
-
# except for `local_dir`
|
360
|
-
@huggingface_hub(load=[
|
361
|
-
{
|
362
|
-
"repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
|
363
|
-
},
|
364
|
-
{
|
365
|
-
"repo_id": "myorg/mistral-lora",
|
366
|
-
"repo_type": "model",
|
367
|
-
},
|
368
|
-
])
|
369
|
-
@step
|
370
|
-
def finetune_model(self):
|
371
|
-
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
372
|
-
# path_to_model will be /my-directory
|
373
|
-
```
|
277
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
278
|
+
the execution of a step.
|
374
279
|
|
375
280
|
|
376
281
|
Parameters
|
377
282
|
----------
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
The list of repos (models/datasets) to load.
|
383
|
-
|
384
|
-
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
385
|
-
|
386
|
-
- If repo (model/dataset) is not found in the datastore:
|
387
|
-
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
388
|
-
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
389
|
-
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
390
|
-
|
391
|
-
- If repo is found in the datastore:
|
392
|
-
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
283
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
284
|
+
List of secret specs, defining how the secrets are to be retrieved
|
285
|
+
role : str, optional, default: None
|
286
|
+
Role to use for fetching secrets
|
393
287
|
"""
|
394
288
|
...
|
395
289
|
|
396
290
|
@typing.overload
|
397
|
-
def
|
291
|
+
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]]]:
|
398
292
|
"""
|
399
|
-
|
293
|
+
Specifies the PyPI packages for the step.
|
400
294
|
|
401
|
-
|
295
|
+
Information in this decorator will augment any
|
296
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
297
|
+
you can use `@pypi_base` to set packages required by all
|
298
|
+
steps and use `@pypi` to specify step-specific overrides.
|
402
299
|
|
403
300
|
|
404
301
|
Parameters
|
405
302
|
----------
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
timeout : int, default 45
|
413
|
-
Interrupt reporting if it takes more than this many seconds.
|
303
|
+
packages : Dict[str, str], default: {}
|
304
|
+
Packages to use for this step. The key is the name of the package
|
305
|
+
and the value is the version to use.
|
306
|
+
python : str, optional, default: None
|
307
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
308
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
414
309
|
"""
|
415
310
|
...
|
416
311
|
|
417
312
|
@typing.overload
|
418
|
-
def
|
313
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
419
314
|
...
|
420
315
|
|
421
316
|
@typing.overload
|
422
|
-
def
|
317
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
423
318
|
...
|
424
319
|
|
425
|
-
def
|
320
|
+
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):
|
426
321
|
"""
|
427
|
-
|
322
|
+
Specifies the PyPI packages for the step.
|
428
323
|
|
429
|
-
|
324
|
+
Information in this decorator will augment any
|
325
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
326
|
+
you can use `@pypi_base` to set packages required by all
|
327
|
+
steps and use `@pypi` to specify step-specific overrides.
|
430
328
|
|
431
329
|
|
432
330
|
Parameters
|
433
331
|
----------
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
timeout : int, default 45
|
441
|
-
Interrupt reporting if it takes more than this many seconds.
|
332
|
+
packages : Dict[str, str], default: {}
|
333
|
+
Packages to use for this step. The key is the name of the package
|
334
|
+
and the value is the version to use.
|
335
|
+
python : str, optional, default: None
|
336
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
337
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
442
338
|
"""
|
443
339
|
...
|
444
340
|
|
445
|
-
def
|
341
|
+
def ollama(*, models: list, backend: str, force_pull: bool, cache_update_policy: str, force_cache_update: bool, debug: bool, circuit_breaker_config: dict, timeout_config: dict) -> 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]]]:
|
446
342
|
"""
|
447
|
-
This decorator is used to run
|
343
|
+
This decorator is used to run Ollama APIs as Metaflow task sidecars.
|
448
344
|
|
449
345
|
User code call
|
450
346
|
--------------
|
451
|
-
@
|
452
|
-
|
347
|
+
@ollama(
|
348
|
+
models=[...],
|
453
349
|
...
|
454
350
|
)
|
455
351
|
|
456
352
|
Valid backend options
|
457
353
|
---------------------
|
458
354
|
- 'local': Run as a separate process on the local task machine.
|
355
|
+
- (TODO) 'managed': Outerbounds hosts and selects compute provider.
|
356
|
+
- (TODO) 'remote': Spin up separate instance to serve Ollama models.
|
459
357
|
|
460
358
|
Valid model options
|
461
359
|
-------------------
|
462
|
-
Any
|
463
|
-
|
464
|
-
NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
|
465
|
-
If you need multiple models, you must create multiple @vllm decorators.
|
360
|
+
Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
|
466
361
|
|
467
362
|
|
468
363
|
Parameters
|
469
364
|
----------
|
470
|
-
|
471
|
-
|
365
|
+
models: list[str]
|
366
|
+
List of Ollama containers running models in sidecars.
|
472
367
|
backend: str
|
473
|
-
Determines where and how to run the
|
474
|
-
|
475
|
-
Whether to
|
476
|
-
|
477
|
-
|
368
|
+
Determines where and how to run the Ollama process.
|
369
|
+
force_pull: bool
|
370
|
+
Whether to run `ollama pull` no matter what, or first check the remote cache in Metaflow datastore for this model key.
|
371
|
+
cache_update_policy: str
|
372
|
+
Cache update policy: "auto", "force", or "never".
|
373
|
+
force_cache_update: bool
|
374
|
+
Simple override for "force" cache update policy.
|
478
375
|
debug: bool
|
479
376
|
Whether to turn on verbose debugging logs.
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
Maximum number of retries checking for vLLM server startup.
|
485
|
-
Only used when openai_api_server=True.
|
486
|
-
retry_alert_frequency: int
|
487
|
-
Frequency of alert logs for vLLM server startup retries.
|
488
|
-
Only used when openai_api_server=True.
|
489
|
-
engine_args : dict
|
490
|
-
Additional keyword arguments to pass to the vLLM engine.
|
491
|
-
For example, `tensor_parallel_size=2`.
|
492
|
-
"""
|
493
|
-
...
|
494
|
-
|
495
|
-
@typing.overload
|
496
|
-
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]]]:
|
497
|
-
"""
|
498
|
-
Enables checkpointing for a step.
|
499
|
-
|
500
|
-
> Examples
|
501
|
-
|
502
|
-
- Saving Checkpoints
|
503
|
-
|
504
|
-
```python
|
505
|
-
@checkpoint
|
506
|
-
@step
|
507
|
-
def train(self):
|
508
|
-
model = create_model(self.parameters, checkpoint_path = None)
|
509
|
-
for i in range(self.epochs):
|
510
|
-
# some training logic
|
511
|
-
loss = model.train(self.dataset)
|
512
|
-
if i % 10 == 0:
|
513
|
-
model.save(
|
514
|
-
current.checkpoint.directory,
|
515
|
-
)
|
516
|
-
# saves the contents of the `current.checkpoint.directory` as a checkpoint
|
517
|
-
# and returns a reference dictionary to the checkpoint saved in the datastore
|
518
|
-
self.latest_checkpoint = current.checkpoint.save(
|
519
|
-
name="epoch_checkpoint",
|
520
|
-
metadata={
|
521
|
-
"epoch": i,
|
522
|
-
"loss": loss,
|
523
|
-
}
|
524
|
-
)
|
525
|
-
```
|
526
|
-
|
527
|
-
- Using Loaded Checkpoints
|
528
|
-
|
529
|
-
```python
|
530
|
-
@retry(times=3)
|
531
|
-
@checkpoint
|
532
|
-
@step
|
533
|
-
def train(self):
|
534
|
-
# Assume that the task has restarted and the previous attempt of the task
|
535
|
-
# saved a checkpoint
|
536
|
-
checkpoint_path = None
|
537
|
-
if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
|
538
|
-
print("Loaded checkpoint from the previous attempt")
|
539
|
-
checkpoint_path = current.checkpoint.directory
|
540
|
-
|
541
|
-
model = create_model(self.parameters, checkpoint_path = checkpoint_path)
|
542
|
-
for i in range(self.epochs):
|
543
|
-
...
|
544
|
-
```
|
545
|
-
|
546
|
-
|
547
|
-
Parameters
|
548
|
-
----------
|
549
|
-
load_policy : str, default: "fresh"
|
550
|
-
The policy for loading the checkpoint. The following policies are supported:
|
551
|
-
- "eager": Loads the the latest available checkpoint within the namespace.
|
552
|
-
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
553
|
-
will be loaded at the start of the task.
|
554
|
-
- "none": Do not load any checkpoint
|
555
|
-
- "fresh": Loads the lastest checkpoint created within the running Task.
|
556
|
-
This mode helps loading checkpoints across various retry attempts of the same task.
|
557
|
-
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
558
|
-
created within the task will be loaded when the task is retries execution on failure.
|
559
|
-
|
560
|
-
temp_dir_root : str, default: None
|
561
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
562
|
-
"""
|
563
|
-
...
|
564
|
-
|
565
|
-
@typing.overload
|
566
|
-
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
567
|
-
...
|
568
|
-
|
569
|
-
@typing.overload
|
570
|
-
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
571
|
-
...
|
572
|
-
|
573
|
-
def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = 'fresh', temp_dir_root: str = None):
|
574
|
-
"""
|
575
|
-
Enables checkpointing for a step.
|
576
|
-
|
577
|
-
> Examples
|
578
|
-
|
579
|
-
- Saving Checkpoints
|
580
|
-
|
581
|
-
```python
|
582
|
-
@checkpoint
|
583
|
-
@step
|
584
|
-
def train(self):
|
585
|
-
model = create_model(self.parameters, checkpoint_path = None)
|
586
|
-
for i in range(self.epochs):
|
587
|
-
# some training logic
|
588
|
-
loss = model.train(self.dataset)
|
589
|
-
if i % 10 == 0:
|
590
|
-
model.save(
|
591
|
-
current.checkpoint.directory,
|
592
|
-
)
|
593
|
-
# saves the contents of the `current.checkpoint.directory` as a checkpoint
|
594
|
-
# and returns a reference dictionary to the checkpoint saved in the datastore
|
595
|
-
self.latest_checkpoint = current.checkpoint.save(
|
596
|
-
name="epoch_checkpoint",
|
597
|
-
metadata={
|
598
|
-
"epoch": i,
|
599
|
-
"loss": loss,
|
600
|
-
}
|
601
|
-
)
|
602
|
-
```
|
603
|
-
|
604
|
-
- Using Loaded Checkpoints
|
605
|
-
|
606
|
-
```python
|
607
|
-
@retry(times=3)
|
608
|
-
@checkpoint
|
609
|
-
@step
|
610
|
-
def train(self):
|
611
|
-
# Assume that the task has restarted and the previous attempt of the task
|
612
|
-
# saved a checkpoint
|
613
|
-
checkpoint_path = None
|
614
|
-
if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
|
615
|
-
print("Loaded checkpoint from the previous attempt")
|
616
|
-
checkpoint_path = current.checkpoint.directory
|
617
|
-
|
618
|
-
model = create_model(self.parameters, checkpoint_path = checkpoint_path)
|
619
|
-
for i in range(self.epochs):
|
620
|
-
...
|
621
|
-
```
|
622
|
-
|
623
|
-
|
624
|
-
Parameters
|
625
|
-
----------
|
626
|
-
load_policy : str, default: "fresh"
|
627
|
-
The policy for loading the checkpoint. The following policies are supported:
|
628
|
-
- "eager": Loads the the latest available checkpoint within the namespace.
|
629
|
-
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
630
|
-
will be loaded at the start of the task.
|
631
|
-
- "none": Do not load any checkpoint
|
632
|
-
- "fresh": Loads the lastest checkpoint created within the running Task.
|
633
|
-
This mode helps loading checkpoints across various retry attempts of the same task.
|
634
|
-
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
635
|
-
created within the task will be loaded when the task is retries execution on failure.
|
636
|
-
|
637
|
-
temp_dir_root : str, default: None
|
638
|
-
The root directory under which `current.checkpoint.directory` will be created.
|
377
|
+
circuit_breaker_config: dict
|
378
|
+
Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
|
379
|
+
timeout_config: dict
|
380
|
+
Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
|
639
381
|
"""
|
640
382
|
...
|
641
383
|
|
642
384
|
@typing.overload
|
643
|
-
def
|
385
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
644
386
|
"""
|
645
|
-
|
646
|
-
the execution of a step.
|
647
|
-
|
648
|
-
|
649
|
-
Parameters
|
650
|
-
----------
|
651
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
652
|
-
List of secret specs, defining how the secrets are to be retrieved
|
653
|
-
role : str, optional, default: None
|
654
|
-
Role to use for fetching secrets
|
387
|
+
Internal decorator to support Fast bakery
|
655
388
|
"""
|
656
389
|
...
|
657
390
|
|
658
391
|
@typing.overload
|
659
|
-
def
|
660
|
-
...
|
661
|
-
|
662
|
-
@typing.overload
|
663
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
392
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
664
393
|
...
|
665
394
|
|
666
|
-
def
|
395
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
667
396
|
"""
|
668
|
-
|
669
|
-
the execution of a step.
|
670
|
-
|
671
|
-
|
672
|
-
Parameters
|
673
|
-
----------
|
674
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
675
|
-
List of secret specs, defining how the secrets are to be retrieved
|
676
|
-
role : str, optional, default: None
|
677
|
-
Role to use for fetching secrets
|
397
|
+
Internal decorator to support Fast bakery
|
678
398
|
"""
|
679
399
|
...
|
680
400
|
|
@@ -767,62 +487,72 @@ def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: ty
|
|
767
487
|
"""
|
768
488
|
...
|
769
489
|
|
770
|
-
|
771
|
-
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]]]:
|
490
|
+
def vllm(*, model: str, backend: str, openai_api_server: bool, debug: bool, card_refresh_interval: int, max_retries: int, retry_alert_frequency: int, engine_args: dict) -> 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]]]:
|
772
491
|
"""
|
773
|
-
|
492
|
+
This decorator is used to run vllm APIs as Metaflow task sidecars.
|
774
493
|
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
494
|
+
User code call
|
495
|
+
--------------
|
496
|
+
@vllm(
|
497
|
+
model="...",
|
498
|
+
...
|
499
|
+
)
|
500
|
+
|
501
|
+
Valid backend options
|
502
|
+
---------------------
|
503
|
+
- 'local': Run as a separate process on the local task machine.
|
504
|
+
|
505
|
+
Valid model options
|
506
|
+
-------------------
|
507
|
+
Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
|
508
|
+
|
509
|
+
NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
|
510
|
+
If you need multiple models, you must create multiple @vllm decorators.
|
779
511
|
|
780
512
|
|
781
513
|
Parameters
|
782
514
|
----------
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
515
|
+
model: str
|
516
|
+
HuggingFace model identifier to be served by vLLM.
|
517
|
+
backend: str
|
518
|
+
Determines where and how to run the vLLM process.
|
519
|
+
openai_api_server: bool
|
520
|
+
Whether to use OpenAI-compatible API server mode (subprocess) instead of native engine.
|
521
|
+
Default is False (uses native engine).
|
522
|
+
Set to True for backward compatibility with existing code.
|
523
|
+
debug: bool
|
524
|
+
Whether to turn on verbose debugging logs.
|
525
|
+
card_refresh_interval: int
|
526
|
+
Interval in seconds for refreshing the vLLM status card.
|
527
|
+
Only used when openai_api_server=True.
|
528
|
+
max_retries: int
|
529
|
+
Maximum number of retries checking for vLLM server startup.
|
530
|
+
Only used when openai_api_server=True.
|
531
|
+
retry_alert_frequency: int
|
532
|
+
Frequency of alert logs for vLLM server startup retries.
|
533
|
+
Only used when openai_api_server=True.
|
534
|
+
engine_args : dict
|
535
|
+
Additional keyword arguments to pass to the vLLM engine.
|
536
|
+
For example, `tensor_parallel_size=2`.
|
537
|
+
"""
|
798
538
|
...
|
799
539
|
|
800
540
|
@typing.overload
|
801
|
-
def
|
541
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
542
|
+
"""
|
543
|
+
Decorator prototype for all step decorators. This function gets specialized
|
544
|
+
and imported for all decorators types by _import_plugin_decorators().
|
545
|
+
"""
|
802
546
|
...
|
803
547
|
|
804
|
-
|
548
|
+
@typing.overload
|
549
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
550
|
+
...
|
551
|
+
|
552
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
805
553
|
"""
|
806
|
-
|
807
|
-
|
808
|
-
Information in this decorator will augment any
|
809
|
-
attributes set in the `@conda_base` flow-level decorator. Hence,
|
810
|
-
you can use `@conda_base` to set packages required by all
|
811
|
-
steps and use `@conda` to specify step-specific overrides.
|
812
|
-
|
813
|
-
|
814
|
-
Parameters
|
815
|
-
----------
|
816
|
-
packages : Dict[str, str], default {}
|
817
|
-
Packages to use for this step. The key is the name of the package
|
818
|
-
and the value is the version to use.
|
819
|
-
libraries : Dict[str, str], default {}
|
820
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
821
|
-
python : str, optional, default None
|
822
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
823
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
824
|
-
disabled : bool, default False
|
825
|
-
If set to True, disables @conda.
|
554
|
+
Decorator prototype for all step decorators. This function gets specialized
|
555
|
+
and imported for all decorators types by _import_plugin_decorators().
|
826
556
|
"""
|
827
557
|
...
|
828
558
|
|
@@ -956,84 +686,165 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
956
686
|
...
|
957
687
|
|
958
688
|
@typing.overload
|
959
|
-
def
|
689
|
+
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]]]:
|
960
690
|
"""
|
961
|
-
|
691
|
+
Enables checkpointing for a step.
|
692
|
+
|
693
|
+
> Examples
|
694
|
+
|
695
|
+
- Saving Checkpoints
|
696
|
+
|
697
|
+
```python
|
698
|
+
@checkpoint
|
699
|
+
@step
|
700
|
+
def train(self):
|
701
|
+
model = create_model(self.parameters, checkpoint_path = None)
|
702
|
+
for i in range(self.epochs):
|
703
|
+
# some training logic
|
704
|
+
loss = model.train(self.dataset)
|
705
|
+
if i % 10 == 0:
|
706
|
+
model.save(
|
707
|
+
current.checkpoint.directory,
|
708
|
+
)
|
709
|
+
# saves the contents of the `current.checkpoint.directory` as a checkpoint
|
710
|
+
# and returns a reference dictionary to the checkpoint saved in the datastore
|
711
|
+
self.latest_checkpoint = current.checkpoint.save(
|
712
|
+
name="epoch_checkpoint",
|
713
|
+
metadata={
|
714
|
+
"epoch": i,
|
715
|
+
"loss": loss,
|
716
|
+
}
|
717
|
+
)
|
718
|
+
```
|
719
|
+
|
720
|
+
- Using Loaded Checkpoints
|
721
|
+
|
722
|
+
```python
|
723
|
+
@retry(times=3)
|
724
|
+
@checkpoint
|
725
|
+
@step
|
726
|
+
def train(self):
|
727
|
+
# Assume that the task has restarted and the previous attempt of the task
|
728
|
+
# saved a checkpoint
|
729
|
+
checkpoint_path = None
|
730
|
+
if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
|
731
|
+
print("Loaded checkpoint from the previous attempt")
|
732
|
+
checkpoint_path = current.checkpoint.directory
|
733
|
+
|
734
|
+
model = create_model(self.parameters, checkpoint_path = checkpoint_path)
|
735
|
+
for i in range(self.epochs):
|
736
|
+
...
|
737
|
+
```
|
738
|
+
|
739
|
+
|
740
|
+
Parameters
|
741
|
+
----------
|
742
|
+
load_policy : str, default: "fresh"
|
743
|
+
The policy for loading the checkpoint. The following policies are supported:
|
744
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
745
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
746
|
+
will be loaded at the start of the task.
|
747
|
+
- "none": Do not load any checkpoint
|
748
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
749
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
750
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
751
|
+
created within the task will be loaded when the task is retries execution on failure.
|
752
|
+
|
753
|
+
temp_dir_root : str, default: None
|
754
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
962
755
|
"""
|
963
756
|
...
|
964
757
|
|
965
758
|
@typing.overload
|
966
|
-
def
|
759
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
967
760
|
...
|
968
761
|
|
969
|
-
|
970
|
-
|
971
|
-
Internal decorator to support Fast bakery
|
972
|
-
"""
|
762
|
+
@typing.overload
|
763
|
+
def checkpoint(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
973
764
|
...
|
974
765
|
|
975
|
-
def
|
766
|
+
def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, load_policy: str = 'fresh', temp_dir_root: str = None):
|
976
767
|
"""
|
977
|
-
|
768
|
+
Enables checkpointing for a step.
|
978
769
|
|
770
|
+
> Examples
|
979
771
|
|
980
|
-
|
981
|
-
----------
|
982
|
-
gpu : int
|
983
|
-
Number of GPUs to use.
|
984
|
-
gpu_type : str
|
985
|
-
Type of Nvidia GPU to use.
|
986
|
-
"""
|
987
|
-
...
|
988
|
-
|
989
|
-
@typing.overload
|
990
|
-
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]]]:
|
991
|
-
"""
|
992
|
-
Specifies the PyPI packages for the step.
|
772
|
+
- Saving Checkpoints
|
993
773
|
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
774
|
+
```python
|
775
|
+
@checkpoint
|
776
|
+
@step
|
777
|
+
def train(self):
|
778
|
+
model = create_model(self.parameters, checkpoint_path = None)
|
779
|
+
for i in range(self.epochs):
|
780
|
+
# some training logic
|
781
|
+
loss = model.train(self.dataset)
|
782
|
+
if i % 10 == 0:
|
783
|
+
model.save(
|
784
|
+
current.checkpoint.directory,
|
785
|
+
)
|
786
|
+
# saves the contents of the `current.checkpoint.directory` as a checkpoint
|
787
|
+
# and returns a reference dictionary to the checkpoint saved in the datastore
|
788
|
+
self.latest_checkpoint = current.checkpoint.save(
|
789
|
+
name="epoch_checkpoint",
|
790
|
+
metadata={
|
791
|
+
"epoch": i,
|
792
|
+
"loss": loss,
|
793
|
+
}
|
794
|
+
)
|
795
|
+
```
|
796
|
+
|
797
|
+
- Using Loaded Checkpoints
|
798
|
+
|
799
|
+
```python
|
800
|
+
@retry(times=3)
|
801
|
+
@checkpoint
|
802
|
+
@step
|
803
|
+
def train(self):
|
804
|
+
# Assume that the task has restarted and the previous attempt of the task
|
805
|
+
# saved a checkpoint
|
806
|
+
checkpoint_path = None
|
807
|
+
if current.checkpoint.is_loaded: # Check if a checkpoint is loaded
|
808
|
+
print("Loaded checkpoint from the previous attempt")
|
809
|
+
checkpoint_path = current.checkpoint.directory
|
810
|
+
|
811
|
+
model = create_model(self.parameters, checkpoint_path = checkpoint_path)
|
812
|
+
for i in range(self.epochs):
|
813
|
+
...
|
814
|
+
```
|
998
815
|
|
999
816
|
|
1000
817
|
Parameters
|
1001
818
|
----------
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
819
|
+
load_policy : str, default: "fresh"
|
820
|
+
The policy for loading the checkpoint. The following policies are supported:
|
821
|
+
- "eager": Loads the the latest available checkpoint within the namespace.
|
822
|
+
With this mode, the latest checkpoint written by any previous task (can be even a different run) of the step
|
823
|
+
will be loaded at the start of the task.
|
824
|
+
- "none": Do not load any checkpoint
|
825
|
+
- "fresh": Loads the lastest checkpoint created within the running Task.
|
826
|
+
This mode helps loading checkpoints across various retry attempts of the same task.
|
827
|
+
With this mode, no checkpoint will be loaded at the start of a task but any checkpoints
|
828
|
+
created within the task will be loaded when the task is retries execution on failure.
|
829
|
+
|
830
|
+
temp_dir_root : str, default: None
|
831
|
+
The root directory under which `current.checkpoint.directory` will be created.
|
1008
832
|
"""
|
1009
833
|
...
|
1010
834
|
|
1011
|
-
|
1012
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1013
|
-
...
|
1014
|
-
|
1015
|
-
@typing.overload
|
1016
|
-
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1017
|
-
...
|
1018
|
-
|
1019
|
-
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):
|
835
|
+
def nvidia(*, gpu: int, gpu_type: str, queue_timeout: int) -> 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]]]:
|
1020
836
|
"""
|
1021
|
-
Specifies
|
1022
|
-
|
1023
|
-
Information in this decorator will augment any
|
1024
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1025
|
-
you can use `@pypi_base` to set packages required by all
|
1026
|
-
steps and use `@pypi` to specify step-specific overrides.
|
837
|
+
Specifies that this step should execute on DGX cloud.
|
1027
838
|
|
1028
839
|
|
1029
840
|
Parameters
|
1030
841
|
----------
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
842
|
+
gpu : int
|
843
|
+
Number of GPUs to use.
|
844
|
+
gpu_type : str
|
845
|
+
Type of Nvidia GPU to use.
|
846
|
+
queue_timeout : int
|
847
|
+
Time to keep the job in NVCF's queue.
|
1037
848
|
"""
|
1038
849
|
...
|
1039
850
|
|
@@ -1093,113 +904,220 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1093
904
|
...
|
1094
905
|
|
1095
906
|
@typing.overload
|
1096
|
-
def
|
907
|
+
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]]]:
|
1097
908
|
"""
|
1098
|
-
Specifies
|
909
|
+
Specifies the Conda environment for the step.
|
910
|
+
|
911
|
+
Information in this decorator will augment any
|
912
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
913
|
+
you can use `@conda_base` to set packages required by all
|
914
|
+
steps and use `@conda` to specify step-specific overrides.
|
1099
915
|
|
1100
916
|
|
1101
917
|
Parameters
|
1102
918
|
----------
|
1103
|
-
|
1104
|
-
|
919
|
+
packages : Dict[str, str], default {}
|
920
|
+
Packages to use for this step. The key is the name of the package
|
921
|
+
and the value is the version to use.
|
922
|
+
libraries : Dict[str, str], default {}
|
923
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
924
|
+
python : str, optional, default None
|
925
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
926
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
927
|
+
disabled : bool, default False
|
928
|
+
If set to True, disables @conda.
|
1105
929
|
"""
|
1106
930
|
...
|
1107
931
|
|
1108
932
|
@typing.overload
|
1109
|
-
def
|
933
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1110
934
|
...
|
1111
935
|
|
1112
936
|
@typing.overload
|
1113
|
-
def
|
937
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1114
938
|
...
|
1115
939
|
|
1116
|
-
def
|
940
|
+
def conda(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
1117
941
|
"""
|
1118
|
-
Specifies
|
942
|
+
Specifies the Conda environment for the step.
|
943
|
+
|
944
|
+
Information in this decorator will augment any
|
945
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
946
|
+
you can use `@conda_base` to set packages required by all
|
947
|
+
steps and use `@conda` to specify step-specific overrides.
|
1119
948
|
|
1120
949
|
|
1121
950
|
Parameters
|
1122
951
|
----------
|
1123
|
-
|
1124
|
-
|
952
|
+
packages : Dict[str, str], default {}
|
953
|
+
Packages to use for this step. The key is the name of the package
|
954
|
+
and the value is the version to use.
|
955
|
+
libraries : Dict[str, str], default {}
|
956
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
957
|
+
python : str, optional, default None
|
958
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
959
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
960
|
+
disabled : bool, default False
|
961
|
+
If set to True, disables @conda.
|
1125
962
|
"""
|
1126
963
|
...
|
1127
964
|
|
1128
|
-
def
|
965
|
+
def huggingface_hub(*, temp_dir_root: typing.Optional[str] = None, load: typing.Union[typing.List[str], typing.List[typing.Tuple[typing.Dict, str]], typing.List[typing.Tuple[str, str]], typing.List[typing.Dict], 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]]]:
|
1129
966
|
"""
|
1130
|
-
|
967
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
968
|
+
|
969
|
+
> Examples
|
970
|
+
|
971
|
+
**Usage: creating references of models from huggingface that may be loaded in downstream steps**
|
972
|
+
```python
|
973
|
+
@huggingface_hub
|
974
|
+
@step
|
975
|
+
def pull_model_from_huggingface(self):
|
976
|
+
# `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
|
977
|
+
# and saves it in the backend storage based on the model's `repo_id`. If there exists a model
|
978
|
+
# with the same `repo_id` in the backend storage, it will not download the model again. The return
|
979
|
+
# value of the function is a reference to the model in the backend storage.
|
980
|
+
# This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
|
981
|
+
|
982
|
+
self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
|
983
|
+
self.llama_model = current.huggingface_hub.snapshot_download(
|
984
|
+
repo_id=self.model_id,
|
985
|
+
allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
|
986
|
+
)
|
987
|
+
self.next(self.train)
|
988
|
+
```
|
989
|
+
|
990
|
+
**Usage: loading models directly from huggingface hub or from cache (from metaflow's datastore)**
|
991
|
+
```python
|
992
|
+
@huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
|
993
|
+
@step
|
994
|
+
def pull_model_from_huggingface(self):
|
995
|
+
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
996
|
+
```
|
997
|
+
|
998
|
+
```python
|
999
|
+
@huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora, "/my-lora-directory")])
|
1000
|
+
@step
|
1001
|
+
def finetune_model(self):
|
1002
|
+
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
1003
|
+
# path_to_model will be /my-directory
|
1004
|
+
```
|
1005
|
+
|
1006
|
+
```python
|
1007
|
+
# Takes all the arguments passed to `snapshot_download`
|
1008
|
+
# except for `local_dir`
|
1009
|
+
@huggingface_hub(load=[
|
1010
|
+
{
|
1011
|
+
"repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
|
1012
|
+
},
|
1013
|
+
{
|
1014
|
+
"repo_id": "myorg/mistral-lora",
|
1015
|
+
"repo_type": "model",
|
1016
|
+
},
|
1017
|
+
])
|
1018
|
+
@step
|
1019
|
+
def finetune_model(self):
|
1020
|
+
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
1021
|
+
# path_to_model will be /my-directory
|
1022
|
+
```
|
1131
1023
|
|
1132
1024
|
|
1133
1025
|
Parameters
|
1134
1026
|
----------
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1027
|
+
temp_dir_root : str, optional
|
1028
|
+
The root directory that will hold the temporary directory where objects will be downloaded.
|
1029
|
+
|
1030
|
+
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
1031
|
+
The list of repos (models/datasets) to load.
|
1032
|
+
|
1033
|
+
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
1034
|
+
|
1035
|
+
- If repo (model/dataset) is not found in the datastore:
|
1036
|
+
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
1037
|
+
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
1038
|
+
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
1039
|
+
|
1040
|
+
- If repo is found in the datastore:
|
1041
|
+
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
1141
1042
|
"""
|
1142
1043
|
...
|
1143
1044
|
|
1144
|
-
|
1045
|
+
@typing.overload
|
1046
|
+
def resources(*, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1145
1047
|
"""
|
1146
|
-
|
1147
|
-
|
1148
|
-
User code call
|
1149
|
-
--------------
|
1150
|
-
@ollama(
|
1151
|
-
models=[...],
|
1152
|
-
...
|
1153
|
-
)
|
1048
|
+
Specifies the resources needed when executing this step.
|
1154
1049
|
|
1155
|
-
|
1156
|
-
|
1157
|
-
- 'local': Run as a separate process on the local task machine.
|
1158
|
-
- (TODO) 'managed': Outerbounds hosts and selects compute provider.
|
1159
|
-
- (TODO) 'remote': Spin up separate instance to serve Ollama models.
|
1050
|
+
Use `@resources` to specify the resource requirements
|
1051
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
1160
1052
|
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1053
|
+
You can choose the compute layer on the command line by executing e.g.
|
1054
|
+
```
|
1055
|
+
python myflow.py run --with batch
|
1056
|
+
```
|
1057
|
+
or
|
1058
|
+
```
|
1059
|
+
python myflow.py run --with kubernetes
|
1060
|
+
```
|
1061
|
+
which executes the flow on the desired system using the
|
1062
|
+
requirements specified in `@resources`.
|
1164
1063
|
|
1165
1064
|
|
1166
1065
|
Parameters
|
1167
1066
|
----------
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
Whether to turn on verbose debugging logs.
|
1180
|
-
circuit_breaker_config: dict
|
1181
|
-
Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
|
1182
|
-
timeout_config: dict
|
1183
|
-
Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
|
1067
|
+
cpu : int, default 1
|
1068
|
+
Number of CPUs required for this step.
|
1069
|
+
gpu : int, optional, default None
|
1070
|
+
Number of GPUs required for this step.
|
1071
|
+
disk : int, optional, default None
|
1072
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1073
|
+
memory : int, default 4096
|
1074
|
+
Memory size (in MB) required for this step.
|
1075
|
+
shared_memory : int, optional, default None
|
1076
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1077
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1184
1078
|
"""
|
1185
1079
|
...
|
1186
1080
|
|
1187
1081
|
@typing.overload
|
1188
|
-
def
|
1189
|
-
"""
|
1190
|
-
Decorator prototype for all step decorators. This function gets specialized
|
1191
|
-
and imported for all decorators types by _import_plugin_decorators().
|
1192
|
-
"""
|
1082
|
+
def resources(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1193
1083
|
...
|
1194
1084
|
|
1195
1085
|
@typing.overload
|
1196
|
-
def
|
1086
|
+
def resources(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1197
1087
|
...
|
1198
1088
|
|
1199
|
-
def
|
1089
|
+
def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, cpu: int = 1, gpu: typing.Optional[int] = None, disk: typing.Optional[int] = None, memory: int = 4096, shared_memory: typing.Optional[int] = None):
|
1200
1090
|
"""
|
1201
|
-
|
1202
|
-
|
1091
|
+
Specifies the resources needed when executing this step.
|
1092
|
+
|
1093
|
+
Use `@resources` to specify the resource requirements
|
1094
|
+
independently of the specific compute layer (`@batch`, `@kubernetes`).
|
1095
|
+
|
1096
|
+
You can choose the compute layer on the command line by executing e.g.
|
1097
|
+
```
|
1098
|
+
python myflow.py run --with batch
|
1099
|
+
```
|
1100
|
+
or
|
1101
|
+
```
|
1102
|
+
python myflow.py run --with kubernetes
|
1103
|
+
```
|
1104
|
+
which executes the flow on the desired system using the
|
1105
|
+
requirements specified in `@resources`.
|
1106
|
+
|
1107
|
+
|
1108
|
+
Parameters
|
1109
|
+
----------
|
1110
|
+
cpu : int, default 1
|
1111
|
+
Number of CPUs required for this step.
|
1112
|
+
gpu : int, optional, default None
|
1113
|
+
Number of GPUs required for this step.
|
1114
|
+
disk : int, optional, default None
|
1115
|
+
Disk size (in MB) required for this step. Only applies on Kubernetes.
|
1116
|
+
memory : int, default 4096
|
1117
|
+
Memory size (in MB) required for this step.
|
1118
|
+
shared_memory : int, optional, default None
|
1119
|
+
The value for the size (in MiB) of the /dev/shm volume for this step.
|
1120
|
+
This parameter maps to the `--shm-size` option in Docker.
|
1203
1121
|
"""
|
1204
1122
|
...
|
1205
1123
|
|
@@ -1255,154 +1173,127 @@ def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1255
1173
|
...
|
1256
1174
|
|
1257
1175
|
@typing.overload
|
1258
|
-
def
|
1176
|
+
def environment(*, vars: typing.Dict[str, str] = {}) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1259
1177
|
"""
|
1260
|
-
Specifies
|
1261
|
-
|
1262
|
-
```
|
1263
|
-
@trigger_on_finish(flow='FooFlow')
|
1264
|
-
```
|
1265
|
-
or
|
1266
|
-
```
|
1267
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1268
|
-
```
|
1269
|
-
This decorator respects the @project decorator and triggers the flow
|
1270
|
-
when upstream runs within the same namespace complete successfully
|
1271
|
-
|
1272
|
-
Additionally, you can specify project aware upstream flow dependencies
|
1273
|
-
by specifying the fully qualified project_flow_name.
|
1274
|
-
```
|
1275
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1276
|
-
```
|
1277
|
-
or
|
1278
|
-
```
|
1279
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1280
|
-
```
|
1281
|
-
|
1282
|
-
You can also specify just the project or project branch (other values will be
|
1283
|
-
inferred from the current project or project branch):
|
1284
|
-
```
|
1285
|
-
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1286
|
-
```
|
1287
|
-
|
1288
|
-
Note that `branch` is typically one of:
|
1289
|
-
- `prod`
|
1290
|
-
- `user.bob`
|
1291
|
-
- `test.my_experiment`
|
1292
|
-
- `prod.staging`
|
1178
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1293
1179
|
|
1294
1180
|
|
1295
1181
|
Parameters
|
1296
1182
|
----------
|
1297
|
-
|
1298
|
-
|
1299
|
-
flows : List[Union[str, Dict[str, str]]], default []
|
1300
|
-
Upstream flow dependencies for this flow.
|
1301
|
-
options : Dict[str, Any], default {}
|
1302
|
-
Backend-specific configuration for tuning eventing behavior.
|
1183
|
+
vars : Dict[str, str], default {}
|
1184
|
+
Dictionary of environment variables to set.
|
1303
1185
|
"""
|
1304
1186
|
...
|
1305
1187
|
|
1306
1188
|
@typing.overload
|
1307
|
-
def
|
1189
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1308
1190
|
...
|
1309
1191
|
|
1310
|
-
|
1192
|
+
@typing.overload
|
1193
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1194
|
+
...
|
1195
|
+
|
1196
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1311
1197
|
"""
|
1312
|
-
Specifies
|
1313
|
-
|
1314
|
-
```
|
1315
|
-
@trigger_on_finish(flow='FooFlow')
|
1316
|
-
```
|
1317
|
-
or
|
1318
|
-
```
|
1319
|
-
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1320
|
-
```
|
1321
|
-
This decorator respects the @project decorator and triggers the flow
|
1322
|
-
when upstream runs within the same namespace complete successfully
|
1198
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1323
1199
|
|
1324
|
-
Additionally, you can specify project aware upstream flow dependencies
|
1325
|
-
by specifying the fully qualified project_flow_name.
|
1326
|
-
```
|
1327
|
-
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1328
|
-
```
|
1329
|
-
or
|
1330
|
-
```
|
1331
|
-
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1332
|
-
```
|
1333
1200
|
|
1334
|
-
|
1335
|
-
|
1336
|
-
|
1337
|
-
|
1338
|
-
|
1201
|
+
Parameters
|
1202
|
+
----------
|
1203
|
+
vars : Dict[str, str], default {}
|
1204
|
+
Dictionary of environment variables to set.
|
1205
|
+
"""
|
1206
|
+
...
|
1207
|
+
|
1208
|
+
@typing.overload
|
1209
|
+
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]]]:
|
1210
|
+
"""
|
1211
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1339
1212
|
|
1340
|
-
Note that `
|
1341
|
-
- `prod`
|
1342
|
-
- `user.bob`
|
1343
|
-
- `test.my_experiment`
|
1344
|
-
- `prod.staging`
|
1213
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1345
1214
|
|
1346
1215
|
|
1347
1216
|
Parameters
|
1348
1217
|
----------
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1218
|
+
type : str, default 'default'
|
1219
|
+
Card type.
|
1220
|
+
id : str, optional, default None
|
1221
|
+
If multiple cards are present, use this id to identify this card.
|
1353
1222
|
options : Dict[str, Any], default {}
|
1354
|
-
|
1223
|
+
Options passed to the card. The contents depend on the card type.
|
1224
|
+
timeout : int, default 45
|
1225
|
+
Interrupt reporting if it takes more than this many seconds.
|
1355
1226
|
"""
|
1356
1227
|
...
|
1357
1228
|
|
1358
1229
|
@typing.overload
|
1359
|
-
def
|
1230
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1231
|
+
...
|
1232
|
+
|
1233
|
+
@typing.overload
|
1234
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1235
|
+
...
|
1236
|
+
|
1237
|
+
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):
|
1360
1238
|
"""
|
1361
|
-
|
1362
|
-
|
1239
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1240
|
+
|
1241
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1363
1242
|
|
1364
1243
|
|
1365
1244
|
Parameters
|
1366
1245
|
----------
|
1367
|
-
|
1368
|
-
|
1369
|
-
|
1370
|
-
|
1371
|
-
|
1372
|
-
|
1373
|
-
|
1374
|
-
|
1375
|
-
specified by this expression.
|
1376
|
-
timezone : str, optional, default None
|
1377
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1378
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1246
|
+
type : str, default 'default'
|
1247
|
+
Card type.
|
1248
|
+
id : str, optional, default None
|
1249
|
+
If multiple cards are present, use this id to identify this card.
|
1250
|
+
options : Dict[str, Any], default {}
|
1251
|
+
Options passed to the card. The contents depend on the card type.
|
1252
|
+
timeout : int, default 45
|
1253
|
+
Interrupt reporting if it takes more than this many seconds.
|
1379
1254
|
"""
|
1380
1255
|
...
|
1381
1256
|
|
1382
|
-
|
1383
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1384
|
-
...
|
1385
|
-
|
1386
|
-
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
1257
|
+
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]]:
|
1387
1258
|
"""
|
1388
|
-
|
1389
|
-
|
1259
|
+
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.
|
1260
|
+
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.
|
1390
1261
|
|
1391
1262
|
|
1392
1263
|
Parameters
|
1393
1264
|
----------
|
1394
|
-
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
1405
|
-
|
1265
|
+
timeout : int
|
1266
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1267
|
+
poke_interval : int
|
1268
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1269
|
+
mode : str
|
1270
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1271
|
+
exponential_backoff : bool
|
1272
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1273
|
+
pool : str
|
1274
|
+
the slot pool this task should run in,
|
1275
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1276
|
+
soft_fail : bool
|
1277
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1278
|
+
name : str
|
1279
|
+
Name of the sensor on Airflow
|
1280
|
+
description : str
|
1281
|
+
Description of sensor in the Airflow UI
|
1282
|
+
external_dag_id : str
|
1283
|
+
The dag_id that contains the task you want to wait for.
|
1284
|
+
external_task_ids : List[str]
|
1285
|
+
The list of task_ids that you want to wait for.
|
1286
|
+
If None (default value) the sensor waits for the DAG. (Default: None)
|
1287
|
+
allowed_states : List[str]
|
1288
|
+
Iterable of allowed states, (Default: ['success'])
|
1289
|
+
failed_states : List[str]
|
1290
|
+
Iterable of failed or dis-allowed states. (Default: None)
|
1291
|
+
execution_delta : datetime.timedelta
|
1292
|
+
time difference with the previous execution to look at,
|
1293
|
+
the default is the same logical date as the current task or DAG. (Default: None)
|
1294
|
+
check_existence: bool
|
1295
|
+
Set to True to check if the external task exists or check if
|
1296
|
+
the DAG to wait for exists. (Default: True)
|
1406
1297
|
"""
|
1407
1298
|
...
|
1408
1299
|
|
@@ -1520,6 +1411,135 @@ def with_artifact_store(f: typing.Optional[typing.Type[FlowSpecDerived]] = None)
|
|
1520
1411
|
"""
|
1521
1412
|
...
|
1522
1413
|
|
1414
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1415
|
+
"""
|
1416
|
+
Specifies what flows belong to the same project.
|
1417
|
+
|
1418
|
+
A project-specific namespace is created for all flows that
|
1419
|
+
use the same `@project(name)`.
|
1420
|
+
|
1421
|
+
|
1422
|
+
Parameters
|
1423
|
+
----------
|
1424
|
+
name : str
|
1425
|
+
Project name. Make sure that the name is unique amongst all
|
1426
|
+
projects that use the same production scheduler. The name may
|
1427
|
+
contain only lowercase alphanumeric characters and underscores.
|
1428
|
+
|
1429
|
+
branch : Optional[str], default None
|
1430
|
+
The branch to use. If not specified, the branch is set to
|
1431
|
+
`user.<username>` unless `production` is set to `True`. This can
|
1432
|
+
also be set on the command line using `--branch` as a top-level option.
|
1433
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
1434
|
+
|
1435
|
+
production : bool, default False
|
1436
|
+
Whether or not the branch is the production branch. This can also be set on the
|
1437
|
+
command line using `--production` as a top-level option. It is an error to specify
|
1438
|
+
`production` in the decorator and on the command line.
|
1439
|
+
The project branch name will be:
|
1440
|
+
- if `branch` is specified:
|
1441
|
+
- if `production` is True: `prod.<branch>`
|
1442
|
+
- if `production` is False: `test.<branch>`
|
1443
|
+
- if `branch` is not specified:
|
1444
|
+
- if `production` is True: `prod`
|
1445
|
+
- if `production` is False: `user.<username>`
|
1446
|
+
"""
|
1447
|
+
...
|
1448
|
+
|
1449
|
+
@typing.overload
|
1450
|
+
def conda_base(*, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1451
|
+
"""
|
1452
|
+
Specifies the Conda environment for all steps of the flow.
|
1453
|
+
|
1454
|
+
Use `@conda_base` to set common libraries required by all
|
1455
|
+
steps and use `@conda` to specify step-specific additions.
|
1456
|
+
|
1457
|
+
|
1458
|
+
Parameters
|
1459
|
+
----------
|
1460
|
+
packages : Dict[str, str], default {}
|
1461
|
+
Packages to use for this flow. The key is the name of the package
|
1462
|
+
and the value is the version to use.
|
1463
|
+
libraries : Dict[str, str], default {}
|
1464
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1465
|
+
python : str, optional, default None
|
1466
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1467
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1468
|
+
disabled : bool, default False
|
1469
|
+
If set to True, disables Conda.
|
1470
|
+
"""
|
1471
|
+
...
|
1472
|
+
|
1473
|
+
@typing.overload
|
1474
|
+
def conda_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1475
|
+
...
|
1476
|
+
|
1477
|
+
def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, libraries: typing.Dict[str, str] = {}, python: typing.Optional[str] = None, disabled: bool = False):
|
1478
|
+
"""
|
1479
|
+
Specifies the Conda environment for all steps of the flow.
|
1480
|
+
|
1481
|
+
Use `@conda_base` to set common libraries required by all
|
1482
|
+
steps and use `@conda` to specify step-specific additions.
|
1483
|
+
|
1484
|
+
|
1485
|
+
Parameters
|
1486
|
+
----------
|
1487
|
+
packages : Dict[str, str], default {}
|
1488
|
+
Packages to use for this flow. The key is the name of the package
|
1489
|
+
and the value is the version to use.
|
1490
|
+
libraries : Dict[str, str], default {}
|
1491
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1492
|
+
python : str, optional, default None
|
1493
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1494
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1495
|
+
disabled : bool, default False
|
1496
|
+
If set to True, disables Conda.
|
1497
|
+
"""
|
1498
|
+
...
|
1499
|
+
|
1500
|
+
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]]:
|
1501
|
+
"""
|
1502
|
+
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)
|
1503
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1504
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1505
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1506
|
+
starts only after all sensors finish.
|
1507
|
+
|
1508
|
+
|
1509
|
+
Parameters
|
1510
|
+
----------
|
1511
|
+
timeout : int
|
1512
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1513
|
+
poke_interval : int
|
1514
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1515
|
+
mode : str
|
1516
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1517
|
+
exponential_backoff : bool
|
1518
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1519
|
+
pool : str
|
1520
|
+
the slot pool this task should run in,
|
1521
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1522
|
+
soft_fail : bool
|
1523
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1524
|
+
name : str
|
1525
|
+
Name of the sensor on Airflow
|
1526
|
+
description : str
|
1527
|
+
Description of sensor in the Airflow UI
|
1528
|
+
bucket_key : Union[str, List[str]]
|
1529
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1530
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1531
|
+
bucket_name : str
|
1532
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1533
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1534
|
+
wildcard_match : bool
|
1535
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1536
|
+
aws_conn_id : str
|
1537
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1538
|
+
verify : bool
|
1539
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1540
|
+
"""
|
1541
|
+
...
|
1542
|
+
|
1523
1543
|
@typing.overload
|
1524
1544
|
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1525
1545
|
"""
|
@@ -1561,140 +1581,155 @@ def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packag
|
|
1561
1581
|
"""
|
1562
1582
|
...
|
1563
1583
|
|
1564
|
-
|
1584
|
+
@typing.overload
|
1585
|
+
def trigger_on_finish(*, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1565
1586
|
"""
|
1566
|
-
|
1567
|
-
|
1587
|
+
Specifies the flow(s) that this flow depends on.
|
1588
|
+
|
1589
|
+
```
|
1590
|
+
@trigger_on_finish(flow='FooFlow')
|
1591
|
+
```
|
1592
|
+
or
|
1593
|
+
```
|
1594
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1595
|
+
```
|
1596
|
+
This decorator respects the @project decorator and triggers the flow
|
1597
|
+
when upstream runs within the same namespace complete successfully
|
1598
|
+
|
1599
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1600
|
+
by specifying the fully qualified project_flow_name.
|
1601
|
+
```
|
1602
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1603
|
+
```
|
1604
|
+
or
|
1605
|
+
```
|
1606
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1607
|
+
```
|
1608
|
+
|
1609
|
+
You can also specify just the project or project branch (other values will be
|
1610
|
+
inferred from the current project or project branch):
|
1611
|
+
```
|
1612
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1613
|
+
```
|
1614
|
+
|
1615
|
+
Note that `branch` is typically one of:
|
1616
|
+
- `prod`
|
1617
|
+
- `user.bob`
|
1618
|
+
- `test.my_experiment`
|
1619
|
+
- `prod.staging`
|
1568
1620
|
|
1569
1621
|
|
1570
1622
|
Parameters
|
1571
1623
|
----------
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
exponential_backoff : bool
|
1579
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1580
|
-
pool : str
|
1581
|
-
the slot pool this task should run in,
|
1582
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1583
|
-
soft_fail : bool
|
1584
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1585
|
-
name : str
|
1586
|
-
Name of the sensor on Airflow
|
1587
|
-
description : str
|
1588
|
-
Description of sensor in the Airflow UI
|
1589
|
-
external_dag_id : str
|
1590
|
-
The dag_id that contains the task you want to wait for.
|
1591
|
-
external_task_ids : List[str]
|
1592
|
-
The list of task_ids that you want to wait for.
|
1593
|
-
If None (default value) the sensor waits for the DAG. (Default: None)
|
1594
|
-
allowed_states : List[str]
|
1595
|
-
Iterable of allowed states, (Default: ['success'])
|
1596
|
-
failed_states : List[str]
|
1597
|
-
Iterable of failed or dis-allowed states. (Default: None)
|
1598
|
-
execution_delta : datetime.timedelta
|
1599
|
-
time difference with the previous execution to look at,
|
1600
|
-
the default is the same logical date as the current task or DAG. (Default: None)
|
1601
|
-
check_existence: bool
|
1602
|
-
Set to True to check if the external task exists or check if
|
1603
|
-
the DAG to wait for exists. (Default: True)
|
1624
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1625
|
+
Upstream flow dependency for this flow.
|
1626
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1627
|
+
Upstream flow dependencies for this flow.
|
1628
|
+
options : Dict[str, Any], default {}
|
1629
|
+
Backend-specific configuration for tuning eventing behavior.
|
1604
1630
|
"""
|
1605
1631
|
...
|
1606
1632
|
|
1607
|
-
|
1633
|
+
@typing.overload
|
1634
|
+
def trigger_on_finish(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1635
|
+
...
|
1636
|
+
|
1637
|
+
def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, flow: typing.Union[typing.Dict[str, str], str, None] = None, flows: typing.List[typing.Union[str, typing.Dict[str, str]]] = [], options: typing.Dict[str, typing.Any] = {}):
|
1608
1638
|
"""
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
|
1613
|
-
|
1639
|
+
Specifies the flow(s) that this flow depends on.
|
1640
|
+
|
1641
|
+
```
|
1642
|
+
@trigger_on_finish(flow='FooFlow')
|
1643
|
+
```
|
1644
|
+
or
|
1645
|
+
```
|
1646
|
+
@trigger_on_finish(flows=['FooFlow', 'BarFlow'])
|
1647
|
+
```
|
1648
|
+
This decorator respects the @project decorator and triggers the flow
|
1649
|
+
when upstream runs within the same namespace complete successfully
|
1650
|
+
|
1651
|
+
Additionally, you can specify project aware upstream flow dependencies
|
1652
|
+
by specifying the fully qualified project_flow_name.
|
1653
|
+
```
|
1654
|
+
@trigger_on_finish(flow='my_project.branch.my_branch.FooFlow')
|
1655
|
+
```
|
1656
|
+
or
|
1657
|
+
```
|
1658
|
+
@trigger_on_finish(flows=['my_project.branch.my_branch.FooFlow', 'BarFlow'])
|
1659
|
+
```
|
1660
|
+
|
1661
|
+
You can also specify just the project or project branch (other values will be
|
1662
|
+
inferred from the current project or project branch):
|
1663
|
+
```
|
1664
|
+
@trigger_on_finish(flow={"name": "FooFlow", "project": "my_project", "project_branch": "branch"})
|
1665
|
+
```
|
1666
|
+
|
1667
|
+
Note that `branch` is typically one of:
|
1668
|
+
- `prod`
|
1669
|
+
- `user.bob`
|
1670
|
+
- `test.my_experiment`
|
1671
|
+
- `prod.staging`
|
1614
1672
|
|
1615
1673
|
|
1616
1674
|
Parameters
|
1617
1675
|
----------
|
1618
|
-
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1623
|
-
|
1624
|
-
exponential_backoff : bool
|
1625
|
-
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1626
|
-
pool : str
|
1627
|
-
the slot pool this task should run in,
|
1628
|
-
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1629
|
-
soft_fail : bool
|
1630
|
-
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1631
|
-
name : str
|
1632
|
-
Name of the sensor on Airflow
|
1633
|
-
description : str
|
1634
|
-
Description of sensor in the Airflow UI
|
1635
|
-
bucket_key : Union[str, List[str]]
|
1636
|
-
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1637
|
-
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1638
|
-
bucket_name : str
|
1639
|
-
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1640
|
-
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1641
|
-
wildcard_match : bool
|
1642
|
-
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1643
|
-
aws_conn_id : str
|
1644
|
-
a reference to the s3 connection on Airflow. (Default: None)
|
1645
|
-
verify : bool
|
1646
|
-
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1676
|
+
flow : Union[str, Dict[str, str]], optional, default None
|
1677
|
+
Upstream flow dependency for this flow.
|
1678
|
+
flows : List[Union[str, Dict[str, str]]], default []
|
1679
|
+
Upstream flow dependencies for this flow.
|
1680
|
+
options : Dict[str, Any], default {}
|
1681
|
+
Backend-specific configuration for tuning eventing behavior.
|
1647
1682
|
"""
|
1648
1683
|
...
|
1649
1684
|
|
1650
1685
|
@typing.overload
|
1651
|
-
def
|
1686
|
+
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]]:
|
1652
1687
|
"""
|
1653
|
-
Specifies the
|
1654
|
-
|
1655
|
-
Use `@conda_base` to set common libraries required by all
|
1656
|
-
steps and use `@conda` to specify step-specific additions.
|
1688
|
+
Specifies the times when the flow should be run when running on a
|
1689
|
+
production scheduler.
|
1657
1690
|
|
1658
1691
|
|
1659
1692
|
Parameters
|
1660
1693
|
----------
|
1661
|
-
|
1662
|
-
|
1663
|
-
|
1664
|
-
|
1665
|
-
|
1666
|
-
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1694
|
+
hourly : bool, default False
|
1695
|
+
Run the workflow hourly.
|
1696
|
+
daily : bool, default True
|
1697
|
+
Run the workflow daily.
|
1698
|
+
weekly : bool, default False
|
1699
|
+
Run the workflow weekly.
|
1700
|
+
cron : str, optional, default None
|
1701
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1702
|
+
specified by this expression.
|
1703
|
+
timezone : str, optional, default None
|
1704
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1705
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1671
1706
|
"""
|
1672
1707
|
...
|
1673
1708
|
|
1674
1709
|
@typing.overload
|
1675
|
-
def
|
1710
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1676
1711
|
...
|
1677
1712
|
|
1678
|
-
def
|
1713
|
+
def schedule(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, hourly: bool = False, daily: bool = True, weekly: bool = False, cron: typing.Optional[str] = None, timezone: typing.Optional[str] = None):
|
1679
1714
|
"""
|
1680
|
-
Specifies the
|
1681
|
-
|
1682
|
-
Use `@conda_base` to set common libraries required by all
|
1683
|
-
steps and use `@conda` to specify step-specific additions.
|
1715
|
+
Specifies the times when the flow should be run when running on a
|
1716
|
+
production scheduler.
|
1684
1717
|
|
1685
1718
|
|
1686
1719
|
Parameters
|
1687
1720
|
----------
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1721
|
+
hourly : bool, default False
|
1722
|
+
Run the workflow hourly.
|
1723
|
+
daily : bool, default True
|
1724
|
+
Run the workflow daily.
|
1725
|
+
weekly : bool, default False
|
1726
|
+
Run the workflow weekly.
|
1727
|
+
cron : str, optional, default None
|
1728
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1729
|
+
specified by this expression.
|
1730
|
+
timezone : str, optional, default None
|
1731
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1732
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1698
1733
|
"""
|
1699
1734
|
...
|
1700
1735
|
|
@@ -1791,40 +1826,5 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1791
1826
|
"""
|
1792
1827
|
...
|
1793
1828
|
|
1794
|
-
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1795
|
-
"""
|
1796
|
-
Specifies what flows belong to the same project.
|
1797
|
-
|
1798
|
-
A project-specific namespace is created for all flows that
|
1799
|
-
use the same `@project(name)`.
|
1800
|
-
|
1801
|
-
|
1802
|
-
Parameters
|
1803
|
-
----------
|
1804
|
-
name : str
|
1805
|
-
Project name. Make sure that the name is unique amongst all
|
1806
|
-
projects that use the same production scheduler. The name may
|
1807
|
-
contain only lowercase alphanumeric characters and underscores.
|
1808
|
-
|
1809
|
-
branch : Optional[str], default None
|
1810
|
-
The branch to use. If not specified, the branch is set to
|
1811
|
-
`user.<username>` unless `production` is set to `True`. This can
|
1812
|
-
also be set on the command line using `--branch` as a top-level option.
|
1813
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
1814
|
-
|
1815
|
-
production : bool, default False
|
1816
|
-
Whether or not the branch is the production branch. This can also be set on the
|
1817
|
-
command line using `--production` as a top-level option. It is an error to specify
|
1818
|
-
`production` in the decorator and on the command line.
|
1819
|
-
The project branch name will be:
|
1820
|
-
- if `branch` is specified:
|
1821
|
-
- if `production` is True: `prod.<branch>`
|
1822
|
-
- if `production` is False: `test.<branch>`
|
1823
|
-
- if `branch` is not specified:
|
1824
|
-
- if `production` is True: `prod`
|
1825
|
-
- if `production` is False: `user.<username>`
|
1826
|
-
"""
|
1827
|
-
...
|
1828
|
-
|
1829
1829
|
pkg_name: str
|
1830
1830
|
|