From 17c0c838759a50d5eb26cd7f9cbf40766371218a Mon Sep 17 00:00:00 2001 From: Safoine El khabich Date: Thu, 28 Nov 2024 18:10:15 +0100 Subject: [PATCH] Rename model references from gitguarden to secret_detection across configurations and pipelines --- train_and_deploy/README.md | 2 +- .../configs/deploy_production.yaml | 2 +- train_and_deploy/configs/deployer_config.yaml | 2 +- .../configs/inference_config.yaml | 2 +- train_and_deploy/configs/train_config.yaml | 8 ++--- train_and_deploy/gitguarden.yaml | 35 +++++++++++++++++++ train_and_deploy/pipelines/__init__.py | 8 ++--- train_and_deploy/pipelines/batch_inference.py | 2 +- .../pipelines/deploy_production.py | 2 +- .../pipelines/local_deployment.py | 2 +- train_and_deploy/pipelines/training.py | 2 +- train_and_deploy/run.py | 24 ++++++------- train_and_deploy/service.py | 2 +- 13 files changed, 64 insertions(+), 29 deletions(-) create mode 100644 train_and_deploy/gitguarden.yaml diff --git a/train_and_deploy/README.md b/train_and_deploy/README.md index 1abe6603..4eae458e 100644 --- a/train_and_deploy/README.md +++ b/train_and_deploy/README.md @@ -7,7 +7,7 @@ classification datasets provided by the scikit-learn library. The project was generated from the [E2E Batch ZenML project template](https://github.com/zenml-io/template-e2e-batch) with the following properties: - Project name: ZenML E2E project -- Technical Name: gitguarden +- Technical Name: secret_detection - Version: `0.0.1` - Licensed with apache to ZenML GmbH<> - Deployment environment: `staging` diff --git a/train_and_deploy/configs/deploy_production.yaml b/train_and_deploy/configs/deploy_production.yaml index cd575ec2..808eb93b 100644 --- a/train_and_deploy/configs/deploy_production.yaml +++ b/train_and_deploy/configs/deploy_production.yaml @@ -33,7 +33,7 @@ steps: # configuration of the Model Control Plane model: - name: gitguarden + name: secret_detection version: staging # pipeline level extra configurations diff --git a/train_and_deploy/configs/deployer_config.yaml b/train_and_deploy/configs/deployer_config.yaml index cd575ec2..808eb93b 100644 --- a/train_and_deploy/configs/deployer_config.yaml +++ b/train_and_deploy/configs/deployer_config.yaml @@ -33,7 +33,7 @@ steps: # configuration of the Model Control Plane model: - name: gitguarden + name: secret_detection version: staging # pipeline level extra configurations diff --git a/train_and_deploy/configs/inference_config.yaml b/train_and_deploy/configs/inference_config.yaml index 1a46bd01..2611d300 100644 --- a/train_and_deploy/configs/inference_config.yaml +++ b/train_and_deploy/configs/inference_config.yaml @@ -32,7 +32,7 @@ steps: # configuration of the Model Control Plane model: - name: gitguarden + name: secret_detection version: staging # pipeline level extra configurations diff --git a/train_and_deploy/configs/train_config.yaml b/train_and_deploy/configs/train_config.yaml index 63fc3ac8..dfcff182 100644 --- a/train_and_deploy/configs/train_config.yaml +++ b/train_and_deploy/configs/train_config.yaml @@ -28,19 +28,19 @@ settings: steps: model_trainer: parameters: - name: gitguarden + name: secret_detection promote_with_metric_compare: parameters: - mlflow_model_name: gitguarden + mlflow_model_name: secret_detection notify_on_success: parameters: notify_on_success: False # configuration of the Model Control Plane model: - name: gitguarden + name: secret_detection license: apache - description: gitguarden E2E Batch Use Case + description: secret_detection E2E Batch Use Case audience: All ZenML users use_cases: | The ZenML E2E project project demonstrates how the most important steps of diff --git a/train_and_deploy/gitguarden.yaml b/train_and_deploy/gitguarden.yaml new file mode 100644 index 00000000..c2fb92c0 --- /dev/null +++ b/train_and_deploy/gitguarden.yaml @@ -0,0 +1,35 @@ +components: + artifact_store: + configuration: + path: s3://zenml-dev + flavor: s3 + name: s3 + type: artifact_store + container_registry: + configuration: + uri: 339712793861.dkr.ecr.eu-central-1.amazonaws.com + flavor: aws + name: ecr + type: container_registry + data_validator: + configuration: {} + flavor: evidently + name: evidently_data_validator + type: data_validator + image_builder: + configuration: {} + flavor: local + name: local_builder + type: image_builder + model_deployer: + configuration: {} + flavor: bentoml + name: jayesh_bento + type: model_deployer + orchestrator: + configuration: {} + flavor: local + name: default + type: orchestrator +stack_name: secret_detection +zenml_version: 0.70.0 diff --git a/train_and_deploy/pipelines/__init__.py b/train_and_deploy/pipelines/__init__.py index 7ef1c39e..cd019ac0 100644 --- a/train_and_deploy/pipelines/__init__.py +++ b/train_and_deploy/pipelines/__init__.py @@ -16,7 +16,7 @@ # -from .batch_inference import gitguarden_batch_inference -from .training import gitguarden_training -from .local_deployment import gitguarden_local_deployment -from .deploy_production import gitguarden_production_deployment +from .batch_inference import secret_detection_batch_inference +from .training import secret_detection_training +from .local_deployment import secret_detection_local_deployment +from .deploy_production import secret_detection_production_deployment diff --git a/train_and_deploy/pipelines/batch_inference.py b/train_and_deploy/pipelines/batch_inference.py index 08d8d0fb..f891c291 100644 --- a/train_and_deploy/pipelines/batch_inference.py +++ b/train_and_deploy/pipelines/batch_inference.py @@ -33,7 +33,7 @@ @pipeline(on_failure=notify_on_failure) -def gitguarden_batch_inference( +def secret_detection_batch_inference( target_env: str, ): """ diff --git a/train_and_deploy/pipelines/deploy_production.py b/train_and_deploy/pipelines/deploy_production.py index 4545e7d8..86cb911b 100644 --- a/train_and_deploy/pipelines/deploy_production.py +++ b/train_and_deploy/pipelines/deploy_production.py @@ -21,7 +21,7 @@ @pipeline(on_failure=notify_on_failure, enable_cache=False) -def gitguarden_production_deployment( +def secret_detection_production_deployment( target_env: str, ): """Model deployment pipeline. diff --git a/train_and_deploy/pipelines/local_deployment.py b/train_and_deploy/pipelines/local_deployment.py index dd3a4f36..4fce7bc2 100644 --- a/train_and_deploy/pipelines/local_deployment.py +++ b/train_and_deploy/pipelines/local_deployment.py @@ -21,7 +21,7 @@ @pipeline(on_failure=notify_on_failure, enable_cache=False) -def gitguarden_local_deployment( +def secret_detection_local_deployment( target_env: str, ): """Model deployment pipeline. diff --git a/train_and_deploy/pipelines/training.py b/train_and_deploy/pipelines/training.py index 9b151eb6..f0c9e9e4 100644 --- a/train_and_deploy/pipelines/training.py +++ b/train_and_deploy/pipelines/training.py @@ -39,7 +39,7 @@ @pipeline(on_failure=notify_on_failure) -def gitguarden_training( +def secret_detection_training( model_search_space: Dict[str, Any], target_env: str, test_size: float = 0.2, diff --git a/train_and_deploy/run.py b/train_and_deploy/run.py index 1b938a4d..4f1d18db 100644 --- a/train_and_deploy/run.py +++ b/train_and_deploy/run.py @@ -21,10 +21,10 @@ import click from pipelines import ( - gitguarden_batch_inference, - gitguarden_local_deployment, - gitguarden_production_deployment, - gitguarden_training, + secret_detection_batch_inference, + secret_detection_local_deployment, + secret_detection_production_deployment, + secret_detection_training, ) from zenml.logger import get_logger @@ -202,9 +202,9 @@ def main( "train_config.yaml", ) pipeline_args["run_name"] = ( - f"gitguarden_training_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" + f"secret_detection_training_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" ) - gitguarden_training.with_options(**pipeline_args)(**run_args_train) + secret_detection_training.with_options(**pipeline_args)(**run_args_train) logger.info("Training pipeline finished successfully!") if deployment: @@ -216,9 +216,9 @@ def main( "deployer_config.yaml", ) pipeline_args["run_name"] = ( - f"gitguarden_local_deployment_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" + f"secret_detection_local_deployment_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" ) - gitguarden_local_deployment.with_options(**pipeline_args)(**run_args_inference) + secret_detection_local_deployment.with_options(**pipeline_args)(**run_args_inference) if inference: # Execute Batch Inference Pipeline @@ -229,9 +229,9 @@ def main( "inference_config.yaml", ) pipeline_args["run_name"] = ( - f"gitguarden_batch_inference_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" + f"secret_detection_batch_inference_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" ) - gitguarden_batch_inference.with_options(**pipeline_args)( + secret_detection_batch_inference.with_options(**pipeline_args)( **run_args_inference ) if production: @@ -243,9 +243,9 @@ def main( "deploy_production.yaml", ) pipeline_args["run_name"] = ( - f"gitguarden_production_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" + f"secret_detection_production_run_{dt.now().strftime('%Y_%m_%d_%H_%M_%S')}" ) - gitguarden_production_deployment.with_options(**pipeline_args)( + secret_detection_production_deployment.with_options(**pipeline_args)( **run_args_production ) diff --git a/train_and_deploy/service.py b/train_and_deploy/service.py index d34f0cb1..6bc59dcf 100644 --- a/train_and_deploy/service.py +++ b/train_and_deploy/service.py @@ -11,7 +11,7 @@ class GitGuarden: """ # Load in the class scope to declare the model as a dependency of the service - iris_model = bentoml.models.get("gitguarden:latest") + iris_model = bentoml.models.get("secret_detection:latest") def __init__(self): """