Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SOURCEDIR = .
BUILDDIR = _build

# YAML Validation on these directories
SCHEMA_DIRS=data/spec_26 data/spec_14
SCHEMA_DIRS=data/spec_31 data/spec_26 data/spec_14

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -26,7 +26,7 @@ check: $(SCHEMA_DIRS) spelling
./indexcheck spec_*.rst

$(SCHEMA_DIRS):
python ./validate.py --schema=$@/schema.json $@/*.yaml
python3 ./validate.py --schema=$@/schema.json $@/*.yaml

spelling:
@$(SPHINXBUILD) -W -b spelling "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Table of Contents
- [27/Flux Resource Allocation Protocol Version 1](spec_27.rst)
- [29/Hostlist Format](spec_29.rst)
- [30/Job Urgency](spec_30.rst)
- [31/Job Specification Version 2](spec_31.rst)

Build Instructions
------------------
Expand Down
12 changes: 11 additions & 1 deletion data/spec_14/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,17 @@
"type": "object",
"properties": {
"per_slot": { "type": "integer", "minimum" : 1 },
"total": { "type": "integer", "minimum" : 1 }
"total": { "type": "integer", "minimum" : 1 },
"per_resource": { "type": "object",
"required": ["type", "count"],
"properties": {
"type": {"type": "string"},
"count": {
"type": "integer",
"mininum" : 1
}
}
}
}
},
"distribution": { "type": "string" },
Expand Down
22 changes: 22 additions & 0 deletions data/spec_31/example1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
resources:
- type: node
count: 4
with:
- type: slot
count: 1
label: default
with:
- type: core
count: 2
tasks:
- command: [ "app" ]
slot: default
count:
per_slot: 1
attributes:
system:
duration: 3600.
cwd: "/home/flux"
environment:
HOME: "/home/flux"
161 changes: 161 additions & 0 deletions data/spec_31/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://github.com/flux-framework/rfc/tree/master/data/spec_31/schema.json",
"title": "jobspec-02",

"description": "Flux jobspec version 2",

"definitions": {
"complex_range": {
"description": "a complex range of numbers",
"type": "object",
"properties":{
"min": { "type": "integer", "minimum" : 1 },
"max": { "type": "integer", "minimum" : 1 },
"operator": { "type": "string", "enum": ["+", "*", "^"] },
"operand": { "type": "integer", "minimum" : 1 }
},
"required": ["min"],
"dependencies": {
"max": { "required": ["operator", "operand"] },
"operator": { "required": ["max", "operand"] },
"operand": { "required": ["max", "operator"] }
},
"additionalProperties": false
},
"resource_vertex_base": {
"description": "base schema for slot/other resource vertex",
"type": "object",
"required": ["type", "count"],
"properties": {
"type": { "type": "string" },
"count": {
"oneOf": [
{ "type": "integer", "minimum" : 1 },
{ "$ref": "#/definitions/complex_range" }
]
},
"exclusive": { "type": "boolean" },
"with": {
"type": "array",
"items": { "$ref": "#/definitions/resource_vertex" },
"minItems": 1,
"maxItems": 2
},
"id": { "type": "string" },
"unit": { "type": "string" },
"label": { "type": "string" }
},
"additionalProperties": false
},
"resource_vertex_slot": {
"description": "special slot resource type - label assigns to task slot",
"allOf": [
{ "$ref": "#/definitions/resource_vertex_base" },
{
"properties": {
"type": { "enum": ["slot"] }
},
"required": ["label"]
}
]
},
"resource_vertex_other": {
"description": "other (non-slot) resource type",
"allOf": [
{ "$ref": "#/definitions/resource_vertex_base" },
{
"properties": {
"type": { "enum": ["node", "gpu", "core"] }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to expand this list of valid types.

}
}
]
},
"resource_vertex": {
"oneOf":[
{ "$ref": "#/definitions/resource_vertex_slot" },
{ "$ref": "#/definitions/resource_vertex_other" }
]
}
},

"type": "object",
"required": ["version", "resources", "attributes", "tasks"],
"properties": {
"version": {
"description": "the jobspec version",
"type": "integer",
"enum": [2]
},
"resources": {
"description": "requested resources",
"type": "array",
"minItems": 1,
"maxItems": 1,
"items": { "$ref": "#/definitions/resource_vertex" }
},
"attributes": {
"description": "system and user attributes",
"type": ["object", "null"],
"properties": {
"system": {
"type": "object",
"properties": {
"duration": { "type": "number", "minimum": 0 },
"cwd": { "type": "string" },
"environment": { "type": "object" },
"dependencies" : {
"$ref": "file:data/spec_26/schema.json"
}
}
},
"user": {
"type": "object"
}
},
"additionalProperties": false
},
"tasks": {
"description": "task configuration",
"type": "array",
"items": {
"type": "object",
"required": ["command", "slot", "count" ],
"properties": {
"command": {
"type": "array",
"minItems": 1,
"items": { "type": "string" }
},
"slot": { "type": "string" },
"count": {
"type": "object",
"properties": {
"per_slot": { "type": "integer", "minimum" : 1 },
"total": { "type": "integer", "minimum" : 1 },
"per_resource": { "type": "object",
"required": ["type", "count"],
"properties": {
"type": {"type": "string"},
"count": {
"type": "integer",
"mininum" : 1
}
}
}
}
},
"distribution": { "type": "string" },
"attributes": {
"type": "object",
"properties": {
"environment": { "type" : "object"}
},
"additionalProperties": { "type": "string" }
}
},
"additionalProperties": false
}
}
}
}
22 changes: 22 additions & 0 deletions data/spec_31/use_case_1.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
resources:
- type: node
count: 4
with:
- type: slot
count: 1
label: default
with:
- type: core
count: 1
tasks:
- command: [ "flux", "start" ]
slot: default
count:
per_slot: 1
attributes:
system:
duration: 3600.
cwd: "/home/flux"
environment:
HOME: "/home/flux"
22 changes: 22 additions & 0 deletions data/spec_31/use_case_1.2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
resources:
- type: slot
count: 4
label: default
with:
- type: node
count: 1
with:
- type: core
count: 1
tasks:
- command: [ "flux", "start" ]
slot: default
count:
per_slot: 1
attributes:
system:
duration: 3600.
cwd: "/home/flux"
environment:
HOME: "/home/flux"
24 changes: 24 additions & 0 deletions data/spec_31/use_case_1.3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
resources:
- type: slot
count: 1
label: default
with:
- type: node
count: {min: 1}
with:
- type: core
count: 120
tasks:
- command: [ "flux", "start" ]
slot: default
count:
per_resource:
type: node
count: 1
attributes:
system:
duration: 3600.
cwd: "/home/flux"
environment:
HOME: "/home/flux"
22 changes: 22 additions & 0 deletions data/spec_31/use_case_2.1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
resources:
- type: node
count: 4
with:
- type: slot
count: 1
label: myslot
with:
- type: core
count: 1
tasks:
- command: [ "hostname" ]
slot: myslot
count:
total: 5
attributes:
system:
duration: 3600.
cwd: "/home/flux"
environment:
HOME: "/home/flux"
19 changes: 19 additions & 0 deletions data/spec_31/use_case_2.2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
resources:
- type: slot
label: default
count: 10
with:
- type: core
count: 2
tasks:
- command: [ "myapp" ]
slot: default
count:
per_slot: 1
attributes:
system:
duration: 3600.
cwd: "/home/flux"
environment:
HOME: "/home/flux"
21 changes: 21 additions & 0 deletions data/spec_31/use_case_2.3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
resources:
- type: slot
count: 10
label: default
with:
- type: core
count: 2
- type: gpu
count: 1
tasks:
- command: [ "myapp" ]
slot: default
count:
per_slot: 1
attributes:
system:
duration: 3600.
cwd: "/home/flux"
environment:
HOME: "/home/flux"
24 changes: 24 additions & 0 deletions data/spec_31/use_case_2.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
resources:
- type: node
count: 4
with:
- type: slot
count: 4
label: default
with:
- type: core
count: 1
- type: gpu
count: 1
tasks:
- command: [ "myapp" ]
slot: default
count:
per_slot: 1
attributes:
system:
duration: 3600.
cwd: "/home/flux"
environment:
HOME: "/home/flux"
Loading