|
2 | 2 | "$schema": "https://json-schema.org/draft/2020-12/schema",
|
3 | 3 | "$id": "https://raw.githubusercontent.com/microsoft/MLOS/main/mlos_bench/mlos_bench/config/schemas/schedulers/scheduler-schema.json",
|
4 | 4 | "title": "mlos_bench Scheduler config",
|
5 |
| - |
6 |
| - "$defs": { |
7 |
| - "comment": { |
8 |
| - "$comment": "This section contains reusable partial schema bits (or just split out for readability)" |
9 |
| - }, |
10 |
| - |
11 |
| - "config_base_scheduler": { |
12 |
| - "$comment": "config properties common to all Scheduler types.", |
13 |
| - "type": "object", |
14 |
| - "properties": { |
15 |
| - "experiment_id": { |
16 |
| - "$ref": "../cli/common-defs-subschemas.json#/$defs/experiment_id" |
17 |
| - }, |
18 |
| - "trial_id": { |
19 |
| - "$ref": "../cli/common-defs-subschemas.json#/$defs/trial_id" |
20 |
| - }, |
21 |
| - "config_id": { |
22 |
| - "$ref": "../cli/common-defs-subschemas.json#/$defs/config_id" |
23 |
| - }, |
24 |
| - "teardown": { |
25 |
| - "description": "Whether to teardown the experiment after running it.", |
26 |
| - "type": "boolean" |
27 |
| - }, |
28 |
| - "max_trials": { |
29 |
| - "description": "Max. number of trials to run. Use -1 or 0 for unlimited.", |
30 |
| - "type": "integer", |
31 |
| - "minimum": -1, |
32 |
| - "examples": [50, -1] |
33 |
| - }, |
34 |
| - "trial_config_repeat_count": { |
35 |
| - "description": "Number of times to repeat a config.", |
36 |
| - "type": "integer", |
37 |
| - "minimum": 1, |
38 |
| - "examples": [3, 5] |
39 |
| - } |
40 |
| - } |
41 |
| - } |
42 |
| - }, |
43 |
| - |
44 | 5 | "description": "config for the mlos_bench scheduler",
|
45 | 6 | "$comment": "top level schema document rules",
|
46 |
| - "type": "object", |
47 |
| - "properties": { |
48 |
| - "$schema": { |
49 |
| - "description": "The schema to use for validating the scheduler config (accepts both URLs and local paths).", |
50 |
| - "type": "string", |
51 |
| - "$comment": "This is optional, but if provided, should match the name of this file.", |
52 |
| - "pattern": "/schemas/schedulers/scheduler-schema.json$" |
53 |
| - }, |
54 |
| - |
55 |
| - "description": { |
56 |
| - "description": "Optional description of the config.", |
57 |
| - "type": "string" |
58 |
| - }, |
59 | 7 |
|
60 |
| - "class": { |
61 |
| - "description": "The name of the scheduler class to use.", |
62 |
| - "$comment": "required", |
63 |
| - "enum": [ |
64 |
| - "mlos_bench.schedulers.SyncScheduler", |
65 |
| - "mlos_bench.schedulers.sync_scheduler.SyncScheduler" |
66 |
| - ] |
| 8 | + "type": "object", |
| 9 | + "allOf": [ |
| 10 | + { |
| 11 | + "$comment": "All scheduler subschemas support these base properties.", |
| 12 | + "$ref": "./base-scheduler-subschema.json" |
67 | 13 | },
|
68 |
| - |
69 |
| - "config": { |
70 |
| - "description": "The scheduler-specific config.", |
71 |
| - "$comment": "Stub for scheduler-specific config appended with condition statements below", |
72 |
| - "type": "object", |
73 |
| - "minProperties": 1 |
74 |
| - } |
75 |
| - }, |
76 |
| - "required": ["class"], |
77 |
| - |
78 |
| - "oneOf": [ |
79 | 14 | {
|
80 |
| - "$comment": "extensions to the 'config' object properties when synchronous scheduler is being used", |
81 |
| - "if": { |
82 |
| - "properties": { |
83 |
| - "class": { |
84 |
| - "enum": [ |
85 |
| - "mlos_bench.schedulers.SyncScheduler", |
86 |
| - "mlos_bench.schedulers.sync_scheduler.SyncScheduler" |
87 |
| - ] |
88 |
| - } |
89 |
| - }, |
90 |
| - "required": ["class"] |
91 |
| - }, |
92 |
| - "then": { |
93 |
| - "properties": { |
94 |
| - "config": { |
95 |
| - "type": "object", |
96 |
| - "allOf": [{ "$ref": "#/$defs/config_base_scheduler" }], |
97 |
| - "$comment": "disallow other properties", |
98 |
| - "unevaluatedProperties": false |
99 |
| - } |
| 15 | + "$comment": "The set of known Scheduler subschemas. Add others as needed.", |
| 16 | + "oneOf": [ |
| 17 | + { |
| 18 | + "$ref": "./sync-scheduler-subschema.json" |
100 | 19 | }
|
101 |
| - }, |
102 |
| - "else": false |
| 20 | + ] |
103 | 21 | }
|
104 | 22 | ],
|
| 23 | + "required": ["class"], |
105 | 24 | "unevaluatedProperties": false
|
106 | 25 | }
|
0 commit comments