docs(admin-config-tool): commit spec docs and example configs
design.md, research.md (new), brief.md and requirements.md (updated during spec authoring: Req 1.6 resolved/superseded by bundling, Req 5.5 added, Req 4.3/4.4 extended for limits.yaml) had been sitting uncommitted since before implementation began -- the entire 18-task implementation was built against these documents without them ever landing in git. src/configs/*.yaml + schema/*.schema.json: the example config directory and bundled JSON schemas most of the test suite reads as "real repo fixtures" (test_config_build.py, test_mapping.py, test_validation.py, etc.) were likewise never committed -- those tests would silently skip (skipif guards) rather than run for anyone else checking out this branch.
This commit is contained in:
parent
67cc361191
commit
a14785108c
18 changed files with 1574 additions and 53 deletions
101
src/configs/schema/hosts.schema.json
Normal file
101
src/configs/schema/hosts.schema.json
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://example.com/schemas/hosts.schema.json",
|
||||
"title": "Hosts and Hostgroups",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"hosts": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/Host" }
|
||||
},
|
||||
"hostgroups": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/HostGroup" }
|
||||
}
|
||||
},
|
||||
"required": ["hosts"],
|
||||
"$defs": {
|
||||
"Host": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"hostname": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" },
|
||||
"type": { "type": "string" },
|
||||
"model": { "type": "string" },
|
||||
"max_slot": { "type": "integer", "minimum": -1, "description": "-1 means auto-detect" },
|
||||
"dispatch_window": { "type": "array", "items": { "$ref": "#/$defs/TimeWindow" } },
|
||||
"sched_stop": { "type": "array", "items": { "$ref": "#/$defs/SchedStop" } },
|
||||
"resource": { "type": "array", "items": { "$ref": "#/$defs/HostResource" } },
|
||||
"description": { "type": "string", "maxLength": 4096 }
|
||||
},
|
||||
"required": ["hostname"]
|
||||
},
|
||||
"HostResource": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" },
|
||||
"value": {
|
||||
"description": "Resource value (string or number)",
|
||||
"oneOf": [
|
||||
{ "type": "number" },
|
||||
{ "type": "string" }
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": ["name"]
|
||||
},
|
||||
"TimeWindow": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"start_time": {
|
||||
"type": "string",
|
||||
"description": "[day:]hour[:minute]; day 0-6, hour 0-23, minute 0-59",
|
||||
"pattern": "^((([0-6]):)?([01]?\\d|2[0-3])(:[0-5]?\\d)?)$"
|
||||
},
|
||||
"end_time": {
|
||||
"type": "string",
|
||||
"description": "[day:]hour[:minute]; day 0-6, hour 0-23, minute 0-59",
|
||||
"pattern": "^((([0-6]):)?([01]?\\d|2[0-3])(:[0-5]?\\d)?)$"
|
||||
}
|
||||
},
|
||||
"required": ["start_time", "end_time"]
|
||||
},
|
||||
"SchedStop": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"resname": { "type": "string" },
|
||||
"sched": { "type": "number" },
|
||||
"stop": { "type": "number" }
|
||||
},
|
||||
"required": ["resname"],
|
||||
"anyOf": [
|
||||
{ "required": ["sched"] },
|
||||
{ "required": ["stop"] }
|
||||
]
|
||||
},
|
||||
"HostGroup": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"groupname": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" },
|
||||
"members": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "string",
|
||||
"pattern": "^(?:all|!|[A-Za-z0-9._*\\[\\]-]+)$"
|
||||
}
|
||||
},
|
||||
"exclude_members": {
|
||||
"type": "array",
|
||||
"items": { "type": "string", "pattern": "^(?:all|!|[A-Za-z0-9._*\\[\\]-]+)$" }
|
||||
}
|
||||
},
|
||||
"required": ["groupname", "members"]
|
||||
}
|
||||
}
|
||||
}
|
||||
54
src/configs/schema/limits.schema.json
Normal file
54
src/configs/schema/limits.schema.json
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://example.com/schemas/limits.schema.json",
|
||||
"title": "Limits",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"limits": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/Limit" }
|
||||
}
|
||||
},
|
||||
"required": ["limits"],
|
||||
"$defs": {
|
||||
"Membership": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"members": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "string",
|
||||
"pattern": "^(?:all|[A-Za-z0-9._*\\[\\]-]+)$"
|
||||
}
|
||||
},
|
||||
"exclude_members": {
|
||||
"type": "array",
|
||||
"items": { "type": "string", "pattern": "^[A-Za-z0-9._*\\[\\]-]+$" }
|
||||
}
|
||||
},
|
||||
"required": ["members"]
|
||||
},
|
||||
"Limit": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" },
|
||||
"users": { "$ref": "#/$defs/Membership" },
|
||||
"queues": { "$ref": "#/$defs/Membership" },
|
||||
"projects": { "$ref": "#/$defs/Membership" },
|
||||
"hosts": { "$ref": "#/$defs/Membership" },
|
||||
"resname": { "type": "string" },
|
||||
"value": { "type": "number" },
|
||||
"percent": { "type": "boolean" },
|
||||
"per_user": { "type": "boolean" },
|
||||
"per_queue": { "type": "boolean" },
|
||||
"per_project": { "type": "boolean" },
|
||||
"per_host": { "type": "boolean" }
|
||||
},
|
||||
"required": ["name", "resname", "value"]
|
||||
}
|
||||
}
|
||||
}
|
||||
120
src/configs/schema/queues.schema.json
Normal file
120
src/configs/schema/queues.schema.json
Normal file
|
|
@ -0,0 +1,120 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://example.com/schemas/queues.schema.json",
|
||||
"title": "Queues",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"queues": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/Queue" }
|
||||
}
|
||||
},
|
||||
"required": ["queues"],
|
||||
"$defs": {
|
||||
"TimeWindow": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"start_time": {
|
||||
"type": "string",
|
||||
"description": "[day:]HH[:MM] (day 0-6 optional, minute optional)",
|
||||
"pattern": "^((([0-6]):)?([01]?\\d|2[0-3])(:[0-5]?\\d)?)$"
|
||||
},
|
||||
"end_time": {
|
||||
"type": "string",
|
||||
"description": "[day:]HH[:MM] (day 0-6 optional, minute optional)",
|
||||
"pattern": "^((([0-6]):)?([01]?\\d|2[0-3])(:[0-5]?\\d)?)$"
|
||||
}
|
||||
},
|
||||
"required": ["start_time", "end_time"]
|
||||
},
|
||||
"SchedStop": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"resname": { "type": "string" },
|
||||
"sched": { "type": "number" },
|
||||
"stop": { "type": "number" }
|
||||
},
|
||||
"required": ["resname"],
|
||||
"anyOf": [
|
||||
{ "required": ["sched"] },
|
||||
{ "required": ["stop"] }
|
||||
]
|
||||
},
|
||||
"FairShare": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"user": { "type": "string" },
|
||||
"share": { "type": "integer", "minimum": 0 }
|
||||
},
|
||||
"required": ["user", "share"]
|
||||
},
|
||||
"Membership": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"members": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "string", "pattern": "^(?:all|[A-Za-z0-9._*\\[\\]-]+)$"
|
||||
}
|
||||
},
|
||||
"exclude_members": {
|
||||
"type": "array",
|
||||
"items": { "type": "string", "pattern": "^[A-Za-z0-9._*\\[\\]-]+$" }
|
||||
}
|
||||
},
|
||||
"required": ["members"]
|
||||
},
|
||||
"Queue": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" },
|
||||
"description": { "type": "string" },
|
||||
"priority": { "type": "integer" },
|
||||
"nice": { "type": "integer" },
|
||||
"res_req": { "type": "string" },
|
||||
"gpu_req": { "type": "string" },
|
||||
"fairshare": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/FairShare" }
|
||||
},
|
||||
"cpulimit": { "type": "number" },
|
||||
"memlimit": { "type": "number" },
|
||||
"runlimit": { "type": "number" },
|
||||
"runtimeest": { "type": "number" },
|
||||
"dispatch_window": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/TimeWindow" }
|
||||
},
|
||||
"run_window": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/TimeWindow" }
|
||||
},
|
||||
"sched_stop": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/SchedStop" }
|
||||
},
|
||||
"reservation": { "type": "integer", "minimum": 0 },
|
||||
"preemption": {
|
||||
"type": "string",
|
||||
"enum": ["preemptive", "preemptable"]
|
||||
},
|
||||
"backfill": { "type": "boolean" },
|
||||
"exclusive": { "type": "boolean" },
|
||||
"rerunable": { "type": "boolean" },
|
||||
"pre_exec": { "type": "string" },
|
||||
"post_exec": { "type": "string" },
|
||||
"job_starter": { "type": "string" },
|
||||
"users": { "$ref": "#/$defs/Membership" },
|
||||
"hosts": { "$ref": "#/$defs/Membership" }
|
||||
},
|
||||
"required": ["name", "priority"]
|
||||
}
|
||||
}
|
||||
}
|
||||
41
src/configs/schema/resources.schema.json
Normal file
41
src/configs/schema/resources.schema.json
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"resources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"type": { "type": "string", "enum": ["numeric", "boolean", "string"] },
|
||||
"interval": { "type": "integer" },
|
||||
"order": { "type": "string", "enum": ["increase", "decrease", "na"] },
|
||||
"consumable": { "type": "boolean" },
|
||||
"release": { "type": "boolean" },
|
||||
"description": { "type": "string" },
|
||||
"resourcemap": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"value": {
|
||||
"oneOf": [
|
||||
{ "type": "number" },
|
||||
{ "type": "string" },
|
||||
{ "type": "boolean" }
|
||||
]
|
||||
},
|
||||
"location": {
|
||||
"type": "array",
|
||||
"items": { "type": "string" }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["name", "type"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": ["resources"]
|
||||
}
|
||||
28
src/configs/schema/scaler.schema.json
Normal file
28
src/configs/schema/scaler.schema.json
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://example.com/schemas/scaler.schema.json",
|
||||
"title": "Scalers",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"scalers": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/Scaler" }
|
||||
}
|
||||
},
|
||||
"required": ["scalers"],
|
||||
"$defs": {
|
||||
"Scaler": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" },
|
||||
"type": { "type": "string", "description": "provider type, e.g. \"script\"" },
|
||||
"conf_path": { "type": "string" },
|
||||
"script_path": { "type": "string" },
|
||||
"script_option": { "type": "string" }
|
||||
},
|
||||
"required": ["name", "type", "script_path"]
|
||||
}
|
||||
}
|
||||
}
|
||||
39
src/configs/schema/users.schema.json
Normal file
39
src/configs/schema/users.schema.json
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://example.com/schemas/users.schema.json",
|
||||
"title": "Usergroups",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"usergroups": {
|
||||
"type": "array",
|
||||
"items": { "$ref": "#/$defs/UserGroup" }
|
||||
}
|
||||
},
|
||||
"required": ["usergroups"],
|
||||
"$defs": {
|
||||
"UserGroup": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"groupname": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9._-]+$"
|
||||
},
|
||||
"members": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "string",
|
||||
"pattern": "^(?:all|!|[A-Za-z0-9._*\\[\\]-]+)$"
|
||||
}
|
||||
},
|
||||
"exclude_members": {
|
||||
"type": "array",
|
||||
"items": { "type": "string", "pattern": "^(?:all|!|[A-Za-z0-9._*\\[\\]-]+)$" }
|
||||
}
|
||||
},
|
||||
"required": ["groupname", "members"]
|
||||
}
|
||||
}
|
||||
}
|
||||
35
src/configs/schema/xce.schema.json
Normal file
35
src/configs/schema/xce.schema.json
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://example.com/schemas/xce.schema.json",
|
||||
"title": "XCE Cluster Settings",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cluster_name": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-Za-z0-9._-]+$",
|
||||
"description": "cluster identity — must be identical on every controller instance"
|
||||
},
|
||||
"heartbeat_interval": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"description": "seconds between controller->worker liveness heartbeats"
|
||||
},
|
||||
"inactive_heartbeat_count": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"description": "missed heartbeats before a worker is marked unavailable"
|
||||
},
|
||||
"fetch_job_interval": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "seconds between scheduler job-fetch passes"
|
||||
},
|
||||
"netio_timeout": {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"description": "network I/O timeout in seconds"
|
||||
}
|
||||
},
|
||||
"required": ["cluster_name", "heartbeat_interval", "inactive_heartbeat_count"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue