From 7a54214efcbae91a42754feffe2ba93af332a313 Mon Sep 17 00:00:00 2001 From: Stefan Nica Date: Mon, 25 Nov 2024 22:31:41 +0100 Subject: [PATCH] Shorten the inference pipeline name --- README.md | 2 +- copier.yml | 2 +- template/README.md | 2 +- template/pipelines/__init__.py | 2 +- template/pipelines/{batch_inference.py => inference.py} | 2 +- template/run.py | 6 +++--- tests/test_template.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) rename template/pipelines/{batch_inference.py => inference.py} (98%) diff --git a/README.md b/README.md index 148d10c..60d2d77 100644 --- a/README.md +++ b/README.md @@ -265,7 +265,7 @@ model: ```

- +

### [Continuous Deployment] Batch Inference: ETL Steps diff --git a/copier.yml b/copier.yml index 862cda7..d48a169 100644 --- a/copier.yml +++ b/copier.yml @@ -92,7 +92,7 @@ email: product_name: type: str help: The technical name of the data product you are building - default: supply_chain_forecasting + default: supply_chain_fcast target_environment: type: str help: "The target environment for your project" diff --git a/template/README.md b/template/README.md index bdec5b8..3308893 100644 --- a/template/README.md +++ b/template/README.md @@ -158,7 +158,7 @@ The project loosely follows [the recommended ZenML project structure](https://do │ ├── inference_config.yaml # the configuration of the batch inference pipeline │ └── train_config.yaml # the configuration of the training pipeline ├── pipelines # `zenml.pipeline` implementations -│ ├── batch_inference.py # [CD] Batch Inference pipeline +│ ├── inference.py # [CD] Batch Inference pipeline │ ├── deployment.py # [CD] Deployment pipeline │ └── training.py # [CT] Training Pipeline ├── steps # logically grouped `zenml.steps` implementations diff --git a/template/pipelines/__init__.py b/template/pipelines/__init__.py index 1d47cf4..79eac21 100644 --- a/template/pipelines/__init__.py +++ b/template/pipelines/__init__.py @@ -1,5 +1,5 @@ # {% include 'template/license_header' %} -from .batch_inference import {{product_name}}_batch_inference +from .inference import {{product_name}}_inference from .training import {{product_name}}_training \ No newline at end of file diff --git a/template/pipelines/batch_inference.py b/template/pipelines/inference.py similarity index 98% rename from template/pipelines/batch_inference.py rename to template/pipelines/inference.py index b940458..b476d54 100644 --- a/template/pipelines/batch_inference.py +++ b/template/pipelines/inference.py @@ -21,7 +21,7 @@ @pipeline(on_failure=notify_on_failure, tags=[DATA_CLASSIFICATION]) -def {{product_name}}_batch_inference(): +def {{product_name}}_inference(): """ Model batch inference pipeline. diff --git a/template/run.py b/template/run.py index a574dad..31c536a 100644 --- a/template/run.py +++ b/template/run.py @@ -8,7 +8,7 @@ from zenml.client import Client from zenml.logger import get_logger -from pipelines import {{product_name}}_batch_inference, {{product_name}}_training +from pipelines import {{product_name}}_inference, {{product_name}}_training logger = get_logger(__name__) @@ -177,8 +177,8 @@ def main( ) pipeline_args[ "run_name" - ] = f"{{product_name}}_batch_inference_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" - {{product_name}}_batch_inference.with_options(**pipeline_args)(**run_args_inference) + ] = f"{{product_name}}_inference_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" + {{product_name}}_inference.with_options(**pipeline_args)(**run_args_inference) diff --git a/tests/test_template.py b/tests/test_template.py index 8d25de6..495160a 100644 --- a/tests/test_template.py +++ b/tests/test_template.py @@ -96,7 +96,7 @@ def generate_and_run_project( ) from e # check the pipeline run is successful - for pipeline_suffix in ["_training", "_batch_inference"]: + for pipeline_suffix in ["_training", "_inference"]: pipeline = Client().get_pipeline(product_name + pipeline_suffix) assert pipeline runs = pipeline.runs