ob-metaflow-stubs 6.0.4.6rc1__py2.py3-none-any.whl → 6.0.4.8rc1__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 +729 -704
- metaflow-stubs/cards.pyi +2 -2
- metaflow-stubs/cli.pyi +3 -2
- metaflow-stubs/cli_components/__init__.pyi +2 -2
- metaflow-stubs/cli_components/utils.pyi +2 -2
- metaflow-stubs/client/__init__.pyi +2 -2
- metaflow-stubs/client/core.pyi +7 -8
- metaflow-stubs/client/filecache.pyi +2 -2
- metaflow-stubs/events.pyi +3 -3
- metaflow-stubs/exception.pyi +2 -2
- metaflow-stubs/flowspec.pyi +8 -8
- metaflow-stubs/generated_for.txt +1 -1
- metaflow-stubs/includefile.pyi +4 -4
- metaflow-stubs/{info_file.pyi → meta_files.pyi} +2 -6
- metaflow-stubs/metadata_provider/__init__.pyi +2 -2
- metaflow-stubs/metadata_provider/heartbeat.pyi +2 -2
- metaflow-stubs/metadata_provider/metadata.pyi +2 -2
- metaflow-stubs/metadata_provider/util.pyi +2 -2
- metaflow-stubs/metaflow_config.pyi +6 -2
- metaflow-stubs/metaflow_current.pyi +34 -34
- metaflow-stubs/metaflow_git.pyi +2 -2
- metaflow-stubs/mf_extensions/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/__init__.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/card_utils/extra_components.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/cards/__init__.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/checkpoint_storage.pyi +4 -4
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/constructors.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/final_api.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/checkpoints/lineage.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/__init__.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/task_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastore/utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/datastructures.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/hf_hub/decorator.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/core.pyi +3 -3
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/modeling_utils/exceptions.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/flowspec_utils.pyi +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/general.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/obcheckpoint/plugins/machine_learning_utilities/utils/serialization_handler/base.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_state_machine.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/_vendor/spinner/spinners.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_cli.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/app_config.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/capsule.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/click_importer.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/code_package/__init__.pyi +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/config/cli_generator.pyi +2 -2
- 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 +2 -2
- 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 +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/deployer.pyi +4 -4
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/experimental/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/perimeters.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/apps/core/utils.pyi +4 -4
- metaflow-stubs/mf_extensions/outerbounds/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/aws/assume_role_decorator.pyi +12 -8
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/async_cards.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/card_utilities/injector.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/coreweave.pyi +13 -8
- metaflow-stubs/mf_extensions/outerbounds/plugins/checkpoint_datastores/nebius.pyi +11 -8
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/baker.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/docker_environment.pyi +3 -3
- metaflow-stubs/mf_extensions/outerbounds/plugins/fast_bakery/fast_bakery.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/kubernetes/pod_killer.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/constants.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/exceptions.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/ollama.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/ollama/status_card.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/plugins/snowflake/snowflake.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/profilers/gpu.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/remote_config.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/__init__.pyi +2 -2
- metaflow-stubs/mf_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.pyi +2 -2
- metaflow-stubs/multicore_utils.pyi +2 -2
- metaflow-stubs/ob_internal.pyi +2 -2
- metaflow-stubs/packaging_sys/__init__.pyi +430 -0
- metaflow-stubs/packaging_sys/backend.pyi +73 -0
- metaflow-stubs/packaging_sys/distribution_support.pyi +57 -0
- metaflow-stubs/packaging_sys/tar_backend.pyi +53 -0
- metaflow-stubs/packaging_sys/utils.pyi +26 -0
- metaflow-stubs/packaging_sys/v1.pyi +145 -0
- metaflow-stubs/parameters.pyi +4 -4
- metaflow-stubs/plugins/__init__.pyi +11 -11
- metaflow-stubs/plugins/airflow/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/airflow_utils.pyi +2 -2
- metaflow-stubs/plugins/airflow/exception.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/__init__.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/base_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/external_task_sensor.pyi +2 -2
- metaflow-stubs/plugins/airflow/sensors/s3_sensor.pyi +2 -2
- metaflow-stubs/plugins/argo/__init__.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_client.pyi +3 -3
- metaflow-stubs/plugins/argo/argo_events.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_decorator.pyi +2 -2
- metaflow-stubs/plugins/argo/argo_workflows_deployer.pyi +4 -4
- metaflow-stubs/plugins/argo/argo_workflows_deployer_objects.pyi +21 -3
- metaflow-stubs/plugins/argo/exit_hooks.pyi +2 -2
- metaflow-stubs/plugins/aws/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_client.pyi +2 -2
- metaflow-stubs/plugins/aws/aws_utils.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch.pyi +4 -4
- metaflow-stubs/plugins/aws/batch/batch_client.pyi +2 -2
- metaflow-stubs/plugins/aws/batch/batch_decorator.pyi +4 -2
- metaflow-stubs/plugins/aws/secrets_manager/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/secrets_manager/aws_secrets_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/aws/step_functions/__init__.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/event_bridge_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/schedule_decorator.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_client.pyi +2 -2
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer.pyi +3 -3
- metaflow-stubs/plugins/aws/step_functions/step_functions_deployer_objects.pyi +13 -2
- metaflow-stubs/plugins/azure/__init__.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_credential.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_exceptions.pyi +2 -2
- metaflow-stubs/plugins/azure/azure_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/azure/azure_utils.pyi +2 -2
- metaflow-stubs/plugins/azure/blob_service_client_factory.pyi +2 -2
- metaflow-stubs/plugins/azure/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/cards/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_client.pyi +2 -2
- metaflow-stubs/plugins/cards/card_creator.pyi +2 -2
- metaflow-stubs/plugins/cards/card_datastore.pyi +2 -2
- metaflow-stubs/plugins/cards/card_decorator.pyi +2 -4
- metaflow-stubs/plugins/cards/card_modules/__init__.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/basic.pyi +3 -3
- metaflow-stubs/plugins/cards/card_modules/card.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/components.pyi +4 -4
- metaflow-stubs/plugins/cards/card_modules/convert_to_native_type.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/renderer_tools.pyi +2 -2
- metaflow-stubs/plugins/cards/card_modules/test_cards.pyi +2 -2
- metaflow-stubs/plugins/cards/card_resolver.pyi +2 -2
- metaflow-stubs/plugins/cards/component_serializer.pyi +2 -2
- metaflow-stubs/plugins/cards/exception.pyi +2 -2
- metaflow-stubs/plugins/catch_decorator.pyi +2 -2
- metaflow-stubs/plugins/datatools/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/local.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/__init__.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3.pyi +3 -3
- metaflow-stubs/plugins/datatools/s3/s3tail.pyi +2 -2
- metaflow-stubs/plugins/datatools/s3/s3util.pyi +2 -2
- metaflow-stubs/plugins/debug_logger.pyi +2 -2
- metaflow-stubs/plugins/debug_monitor.pyi +2 -2
- metaflow-stubs/plugins/environment_decorator.pyi +2 -2
- metaflow-stubs/plugins/events_decorator.pyi +2 -2
- metaflow-stubs/plugins/exit_hook/__init__.pyi +2 -2
- metaflow-stubs/plugins/exit_hook/exit_hook_decorator.pyi +2 -2
- metaflow-stubs/plugins/frameworks/__init__.pyi +2 -2
- metaflow-stubs/plugins/frameworks/pytorch.pyi +2 -2
- metaflow-stubs/plugins/gcp/__init__.pyi +2 -2
- metaflow-stubs/plugins/gcp/gcp_secret_manager_secrets_provider.pyi +4 -4
- metaflow-stubs/plugins/gcp/gs_exceptions.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_storage_client_factory.pyi +2 -2
- metaflow-stubs/plugins/gcp/gs_utils.pyi +2 -2
- metaflow-stubs/plugins/gcp/includefile_support.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/__init__.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kube_utils.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes.pyi +4 -4
- metaflow-stubs/plugins/kubernetes/kubernetes_client.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/kubernetes_decorator.pyi +5 -3
- metaflow-stubs/plugins/kubernetes/kubernetes_jobsets.pyi +2 -2
- metaflow-stubs/plugins/kubernetes/spot_monitor_sidecar.pyi +2 -2
- metaflow-stubs/plugins/ollama/__init__.pyi +2 -2
- metaflow-stubs/plugins/parallel_decorator.pyi +3 -3
- metaflow-stubs/plugins/perimeters.pyi +2 -2
- metaflow-stubs/plugins/project_decorator.pyi +2 -2
- metaflow-stubs/plugins/pypi/__init__.pyi +2 -2
- metaflow-stubs/plugins/pypi/conda_decorator.pyi +5 -8
- metaflow-stubs/plugins/pypi/conda_environment.pyi +5 -4
- metaflow-stubs/plugins/pypi/parsers.pyi +2 -2
- metaflow-stubs/plugins/pypi/pypi_decorator.pyi +4 -4
- metaflow-stubs/plugins/pypi/pypi_environment.pyi +2 -2
- metaflow-stubs/plugins/pypi/utils.pyi +2 -2
- metaflow-stubs/plugins/resources_decorator.pyi +2 -2
- metaflow-stubs/plugins/retry_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/__init__.pyi +3 -3
- metaflow-stubs/plugins/secrets/inline_secrets_provider.pyi +3 -3
- metaflow-stubs/plugins/secrets/secrets_decorator.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_func.pyi +2 -2
- metaflow-stubs/plugins/secrets/secrets_spec.pyi +2 -2
- metaflow-stubs/plugins/secrets/utils.pyi +2 -2
- metaflow-stubs/plugins/snowflake/__init__.pyi +2 -2
- metaflow-stubs/plugins/storage_executor.pyi +2 -2
- metaflow-stubs/plugins/test_unbounded_foreach_decorator.pyi +3 -3
- metaflow-stubs/plugins/timeout_decorator.pyi +2 -2
- metaflow-stubs/plugins/torchtune/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/__init__.pyi +2 -2
- metaflow-stubs/plugins/uv/uv_environment.pyi +3 -2
- metaflow-stubs/profilers/__init__.pyi +2 -2
- metaflow-stubs/pylint_wrapper.pyi +2 -2
- metaflow-stubs/runner/__init__.pyi +2 -2
- metaflow-stubs/runner/deployer.pyi +31 -6
- metaflow-stubs/runner/deployer_impl.pyi +2 -2
- metaflow-stubs/runner/metaflow_runner.pyi +3 -3
- metaflow-stubs/runner/nbdeploy.pyi +2 -2
- metaflow-stubs/runner/nbrun.pyi +2 -2
- metaflow-stubs/runner/subprocess_manager.pyi +3 -2
- metaflow-stubs/runner/utils.pyi +3 -3
- metaflow-stubs/system/__init__.pyi +2 -2
- metaflow-stubs/system/system_logger.pyi +3 -3
- metaflow-stubs/system/system_monitor.pyi +2 -2
- metaflow-stubs/tagging_util.pyi +2 -2
- metaflow-stubs/tuple_util.pyi +2 -2
- metaflow-stubs/user_configs/__init__.pyi +2 -3
- metaflow-stubs/user_configs/config_options.pyi +4 -5
- metaflow-stubs/user_configs/config_parameters.pyi +6 -8
- metaflow-stubs/user_decorators/__init__.pyi +15 -0
- metaflow-stubs/user_decorators/common.pyi +38 -0
- metaflow-stubs/user_decorators/mutable_flow.pyi +223 -0
- metaflow-stubs/user_decorators/mutable_step.pyi +152 -0
- metaflow-stubs/user_decorators/user_flow_decorator.pyi +137 -0
- metaflow-stubs/user_decorators/user_step_decorator.pyi +323 -0
- {ob_metaflow_stubs-6.0.4.6rc1.dist-info → ob_metaflow_stubs-6.0.4.8rc1.dist-info}/METADATA +1 -1
- ob_metaflow_stubs-6.0.4.8rc1.dist-info/RECORD +260 -0
- metaflow-stubs/user_configs/config_decorators.pyi +0 -251
- ob_metaflow_stubs-6.0.4.6rc1.dist-info/RECORD +0 -249
- {ob_metaflow_stubs-6.0.4.6rc1.dist-info → ob_metaflow_stubs-6.0.4.8rc1.dist-info}/WHEEL +0 -0
- {ob_metaflow_stubs-6.0.4.6rc1.dist-info → ob_metaflow_stubs-6.0.4.8rc1.dist-info}/top_level.txt +0 -0
metaflow-stubs/__init__.pyi
CHANGED
@@ -1,19 +1,20 @@
|
|
1
1
|
######################################################################################################
|
2
2
|
# Auto-generated Metaflow stub file #
|
3
|
-
# MF version: 2.
|
4
|
-
# Generated on 2025-07-
|
3
|
+
# MF version: 2.16.5.1+obcheckpoint(0.2.4);ob(v1) #
|
4
|
+
# Generated on 2025-07-28T18:04:46.561163 #
|
5
5
|
######################################################################################################
|
6
6
|
|
7
7
|
from __future__ import annotations
|
8
8
|
|
9
9
|
import typing
|
10
10
|
if typing.TYPE_CHECKING:
|
11
|
-
import datetime
|
12
11
|
import typing
|
12
|
+
import datetime
|
13
13
|
FlowSpecDerived = typing.TypeVar("FlowSpecDerived", bound="FlowSpec", contravariant=False, covariant=False)
|
14
14
|
StepFlag = typing.NewType("StepFlag", bool)
|
15
15
|
|
16
|
-
from . import
|
16
|
+
from . import meta_files as meta_files
|
17
|
+
from . import packaging_sys as packaging_sys
|
17
18
|
from . import exception as exception
|
18
19
|
from . import metaflow_config as metaflow_config
|
19
20
|
from . import multicore_utils as multicore_utils
|
@@ -23,6 +24,7 @@ from . import metaflow_current as metaflow_current
|
|
23
24
|
from .metaflow_current import current as current
|
24
25
|
from . import parameters as parameters
|
25
26
|
from . import user_configs as user_configs
|
27
|
+
from . import user_decorators as user_decorators
|
26
28
|
from . import tagging_util as tagging_util
|
27
29
|
from . import metadata_provider as metadata_provider
|
28
30
|
from . import flowspec as flowspec
|
@@ -33,20 +35,22 @@ from .parameters import JSONType as JSONType
|
|
33
35
|
from .user_configs.config_parameters import Config as Config
|
34
36
|
from .user_configs.config_parameters import ConfigValue as ConfigValue
|
35
37
|
from .user_configs.config_parameters import config_expr as config_expr
|
36
|
-
from .
|
37
|
-
from .
|
38
|
-
from . import
|
38
|
+
from .user_decorators.user_step_decorator import UserStepDecorator as UserStepDecorator
|
39
|
+
from .user_decorators.user_step_decorator import StepMutator as StepMutator
|
40
|
+
from .user_decorators.user_step_decorator import user_step_decorator as user_step_decorator
|
41
|
+
from .user_decorators.user_flow_decorator import FlowMutator as FlowMutator
|
39
42
|
from . import tuple_util as tuple_util
|
40
|
-
from . import
|
43
|
+
from . import cards as cards
|
41
44
|
from . import metaflow_git as metaflow_git
|
45
|
+
from . import events as events
|
42
46
|
from . import runner as runner
|
43
47
|
from . import plugins as plugins
|
44
48
|
from .mf_extensions.outerbounds.toplevel.global_aliases_for_metaflow_package import S3 as S3
|
45
49
|
from . import includefile as includefile
|
46
50
|
from .includefile import IncludeFile as IncludeFile
|
47
|
-
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
48
|
-
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
49
51
|
from .plugins.pypi.parsers import pyproject_toml_parser as pyproject_toml_parser
|
52
|
+
from .plugins.pypi.parsers import conda_environment_yml_parser as conda_environment_yml_parser
|
53
|
+
from .plugins.pypi.parsers import requirements_txt_parser as requirements_txt_parser
|
50
54
|
from . import client as client
|
51
55
|
from .client.core import namespace as namespace
|
52
56
|
from .client.core import get_namespace as get_namespace
|
@@ -83,6 +87,8 @@ from . import ob_internal as ob_internal
|
|
83
87
|
|
84
88
|
EXT_PKG: str
|
85
89
|
|
90
|
+
USER_SKIP_STEP: dict
|
91
|
+
|
86
92
|
@typing.overload
|
87
93
|
def step(f: typing.Callable[[FlowSpecDerived], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
88
94
|
"""
|
@@ -156,95 +162,6 @@ def step(f: typing.Union[typing.Callable[[FlowSpecDerived], None], typing.Callab
|
|
156
162
|
"""
|
157
163
|
...
|
158
164
|
|
159
|
-
@typing.overload
|
160
|
-
def app_deploy(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 app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
169
|
-
...
|
170
|
-
|
171
|
-
def app_deploy(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
|
-
@typing.overload
|
179
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
180
|
-
"""
|
181
|
-
Decorator prototype for all step decorators. This function gets specialized
|
182
|
-
and imported for all decorators types by _import_plugin_decorators().
|
183
|
-
"""
|
184
|
-
...
|
185
|
-
|
186
|
-
@typing.overload
|
187
|
-
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
188
|
-
...
|
189
|
-
|
190
|
-
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
191
|
-
"""
|
192
|
-
Decorator prototype for all step decorators. This function gets specialized
|
193
|
-
and imported for all decorators types by _import_plugin_decorators().
|
194
|
-
"""
|
195
|
-
...
|
196
|
-
|
197
|
-
@typing.overload
|
198
|
-
def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
199
|
-
"""
|
200
|
-
Specifies that the step will success under all circumstances.
|
201
|
-
|
202
|
-
The decorator will create an optional artifact, specified by `var`, which
|
203
|
-
contains the exception raised. You can use it to detect the presence
|
204
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
205
|
-
are missing.
|
206
|
-
|
207
|
-
|
208
|
-
Parameters
|
209
|
-
----------
|
210
|
-
var : str, optional, default None
|
211
|
-
Name of the artifact in which to store the caught exception.
|
212
|
-
If not specified, the exception is not stored.
|
213
|
-
print_exception : bool, default True
|
214
|
-
Determines whether or not the exception is printed to
|
215
|
-
stdout when caught.
|
216
|
-
"""
|
217
|
-
...
|
218
|
-
|
219
|
-
@typing.overload
|
220
|
-
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
221
|
-
...
|
222
|
-
|
223
|
-
@typing.overload
|
224
|
-
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
225
|
-
...
|
226
|
-
|
227
|
-
def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
|
228
|
-
"""
|
229
|
-
Specifies that the step will success under all circumstances.
|
230
|
-
|
231
|
-
The decorator will create an optional artifact, specified by `var`, which
|
232
|
-
contains the exception raised. You can use it to detect the presence
|
233
|
-
of errors, indicating that all happy-path artifacts produced by the step
|
234
|
-
are missing.
|
235
|
-
|
236
|
-
|
237
|
-
Parameters
|
238
|
-
----------
|
239
|
-
var : str, optional, default None
|
240
|
-
Name of the artifact in which to store the caught exception.
|
241
|
-
If not specified, the exception is not stored.
|
242
|
-
print_exception : bool, default True
|
243
|
-
Determines whether or not the exception is printed to
|
244
|
-
stdout when caught.
|
245
|
-
"""
|
246
|
-
...
|
247
|
-
|
248
165
|
@typing.overload
|
249
166
|
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]]]:
|
250
167
|
"""
|
@@ -324,114 +241,120 @@ def resources(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None]
|
|
324
241
|
"""
|
325
242
|
...
|
326
243
|
|
327
|
-
def
|
244
|
+
def kubernetes(*, cpu: int = 1, memory: int = 4096, disk: int = 10240, image: typing.Optional[str] = None, image_pull_policy: str = 'KUBERNETES_IMAGE_PULL_POLICY', image_pull_secrets: typing.List[str] = [], service_account: str = 'METAFLOW_KUBERNETES_SERVICE_ACCOUNT', secrets: typing.Optional[typing.List[str]] = None, node_selector: typing.Union[typing.Dict[str, str], str, None] = None, namespace: str = 'METAFLOW_KUBERNETES_NAMESPACE', gpu: typing.Optional[int] = None, gpu_vendor: str = 'KUBERNETES_GPU_VENDOR', tolerations: typing.List[typing.Dict[str, str]] = [], labels: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_LABELS', annotations: typing.Dict[str, str] = 'METAFLOW_KUBERNETES_ANNOTATIONS', use_tmpfs: bool = False, tmpfs_tempdir: bool = True, tmpfs_size: typing.Optional[int] = None, tmpfs_path: typing.Optional[str] = '/metaflow_temp', persistent_volume_claims: typing.Optional[typing.Dict[str, str]] = None, shared_memory: typing.Optional[int] = None, port: typing.Optional[int] = None, compute_pool: typing.Optional[str] = None, hostname_resolution_timeout: int = 600, qos: str = 'Burstable', security_context: typing.Optional[typing.Dict[str, typing.Any]] = 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]]]:
|
328
245
|
"""
|
329
|
-
|
330
|
-
|
331
|
-
User code call
|
332
|
-
--------------
|
333
|
-
@ollama(
|
334
|
-
models=[...],
|
335
|
-
...
|
336
|
-
)
|
337
|
-
|
338
|
-
Valid backend options
|
339
|
-
---------------------
|
340
|
-
- 'local': Run as a separate process on the local task machine.
|
341
|
-
- (TODO) 'managed': Outerbounds hosts and selects compute provider.
|
342
|
-
- (TODO) 'remote': Spin up separate instance to serve Ollama models.
|
343
|
-
|
344
|
-
Valid model options
|
345
|
-
-------------------
|
346
|
-
Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
|
246
|
+
Specifies that this step should execute on Kubernetes.
|
347
247
|
|
348
248
|
|
349
249
|
Parameters
|
350
250
|
----------
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
251
|
+
cpu : int, default 1
|
252
|
+
Number of CPUs required for this step. If `@resources` is
|
253
|
+
also present, the maximum value from all decorators is used.
|
254
|
+
memory : int, default 4096
|
255
|
+
Memory size (in MB) required for this step. If
|
256
|
+
`@resources` is also present, the maximum value from all decorators is
|
257
|
+
used.
|
258
|
+
disk : int, default 10240
|
259
|
+
Disk size (in MB) required for this step. If
|
260
|
+
`@resources` is also present, the maximum value from all decorators is
|
261
|
+
used.
|
262
|
+
image : str, optional, default None
|
263
|
+
Docker image to use when launching on Kubernetes. If not specified, and
|
264
|
+
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
265
|
+
not, a default Docker image mapping to the current version of Python is used.
|
266
|
+
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
267
|
+
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
268
|
+
image_pull_secrets: List[str], default []
|
269
|
+
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
270
|
+
Kubernetes image pull secrets to use when pulling container images
|
271
|
+
in Kubernetes.
|
272
|
+
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
273
|
+
Kubernetes service account to use when launching pod in Kubernetes.
|
274
|
+
secrets : List[str], optional, default None
|
275
|
+
Kubernetes secrets to use when launching pod in Kubernetes. These
|
276
|
+
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
277
|
+
in Metaflow configuration.
|
278
|
+
node_selector: Union[Dict[str,str], str], optional, default None
|
279
|
+
Kubernetes node selector(s) to apply to the pod running the task.
|
280
|
+
Can be passed in as a comma separated string of values e.g.
|
281
|
+
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
282
|
+
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
283
|
+
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
284
|
+
Kubernetes namespace to use when launching pod in Kubernetes.
|
285
|
+
gpu : int, optional, default None
|
286
|
+
Number of GPUs required for this step. A value of zero implies that
|
287
|
+
the scheduled node should not have GPUs.
|
288
|
+
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
289
|
+
The vendor of the GPUs to be used for this step.
|
290
|
+
tolerations : List[Dict[str,str]], default []
|
291
|
+
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
292
|
+
Kubernetes tolerations to use when launching pod in Kubernetes.
|
293
|
+
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
294
|
+
Kubernetes labels to use when launching pod in Kubernetes.
|
295
|
+
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
296
|
+
Kubernetes annotations to use when launching pod in Kubernetes.
|
297
|
+
use_tmpfs : bool, default False
|
298
|
+
This enables an explicit tmpfs mount for this step.
|
299
|
+
tmpfs_tempdir : bool, default True
|
300
|
+
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
301
|
+
tmpfs_size : int, optional, default: None
|
302
|
+
The value for the size (in MiB) of the tmpfs mount for this step.
|
303
|
+
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
304
|
+
memory allocated for this step.
|
305
|
+
tmpfs_path : str, optional, default /metaflow_temp
|
306
|
+
Path to tmpfs mount for this step.
|
307
|
+
persistent_volume_claims : Dict[str, str], optional, default None
|
308
|
+
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
309
|
+
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
310
|
+
shared_memory: int, optional
|
311
|
+
Shared memory size (in MiB) required for this step
|
312
|
+
port: int, optional
|
313
|
+
Port number to specify in the Kubernetes job object
|
314
|
+
compute_pool : str, optional, default None
|
315
|
+
Compute pool to be used for for this step.
|
316
|
+
If not specified, any accessible compute pool within the perimeter is used.
|
317
|
+
hostname_resolution_timeout: int, default 10 * 60
|
318
|
+
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
319
|
+
Only applicable when @parallel is used.
|
320
|
+
qos: str, default: Burstable
|
321
|
+
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
322
|
+
|
323
|
+
security_context: Dict[str, Any], optional, default None
|
324
|
+
Container security context. Applies to the task container. Allows the following keys:
|
325
|
+
- privileged: bool, optional, default None
|
326
|
+
- allow_privilege_escalation: bool, optional, default None
|
327
|
+
- run_as_user: int, optional, default None
|
328
|
+
- run_as_group: int, optional, default None
|
329
|
+
- run_as_non_root: bool, optional, default None
|
367
330
|
"""
|
368
331
|
...
|
369
332
|
|
370
333
|
@typing.overload
|
371
|
-
def
|
334
|
+
def app_deploy(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
372
335
|
"""
|
373
|
-
|
374
|
-
|
375
|
-
This decorator is useful if this step may hang indefinitely.
|
376
|
-
|
377
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
378
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
379
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
380
|
-
|
381
|
-
Note that all the values specified in parameters are added together so if you specify
|
382
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
383
|
-
|
384
|
-
|
385
|
-
Parameters
|
386
|
-
----------
|
387
|
-
seconds : int, default 0
|
388
|
-
Number of seconds to wait prior to timing out.
|
389
|
-
minutes : int, default 0
|
390
|
-
Number of minutes to wait prior to timing out.
|
391
|
-
hours : int, default 0
|
392
|
-
Number of hours to wait prior to timing out.
|
336
|
+
Decorator prototype for all step decorators. This function gets specialized
|
337
|
+
and imported for all decorators types by _import_plugin_decorators().
|
393
338
|
"""
|
394
339
|
...
|
395
340
|
|
396
341
|
@typing.overload
|
397
|
-
def
|
342
|
+
def app_deploy(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
398
343
|
...
|
399
344
|
|
400
|
-
|
401
|
-
|
345
|
+
def app_deploy(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
346
|
+
"""
|
347
|
+
Decorator prototype for all step decorators. This function gets specialized
|
348
|
+
and imported for all decorators types by _import_plugin_decorators().
|
349
|
+
"""
|
402
350
|
...
|
403
351
|
|
404
|
-
|
352
|
+
@typing.overload
|
353
|
+
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]]]:
|
405
354
|
"""
|
406
|
-
|
355
|
+
Enables checkpointing for a step.
|
407
356
|
|
408
|
-
|
409
|
-
|
410
|
-
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
411
|
-
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
412
|
-
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
413
|
-
|
414
|
-
Note that all the values specified in parameters are added together so if you specify
|
415
|
-
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
416
|
-
|
417
|
-
|
418
|
-
Parameters
|
419
|
-
----------
|
420
|
-
seconds : int, default 0
|
421
|
-
Number of seconds to wait prior to timing out.
|
422
|
-
minutes : int, default 0
|
423
|
-
Number of minutes to wait prior to timing out.
|
424
|
-
hours : int, default 0
|
425
|
-
Number of hours to wait prior to timing out.
|
426
|
-
"""
|
427
|
-
...
|
428
|
-
|
429
|
-
@typing.overload
|
430
|
-
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]]]:
|
431
|
-
"""
|
432
|
-
Enables checkpointing for a step.
|
433
|
-
|
434
|
-
> Examples
|
357
|
+
> Examples
|
435
358
|
|
436
359
|
- Saving Checkpoints
|
437
360
|
|
@@ -574,220 +497,142 @@ def checkpoint(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None
|
|
574
497
|
...
|
575
498
|
|
576
499
|
@typing.overload
|
577
|
-
def
|
500
|
+
def test_append_card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
578
501
|
"""
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
Parameters
|
583
|
-
----------
|
584
|
-
vars : Dict[str, str], default {}
|
585
|
-
Dictionary of environment variables to set.
|
502
|
+
A simple decorator that demonstrates using CardDecoratorInjector
|
503
|
+
to inject a card and render simple markdown content.
|
586
504
|
"""
|
587
505
|
...
|
588
506
|
|
589
507
|
@typing.overload
|
590
|
-
def
|
508
|
+
def test_append_card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
591
509
|
...
|
592
510
|
|
593
|
-
|
594
|
-
|
511
|
+
def test_append_card(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
512
|
+
"""
|
513
|
+
A simple decorator that demonstrates using CardDecoratorInjector
|
514
|
+
to inject a card and render simple markdown content.
|
515
|
+
"""
|
595
516
|
...
|
596
517
|
|
597
|
-
|
518
|
+
@typing.overload
|
519
|
+
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]]]:
|
598
520
|
"""
|
599
|
-
Specifies
|
521
|
+
Specifies the Conda environment for the step.
|
522
|
+
|
523
|
+
Information in this decorator will augment any
|
524
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
525
|
+
you can use `@conda_base` to set packages required by all
|
526
|
+
steps and use `@conda` to specify step-specific overrides.
|
600
527
|
|
601
528
|
|
602
529
|
Parameters
|
603
530
|
----------
|
604
|
-
|
605
|
-
|
531
|
+
packages : Dict[str, str], default {}
|
532
|
+
Packages to use for this step. The key is the name of the package
|
533
|
+
and the value is the version to use.
|
534
|
+
libraries : Dict[str, str], default {}
|
535
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
536
|
+
python : str, optional, default None
|
537
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
538
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
539
|
+
disabled : bool, default False
|
540
|
+
If set to True, disables @conda.
|
606
541
|
"""
|
607
542
|
...
|
608
543
|
|
609
544
|
@typing.overload
|
610
|
-
def
|
611
|
-
"""
|
612
|
-
Internal decorator to support Fast bakery
|
613
|
-
"""
|
545
|
+
def conda(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
614
546
|
...
|
615
547
|
|
616
548
|
@typing.overload
|
617
|
-
def
|
549
|
+
def conda(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
618
550
|
...
|
619
551
|
|
620
|
-
def
|
552
|
+
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):
|
621
553
|
"""
|
622
|
-
|
554
|
+
Specifies the Conda environment for the step.
|
555
|
+
|
556
|
+
Information in this decorator will augment any
|
557
|
+
attributes set in the `@conda_base` flow-level decorator. Hence,
|
558
|
+
you can use `@conda_base` to set packages required by all
|
559
|
+
steps and use `@conda` to specify step-specific overrides.
|
560
|
+
|
561
|
+
|
562
|
+
Parameters
|
563
|
+
----------
|
564
|
+
packages : Dict[str, str], default {}
|
565
|
+
Packages to use for this step. The key is the name of the package
|
566
|
+
and the value is the version to use.
|
567
|
+
libraries : Dict[str, str], default {}
|
568
|
+
Supported for backward compatibility. When used with packages, packages will take precedence.
|
569
|
+
python : str, optional, default None
|
570
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
571
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
572
|
+
disabled : bool, default False
|
573
|
+
If set to True, disables @conda.
|
623
574
|
"""
|
624
575
|
...
|
625
576
|
|
626
|
-
def
|
577
|
+
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]]]:
|
627
578
|
"""
|
628
|
-
This decorator is used to run
|
579
|
+
This decorator is used to run Ollama APIs as Metaflow task sidecars.
|
629
580
|
|
630
581
|
User code call
|
631
582
|
--------------
|
632
|
-
@
|
633
|
-
|
583
|
+
@ollama(
|
584
|
+
models=[...],
|
634
585
|
...
|
635
586
|
)
|
636
587
|
|
637
588
|
Valid backend options
|
638
589
|
---------------------
|
639
590
|
- 'local': Run as a separate process on the local task machine.
|
591
|
+
- (TODO) 'managed': Outerbounds hosts and selects compute provider.
|
592
|
+
- (TODO) 'remote': Spin up separate instance to serve Ollama models.
|
640
593
|
|
641
594
|
Valid model options
|
642
595
|
-------------------
|
643
|
-
Any
|
644
|
-
|
645
|
-
NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
|
646
|
-
If you need multiple models, you must create multiple @vllm decorators.
|
596
|
+
Any model here https://ollama.com/search, e.g. 'llama3.2', 'llama3.3'
|
647
597
|
|
648
598
|
|
649
599
|
Parameters
|
650
600
|
----------
|
651
|
-
|
652
|
-
|
601
|
+
models: list[str]
|
602
|
+
List of Ollama containers running models in sidecars.
|
653
603
|
backend: str
|
654
|
-
Determines where and how to run the
|
655
|
-
|
656
|
-
Whether to
|
657
|
-
|
658
|
-
|
604
|
+
Determines where and how to run the Ollama process.
|
605
|
+
force_pull: bool
|
606
|
+
Whether to run `ollama pull` no matter what, or first check the remote cache in Metaflow datastore for this model key.
|
607
|
+
cache_update_policy: str
|
608
|
+
Cache update policy: "auto", "force", or "never".
|
609
|
+
force_cache_update: bool
|
610
|
+
Simple override for "force" cache update policy.
|
659
611
|
debug: bool
|
660
612
|
Whether to turn on verbose debugging logs.
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
Maximum number of retries checking for vLLM server startup.
|
666
|
-
Only used when openai_api_server=True.
|
667
|
-
retry_alert_frequency: int
|
668
|
-
Frequency of alert logs for vLLM server startup retries.
|
669
|
-
Only used when openai_api_server=True.
|
670
|
-
engine_args : dict
|
671
|
-
Additional keyword arguments to pass to the vLLM engine.
|
672
|
-
For example, `tensor_parallel_size=2`.
|
673
|
-
"""
|
674
|
-
...
|
675
|
-
|
676
|
-
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]]]:
|
677
|
-
"""
|
678
|
-
Specifies that this step should execute on DGX cloud.
|
679
|
-
|
680
|
-
|
681
|
-
Parameters
|
682
|
-
----------
|
683
|
-
gpu : int
|
684
|
-
Number of GPUs to use.
|
685
|
-
gpu_type : str
|
686
|
-
Type of Nvidia GPU to use.
|
687
|
-
"""
|
688
|
-
...
|
689
|
-
|
690
|
-
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]]]:
|
691
|
-
"""
|
692
|
-
Specifies that this step should execute on DGX cloud.
|
693
|
-
|
694
|
-
|
695
|
-
Parameters
|
696
|
-
----------
|
697
|
-
gpu : int
|
698
|
-
Number of GPUs to use.
|
699
|
-
gpu_type : str
|
700
|
-
Type of Nvidia GPU to use.
|
701
|
-
queue_timeout : int
|
702
|
-
Time to keep the job in NVCF's queue.
|
703
|
-
"""
|
704
|
-
...
|
705
|
-
|
706
|
-
@typing.overload
|
707
|
-
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]]]:
|
708
|
-
"""
|
709
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
710
|
-
|
711
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
712
|
-
|
713
|
-
|
714
|
-
Parameters
|
715
|
-
----------
|
716
|
-
type : str, default 'default'
|
717
|
-
Card type.
|
718
|
-
id : str, optional, default None
|
719
|
-
If multiple cards are present, use this id to identify this card.
|
720
|
-
options : Dict[str, Any], default {}
|
721
|
-
Options passed to the card. The contents depend on the card type.
|
722
|
-
timeout : int, default 45
|
723
|
-
Interrupt reporting if it takes more than this many seconds.
|
724
|
-
"""
|
725
|
-
...
|
726
|
-
|
727
|
-
@typing.overload
|
728
|
-
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
729
|
-
...
|
730
|
-
|
731
|
-
@typing.overload
|
732
|
-
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
733
|
-
...
|
734
|
-
|
735
|
-
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):
|
736
|
-
"""
|
737
|
-
Creates a human-readable report, a Metaflow Card, after this step completes.
|
738
|
-
|
739
|
-
Note that you may add multiple `@card` decorators in a step with different parameters.
|
740
|
-
|
741
|
-
|
742
|
-
Parameters
|
743
|
-
----------
|
744
|
-
type : str, default 'default'
|
745
|
-
Card type.
|
746
|
-
id : str, optional, default None
|
747
|
-
If multiple cards are present, use this id to identify this card.
|
748
|
-
options : Dict[str, Any], default {}
|
749
|
-
Options passed to the card. The contents depend on the card type.
|
750
|
-
timeout : int, default 45
|
751
|
-
Interrupt reporting if it takes more than this many seconds.
|
613
|
+
circuit_breaker_config: dict
|
614
|
+
Configuration for circuit breaker protection. Keys: failure_threshold, recovery_timeout, reset_timeout.
|
615
|
+
timeout_config: dict
|
616
|
+
Configuration for various operation timeouts. Keys: pull, stop, health_check, install, server_startup.
|
752
617
|
"""
|
753
618
|
...
|
754
619
|
|
755
620
|
@typing.overload
|
756
|
-
def
|
621
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
757
622
|
"""
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
Parameters
|
763
|
-
----------
|
764
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
765
|
-
List of secret specs, defining how the secrets are to be retrieved
|
766
|
-
role : str, optional, default: None
|
767
|
-
Role to use for fetching secrets
|
623
|
+
Decorator prototype for all step decorators. This function gets specialized
|
624
|
+
and imported for all decorators types by _import_plugin_decorators().
|
768
625
|
"""
|
769
626
|
...
|
770
627
|
|
771
628
|
@typing.overload
|
772
|
-
def
|
773
|
-
...
|
774
|
-
|
775
|
-
@typing.overload
|
776
|
-
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
629
|
+
def parallel(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
777
630
|
...
|
778
631
|
|
779
|
-
def
|
632
|
+
def parallel(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
780
633
|
"""
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
Parameters
|
786
|
-
----------
|
787
|
-
sources : List[Union[str, Dict[str, Any]]], default: []
|
788
|
-
List of secret specs, defining how the secrets are to be retrieved
|
789
|
-
role : str, optional, default: None
|
790
|
-
Role to use for fetching secrets
|
634
|
+
Decorator prototype for all step decorators. This function gets specialized
|
635
|
+
and imported for all decorators types by _import_plugin_decorators().
|
791
636
|
"""
|
792
637
|
...
|
793
638
|
|
@@ -846,304 +691,176 @@ def retry(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
846
691
|
"""
|
847
692
|
...
|
848
693
|
|
849
|
-
def
|
694
|
+
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]]]:
|
850
695
|
"""
|
851
|
-
Specifies that this step should execute on
|
696
|
+
Specifies that this step should execute on DGX cloud.
|
852
697
|
|
853
698
|
|
854
699
|
Parameters
|
855
700
|
----------
|
856
|
-
|
857
|
-
Number of
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
used.
|
863
|
-
disk : int, default 10240
|
864
|
-
Disk size (in MB) required for this step. If
|
865
|
-
`@resources` is also present, the maximum value from all decorators is
|
866
|
-
used.
|
867
|
-
image : str, optional, default None
|
868
|
-
Docker image to use when launching on Kubernetes. If not specified, and
|
869
|
-
METAFLOW_KUBERNETES_CONTAINER_IMAGE is specified, that image is used. If
|
870
|
-
not, a default Docker image mapping to the current version of Python is used.
|
871
|
-
image_pull_policy: str, default KUBERNETES_IMAGE_PULL_POLICY
|
872
|
-
If given, the imagePullPolicy to be applied to the Docker image of the step.
|
873
|
-
image_pull_secrets: List[str], default []
|
874
|
-
The default is extracted from METAFLOW_KUBERNETES_IMAGE_PULL_SECRETS.
|
875
|
-
Kubernetes image pull secrets to use when pulling container images
|
876
|
-
in Kubernetes.
|
877
|
-
service_account : str, default METAFLOW_KUBERNETES_SERVICE_ACCOUNT
|
878
|
-
Kubernetes service account to use when launching pod in Kubernetes.
|
879
|
-
secrets : List[str], optional, default None
|
880
|
-
Kubernetes secrets to use when launching pod in Kubernetes. These
|
881
|
-
secrets are in addition to the ones defined in `METAFLOW_KUBERNETES_SECRETS`
|
882
|
-
in Metaflow configuration.
|
883
|
-
node_selector: Union[Dict[str,str], str], optional, default None
|
884
|
-
Kubernetes node selector(s) to apply to the pod running the task.
|
885
|
-
Can be passed in as a comma separated string of values e.g.
|
886
|
-
'kubernetes.io/os=linux,kubernetes.io/arch=amd64' or as a dictionary
|
887
|
-
{'kubernetes.io/os': 'linux', 'kubernetes.io/arch': 'amd64'}
|
888
|
-
namespace : str, default METAFLOW_KUBERNETES_NAMESPACE
|
889
|
-
Kubernetes namespace to use when launching pod in Kubernetes.
|
890
|
-
gpu : int, optional, default None
|
891
|
-
Number of GPUs required for this step. A value of zero implies that
|
892
|
-
the scheduled node should not have GPUs.
|
893
|
-
gpu_vendor : str, default KUBERNETES_GPU_VENDOR
|
894
|
-
The vendor of the GPUs to be used for this step.
|
895
|
-
tolerations : List[str], default []
|
896
|
-
The default is extracted from METAFLOW_KUBERNETES_TOLERATIONS.
|
897
|
-
Kubernetes tolerations to use when launching pod in Kubernetes.
|
898
|
-
labels: Dict[str, str], default: METAFLOW_KUBERNETES_LABELS
|
899
|
-
Kubernetes labels to use when launching pod in Kubernetes.
|
900
|
-
annotations: Dict[str, str], default: METAFLOW_KUBERNETES_ANNOTATIONS
|
901
|
-
Kubernetes annotations to use when launching pod in Kubernetes.
|
902
|
-
use_tmpfs : bool, default False
|
903
|
-
This enables an explicit tmpfs mount for this step.
|
904
|
-
tmpfs_tempdir : bool, default True
|
905
|
-
sets METAFLOW_TEMPDIR to tmpfs_path if set for this step.
|
906
|
-
tmpfs_size : int, optional, default: None
|
907
|
-
The value for the size (in MiB) of the tmpfs mount for this step.
|
908
|
-
This parameter maps to the `--tmpfs` option in Docker. Defaults to 50% of the
|
909
|
-
memory allocated for this step.
|
910
|
-
tmpfs_path : str, optional, default /metaflow_temp
|
911
|
-
Path to tmpfs mount for this step.
|
912
|
-
persistent_volume_claims : Dict[str, str], optional, default None
|
913
|
-
A map (dictionary) of persistent volumes to be mounted to the pod for this step. The map is from persistent
|
914
|
-
volumes to the path to which the volume is to be mounted, e.g., `{'pvc-name': '/path/to/mount/on'}`.
|
915
|
-
shared_memory: int, optional
|
916
|
-
Shared memory size (in MiB) required for this step
|
917
|
-
port: int, optional
|
918
|
-
Port number to specify in the Kubernetes job object
|
919
|
-
compute_pool : str, optional, default None
|
920
|
-
Compute pool to be used for for this step.
|
921
|
-
If not specified, any accessible compute pool within the perimeter is used.
|
922
|
-
hostname_resolution_timeout: int, default 10 * 60
|
923
|
-
Timeout in seconds for the workers tasks in the gang scheduled cluster to resolve the hostname of control task.
|
924
|
-
Only applicable when @parallel is used.
|
925
|
-
qos: str, default: Burstable
|
926
|
-
Quality of Service class to assign to the pod. Supported values are: Guaranteed, Burstable, BestEffort
|
927
|
-
|
928
|
-
security_context: Dict[str, Any], optional, default None
|
929
|
-
Container security context. Applies to the task container. Allows the following keys:
|
930
|
-
- privileged: bool, optional, default None
|
931
|
-
- allow_privilege_escalation: bool, optional, default None
|
932
|
-
- run_as_user: int, optional, default None
|
933
|
-
- run_as_group: int, optional, default None
|
934
|
-
- run_as_non_root: bool, optional, default None
|
935
|
-
"""
|
936
|
-
...
|
937
|
-
|
938
|
-
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]]]:
|
939
|
-
"""
|
940
|
-
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
941
|
-
|
942
|
-
> Examples
|
943
|
-
|
944
|
-
**Usage: creating references of models from huggingface that may be loaded in downstream steps**
|
945
|
-
```python
|
946
|
-
@huggingface_hub
|
947
|
-
@step
|
948
|
-
def pull_model_from_huggingface(self):
|
949
|
-
# `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
|
950
|
-
# and saves it in the backend storage based on the model's `repo_id`. If there exists a model
|
951
|
-
# with the same `repo_id` in the backend storage, it will not download the model again. The return
|
952
|
-
# value of the function is a reference to the model in the backend storage.
|
953
|
-
# This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
|
954
|
-
|
955
|
-
self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
|
956
|
-
self.llama_model = current.huggingface_hub.snapshot_download(
|
957
|
-
repo_id=self.model_id,
|
958
|
-
allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
|
959
|
-
)
|
960
|
-
self.next(self.train)
|
961
|
-
```
|
962
|
-
|
963
|
-
**Usage: loading models directly from huggingface hub or from cache (from metaflow's datastore)**
|
964
|
-
```python
|
965
|
-
@huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
|
966
|
-
@step
|
967
|
-
def pull_model_from_huggingface(self):
|
968
|
-
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
969
|
-
```
|
970
|
-
|
971
|
-
```python
|
972
|
-
@huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora, "/my-lora-directory")])
|
973
|
-
@step
|
974
|
-
def finetune_model(self):
|
975
|
-
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
976
|
-
# path_to_model will be /my-directory
|
977
|
-
```
|
978
|
-
|
979
|
-
```python
|
980
|
-
# Takes all the arguments passed to `snapshot_download`
|
981
|
-
# except for `local_dir`
|
982
|
-
@huggingface_hub(load=[
|
983
|
-
{
|
984
|
-
"repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
|
985
|
-
},
|
986
|
-
{
|
987
|
-
"repo_id": "myorg/mistral-lora",
|
988
|
-
"repo_type": "model",
|
989
|
-
},
|
990
|
-
])
|
991
|
-
@step
|
992
|
-
def finetune_model(self):
|
993
|
-
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
994
|
-
# path_to_model will be /my-directory
|
995
|
-
```
|
996
|
-
|
997
|
-
|
998
|
-
Parameters
|
999
|
-
----------
|
1000
|
-
temp_dir_root : str, optional
|
1001
|
-
The root directory that will hold the temporary directory where objects will be downloaded.
|
1002
|
-
|
1003
|
-
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
1004
|
-
The list of repos (models/datasets) to load.
|
1005
|
-
|
1006
|
-
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
1007
|
-
|
1008
|
-
- If repo (model/dataset) is not found in the datastore:
|
1009
|
-
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
1010
|
-
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
1011
|
-
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
1012
|
-
|
1013
|
-
- If repo is found in the datastore:
|
1014
|
-
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
701
|
+
gpu : int
|
702
|
+
Number of GPUs to use.
|
703
|
+
gpu_type : str
|
704
|
+
Type of Nvidia GPU to use.
|
705
|
+
queue_timeout : int
|
706
|
+
Time to keep the job in NVCF's queue.
|
1015
707
|
"""
|
1016
708
|
...
|
1017
709
|
|
1018
710
|
@typing.overload
|
1019
|
-
def
|
711
|
+
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]]]:
|
1020
712
|
"""
|
1021
|
-
Specifies the
|
713
|
+
Specifies the PyPI packages for the step.
|
1022
714
|
|
1023
715
|
Information in this decorator will augment any
|
1024
|
-
attributes set in the `@
|
1025
|
-
you can use `@
|
1026
|
-
steps and use `@
|
716
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
717
|
+
you can use `@pypi_base` to set packages required by all
|
718
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1027
719
|
|
1028
720
|
|
1029
721
|
Parameters
|
1030
722
|
----------
|
1031
|
-
packages : Dict[str, str], default {}
|
723
|
+
packages : Dict[str, str], default: {}
|
1032
724
|
Packages to use for this step. The key is the name of the package
|
1033
725
|
and the value is the version to use.
|
1034
|
-
|
1035
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1036
|
-
python : str, optional, default None
|
726
|
+
python : str, optional, default: None
|
1037
727
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1038
728
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1039
|
-
disabled : bool, default False
|
1040
|
-
If set to True, disables @conda.
|
1041
729
|
"""
|
1042
730
|
...
|
1043
731
|
|
1044
732
|
@typing.overload
|
1045
|
-
def
|
733
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1046
734
|
...
|
1047
735
|
|
1048
736
|
@typing.overload
|
1049
|
-
def
|
737
|
+
def pypi(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1050
738
|
...
|
1051
739
|
|
1052
|
-
def
|
740
|
+
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):
|
1053
741
|
"""
|
1054
|
-
Specifies the
|
742
|
+
Specifies the PyPI packages for the step.
|
1055
743
|
|
1056
744
|
Information in this decorator will augment any
|
1057
|
-
attributes set in the `@
|
1058
|
-
you can use `@
|
1059
|
-
steps and use `@
|
745
|
+
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
746
|
+
you can use `@pypi_base` to set packages required by all
|
747
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1060
748
|
|
1061
749
|
|
1062
750
|
Parameters
|
1063
751
|
----------
|
1064
|
-
packages : Dict[str, str], default {}
|
752
|
+
packages : Dict[str, str], default: {}
|
1065
753
|
Packages to use for this step. The key is the name of the package
|
1066
754
|
and the value is the version to use.
|
1067
|
-
|
1068
|
-
Supported for backward compatibility. When used with packages, packages will take precedence.
|
1069
|
-
python : str, optional, default None
|
755
|
+
python : str, optional, default: None
|
1070
756
|
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1071
757
|
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1072
|
-
disabled : bool, default False
|
1073
|
-
If set to True, disables @conda.
|
1074
758
|
"""
|
1075
759
|
...
|
1076
760
|
|
1077
761
|
@typing.overload
|
1078
|
-
def
|
762
|
+
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]]]:
|
1079
763
|
"""
|
1080
|
-
Specifies
|
1081
|
-
|
1082
|
-
Information in this decorator will augment any
|
1083
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1084
|
-
you can use `@pypi_base` to set packages required by all
|
1085
|
-
steps and use `@pypi` to specify step-specific overrides.
|
764
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1086
765
|
|
1087
766
|
|
1088
767
|
Parameters
|
1089
768
|
----------
|
1090
|
-
|
1091
|
-
|
1092
|
-
and the value is the version to use.
|
1093
|
-
python : str, optional, default: None
|
1094
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1095
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
769
|
+
vars : Dict[str, str], default {}
|
770
|
+
Dictionary of environment variables to set.
|
1096
771
|
"""
|
1097
772
|
...
|
1098
773
|
|
1099
774
|
@typing.overload
|
1100
|
-
def
|
775
|
+
def environment(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1101
776
|
...
|
1102
777
|
|
1103
778
|
@typing.overload
|
1104
|
-
def
|
779
|
+
def environment(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1105
780
|
...
|
1106
781
|
|
1107
|
-
def
|
782
|
+
def environment(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, vars: typing.Dict[str, str] = {}):
|
1108
783
|
"""
|
1109
|
-
Specifies
|
1110
|
-
|
1111
|
-
Information in this decorator will augment any
|
1112
|
-
attributes set in the `@pyi_base` flow-level decorator. Hence,
|
1113
|
-
you can use `@pypi_base` to set packages required by all
|
1114
|
-
steps and use `@pypi` to specify step-specific overrides.
|
784
|
+
Specifies environment variables to be set prior to the execution of a step.
|
1115
785
|
|
1116
786
|
|
1117
787
|
Parameters
|
1118
788
|
----------
|
1119
|
-
|
1120
|
-
|
1121
|
-
and the value is the version to use.
|
1122
|
-
python : str, optional, default: None
|
1123
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1124
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
789
|
+
vars : Dict[str, str], default {}
|
790
|
+
Dictionary of environment variables to set.
|
1125
791
|
"""
|
1126
792
|
...
|
1127
793
|
|
1128
794
|
@typing.overload
|
1129
|
-
def
|
795
|
+
def catch(*, var: typing.Optional[str] = None, print_exception: bool = True) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
1130
796
|
"""
|
1131
|
-
|
797
|
+
Specifies that the step will success under all circumstances.
|
1132
798
|
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
799
|
+
The decorator will create an optional artifact, specified by `var`, which
|
800
|
+
contains the exception raised. You can use it to detect the presence
|
801
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
802
|
+
are missing.
|
803
|
+
|
804
|
+
|
805
|
+
Parameters
|
806
|
+
----------
|
807
|
+
var : str, optional, default None
|
808
|
+
Name of the artifact in which to store the caught exception.
|
809
|
+
If not specified, the exception is not stored.
|
810
|
+
print_exception : bool, default True
|
811
|
+
Determines whether or not the exception is printed to
|
812
|
+
stdout when caught.
|
813
|
+
"""
|
814
|
+
...
|
815
|
+
|
816
|
+
@typing.overload
|
817
|
+
def catch(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
818
|
+
...
|
819
|
+
|
820
|
+
@typing.overload
|
821
|
+
def catch(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
822
|
+
...
|
823
|
+
|
824
|
+
def catch(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, var: typing.Optional[str] = None, print_exception: bool = True):
|
825
|
+
"""
|
826
|
+
Specifies that the step will success under all circumstances.
|
827
|
+
|
828
|
+
The decorator will create an optional artifact, specified by `var`, which
|
829
|
+
contains the exception raised. You can use it to detect the presence
|
830
|
+
of errors, indicating that all happy-path artifacts produced by the step
|
831
|
+
are missing.
|
832
|
+
|
833
|
+
|
834
|
+
Parameters
|
835
|
+
----------
|
836
|
+
var : str, optional, default None
|
837
|
+
Name of the artifact in which to store the caught exception.
|
838
|
+
If not specified, the exception is not stored.
|
839
|
+
print_exception : bool, default True
|
840
|
+
Determines whether or not the exception is printed to
|
841
|
+
stdout when caught.
|
842
|
+
"""
|
843
|
+
...
|
844
|
+
|
845
|
+
@typing.overload
|
846
|
+
def model(*, load: typing.Union[typing.List[str], str, typing.List[typing.Tuple[str, typing.Optional[str]]]] = None, temp_dir_root: str = None) -> typing.Callable[[typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]], typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]]]:
|
847
|
+
"""
|
848
|
+
Enables loading / saving of models within a step.
|
849
|
+
|
850
|
+
> Examples
|
851
|
+
- Saving Models
|
852
|
+
```python
|
853
|
+
@model
|
854
|
+
@step
|
855
|
+
def train(self):
|
856
|
+
# current.model.save returns a dictionary reference to the model saved
|
857
|
+
self.my_model = current.model.save(
|
858
|
+
path_to_my_model,
|
859
|
+
label="my_model",
|
860
|
+
metadata={
|
861
|
+
"epochs": 10,
|
862
|
+
"batch-size": 32,
|
863
|
+
"learning-rate": 0.001,
|
1147
864
|
}
|
1148
865
|
)
|
1149
866
|
self.next(self.test)
|
@@ -1254,46 +971,311 @@ def model(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], ty
|
|
1254
971
|
"""
|
1255
972
|
...
|
1256
973
|
|
1257
|
-
|
974
|
+
@typing.overload
|
975
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1258
976
|
"""
|
1259
|
-
|
1260
|
-
|
1261
|
-
|
1262
|
-
|
1263
|
-
|
977
|
+
Internal decorator to support Fast bakery
|
978
|
+
"""
|
979
|
+
...
|
980
|
+
|
981
|
+
@typing.overload
|
982
|
+
def fast_bakery_internal(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
983
|
+
...
|
984
|
+
|
985
|
+
def fast_bakery_internal(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None):
|
986
|
+
"""
|
987
|
+
Internal decorator to support Fast bakery
|
988
|
+
"""
|
989
|
+
...
|
990
|
+
|
991
|
+
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]]]:
|
992
|
+
"""
|
993
|
+
This decorator is used to run vllm APIs as Metaflow task sidecars.
|
994
|
+
|
995
|
+
User code call
|
996
|
+
--------------
|
997
|
+
@vllm(
|
998
|
+
model="...",
|
999
|
+
...
|
1000
|
+
)
|
1001
|
+
|
1002
|
+
Valid backend options
|
1003
|
+
---------------------
|
1004
|
+
- 'local': Run as a separate process on the local task machine.
|
1005
|
+
|
1006
|
+
Valid model options
|
1007
|
+
-------------------
|
1008
|
+
Any HuggingFace model identifier, e.g. 'meta-llama/Llama-3.2-1B'
|
1009
|
+
|
1010
|
+
NOTE: vLLM's OpenAI-compatible server serves ONE model per server instance.
|
1011
|
+
If you need multiple models, you must create multiple @vllm decorators.
|
1264
1012
|
|
1265
1013
|
|
1266
1014
|
Parameters
|
1267
1015
|
----------
|
1268
|
-
|
1269
|
-
|
1270
|
-
|
1271
|
-
|
1272
|
-
|
1273
|
-
|
1274
|
-
|
1275
|
-
|
1276
|
-
|
1277
|
-
|
1278
|
-
|
1279
|
-
|
1280
|
-
|
1281
|
-
|
1282
|
-
|
1283
|
-
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
|
1290
|
-
|
1291
|
-
|
1292
|
-
|
1293
|
-
|
1294
|
-
|
1295
|
-
|
1296
|
-
|
1016
|
+
model: str
|
1017
|
+
HuggingFace model identifier to be served by vLLM.
|
1018
|
+
backend: str
|
1019
|
+
Determines where and how to run the vLLM process.
|
1020
|
+
openai_api_server: bool
|
1021
|
+
Whether to use OpenAI-compatible API server mode (subprocess) instead of native engine.
|
1022
|
+
Default is False (uses native engine).
|
1023
|
+
Set to True for backward compatibility with existing code.
|
1024
|
+
debug: bool
|
1025
|
+
Whether to turn on verbose debugging logs.
|
1026
|
+
card_refresh_interval: int
|
1027
|
+
Interval in seconds for refreshing the vLLM status card.
|
1028
|
+
Only used when openai_api_server=True.
|
1029
|
+
max_retries: int
|
1030
|
+
Maximum number of retries checking for vLLM server startup.
|
1031
|
+
Only used when openai_api_server=True.
|
1032
|
+
retry_alert_frequency: int
|
1033
|
+
Frequency of alert logs for vLLM server startup retries.
|
1034
|
+
Only used when openai_api_server=True.
|
1035
|
+
engine_args : dict
|
1036
|
+
Additional keyword arguments to pass to the vLLM engine.
|
1037
|
+
For example, `tensor_parallel_size=2`.
|
1038
|
+
"""
|
1039
|
+
...
|
1040
|
+
|
1041
|
+
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]]]:
|
1042
|
+
"""
|
1043
|
+
Specifies that this step should execute on DGX cloud.
|
1044
|
+
|
1045
|
+
|
1046
|
+
Parameters
|
1047
|
+
----------
|
1048
|
+
gpu : int
|
1049
|
+
Number of GPUs to use.
|
1050
|
+
gpu_type : str
|
1051
|
+
Type of Nvidia GPU to use.
|
1052
|
+
"""
|
1053
|
+
...
|
1054
|
+
|
1055
|
+
@typing.overload
|
1056
|
+
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]]]:
|
1057
|
+
"""
|
1058
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1059
|
+
|
1060
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1061
|
+
|
1062
|
+
|
1063
|
+
Parameters
|
1064
|
+
----------
|
1065
|
+
type : str, default 'default'
|
1066
|
+
Card type.
|
1067
|
+
id : str, optional, default None
|
1068
|
+
If multiple cards are present, use this id to identify this card.
|
1069
|
+
options : Dict[str, Any], default {}
|
1070
|
+
Options passed to the card. The contents depend on the card type.
|
1071
|
+
timeout : int, default 45
|
1072
|
+
Interrupt reporting if it takes more than this many seconds.
|
1073
|
+
"""
|
1074
|
+
...
|
1075
|
+
|
1076
|
+
@typing.overload
|
1077
|
+
def card(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1078
|
+
...
|
1079
|
+
|
1080
|
+
@typing.overload
|
1081
|
+
def card(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1082
|
+
...
|
1083
|
+
|
1084
|
+
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):
|
1085
|
+
"""
|
1086
|
+
Creates a human-readable report, a Metaflow Card, after this step completes.
|
1087
|
+
|
1088
|
+
Note that you may add multiple `@card` decorators in a step with different parameters.
|
1089
|
+
|
1090
|
+
|
1091
|
+
Parameters
|
1092
|
+
----------
|
1093
|
+
type : str, default 'default'
|
1094
|
+
Card type.
|
1095
|
+
id : str, optional, default None
|
1096
|
+
If multiple cards are present, use this id to identify this card.
|
1097
|
+
options : Dict[str, Any], default {}
|
1098
|
+
Options passed to the card. The contents depend on the card type.
|
1099
|
+
timeout : int, default 45
|
1100
|
+
Interrupt reporting if it takes more than this many seconds.
|
1101
|
+
"""
|
1102
|
+
...
|
1103
|
+
|
1104
|
+
@typing.overload
|
1105
|
+
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]]]:
|
1106
|
+
"""
|
1107
|
+
Specifies a timeout for your step.
|
1108
|
+
|
1109
|
+
This decorator is useful if this step may hang indefinitely.
|
1110
|
+
|
1111
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1112
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1113
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1114
|
+
|
1115
|
+
Note that all the values specified in parameters are added together so if you specify
|
1116
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1117
|
+
|
1118
|
+
|
1119
|
+
Parameters
|
1120
|
+
----------
|
1121
|
+
seconds : int, default 0
|
1122
|
+
Number of seconds to wait prior to timing out.
|
1123
|
+
minutes : int, default 0
|
1124
|
+
Number of minutes to wait prior to timing out.
|
1125
|
+
hours : int, default 0
|
1126
|
+
Number of hours to wait prior to timing out.
|
1127
|
+
"""
|
1128
|
+
...
|
1129
|
+
|
1130
|
+
@typing.overload
|
1131
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1132
|
+
...
|
1133
|
+
|
1134
|
+
@typing.overload
|
1135
|
+
def timeout(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1136
|
+
...
|
1137
|
+
|
1138
|
+
def timeout(f: typing.Union[typing.Callable[[FlowSpecDerived, StepFlag], None], typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None], None] = None, *, seconds: int = 0, minutes: int = 0, hours: int = 0):
|
1139
|
+
"""
|
1140
|
+
Specifies a timeout for your step.
|
1141
|
+
|
1142
|
+
This decorator is useful if this step may hang indefinitely.
|
1143
|
+
|
1144
|
+
This can be used in conjunction with the `@retry` decorator as well as the `@catch` decorator.
|
1145
|
+
A timeout is considered to be an exception thrown by the step. It will cause the step to be
|
1146
|
+
retried if needed and the exception will be caught by the `@catch` decorator, if present.
|
1147
|
+
|
1148
|
+
Note that all the values specified in parameters are added together so if you specify
|
1149
|
+
60 seconds and 1 hour, the decorator will have an effective timeout of 1 hour and 1 minute.
|
1150
|
+
|
1151
|
+
|
1152
|
+
Parameters
|
1153
|
+
----------
|
1154
|
+
seconds : int, default 0
|
1155
|
+
Number of seconds to wait prior to timing out.
|
1156
|
+
minutes : int, default 0
|
1157
|
+
Number of minutes to wait prior to timing out.
|
1158
|
+
hours : int, default 0
|
1159
|
+
Number of hours to wait prior to timing out.
|
1160
|
+
"""
|
1161
|
+
...
|
1162
|
+
|
1163
|
+
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]]]:
|
1164
|
+
"""
|
1165
|
+
Decorator that helps cache, version and store models/datasets from huggingface hub.
|
1166
|
+
|
1167
|
+
> Examples
|
1168
|
+
|
1169
|
+
**Usage: creating references of models from huggingface that may be loaded in downstream steps**
|
1170
|
+
```python
|
1171
|
+
@huggingface_hub
|
1172
|
+
@step
|
1173
|
+
def pull_model_from_huggingface(self):
|
1174
|
+
# `current.huggingface_hub.snapshot_download` downloads the model from the Hugging Face Hub
|
1175
|
+
# and saves it in the backend storage based on the model's `repo_id`. If there exists a model
|
1176
|
+
# with the same `repo_id` in the backend storage, it will not download the model again. The return
|
1177
|
+
# value of the function is a reference to the model in the backend storage.
|
1178
|
+
# This reference can be used to load the model in the subsequent steps via `@model(load=["llama_model"])`
|
1179
|
+
|
1180
|
+
self.model_id = "mistralai/Mistral-7B-Instruct-v0.1"
|
1181
|
+
self.llama_model = current.huggingface_hub.snapshot_download(
|
1182
|
+
repo_id=self.model_id,
|
1183
|
+
allow_patterns=["*.safetensors", "*.json", "tokenizer.*"],
|
1184
|
+
)
|
1185
|
+
self.next(self.train)
|
1186
|
+
```
|
1187
|
+
|
1188
|
+
**Usage: loading models directly from huggingface hub or from cache (from metaflow's datastore)**
|
1189
|
+
```python
|
1190
|
+
@huggingface_hub(load=["mistralai/Mistral-7B-Instruct-v0.1"])
|
1191
|
+
@step
|
1192
|
+
def pull_model_from_huggingface(self):
|
1193
|
+
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
1194
|
+
```
|
1195
|
+
|
1196
|
+
```python
|
1197
|
+
@huggingface_hub(load=[("mistralai/Mistral-7B-Instruct-v0.1", "/my-directory"), ("myorg/mistral-lora, "/my-lora-directory")])
|
1198
|
+
@step
|
1199
|
+
def finetune_model(self):
|
1200
|
+
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
1201
|
+
# path_to_model will be /my-directory
|
1202
|
+
```
|
1203
|
+
|
1204
|
+
```python
|
1205
|
+
# Takes all the arguments passed to `snapshot_download`
|
1206
|
+
# except for `local_dir`
|
1207
|
+
@huggingface_hub(load=[
|
1208
|
+
{
|
1209
|
+
"repo_id": "mistralai/Mistral-7B-Instruct-v0.1",
|
1210
|
+
},
|
1211
|
+
{
|
1212
|
+
"repo_id": "myorg/mistral-lora",
|
1213
|
+
"repo_type": "model",
|
1214
|
+
},
|
1215
|
+
])
|
1216
|
+
@step
|
1217
|
+
def finetune_model(self):
|
1218
|
+
path_to_model = current.huggingface_hub.loaded["mistralai/Mistral-7B-Instruct-v0.1"]
|
1219
|
+
# path_to_model will be /my-directory
|
1220
|
+
```
|
1221
|
+
|
1222
|
+
|
1223
|
+
Parameters
|
1224
|
+
----------
|
1225
|
+
temp_dir_root : str, optional
|
1226
|
+
The root directory that will hold the temporary directory where objects will be downloaded.
|
1227
|
+
|
1228
|
+
load: Union[List[str], List[Tuple[Dict, str]], List[Tuple[str, str]], List[Dict], None]
|
1229
|
+
The list of repos (models/datasets) to load.
|
1230
|
+
|
1231
|
+
Loaded repos can be accessed via `current.huggingface_hub.loaded`. If load is set, then the following happens:
|
1232
|
+
|
1233
|
+
- If repo (model/dataset) is not found in the datastore:
|
1234
|
+
- Downloads the repo from Hugging Face Hub to a temporary directory (or uses specified path) for local access
|
1235
|
+
- Stores it in Metaflow's datastore (s3/gcs/azure etc.) with a unique name based on repo_type/repo_id
|
1236
|
+
- All HF models loaded for a `@step` will be cached separately under flow/step/namespace.
|
1237
|
+
|
1238
|
+
- If repo is found in the datastore:
|
1239
|
+
- Loads it directly from datastore to local path (can be temporary directory or specified path)
|
1240
|
+
"""
|
1241
|
+
...
|
1242
|
+
|
1243
|
+
@typing.overload
|
1244
|
+
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]]]:
|
1245
|
+
"""
|
1246
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1247
|
+
the execution of a step.
|
1248
|
+
|
1249
|
+
|
1250
|
+
Parameters
|
1251
|
+
----------
|
1252
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1253
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1254
|
+
role : str, optional, default: None
|
1255
|
+
Role to use for fetching secrets
|
1256
|
+
"""
|
1257
|
+
...
|
1258
|
+
|
1259
|
+
@typing.overload
|
1260
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, StepFlag], None]:
|
1261
|
+
...
|
1262
|
+
|
1263
|
+
@typing.overload
|
1264
|
+
def secrets(f: typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]) -> typing.Callable[[FlowSpecDerived, typing.Any, StepFlag], None]:
|
1265
|
+
...
|
1266
|
+
|
1267
|
+
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):
|
1268
|
+
"""
|
1269
|
+
Specifies secrets to be retrieved and injected as environment variables prior to
|
1270
|
+
the execution of a step.
|
1271
|
+
|
1272
|
+
|
1273
|
+
Parameters
|
1274
|
+
----------
|
1275
|
+
sources : List[Union[str, Dict[str, Any]]], default: []
|
1276
|
+
List of secret specs, defining how the secrets are to be retrieved
|
1277
|
+
role : str, optional, default: None
|
1278
|
+
Role to use for fetching secrets
|
1297
1279
|
"""
|
1298
1280
|
...
|
1299
1281
|
|
@@ -1462,54 +1444,46 @@ def conda_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packa
|
|
1462
1444
|
"""
|
1463
1445
|
...
|
1464
1446
|
|
1465
|
-
|
1466
|
-
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]]:
|
1467
|
-
"""
|
1468
|
-
Specifies the times when the flow should be run when running on a
|
1469
|
-
production scheduler.
|
1470
|
-
|
1471
|
-
|
1472
|
-
Parameters
|
1473
|
-
----------
|
1474
|
-
hourly : bool, default False
|
1475
|
-
Run the workflow hourly.
|
1476
|
-
daily : bool, default True
|
1477
|
-
Run the workflow daily.
|
1478
|
-
weekly : bool, default False
|
1479
|
-
Run the workflow weekly.
|
1480
|
-
cron : str, optional, default None
|
1481
|
-
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1482
|
-
specified by this expression.
|
1483
|
-
timezone : str, optional, default None
|
1484
|
-
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1485
|
-
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1486
|
-
"""
|
1487
|
-
...
|
1488
|
-
|
1489
|
-
@typing.overload
|
1490
|
-
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1491
|
-
...
|
1492
|
-
|
1493
|
-
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):
|
1447
|
+
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]]:
|
1494
1448
|
"""
|
1495
|
-
|
1496
|
-
|
1449
|
+
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)
|
1450
|
+
before the start step of the flow. This decorator only works when a flow is scheduled on Airflow
|
1451
|
+
and is compiled using `airflow create`. More than one `@airflow_s3_key_sensor` can be
|
1452
|
+
added as a flow decorators. Adding more than one decorator will ensure that `start` step
|
1453
|
+
starts only after all sensors finish.
|
1497
1454
|
|
1498
1455
|
|
1499
1456
|
Parameters
|
1500
1457
|
----------
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1458
|
+
timeout : int
|
1459
|
+
Time, in seconds before the task times out and fails. (Default: 3600)
|
1460
|
+
poke_interval : int
|
1461
|
+
Time in seconds that the job should wait in between each try. (Default: 60)
|
1462
|
+
mode : str
|
1463
|
+
How the sensor operates. Options are: { poke | reschedule }. (Default: "poke")
|
1464
|
+
exponential_backoff : bool
|
1465
|
+
allow progressive longer waits between pokes by using exponential backoff algorithm. (Default: True)
|
1466
|
+
pool : str
|
1467
|
+
the slot pool this task should run in,
|
1468
|
+
slot pools are a way to limit concurrency for certain tasks. (Default:None)
|
1469
|
+
soft_fail : bool
|
1470
|
+
Set to true to mark the task as SKIPPED on failure. (Default: False)
|
1471
|
+
name : str
|
1472
|
+
Name of the sensor on Airflow
|
1473
|
+
description : str
|
1474
|
+
Description of sensor in the Airflow UI
|
1475
|
+
bucket_key : Union[str, List[str]]
|
1476
|
+
The key(s) being waited on. Supports full s3:// style url or relative path from root level.
|
1477
|
+
When it's specified as a full s3:// url, please leave `bucket_name` as None
|
1478
|
+
bucket_name : str
|
1479
|
+
Name of the S3 bucket. Only needed when bucket_key is not provided as a full s3:// url.
|
1480
|
+
When specified, all the keys passed to bucket_key refers to this bucket. (Default:None)
|
1481
|
+
wildcard_match : bool
|
1482
|
+
whether the bucket_key should be interpreted as a Unix wildcard pattern. (Default: False)
|
1483
|
+
aws_conn_id : str
|
1484
|
+
a reference to the s3 connection on Airflow. (Default: None)
|
1485
|
+
verify : bool
|
1486
|
+
Whether or not to verify SSL certificates for S3 connection. (Default: None)
|
1513
1487
|
"""
|
1514
1488
|
...
|
1515
1489
|
|
@@ -1606,38 +1580,95 @@ def trigger(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, event: t
|
|
1606
1580
|
"""
|
1607
1581
|
...
|
1608
1582
|
|
1609
|
-
|
1583
|
+
@typing.overload
|
1584
|
+
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]]:
|
1610
1585
|
"""
|
1611
|
-
Specifies
|
1586
|
+
Specifies the times when the flow should be run when running on a
|
1587
|
+
production scheduler.
|
1612
1588
|
|
1613
|
-
|
1614
|
-
|
1589
|
+
|
1590
|
+
Parameters
|
1591
|
+
----------
|
1592
|
+
hourly : bool, default False
|
1593
|
+
Run the workflow hourly.
|
1594
|
+
daily : bool, default True
|
1595
|
+
Run the workflow daily.
|
1596
|
+
weekly : bool, default False
|
1597
|
+
Run the workflow weekly.
|
1598
|
+
cron : str, optional, default None
|
1599
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1600
|
+
specified by this expression.
|
1601
|
+
timezone : str, optional, default None
|
1602
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1603
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1604
|
+
"""
|
1605
|
+
...
|
1606
|
+
|
1607
|
+
@typing.overload
|
1608
|
+
def schedule(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1609
|
+
...
|
1610
|
+
|
1611
|
+
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):
|
1612
|
+
"""
|
1613
|
+
Specifies the times when the flow should be run when running on a
|
1614
|
+
production scheduler.
|
1615
1615
|
|
1616
1616
|
|
1617
1617
|
Parameters
|
1618
1618
|
----------
|
1619
|
-
|
1620
|
-
|
1621
|
-
|
1622
|
-
|
1619
|
+
hourly : bool, default False
|
1620
|
+
Run the workflow hourly.
|
1621
|
+
daily : bool, default True
|
1622
|
+
Run the workflow daily.
|
1623
|
+
weekly : bool, default False
|
1624
|
+
Run the workflow weekly.
|
1625
|
+
cron : str, optional, default None
|
1626
|
+
Run the workflow at [a custom Cron schedule](https://docs.aws.amazon.com/eventbridge/latest/userguide/scheduled-events.html#cron-expressions)
|
1627
|
+
specified by this expression.
|
1628
|
+
timezone : str, optional, default None
|
1629
|
+
Timezone on which the schedule runs (default: None). Currently supported only for Argo workflows,
|
1630
|
+
which accepts timezones in [IANA format](https://nodatime.org/TimeZones).
|
1631
|
+
"""
|
1632
|
+
...
|
1633
|
+
|
1634
|
+
@typing.overload
|
1635
|
+
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1636
|
+
"""
|
1637
|
+
Specifies the PyPI packages for all steps of the flow.
|
1623
1638
|
|
1624
|
-
|
1625
|
-
|
1626
|
-
`user.<username>` unless `production` is set to `True`. This can
|
1627
|
-
also be set on the command line using `--branch` as a top-level option.
|
1628
|
-
It is an error to specify `branch` in the decorator and on the command line.
|
1639
|
+
Use `@pypi_base` to set common packages required by all
|
1640
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1629
1641
|
|
1630
|
-
|
1631
|
-
|
1632
|
-
|
1633
|
-
|
1634
|
-
|
1635
|
-
|
1636
|
-
|
1637
|
-
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1642
|
+
Parameters
|
1643
|
+
----------
|
1644
|
+
packages : Dict[str, str], default: {}
|
1645
|
+
Packages to use for this flow. The key is the name of the package
|
1646
|
+
and the value is the version to use.
|
1647
|
+
python : str, optional, default: None
|
1648
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1649
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1650
|
+
"""
|
1651
|
+
...
|
1652
|
+
|
1653
|
+
@typing.overload
|
1654
|
+
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1655
|
+
...
|
1656
|
+
|
1657
|
+
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1658
|
+
"""
|
1659
|
+
Specifies the PyPI packages for all steps of the flow.
|
1660
|
+
|
1661
|
+
Use `@pypi_base` to set common packages required by all
|
1662
|
+
steps and use `@pypi` to specify step-specific overrides.
|
1663
|
+
|
1664
|
+
Parameters
|
1665
|
+
----------
|
1666
|
+
packages : Dict[str, str], default: {}
|
1667
|
+
Packages to use for this flow. The key is the name of the package
|
1668
|
+
and the value is the version to use.
|
1669
|
+
python : str, optional, default: None
|
1670
|
+
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1671
|
+
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1641
1672
|
"""
|
1642
1673
|
...
|
1643
1674
|
|
@@ -1742,44 +1773,38 @@ def trigger_on_finish(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *
|
|
1742
1773
|
"""
|
1743
1774
|
...
|
1744
1775
|
|
1745
|
-
|
1746
|
-
def pypi_base(*, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1776
|
+
def project(*, name: str, branch: typing.Optional[str] = None, production: bool = False) -> typing.Callable[[typing.Type[FlowSpecDerived]], typing.Type[FlowSpecDerived]]:
|
1747
1777
|
"""
|
1748
|
-
Specifies
|
1778
|
+
Specifies what flows belong to the same project.
|
1779
|
+
|
1780
|
+
A project-specific namespace is created for all flows that
|
1781
|
+
use the same `@project(name)`.
|
1749
1782
|
|
1750
|
-
Use `@pypi_base` to set common packages required by all
|
1751
|
-
steps and use `@pypi` to specify step-specific overrides.
|
1752
1783
|
|
1753
1784
|
Parameters
|
1754
1785
|
----------
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
1758
|
-
|
1759
|
-
Version of Python to use, e.g. '3.7.4'. A default value of None implies
|
1760
|
-
that the version used will correspond to the version of the Python interpreter used to start the run.
|
1761
|
-
"""
|
1762
|
-
...
|
1763
|
-
|
1764
|
-
@typing.overload
|
1765
|
-
def pypi_base(f: typing.Type[FlowSpecDerived]) -> typing.Type[FlowSpecDerived]:
|
1766
|
-
...
|
1767
|
-
|
1768
|
-
def pypi_base(f: typing.Optional[typing.Type[FlowSpecDerived]] = None, *, packages: typing.Dict[str, str] = {}, python: typing.Optional[str] = None):
|
1769
|
-
"""
|
1770
|
-
Specifies the PyPI packages for all steps of the flow.
|
1786
|
+
name : str
|
1787
|
+
Project name. Make sure that the name is unique amongst all
|
1788
|
+
projects that use the same production scheduler. The name may
|
1789
|
+
contain only lowercase alphanumeric characters and underscores.
|
1771
1790
|
|
1772
|
-
|
1773
|
-
|
1791
|
+
branch : Optional[str], default None
|
1792
|
+
The branch to use. If not specified, the branch is set to
|
1793
|
+
`user.<username>` unless `production` is set to `True`. This can
|
1794
|
+
also be set on the command line using `--branch` as a top-level option.
|
1795
|
+
It is an error to specify `branch` in the decorator and on the command line.
|
1774
1796
|
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1779
|
-
|
1780
|
-
|
1781
|
-
|
1782
|
-
|
1797
|
+
production : bool, default False
|
1798
|
+
Whether or not the branch is the production branch. This can also be set on the
|
1799
|
+
command line using `--production` as a top-level option. It is an error to specify
|
1800
|
+
`production` in the decorator and on the command line.
|
1801
|
+
The project branch name will be:
|
1802
|
+
- if `branch` is specified:
|
1803
|
+
- if `production` is True: `prod.<branch>`
|
1804
|
+
- if `production` is False: `test.<branch>`
|
1805
|
+
- if `branch` is not specified:
|
1806
|
+
- if `production` is True: `prod`
|
1807
|
+
- if `production` is False: `user.<username>`
|
1783
1808
|
"""
|
1784
1809
|
...
|
1785
1810
|
|