From d890bddf8e3edc3fb4d0d30acc1c6d416a8bc451 Mon Sep 17 00:00:00 2001 From: Sergiy Matusevych Date: Wed, 1 Nov 2023 13:01:02 -0700 Subject: [PATCH] Update json schema to the actual parameters of script_env --- .../common-environment-subschemas.json | 19 ++++--------------- .../local_env-bad_script_params_mapping.jsonc | 2 +- ...l_env-bad_script_params_mapping_type.jsonc | 2 +- .../test-cases/good/full/local_env-full.jsonc | 5 +---- .../good/full/remote_env-full.jsonc | 5 +---- 5 files changed, 8 insertions(+), 25 deletions(-) diff --git a/mlos_bench/mlos_bench/config/schemas/environments/common-environment-subschemas.json b/mlos_bench/mlos_bench/config/schemas/environments/common-environment-subschemas.json index 0f504e036b8..2e801b6827f 100644 --- a/mlos_bench/mlos_bench/config/schemas/environments/common-environment-subschemas.json +++ b/mlos_bench/mlos_bench/config/schemas/environments/common-environment-subschemas.json @@ -88,26 +88,15 @@ }, "shell_param_type": { - "description": "All parameters must be valid shell variable names, else use shell_env_params_mapping.", + "description": "All parameters must be valid shell variable names, else use shell_env_params_rename.", "type": "string", "pattern": "^[a-zA-Z_][a-zA-Z0-9_]+$" }, "shell_env_params_config": { "type": "object", "properties": { - "shell_env_params_match": { - "description": "A list of regexes to match against the environment parameters. All matches will be exposed to shell commands as environment variables.", - "type": "array", - "items": { - "type": "string", - "format": "regex", - "examples": [ - "^MLOS_[a-zA-Z0-9_]+$" - ] - } - }, "shell_env_params": { - "description": "An explicit list of parameters (and their values) to pass to the shell as environment variables. These will override any parameters matched by shell_env_params_match.", + "description": "An explicit list of parameters (and their values) to pass to the shell as environment variables.", "type": "array", "items": { "$ref": "#/$defs/shell_param_type" @@ -115,8 +104,8 @@ "uniqueItems": true, "minItems": 1 }, - "shell_env_params_mapping": { - "description": "An explicit mapping of environment variable names from params to be populated with the parameter values and passed to the shell commands. These will override any parameters matched by shell_env_params_match.", + "shell_env_params_rename": { + "description": "An explicit mapping of environment variable names from params to be populated with the parameter values and passed to the shell commands.", "type": "object", "propertyNames": { "$ref": "#/$defs/shell_param_type" diff --git a/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/bad/invalid/local_env-bad_script_params_mapping.jsonc b/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/bad/invalid/local_env-bad_script_params_mapping.jsonc index e7117a57a07..86635aef9f4 100644 --- a/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/bad/invalid/local_env-bad_script_params_mapping.jsonc +++ b/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/bad/invalid/local_env-bad_script_params_mapping.jsonc @@ -5,7 +5,7 @@ "run": [ "/bin/true" ], - "shell_env_params_mapping": { + "shell_env_params_rename": { "invalid.target.name": "/source/param/name" } } diff --git a/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/bad/invalid/local_env-bad_script_params_mapping_type.jsonc b/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/bad/invalid/local_env-bad_script_params_mapping_type.jsonc index 03158aefe1c..6ad15787746 100644 --- a/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/bad/invalid/local_env-bad_script_params_mapping_type.jsonc +++ b/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/bad/invalid/local_env-bad_script_params_mapping_type.jsonc @@ -5,7 +5,7 @@ "run": [ "/bin/true" ], - "shell_env_params_mapping": { + "shell_env_params_rename": { "source_param_num_invalid": 0, "source_param_bool_invalid": true, "source_param_null_invalid": null, diff --git a/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/good/full/local_env-full.jsonc b/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/good/full/local_env-full.jsonc index a02037ccabb..35d999f358b 100644 --- a/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/good/full/local_env-full.jsonc +++ b/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/good/full/local_env-full.jsonc @@ -34,13 +34,10 @@ "read_results_file": "/tmp/results.csv", "read_telemetry_file": "/tmp/telemetry.csv", - "shell_env_params_match": [ - "^MLOS_[a-zA-Z0-9_]+$" - ], "shell_env_params": [ "foo" ], - "shell_env_params_mapping": { + "shell_env_params_rename": { "gets_mapped_to_this_env_name": "/source/param/name/that/is/otherwise/invalid/env/name" } } diff --git a/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/good/full/remote_env-full.jsonc b/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/good/full/remote_env-full.jsonc index d6a9948b30c..e5e9ebbb67b 100644 --- a/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/good/full/remote_env-full.jsonc +++ b/mlos_bench/mlos_bench/tests/config/schemas/environments/test-cases/good/full/remote_env-full.jsonc @@ -28,13 +28,10 @@ "results_stdout_pattern": "(\\w+),([0-9.]+)", - "shell_env_params_match": [ - "^MLOS_[a-zA-Z0-9_]+$" - ], "shell_env_params": [ "foo" ], - "shell_env_params_mapping": { + "shell_env_params_rename": { "gets_mapped_to_this_env_name": "/source/param/name/that/is/otherwise/invalid/env/name" } }