-
Notifications
You must be signed in to change notification settings - Fork 74
Refactor Scheduler schema definitions to make it easier to add new ones. #979
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
69 changes: 69 additions & 0 deletions
69
mlos_bench/mlos_bench/config/schemas/schedulers/base-scheduler-subschema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://raw.githubusercontent.com/microsoft/MLOS/main/mlos_bench/mlos_bench/config/schemas/schedulers/base-scheduler-subschema.json", | ||
"title": "mlos_bench base Scheduler config schema definitions", | ||
"description": "mlos_bench base Scheduler config schema definitions for all Scheduler types.", | ||
|
||
"$defs": { | ||
"base_scheduler_config": { | ||
"$comment": "config properties common to all Scheduler types.", | ||
"description": "The scheduler-specific config.", | ||
"type": "object", | ||
"minProperties": 1, | ||
"properties": { | ||
"experiment_id": { | ||
"$ref": "../cli/common-defs-subschemas.json#/$defs/experiment_id" | ||
}, | ||
"trial_id": { | ||
"$ref": "../cli/common-defs-subschemas.json#/$defs/trial_id" | ||
}, | ||
"config_id": { | ||
"$ref": "../cli/common-defs-subschemas.json#/$defs/config_id" | ||
}, | ||
"teardown": { | ||
"description": "Whether to teardown the experiment after running it.", | ||
"type": "boolean" | ||
}, | ||
"max_trials": { | ||
"description": "Max. number of trials to run. Use -1 or 0 for unlimited.", | ||
"type": "integer", | ||
"minimum": -1, | ||
"examples": [50, -1] | ||
}, | ||
"trial_config_repeat_count": { | ||
"description": "Number of times to repeat a config.", | ||
"type": "integer", | ||
"minimum": 1, | ||
"examples": [3, 5] | ||
} | ||
} | ||
} | ||
}, | ||
|
||
"type": "object", | ||
"properties": { | ||
"$schema": { | ||
"description": "The schema to use for validating the scheduler config (accepts both URLs and local paths).", | ||
"type": "string", | ||
"$comment": "This is optional, but if provided, should match the name of the root schema file.", | ||
"pattern": "/schemas/schedulers/scheduler-schema.json$" | ||
}, | ||
|
||
"description": { | ||
"description": "Optional description of the config.", | ||
"type": "string" | ||
}, | ||
|
||
"class": { | ||
"description": "The name of the scheduler class to use.", | ||
"type": "string", | ||
"$comment": "Exact matches are handled elsewhere.", | ||
"pattern": "^mlos_bench[.]schedulers[.]" | ||
}, | ||
|
||
"config": { | ||
"$ref": "#/$defs/base_scheduler_config" | ||
} | ||
}, | ||
"required": ["class"] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
mlos_bench/mlos_bench/config/schemas/schedulers/sync-scheduler-subschema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://raw.githubusercontent.com/microsoft/MLOS/main/mlos_bench/mlos_bench/config/schemas/schedulers/sync-scheduler-subschema.json", | ||
"title": "mlos_bench SyncScheduler config", | ||
"description": "config for an mlos_bench SyncScheduler", | ||
"type": "object", | ||
"properties": { | ||
"class": { | ||
"enum": [ | ||
"mlos_bench.schedulers.SyncScheduler", | ||
"mlos_bench.schedulers.sync_scheduler.SyncScheduler" | ||
] | ||
}, | ||
"config": { | ||
"type": "object", | ||
"$comment": "No extra properties supported by SyncScheduler.", | ||
"allOf": [ | ||
{ | ||
"$ref": "base-scheduler-subschema.json#/$defs/base_scheduler_config" | ||
} | ||
], | ||
"minProperties": 1, | ||
"unevaluatedProperties": false | ||
} | ||
}, | ||
"required": ["class"] | ||
bpkroth marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.