Skip to content

Commit 4ad973b

Browse files
committed
rfc31: update jobspec v1 specification into v2
mainly designed to handle the flexibility provided by the new `flux run` and `flux submit` interfaces - relaxes restrictions on the ordering of resources, especially in regards to the slot (i.e., a node can be inside or outside a slot). - adds exclusive flag - adds per_resource count key for late-binding of tasks to resources - adds job dependencies Update examples to meet Jobspec V2 specification, including adding a new use case example to highlight the capabilities of V2.
1 parent bcca6f2 commit 4ad973b

File tree

12 files changed

+214
-87
lines changed

12 files changed

+214
-87
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SOURCEDIR = .
99
BUILDDIR = _build
1010

1111
# YAML Validation on these directories
12-
SCHEMA_DIRS=data/spec_26 data/spec_14
12+
SCHEMA_DIRS=data/spec_31 data/spec_26 data/spec_14
1313

1414
# Put it first so that "make" without argument is like "make help".
1515
help:

data/spec_31/example1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1
1+
version: 2
22
resources:
33
- type: node
44
count: 4

data/spec_31/schema.json

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"$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",
3+
"$id": "http://github.com/flux-framework/rfc/tree/master/data/spec_31/schema.json",
4+
"title": "jobspec-02",
55

6-
"description": "Flux canonical jobspec",
6+
"description": "Flux jobspec version 2",
77

88
"definitions": {
99
"complex_range": {
@@ -38,7 +38,9 @@
3838
"exclusive": { "type": "boolean" },
3939
"with": {
4040
"type": "array",
41-
"items": { "$ref": "#/definitions/resource_vertex" }
41+
"items": { "$ref": "#/definitions/resource_vertex" },
42+
"minItems": 1,
43+
"maxItems": 2
4244
},
4345
"id": { "type": "string" },
4446
"unit": { "type": "string" },
@@ -64,7 +66,7 @@
6466
{ "$ref": "#/definitions/resource_vertex_base" },
6567
{
6668
"properties": {
67-
"type": { "not": { "enum": ["slot"] } }
69+
"type": { "enum": ["node", "gpu", "core"] }
6870
}
6971
}
7072
]
@@ -82,12 +84,14 @@
8284
"properties": {
8385
"version": {
8486
"description": "the jobspec version",
85-
"type": "integer"
87+
"type": "integer",
88+
"enum": [2]
8689
},
8790
"resources": {
8891
"description": "requested resources",
8992
"type": "array",
9093
"minItems": 1,
94+
"maxItems": 1,
9195
"items": { "$ref": "#/definitions/resource_vertex" }
9296
},
9397
"attributes": {
@@ -128,7 +132,17 @@
128132
"type": "object",
129133
"properties": {
130134
"per_slot": { "type": "integer", "minimum" : 1 },
131-
"total": { "type": "integer", "minimum" : 1 }
135+
"total": { "type": "integer", "minimum" : 1 },
136+
"per_resource": { "type": "object",
137+
"required": ["type", "count"],
138+
"properties": {
139+
"type": {"type": "string"},
140+
"count": {
141+
"type": "integer",
142+
"mininum" : 1
143+
}
144+
}
145+
}
132146
}
133147
},
134148
"distribution": { "type": "string" },

data/spec_31/use_case_1.1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1
1+
version: 2
22
resources:
33
- type: node
44
count: 4

data/spec_31/use_case_1.2.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
resources:
3+
- type: slot
4+
count: 4
5+
label: default
6+
with:
7+
- type: node
8+
count: 1
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_1.3.yaml

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

data/spec_31/use_case_2.1.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1
1+
version: 2
22
resources:
33
- type: node
44
count: 4

data/spec_31/use_case_2.2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1
1+
version: 2
22
resources:
33
- type: slot
44
label: default

data/spec_31/use_case_2.3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1
1+
version: 2
22
resources:
33
- type: slot
44
count: 10

data/spec_31/use_case_2.4.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1
1+
version: 2
22
resources:
33
- type: node
44
count: 4

0 commit comments

Comments
 (0)