-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mlos_bench config json schema validation: optimizers and tunable_values #340
Conversation
…- can stage more later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we remove "$schema"
from all JSONs - including the ARM template. As a result, our vm_provision()
service method fails when invoking Azure API. Here's the log:
2023-05-12 17:00:47,682 azure_services.py:442 vm_provision DEBUG Request: PUT https://management.azure.com/subscriptions/84334f8c-9e72-424d-8fc2-fd6da32e9ad6/resourceGroups/os-autotune/providers/Microsoft.Resources/deployments/os-autotune-001?api-version=2022-05-01
...
2023-05-12 17:00:48,087 connectionpool.py:456 _make_request DEBUG https://management.azure.com:443 "PUT /subscriptions/84334f8c-9e72-424d-8fc2-fd6da32e9ad6/resourceGroups/os-autotune/providers/Microsoft.Resources/deployments/os-autotune-001?api-version=2022-05-01 HTTP/1.1" 400 218
2023-05-12 17:00:48,089 azure_services.py:449 vm_provision DEBUG Response: <Response [400]>
{
"error": {
"code": "InvalidRequestContent",
"message": "The request content was invalid and could not be deserialized: 'Required property '$schema' not found in JSON. Path 'properties.template', line 1, position 6360.'."
}
}
Our main branch currently works end-to-end and I really want to keep it in a working state so I can run
mlos_bench --config .\mlos_bench\mlos_bench\config\cli\azure-redis-skopt.jsonc
from master at any time. Is it possible with this PR? (also, make it pass flake8/pylint/mypy checks)
BTW many flake8 and pylint fixes are already in #354 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our redis+azure example works again! Left a few flake8+pylint comments; otherwise APPROVE
mlos_bench/mlos_bench/tests/config/environments/test_load_environment_config_examples.py
Outdated
Show resolved
Hide resolved
mlos_bench/mlos_bench/tests/config/schemas/optimizers/test_optimizer_schemas.py
Outdated
Show resolved
Hide resolved
mlos_bench/mlos_bench/tests/config/storage/test_load_storage_config_examples.py
Outdated
Show resolved
Hide resolved
mlos_bench/mlos_bench/tests/config/services/test_load_service_config_examples.py
Outdated
Show resolved
Hide resolved
Extends #340, #346, #349, #352, #359 to Service configs. See Also: #331 - [x] main schema as a set of subschemas - [x] connect schema validation in the mlos_bench code - [x] test-cases To do this we removed support for configs that were flat lists of service configs: `[ {"class": "service.class"} ]` and turned those into objects that have a single key `"services"` with the list instead. `{ "services": [ ... ] }` This makes sure that all configs are dicts/objects that we can optionally put `"$schema"` attributes on but also simplifies some of the config loading logic.
This PR introduces initial json schemas for mlos_bench optimizer configs and tunable_values configs, their validation at load time, and tests for both.
Future PRs will handle other config types.
See Also: #331