|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "$id": "http://github.com/flux-framework/rfc/tree/master/data/spec_14/schema.json", |
| 4 | + "title": "canonical-jobspec", |
| 5 | + |
| 6 | + "description": "Flux canonical jobspec", |
| 7 | + |
| 8 | + "definitions": { |
| 9 | + "complex_range": { |
| 10 | + "description": "a complex range of numbers", |
| 11 | + "type": "object", |
| 12 | + "properties":{ |
| 13 | + "min": { "type": "integer", "minimum" : 1 }, |
| 14 | + "max": { "type": "integer", "minimum" : 1 }, |
| 15 | + "operator": { "type": "string", "enum": ["+", "*", "^"] }, |
| 16 | + "operand": { "type": "integer", "minimum" : 1 } |
| 17 | + }, |
| 18 | + "required": ["min"], |
| 19 | + "dependencies": { |
| 20 | + "max": { "required": ["operator", "operand"] }, |
| 21 | + "operator": { "required": ["max", "operand"] }, |
| 22 | + "operand": { "required": ["max", "operator"] } |
| 23 | + }, |
| 24 | + "additionalProperties": false |
| 25 | + }, |
| 26 | + "resource_vertex_base": { |
| 27 | + "description": "base schema for slot/other resource vertex", |
| 28 | + "type": "object", |
| 29 | + "required": ["type", "count"], |
| 30 | + "properties": { |
| 31 | + "type": { "type": "string" }, |
| 32 | + "count": { |
| 33 | + "oneOf": [ |
| 34 | + { "type": "integer", "minimum" : 1 }, |
| 35 | + { "$ref": "#/definitions/complex_range" } |
| 36 | + ] |
| 37 | + }, |
| 38 | + "exclusive": { "type": "boolean" }, |
| 39 | + "with": { |
| 40 | + "type": "array", |
| 41 | + "items": { "$ref": "#/definitions/resource_vertex" } |
| 42 | + }, |
| 43 | + "id": { "type": "string" }, |
| 44 | + "unit": { "type": "string" }, |
| 45 | + "label": { "type": "string" } |
| 46 | + }, |
| 47 | + "additionalProperties": false |
| 48 | + }, |
| 49 | + "resource_vertex_slot": { |
| 50 | + "description": "special slot resource type - label assigns to task slot", |
| 51 | + "allOf": [ |
| 52 | + { "$ref": "#/definitions/resource_vertex_base" }, |
| 53 | + { |
| 54 | + "properties": { |
| 55 | + "type": { "enum": ["slot"] } |
| 56 | + }, |
| 57 | + "required": ["label"] |
| 58 | + } |
| 59 | + ] |
| 60 | + }, |
| 61 | + "resource_vertex_other": { |
| 62 | + "description": "other (non-slot) resource type", |
| 63 | + "allOf": [ |
| 64 | + { "$ref": "#/definitions/resource_vertex_base" }, |
| 65 | + { |
| 66 | + "properties": { |
| 67 | + "type": { "not": { "enum": ["slot"] } } |
| 68 | + } |
| 69 | + } |
| 70 | + ] |
| 71 | + }, |
| 72 | + "resource_vertex": { |
| 73 | + "oneOf":[ |
| 74 | + { "$ref": "#/definitions/resource_vertex_slot" }, |
| 75 | + { "$ref": "#/definitions/resource_vertex_other" } |
| 76 | + ] |
| 77 | + } |
| 78 | + }, |
| 79 | + |
| 80 | + "type": "object", |
| 81 | + "required": ["version", "resources", "attributes", "tasks"], |
| 82 | + "properties": { |
| 83 | + "version": { |
| 84 | + "description": "the jobspec version", |
| 85 | + "type": "integer" |
| 86 | + }, |
| 87 | + "resources": { |
| 88 | + "description": "requested resources", |
| 89 | + "type": "array", |
| 90 | + "minItems": 1, |
| 91 | + "items": { "$ref": "#/definitions/resource_vertex" } |
| 92 | + }, |
| 93 | + "attributes": { |
| 94 | + "description": "system and user attributes", |
| 95 | + "type": ["object", "null"], |
| 96 | + "properties": { |
| 97 | + "system": { |
| 98 | + "type": "object", |
| 99 | + "properties": { |
| 100 | + "duration": { "type": "number", "minimum": 0 }, |
| 101 | + "cwd": { "type": "string" }, |
| 102 | + "environment": { "type": "object" }, |
| 103 | + "dependencies" : { |
| 104 | + "$ref": "file:data/spec_26/schema.json" |
| 105 | + } |
| 106 | + } |
| 107 | + }, |
| 108 | + "user": { |
| 109 | + "type": "object" |
| 110 | + } |
| 111 | + }, |
| 112 | + "additionalProperties": false |
| 113 | + }, |
| 114 | + "tasks": { |
| 115 | + "description": "task configuration", |
| 116 | + "type": "array", |
| 117 | + "items": { |
| 118 | + "type": "object", |
| 119 | + "required": ["command", "slot", "count" ], |
| 120 | + "properties": { |
| 121 | + "command": { |
| 122 | + "type": "array", |
| 123 | + "minItems": 1, |
| 124 | + "items": { "type": "string" } |
| 125 | + }, |
| 126 | + "slot": { "type": "string" }, |
| 127 | + "count": { |
| 128 | + "type": "object", |
| 129 | + "properties": { |
| 130 | + "per_slot": { "type": "integer", "minimum" : 1 }, |
| 131 | + "total": { "type": "integer", "minimum" : 1 } |
| 132 | + } |
| 133 | + }, |
| 134 | + "distribution": { "type": "string" }, |
| 135 | + "attributes": { |
| 136 | + "type": "object", |
| 137 | + "properties": { |
| 138 | + "environment": { "type" : "object"} |
| 139 | + }, |
| 140 | + "additionalProperties": { "type": "string" } |
| 141 | + } |
| 142 | + }, |
| 143 | + "additionalProperties": false |
| 144 | + } |
| 145 | + } |
| 146 | + } |
| 147 | +} |
0 commit comments