From 5f2e58e2674ace73c671124b0a3f5316631b0e5a Mon Sep 17 00:00:00 2001 From: Eli Fajardo Date: Tue, 12 Dec 2023 19:16:02 -0500 Subject: [PATCH 1/5] fix calls to DFPArgParser constructor --- .../morpheus/benchmarks/benchmark_conf_generator.py | 2 ++ .../dfp_integrated_training_batch_pipeline.py | 12 ++---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/digital_fingerprinting/production/morpheus/benchmarks/benchmark_conf_generator.py b/examples/digital_fingerprinting/production/morpheus/benchmarks/benchmark_conf_generator.py index d86ddbc660..0cb187a51b 100644 --- a/examples/digital_fingerprinting/production/morpheus/benchmarks/benchmark_conf_generator.py +++ b/examples/digital_fingerprinting/production/morpheus/benchmarks/benchmark_conf_generator.py @@ -161,6 +161,8 @@ def get_module_conf(self): source=(self.source), tracking_uri=mlflow.get_tracking_uri(), silence_monitors=True, + mlflow_experiment_name_formatter=self._get_experiment_name_formatter(), + mlflow_model_name_formatter=self._get_model_name_formatter(), train_users='generic') dfp_arg_parser.init() config_generator = ConfigGenerator(self.pipe_config, dfp_arg_parser, self.get_schema()) diff --git a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py index c18da19ee4..02289b2e16 100644 --- a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py +++ b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py @@ -101,14 +101,6 @@ type=str, default="http://mlflow:5000", help=("The MLflow tracking URI to connect to the tracking backend.")) -@click.option('--mlflow_experiment_name_template', - type=str, - default="dfp/{source}/training/{reg_model_name}", - help="The MLflow experiment name template to use when logging experiments. ") -@click.option('--mlflow_model_name_template', - type=str, - default="DFP-{source}-{user_id}", - help="The MLflow model name template to use when logging models. ") @click.option("--disable_pre_filtering", is_flag=True, help=("Enabling this option will skip pre-filtering of json messages. " @@ -134,12 +126,12 @@ def run_pipeline(source: str, tracking_uri, silence_monitors, use_cpp, - mlflow_experiment_name_template, - mlflow_model_name_template, **kwargs): if (skip_user and only_user): logging.error("Option --skip_user and --only_user are mutually exclusive. Exiting") + mlflow_experiment_name_template = f'dfp/{source}/training/' + '{reg_model_name}' + mlflow_model_name_template = f'DFP-{source}-' + '{user_id}' dfp_arg_parser = DFPArgParser(skip_user, only_user, start_time, From bbbd403b2978027bf1513db00dfbeab639868cb1 Mon Sep 17 00:00:00 2001 From: Eli Fajardo Date: Tue, 12 Dec 2023 19:17:05 -0500 Subject: [PATCH 2/5] shorten file load paths in example dfp control messages --- .../morpheus/control_messages/azure_payload_inference.json | 2 +- .../control_messages/azure_payload_load_train_inference.json | 4 ++-- .../control_messages/azure_payload_load_training.json | 2 +- .../morpheus/control_messages/azure_payload_lti.json | 4 ++-- .../morpheus/control_messages/azure_payload_training.json | 2 +- .../morpheus/control_messages/azure_streaming_inference.json | 2 +- .../morpheus/control_messages/azure_streaming_lti.json | 4 ++-- .../morpheus/control_messages/azure_streaming_training.json | 2 +- .../morpheus/control_messages/duo_payload_inference.json | 2 +- .../control_messages/duo_payload_load_train_inference.json | 4 ++-- .../production/morpheus/control_messages/duo_payload_lti.json | 4 ++-- .../morpheus/control_messages/duo_payload_only_load.json | 2 +- .../morpheus/control_messages/duo_payload_training.json | 2 +- .../morpheus/control_messages/duo_streaming_inference.json | 2 +- .../morpheus/control_messages/duo_streaming_lti.json | 4 ++-- .../morpheus/control_messages/duo_streaming_only_load.json | 2 +- .../morpheus/control_messages/duo_streaming_payload.json | 4 ++-- .../morpheus/control_messages/duo_streaming_training.json | 2 +- 18 files changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_inference.json b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_inference.json index a258cf3fd5..f8d2b9ed3a 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_inference.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_inference.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-inference-data/*.json" + "../../../data/dfp/azure-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_load_train_inference.json b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_load_train_inference.json index 0286129151..bf0a3771ef 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_load_train_inference.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_load_train_inference.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-training-data/*.json" + "../../../data/dfp/azure-training-data/*.json" ] } }, @@ -28,7 +28,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-inference-data/*.json" + "../../../data/dfp/azure-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_load_training.json b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_load_training.json index d6e028d4eb..dad09e6062 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_load_training.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_load_training.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-training-data/*.json" + "../../../data/dfp/azure-training-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_lti.json b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_lti.json index 97053f82a4..1b1e226145 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_lti.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_lti.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-training-data/*.json" + "../../../data/dfp/azure-training-data/*.json" ] } }, @@ -34,7 +34,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-inference-data/*.json" + "../../../data/dfp/azure-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_training.json b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_training.json index d6e028d4eb..dad09e6062 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_training.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_payload_training.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-training-data/*.json" + "../../../data/dfp/azure-training-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_inference.json b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_inference.json index d122241e8c..9c5d889d5c 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_inference.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_inference.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-inference-data/*.json" + "../../../data/dfp/azure-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_lti.json b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_lti.json index f798a1a475..7a28c85d73 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_lti.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_lti.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-training-data/*.json" + "../../../data/dfp/azure-training-data/*.json" ] } }, @@ -34,7 +34,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-inference-data/*.json" + "../../../data/dfp/azure-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_training.json b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_training.json index 8397489cb2..882b23a0a3 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_training.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/azure_streaming_training.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/azure-training-data/*.json" + "../../../data/dfp/azure-training-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_inference.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_inference.json index 7b4bb9672a..ebd6669be7 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_inference.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_inference.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-inference-data/*.json" + "../../../data/dfp/duo-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_load_train_inference.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_load_train_inference.json index e378d82760..e30f66ccfe 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_load_train_inference.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_load_train_inference.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-training-data/*.json" + "../../../data/dfp/duo-training-data/*.json" ] } }, @@ -28,7 +28,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-inference-data/*.json" + "../../../data/dfp/duo-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_lti.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_lti.json index 07c69233ba..382ff22808 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_lti.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_lti.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-training-data/*.json" + "../../../data/dfp/duo-training-data/*.json" ] } }, @@ -34,7 +34,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-inference-data/*.json" + "../../../data/dfp/duo-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_only_load.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_only_load.json index 3a214ea810..ed69cbf5af 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_only_load.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_only_load.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-inference-data/*.json" + "../../../data/dfp/duo-inference-data/*.json" ] } } diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_training.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_training.json index df21751d36..2b9995875f 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_training.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_payload_training.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-training-data/*.json" + "../../../data/dfp/duo-training-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_inference.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_inference.json index fc1db57669..2b033b9d7c 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_inference.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_inference.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-inference-data/*.json" + "../../../data/dfp/duo-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_lti.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_lti.json index 91d41cad22..d74bae952b 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_lti.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_lti.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../../examples/data/dfp/duo-training-data/*.json" + "../../../data/dfp/duo-training-data/*.json" ] } }, @@ -34,7 +34,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../../examples/data/dfp/duo-inference-data/*.json" + "../../../data/dfp/duo-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_only_load.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_only_load.json index 28b2a2f7f1..205842d72b 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_only_load.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_only_load.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-inference-data/*.json" + "../../../data/dfp/duo-inference-data/*.json" ] } } diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_payload.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_payload.json index ab5dadf0e5..3daf318961 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_payload.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_payload.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-training-data/*.json" + "../../../data/dfp/duo-training-data/*.json" ] } }, @@ -28,7 +28,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-inference-data/*.json" + "../../../data/dfp/duo-inference-data/*.json" ] } }, diff --git a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_training.json b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_training.json index 73cc9046d9..4486149127 100644 --- a/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_training.json +++ b/examples/digital_fingerprinting/production/morpheus/control_messages/duo_streaming_training.json @@ -7,7 +7,7 @@ "properties": { "loader_id": "fsspec", "files": [ - "../../../../examples/data/dfp/duo-training-data/*.json" + "../../../data/dfp/duo-training-data/*.json" ] } }, From 341e4082a7b1db29860f1367546a6f3ba65a9181 Mon Sep 17 00:00:00 2001 From: Eli Fajardo Date: Tue, 12 Dec 2023 19:17:59 -0500 Subject: [PATCH 3/5] dfp example and benchmark doc updates --- .../guides/10_modular_pipeline_digital_fingerprinting.md | 8 ++++---- .../production/morpheus/benchmarks/README.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/developer_guide/guides/10_modular_pipeline_digital_fingerprinting.md b/docs/source/developer_guide/guides/10_modular_pipeline_digital_fingerprinting.md index 408d6e6804..e30952dd41 100644 --- a/docs/source/developer_guide/guides/10_modular_pipeline_digital_fingerprinting.md +++ b/docs/source/developer_guide/guides/10_modular_pipeline_digital_fingerprinting.md @@ -527,7 +527,7 @@ From the `examples/digital_fingerprinting/production` dir, run: ```bash docker compose run morpheus_pipeline bash ``` -To run the DFP pipelines with the example datasets within the container, run: +To run the DFP pipelines with the example datasets within the container, run the following from `examples/digital_fingerprinting/production/morpheus`: * Duo Training Pipeline ```bash @@ -560,7 +560,7 @@ To run the DFP pipelines with the example datasets within the container, run: --start_time "2022-08-01" \ --duration "60d" \ --train_users generic \ - --input_file "./control_messages/duo_payload_load_train_inference.json" + --input_file "./control_messages/duo_payload_load_train_inference.json" ``` * Azure Training Pipeline @@ -594,7 +594,7 @@ To run the DFP pipelines with the example datasets within the container, run: --start_time "2022-08-01" \ --duration "60d" \ --train_users generic \ - --input_file "./control_messages/azure_payload_load_train_inference.json" + --input_file "./control_messages/azure_payload_load_train_inference.json" ``` ### Output Fields @@ -615,4 +615,4 @@ In addition to this, for each input feature the following output fields will exi | `_z_loss` | FLOAT | The loss z-score | | `_pred` | FLOAT | The predicted value | -Refer to [DFPInferenceStage](6_digital_fingerprinting_reference.md#inference-stage-dfpinferencestage) for more on these fields. \ No newline at end of file +Refer to [DFPInferenceStage](6_digital_fingerprinting_reference.md#inference-stage-dfpinferencestage) for more on these fields. diff --git a/examples/digital_fingerprinting/production/morpheus/benchmarks/README.md b/examples/digital_fingerprinting/production/morpheus/benchmarks/README.md index cad1fe96d6..4ff9f77e99 100644 --- a/examples/digital_fingerprinting/production/morpheus/benchmarks/README.md +++ b/examples/digital_fingerprinting/production/morpheus/benchmarks/README.md @@ -103,11 +103,11 @@ To ensure the [file_to_df_loader.py](../../../../../morpheus/loaders/file_to_df_ export MORPHEUS_FILE_DOWNLOAD_TYPE=dask ``` -Benchmarks for an individual workflow can be run using the following in your dev container: +Benchmarks for an individual workflow can be run from `examples/digital_fingerprinting/production/morpheus` in your dev container: ``` -pytest -s --log-level=WARN --benchmark-enable --benchmark-warmup=on --benchmark-warmup-iterations=1 --benchmark-autosave test_bench_e2e_dfp_pipeline.py:: +pytest -s --log-level=WARN --benchmark-enable --benchmark-warmup=on --benchmark-warmup-iterations=1 --benchmark-autosave benchmarks/test_bench_e2e_dfp_pipeline.py:: ``` The `-s` option allows outputs of pipeline execution to be displayed so you can ensure there are no errors while running your benchmarks. @@ -137,12 +137,12 @@ The `--benchmark-warmup` and `--benchmark-warmup-iterations` options are used to For example, to run E2E benchmarks on the DFP training (modules) workflow on the azure logs: ``` -pytest -s --benchmark-enable --benchmark-warmup=on --benchmark-warmup-iterations=1 --benchmark-autosave test_bench_e2e_dfp_pipeline.py::test_dfp_modules_azure_payload_lti_e2e +pytest -s --benchmark-enable --benchmark-warmup=on --benchmark-warmup-iterations=1 --benchmark-autosave benchmarks/test_bench_e2e_dfp_pipeline.py::test_dfp_modules_azure_payload_lti_e2e ``` To run E2E benchmarks on all workflows: ``` -pytest -s --benchmark-enable --benchmark-warmup=on --benchmark-warmup-iterations=1 --benchmark-autosave test_bench_e2e_dfp_pipeline.py +pytest -s --benchmark-enable --benchmark-warmup=on --benchmark-warmup-iterations=1 --benchmark-autosave benchmarks/test_bench_e2e_dfp_pipeline.py ``` Here are the benchmark comparisons for individual tests. When the control message type is "payload", the rolling window stage is bypassed, whereas when it is "streaming", the windows are created with historical data. From 681bfd5990ab49ab95ebfca8ac005c86c91c26e9 Mon Sep 17 00:00:00 2001 From: Eli Fajardo Date: Tue, 12 Dec 2023 19:35:52 -0500 Subject: [PATCH 4/5] update mlflow experiment and model name defaults --- .../dfp_integrated_training_batch_pipeline.py | 16 ++++++++++++++-- ...dfp_integrated_training_streaming_pipeline.py | 9 +++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py index 02289b2e16..61e8ab0309 100644 --- a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py +++ b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py @@ -101,6 +101,14 @@ type=str, default="http://mlflow:5000", help=("The MLflow tracking URI to connect to the tracking backend.")) +@click.option('--mlflow_experiment_name_template', + type=str, + default=None, + help="The MLflow experiment name template to use when logging experiments. ") +@click.option('--mlflow_model_name_template', + type=str, + default=None, + help="The MLflow model name template to use when logging models. ") @click.option("--disable_pre_filtering", is_flag=True, help=("Enabling this option will skip pre-filtering of json messages. " @@ -126,12 +134,16 @@ def run_pipeline(source: str, tracking_uri, silence_monitors, use_cpp, + mlflow_experiment_name_template, + mlflow_model_name_template, **kwargs): if (skip_user and only_user): logging.error("Option --skip_user and --only_user are mutually exclusive. Exiting") - mlflow_experiment_name_template = f'dfp/{source}/training/' + '{reg_model_name}' - mlflow_model_name_template = f'DFP-{source}-' + '{user_id}' + if mlflow_experiment_name_template is None: + mlflow_experiment_name_template = f'dfp/{source}/training/' + '{reg_model_name}' + if mlflow_model_name_template is None: + mlflow_model_name_template = f'DFP-{source}-' + '{user_id}' dfp_arg_parser = DFPArgParser(skip_user, only_user, start_time, diff --git a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_streaming_pipeline.py b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_streaming_pipeline.py index e60792d6d3..fb890a5375 100644 --- a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_streaming_pipeline.py +++ b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_streaming_pipeline.py @@ -103,11 +103,11 @@ help=("The MLflow tracking URI to connect to the tracking backend.")) @click.option('--mlflow_experiment_name_template', type=str, - default="dfp/{source}/training/{reg_model_name}", + default=None, help="The MLflow experiment name template to use when logging experiments. ") @click.option('--mlflow_model_name_template', type=str, - default="DFP-{source}-{user_id}", + default=None, help="The MLflow model name template to use when logging models. ") @click.option('--bootstrap_servers', type=str, @@ -152,6 +152,11 @@ def run_pipeline(source: str, if (skip_user and only_user): logging.error("Option --skip_user and --only_user are mutually exclusive. Exiting") + if mlflow_experiment_name_template is None: + mlflow_experiment_name_template = f'dfp/{source}/training/' + '{reg_model_name}' + if mlflow_model_name_template is None: + mlflow_model_name_template = f'DFP-{source}-' + '{user_id}' + dfp_arg_parser = DFPArgParser(skip_user, only_user, start_time, From 43c4ced765cb8b06eb48950e56c981af885c83da Mon Sep 17 00:00:00 2001 From: Eli Fajardo Date: Wed, 13 Dec 2023 14:41:50 -0500 Subject: [PATCH 5/5] update click option help messages --- .../morpheus/dfp_integrated_training_batch_pipeline.py | 6 ++++-- .../morpheus/dfp_integrated_training_streaming_pipeline.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py index 61e8ab0309..a1ab2cb9c6 100644 --- a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py +++ b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_batch_pipeline.py @@ -104,11 +104,13 @@ @click.option('--mlflow_experiment_name_template', type=str, default=None, - help="The MLflow experiment name template to use when logging experiments. ") + help=("The MLflow experiment name template to use when logging experiments." + "If None, defaults to dfp/source/training/{reg_model_name}")) @click.option('--mlflow_model_name_template', type=str, default=None, - help="The MLflow model name template to use when logging models. ") + help=("The MLflow model name template to use when logging models." + "If None, defaults to DFP-source-{user_id}")) @click.option("--disable_pre_filtering", is_flag=True, help=("Enabling this option will skip pre-filtering of json messages. " diff --git a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_streaming_pipeline.py b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_streaming_pipeline.py index fb890a5375..29e7893d04 100644 --- a/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_streaming_pipeline.py +++ b/examples/digital_fingerprinting/production/morpheus/dfp_integrated_training_streaming_pipeline.py @@ -104,11 +104,13 @@ @click.option('--mlflow_experiment_name_template', type=str, default=None, - help="The MLflow experiment name template to use when logging experiments. ") + help=("The MLflow experiment name template to use when logging experiments." + "If None, defaults to dfp/source/training/{reg_model_name}")) @click.option('--mlflow_model_name_template', type=str, default=None, - help="The MLflow model name template to use when logging models. ") + help=("The MLflow model name template to use when logging models." + "If None, defaults to DFP-source-{user_id}")) @click.option('--bootstrap_servers', type=str, default="localhost:9092",