mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-25 04:49:05 +01:00
Save state
This commit is contained in:
parent
a8980c7a5e
commit
7c2171afda
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"addr": "127.0.0.1:8080",
|
"addr": "127.0.0.1:8080",
|
||||||
"archive": {
|
"job-archive": {
|
||||||
"kind": "file",
|
"kind": "file",
|
||||||
"path": "./var/job-archive"
|
"path": "./var/job-archive"
|
||||||
},
|
},
|
||||||
|
@ -30,6 +30,8 @@ type ArchiveBackend interface {
|
|||||||
|
|
||||||
GetClusters() []string
|
GetClusters() []string
|
||||||
|
|
||||||
|
CleanUp() error
|
||||||
|
|
||||||
Iter(loadMetricData bool) <-chan JobContainer
|
Iter(loadMetricData bool) <-chan JobContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +147,10 @@ func (fsa *FsArchive) Init(rawConfig json.RawMessage) (uint64, error) {
|
|||||||
return version, nil
|
return version, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fsa *FsArchive) CleanUp() error {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func (fsa *FsArchive) LoadJobData(job *schema.Job) (schema.JobData, error) {
|
func (fsa *FsArchive) LoadJobData(job *schema.Job) (schema.JobData, error) {
|
||||||
var isCompressed bool = true
|
var isCompressed bool = true
|
||||||
filename := getPath(job, fsa.path, "data.json.gz")
|
filename := getPath(job, fsa.path, "data.json.gz")
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"$id": "embedfs://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": {
|
||||||
"addr": {
|
"addr": {
|
||||||
"description": "Address where the http (or https) server will listen on (for example: 'localhost:80').",
|
"description": "Address where the http (or https) server will listen on (for example: 'localhost:80').",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
@ -41,9 +41,52 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"job-archive": {
|
"job-archive": {
|
||||||
"description": "Path to the job-archive.",
|
"description": "Configuration keys for job-archive",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"kind": {
|
||||||
|
"description": "Backend type for job-archive",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"file",
|
||||||
|
"s3"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"path": {
|
||||||
|
"description": "Path to job archive for file backend",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
|
"retention": {
|
||||||
|
"description": "Configuration keys for retention",
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"policy": {
|
||||||
|
"description": "Retention policy",
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"none",
|
||||||
|
"delete",
|
||||||
|
"move"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"time": {
|
||||||
|
"description": "Act on jobs with startTime older than time",
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"directory": {
|
||||||
|
"description": "The target directory for retention. Only applicable for retention move.",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"policy"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"kind"
|
||||||
|
]
|
||||||
|
},
|
||||||
"disable-archive": {
|
"disable-archive": {
|
||||||
"description": "Keep all metric data in the metric data repositories, do not write to the job-archive.",
|
"description": "Keep all metric data in the metric data repositories, do not write to the job-archive.",
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
Loading…
Reference in New Issue
Block a user