mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 05:19:05 +01:00
Fix broken schema and add tests
This commit is contained in:
parent
207254a9e2
commit
2fdf1c14be
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "embedFS://schemas/cluster.schema.json",
|
"$id": "embedfs://cluster.schema.json",
|
||||||
"title": "HPC cluster description",
|
"title": "HPC cluster description",
|
||||||
"description": "Meta data information of a HPC cluster",
|
"description": "Meta data information of a HPC cluster",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@ -78,7 +78,8 @@
|
|||||||
"scope",
|
"scope",
|
||||||
"timestep"
|
"timestep"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"minItems": 1
|
||||||
},
|
},
|
||||||
"subClusters": {
|
"subClusters": {
|
||||||
"description": "Array of cluster hardware partitions",
|
"description": "Array of cluster hardware partitions",
|
||||||
@ -223,7 +224,8 @@
|
|||||||
"flopRateSimd",
|
"flopRateSimd",
|
||||||
"memoryBandwidth"
|
"memoryBandwidth"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"minItems": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required":[
|
"required":[
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "embedFS://schemas/config.schema.json",
|
"$id": "embedfs://config.schema.json",
|
||||||
"title": "cc-backend configuration file schema",
|
"title": "cc-backend configuration file schema",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties":{
|
"properties":{
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "embedFS://schemas/job-data.schema.json",
|
"$id": "embedfs://job-data.schema.json",
|
||||||
"title": "Job metric data list",
|
"title": "Job metric data list",
|
||||||
"description": "Collection of metric data of a HPC job",
|
"description": "Collection of metric data of a HPC job",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@ -10,7 +10,7 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -21,19 +21,19 @@
|
|||||||
"description": "Total flop rate with DP flops scaled up",
|
"description": "Total flop rate with DP flops scaled up",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"memoryDomain": {
|
"memoryDomain": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"core": {
|
"core": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"hwthread": {
|
"hwthread": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -42,13 +42,13 @@
|
|||||||
"description": "Main memory bandwidth",
|
"description": "Main memory bandwidth",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"memoryDomain": {
|
"memoryDomain": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -58,7 +58,7 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -69,19 +69,19 @@
|
|||||||
"description": "Instructions executed per cycle",
|
"description": "Instructions executed per cycle",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"memoryDomain": {
|
"memoryDomain": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"core": {
|
"core": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"hwthread": {
|
"hwthread": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -90,19 +90,19 @@
|
|||||||
"description": "CPU active core utilization",
|
"description": "CPU active core utilization",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"memoryDomain": {
|
"memoryDomain": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"core": {
|
"core": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"hwthread": {
|
"hwthread": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -111,7 +111,7 @@
|
|||||||
"description": "CPU requested core utilization (load 1m)",
|
"description": "CPU requested core utilization (load 1m)",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -122,19 +122,19 @@
|
|||||||
"description": "Double precision flop rate",
|
"description": "Double precision flop rate",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"memoryDomain": {
|
"memoryDomain": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"core": {
|
"core": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"hwthread": {
|
"hwthread": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -143,19 +143,19 @@
|
|||||||
"description": "Single precision flops rate",
|
"description": "Single precision flops rate",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"memoryDomain": {
|
"memoryDomain": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"core": {
|
"core": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"hwthread": {
|
"hwthread": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -164,19 +164,19 @@
|
|||||||
"description": "Fraction of arithmetic instructions using SIMD instructions",
|
"description": "Fraction of arithmetic instructions using SIMD instructions",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"memoryDomain": {
|
"memoryDomain": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"core": {
|
"core": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"hwthread": {
|
"hwthread": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -185,10 +185,10 @@
|
|||||||
"description": "CPU power consumption",
|
"description": "CPU power consumption",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -197,10 +197,10 @@
|
|||||||
"description": "Memory power consumption",
|
"description": "Memory power consumption",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -209,7 +209,7 @@
|
|||||||
"description": "GPU utilization",
|
"description": "GPU utilization",
|
||||||
"properties": {
|
"properties": {
|
||||||
"accelerator": {
|
"accelerator": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -220,7 +220,7 @@
|
|||||||
"description": "GPU memory capacity used",
|
"description": "GPU memory capacity used",
|
||||||
"properties": {
|
"properties": {
|
||||||
"accelerator": {
|
"accelerator": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -231,7 +231,7 @@
|
|||||||
"description": "GPU power consumption",
|
"description": "GPU power consumption",
|
||||||
"properties": {
|
"properties": {
|
||||||
"accelerator": {
|
"accelerator": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -242,19 +242,19 @@
|
|||||||
"description": "Average core frequency",
|
"description": "Average core frequency",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"socket": {
|
"socket": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"memoryDomain": {
|
"memoryDomain": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"core": {
|
"core": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
},
|
},
|
||||||
"hwthread": {
|
"hwthread": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minProperties": 1
|
"minProperties": 1
|
||||||
@ -263,7 +263,7 @@
|
|||||||
"description": "Ethernet read bandwidth",
|
"description": "Ethernet read bandwidth",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -274,7 +274,7 @@
|
|||||||
"description": "Ethernet write bandwidth",
|
"description": "Ethernet write bandwidth",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -306,7 +306,7 @@
|
|||||||
"description": "File system read bandwidth",
|
"description": "File system read bandwidth",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -317,7 +317,7 @@
|
|||||||
"description": "File system write bandwidth",
|
"description": "File system write bandwidth",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -328,7 +328,7 @@
|
|||||||
"description": "File system read requests",
|
"description": "File system read requests",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -339,7 +339,7 @@
|
|||||||
"description": "File system write requests",
|
"description": "File system write requests",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -350,7 +350,7 @@
|
|||||||
"description": "File system write requests",
|
"description": "File system write requests",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -361,7 +361,7 @@
|
|||||||
"description": "File system open and close",
|
"description": "File system open and close",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -372,7 +372,7 @@
|
|||||||
"description": "File system fsync",
|
"description": "File system fsync",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -383,7 +383,7 @@
|
|||||||
"description": "File system create",
|
"description": "File system create",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -394,7 +394,7 @@
|
|||||||
"description": "File system open",
|
"description": "File system open",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -405,7 +405,7 @@
|
|||||||
"description": "File system close",
|
"description": "File system close",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -416,7 +416,7 @@
|
|||||||
"description": "File system seek",
|
"description": "File system seek",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -438,7 +438,7 @@
|
|||||||
"description": "Network interconnect read packets",
|
"description": "Network interconnect read packets",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -449,7 +449,7 @@
|
|||||||
"description": "Network interconnect send packet",
|
"description": "Network interconnect send packet",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -460,7 +460,7 @@
|
|||||||
"description": "Network interconnect read bandwidth",
|
"description": "Network interconnect read bandwidth",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
@ -471,7 +471,7 @@
|
|||||||
"description": "Network interconnect write bandwidth",
|
"description": "Network interconnect write bandwidth",
|
||||||
"properties": {
|
"properties": {
|
||||||
"node": {
|
"node": {
|
||||||
"$ref": "embedFS://schemas/job-metric-data.schema.json"
|
"$ref": "embedfs://job-metric-data.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "embedFS://schemas/job-meta.schema.json",
|
"$id": "embedfs://job-meta.schema.json",
|
||||||
"title": "Job meta data",
|
"title": "Job meta data",
|
||||||
"description": "Meta data information of a HPC job",
|
"description": "Meta data information of a HPC job",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
@ -172,87 +172,87 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"mem_used": {
|
"mem_used": {
|
||||||
"description": "Memory capacity used (required)",
|
"description": "Memory capacity used (required)",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"cpu_load": {
|
"cpu_load": {
|
||||||
"description": "CPU requested core utilization (load 1m) (required)",
|
"description": "CPU requested core utilization (load 1m) (required)",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"flops_any": {
|
"flops_any": {
|
||||||
"description": "Total flop rate with DP flops scaled up (required)",
|
"description": "Total flop rate with DP flops scaled up (required)",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"mem_bw": {
|
"mem_bw": {
|
||||||
"description": "Main memory bandwidth (required)",
|
"description": "Main memory bandwidth (required)",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"net_bw": {
|
"net_bw": {
|
||||||
"description": "Total fast interconnect network bandwidth (required)",
|
"description": "Total fast interconnect network bandwidth (required)",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"file_bw": {
|
"file_bw": {
|
||||||
"description": "Total file IO bandwidth (required)",
|
"description": "Total file IO bandwidth (required)",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"ipc": {
|
"ipc": {
|
||||||
"description": "Instructions executed per cycle",
|
"description": "Instructions executed per cycle",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"cpu_used": {
|
"cpu_used": {
|
||||||
"description": "CPU active core utilization",
|
"description": "CPU active core utilization",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"flops_dp": {
|
"flops_dp": {
|
||||||
"description": "Double precision flop rate",
|
"description": "Double precision flop rate",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"flops_sp": {
|
"flops_sp": {
|
||||||
"description": "Single precision flops rate",
|
"description": "Single precision flops rate",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"rapl_power": {
|
"rapl_power": {
|
||||||
"description": "CPU power consumption",
|
"description": "CPU power consumption",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"gpu_used": {
|
"gpu_used": {
|
||||||
"description": "GPU utilization",
|
"description": "GPU utilization",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"gpu_mem_used": {
|
"gpu_mem_used": {
|
||||||
"description": "GPU memory capacity used",
|
"description": "GPU memory capacity used",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"gpu_power": {
|
"gpu_power": {
|
||||||
"description": "GPU power consumption",
|
"description": "GPU power consumption",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"clock": {
|
"clock": {
|
||||||
"description": "Average core frequency",
|
"description": "Average core frequency",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"eth_read_bw": {
|
"eth_read_bw": {
|
||||||
"description": "Ethernet read bandwidth",
|
"description": "Ethernet read bandwidth",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"eth_write_bw": {
|
"eth_write_bw": {
|
||||||
"description": "Ethernet write bandwidth",
|
"description": "Ethernet write bandwidth",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"ic_rcv_packets": {
|
"ic_rcv_packets": {
|
||||||
"description": "Network interconnect read packets",
|
"description": "Network interconnect read packets",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"ic_send_packets": {
|
"ic_send_packets": {
|
||||||
"description": "Network interconnect send packet",
|
"description": "Network interconnect send packet",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"ic_read_bw": {
|
"ic_read_bw": {
|
||||||
"description": "Network interconnect read bandwidth",
|
"description": "Network interconnect read bandwidth",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"ic_write_bw": {
|
"ic_write_bw": {
|
||||||
"description": "Network interconnect write bandwidth",
|
"description": "Network interconnect write bandwidth",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"filesystems": {
|
"filesystems": {
|
||||||
"description": "Array of filesystems",
|
"description": "Array of filesystems",
|
||||||
@ -277,47 +277,47 @@
|
|||||||
},
|
},
|
||||||
"read_bw": {
|
"read_bw": {
|
||||||
"description": "File system read bandwidth",
|
"description": "File system read bandwidth",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"write_bw": {
|
"write_bw": {
|
||||||
"description": "File system write bandwidth",
|
"description": "File system write bandwidth",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"read_req": {
|
"read_req": {
|
||||||
"description": "File system read requests",
|
"description": "File system read requests",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"write_req": {
|
"write_req": {
|
||||||
"description": "File system write requests",
|
"description": "File system write requests",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"inodes": {
|
"inodes": {
|
||||||
"description": "File system write requests",
|
"description": "File system write requests",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"accesses": {
|
"accesses": {
|
||||||
"description": "File system open and close",
|
"description": "File system open and close",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"fsync": {
|
"fsync": {
|
||||||
"description": "File system fsync",
|
"description": "File system fsync",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"create": {
|
"create": {
|
||||||
"description": "File system create",
|
"description": "File system create",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"open": {
|
"open": {
|
||||||
"description": "File system open",
|
"description": "File system open",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"close": {
|
"close": {
|
||||||
"description": "File system close",
|
"description": "File system close",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
},
|
},
|
||||||
"seek": {
|
"seek": {
|
||||||
"description": "File system seek",
|
"description": "File system seek",
|
||||||
"$ref": "embedFS://schemas/job-metric-statistics.schema.json"
|
"$ref": "embedfs://job-metric-statistics.schema.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "embedFS://schemas/job-metric-data.schema.json",
|
"$id": "embedfs://job-metric-data.schema.json",
|
||||||
"title": "Job metric data",
|
"title": "Job metric data",
|
||||||
"description": "Metric data of a HPC job",
|
"description": "Metric data of a HPC job",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"unit": {
|
"unit": {
|
||||||
"description": "Metric unit",
|
"description": "Metric unit",
|
||||||
"$ref": "embedFS://schemas/unit.schema.json"
|
"$ref": "embedfs://unit.schema.json"
|
||||||
},
|
},
|
||||||
"timestep": {
|
"timestep": {
|
||||||
"description": "Measurement interval in seconds",
|
"description": "Measurement interval in seconds",
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "schemaFS://schemas/job-metric-statistics.schema.json",
|
"$id": "schemafs://job-metric-statistics.schema.json",
|
||||||
"title": "Job statistics",
|
"title": "Job statistics",
|
||||||
"description": "Format specification for job metric statistics",
|
"description": "Format specification for job metric statistics",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"unit": {
|
"unit": {
|
||||||
"description": "Metric unit",
|
"description": "Metric unit",
|
||||||
"$ref": "embedFS://schemas/unit.schema.json"
|
"$ref": "embedfs://unit.schema.json"
|
||||||
},
|
},
|
||||||
"avg": {
|
"avg": {
|
||||||
"description": "Job metric average",
|
"description": "Job metric average",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
||||||
"$id": "embedFS://schemas/unit.schema.json",
|
"$id": "embedfs://unit.schema.json",
|
||||||
"title": "Metric unit",
|
"title": "Metric unit",
|
||||||
"description": "Format specification for job metric units",
|
"description": "Format specification for job metric units",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -9,7 +9,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/url"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/ClusterCockpit/cc-backend/pkg/log"
|
"github.com/ClusterCockpit/cc-backend/pkg/log"
|
||||||
"github.com/santhosh-tekuri/jsonschema/v5"
|
"github.com/santhosh-tekuri/jsonschema/v5"
|
||||||
@ -27,31 +28,22 @@ const (
|
|||||||
//go:embed schemas/*
|
//go:embed schemas/*
|
||||||
var schemaFiles embed.FS
|
var schemaFiles embed.FS
|
||||||
|
|
||||||
func Load(s string) (io.ReadCloser, error) {
|
|
||||||
u, err := url.Parse(s)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
f := u.Path
|
|
||||||
return schemaFiles.Open(f)
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
jsonschema.Loaders["embedFS"] = Load
|
|
||||||
}
|
|
||||||
|
|
||||||
func Validate(k Kind, r io.Reader) (err error) {
|
func Validate(k Kind, r io.Reader) (err error) {
|
||||||
|
jsonschema.Loaders["embedfs"] = func(s string) (io.ReadCloser, error) {
|
||||||
|
f := filepath.Join("schemas", strings.Split(s, "//")[1])
|
||||||
|
return schemaFiles.Open(f)
|
||||||
|
}
|
||||||
var s *jsonschema.Schema
|
var s *jsonschema.Schema
|
||||||
|
|
||||||
switch k {
|
switch k {
|
||||||
case Meta:
|
case Meta:
|
||||||
s, err = jsonschema.Compile("embedFS://schemas/job-meta.schema.json")
|
s, err = jsonschema.Compile("embedfs://job-meta.schema.json")
|
||||||
case Data:
|
case Data:
|
||||||
s, err = jsonschema.Compile("embedFS://schemas/job-data.schema.json")
|
s, err = jsonschema.Compile("embedfs://job-data.schema.json")
|
||||||
case ClusterCfg:
|
case ClusterCfg:
|
||||||
s, err = jsonschema.Compile("embedFS://schemas/cluster.schema.json")
|
s, err = jsonschema.Compile("embedfs://cluster.schema.json")
|
||||||
case Config:
|
case Config:
|
||||||
s, err = jsonschema.Compile("embedFS://schemas/config.schema.json")
|
s, err = jsonschema.Compile("embedfs://config.schema.json")
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unkown schema kind ")
|
return fmt.Errorf("unkown schema kind ")
|
||||||
}
|
}
|
||||||
|
80
pkg/schema/validate_test.go
Normal file
80
pkg/schema/validate_test.go
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
// Copyright (C) 2022 NHR@FAU, University Erlangen-Nuremberg.
|
||||||
|
// All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
package schema
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestValidateConfig(t *testing.T) {
|
||||||
|
json := []byte(`{
|
||||||
|
"clusters": [
|
||||||
|
{
|
||||||
|
"name": "testcluster",
|
||||||
|
"metricDataRepository": {
|
||||||
|
"kind": "cc-metric-store",
|
||||||
|
"url": "localhost:8082"},
|
||||||
|
"filterRanges": {
|
||||||
|
"numNodes": { "from": 1, "to": 64 },
|
||||||
|
"duration": { "from": 0, "to": 86400 },
|
||||||
|
"startTime": { "from": "2022-01-01T00:00:00Z", "to": null }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}`)
|
||||||
|
|
||||||
|
if err := Validate(Config, bytes.NewReader(json)); err != nil {
|
||||||
|
t.Errorf("Error is not nil! %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateJobMeta(t *testing.T) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestValidateCluster(t *testing.T) {
|
||||||
|
json := []byte(`{
|
||||||
|
"name": "emmy",
|
||||||
|
"subClusters": [
|
||||||
|
{
|
||||||
|
"name": "main",
|
||||||
|
"processorType": "Intel IvyBridge",
|
||||||
|
"socketsPerNode": 2,
|
||||||
|
"coresPerSocket": 10,
|
||||||
|
"threadsPerCore": 2,
|
||||||
|
"flopRateScalar": 44,
|
||||||
|
"flopRateSimd": 704,
|
||||||
|
"memoryBandwidth": 80,
|
||||||
|
"topology": {
|
||||||
|
"node": [0,20,1,21,2,22,3,23,4,24,5,25,6,26,7,27,8,28,9,29,10,30,11,31,12,32,13,33,14,34,15,35,16,36,17,37,18,38,19,39],
|
||||||
|
"socket": [
|
||||||
|
[0,20,1,21,2,22,3,23,4,24,5,25,6,26,7,27,8,28,9,29],
|
||||||
|
[10,30,11,31,12,32,13,33,14,34,15,35,16,36,17,37,18,38,19,39]
|
||||||
|
],
|
||||||
|
"memoryDomain": [
|
||||||
|
[0,20,1,21,2,22,3,23,4,24,5,25,6,26,7,27,8,28,9,29],
|
||||||
|
[10,30,11,31,12,32,13,33,14,34,15,35,16,36,17,37,18,38,19,39]
|
||||||
|
],
|
||||||
|
"core": [
|
||||||
|
[0,20],[1,21],[2,22],[3,23],[4,24],[5,25],[6,26],[7,27],[8,28],[9,29],[10,30],[11,31],[12,32],[13,33],[14,34],[15,35],[16,36],[17,37],[18,38],[19,39]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"metricConfig": [
|
||||||
|
{
|
||||||
|
"name": "cpu_load",
|
||||||
|
"scope": "hwthread",
|
||||||
|
"unit": "load",
|
||||||
|
"timestep": 60
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}`)
|
||||||
|
|
||||||
|
if err := Validate(ClusterCfg, bytes.NewReader(json)); err != nil {
|
||||||
|
t.Errorf("Error is not nil! %v", err)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user