Skip to content

Commit bcca6f2

Browse files
committed
rfc31: copy over rfc25 (jobspec v1) as starting point for v2
Also copy most use cases from spec_25's data. The last example (2.5) comes from spec_14.
1 parent 85c0ea0 commit bcca6f2

File tree

11 files changed

+611
-0
lines changed

11 files changed

+611
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Table of Contents
4040
- [27/Flux Resource Allocation Protocol Version 1](spec_27.rst)
4141
- [29/Hostlist Format](spec_29.rst)
4242
- [30/Job Urgency](spec_30.rst)
43+
- [31/Job Specification Version 2](spec_31.rst)
4344

4445
Build Instructions
4546
------------------

data/spec_31/example1.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 1
2+
resources:
3+
- type: node
4+
count: 4
5+
with:
6+
- type: slot
7+
count: 1
8+
label: default
9+
with:
10+
- type: core
11+
count: 2
12+
tasks:
13+
- command: [ "app" ]
14+
slot: default
15+
count:
16+
per_slot: 1
17+
attributes:
18+
system:
19+
duration: 3600.
20+
cwd: "/home/flux"
21+
environment:
22+
HOME: "/home/flux"

data/spec_31/schema.json

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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+
}

data/spec_31/use_case_1.1.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 1
2+
resources:
3+
- type: node
4+
count: 4
5+
with:
6+
- type: slot
7+
count: 1
8+
label: default
9+
with:
10+
- type: core
11+
count: 1
12+
tasks:
13+
- command: [ "flux", "start" ]
14+
slot: default
15+
count:
16+
per_slot: 1
17+
attributes:
18+
system:
19+
duration: 3600.
20+
cwd: "/home/flux"
21+
environment:
22+
HOME: "/home/flux"

data/spec_31/use_case_2.1.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 1
2+
resources:
3+
- type: node
4+
count: 4
5+
with:
6+
- type: slot
7+
count: 1
8+
label: myslot
9+
with:
10+
- type: core
11+
count: 1
12+
tasks:
13+
- command: [ "hostname" ]
14+
slot: myslot
15+
count:
16+
total: 5
17+
attributes:
18+
system:
19+
duration: 3600.
20+
cwd: "/home/flux"
21+
environment:
22+
HOME: "/home/flux"

data/spec_31/use_case_2.2.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
version: 1
2+
resources:
3+
- type: slot
4+
label: default
5+
count: 10
6+
with:
7+
- type: core
8+
count: 2
9+
tasks:
10+
- command: [ "myapp" ]
11+
slot: default
12+
count:
13+
per_slot: 1
14+
attributes:
15+
system:
16+
duration: 3600.
17+
cwd: "/home/flux"
18+
environment:
19+
HOME: "/home/flux"

data/spec_31/use_case_2.3.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 1
2+
resources:
3+
- type: slot
4+
count: 10
5+
label: default
6+
with:
7+
- type: core
8+
count: 2
9+
- type: gpu
10+
count: 1
11+
tasks:
12+
- command: [ "myapp" ]
13+
slot: default
14+
count:
15+
per_slot: 1
16+
attributes:
17+
system:
18+
duration: 3600.
19+
cwd: "/home/flux"
20+
environment:
21+
HOME: "/home/flux"

data/spec_31/use_case_2.4.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: 1
2+
resources:
3+
- type: node
4+
count: 4
5+
with:
6+
- type: slot
7+
count: 4
8+
label: default
9+
with:
10+
- type: core
11+
count: 1
12+
- type: gpu
13+
count: 1
14+
tasks:
15+
- command: [ "myapp" ]
16+
slot: default
17+
count:
18+
per_slot: 1
19+
attributes:
20+
system:
21+
duration: 3600.
22+
cwd: "/home/flux"
23+
environment:
24+
HOME: "/home/flux"

data/spec_31/use_case_2.5.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
version: 999
2+
resources:
3+
- type: slot
4+
count: 1
5+
label: default
6+
with:
7+
- type: node
8+
count: 1
9+
tasks:
10+
- command: [ "flux", "start" ]
11+
slot: default
12+
count:
13+
per_slot: 1
14+
attributes:
15+
system:
16+
duration: 3600.
17+
cwd: "/home/flux"
18+
dependencies:
19+
- type: in
20+
scope: user
21+
scheme: fluid
22+
value: hungry-hippo-white-elephant
23+
- type: in
24+
scope: user
25+
scheme: string
26+
value: foo
27+
- type: out
28+
scope: user
29+
scheme: string
30+
value: bar

index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,13 @@ This specification describes the Flux implementation of the Hostlist Format
209209

210210
This specification describes the Flux job urgency parameter.
211211

212+
:doc:`31/Job Specification Version 2 <spec_31.rst>`
213+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214+
215+
Version 2 of the domain specific job specification language canonically defined
216+
in RFC14.
217+
218+
212219
.. Each file must appear in a toctree
213220
.. toctree::
214221
:hidden:
@@ -241,3 +248,4 @@ This specification describes the Flux job urgency parameter.
241248
spec_27
242249
spec_29
243250
spec_30
251+
spec_31

0 commit comments

Comments
 (0)