Skip to content

Commit

Permalink
Merge pull request #4 from compspec/cleanup-jobspec
Browse files Browse the repository at this point in the history
schema: cleanup nested task
  • Loading branch information
vsoch authored Mar 19, 2024
2 parents fc6e97f + d00ac40 commit 914a59c
Showing 1 changed file with 36 additions and 42 deletions.
78 changes: 36 additions & 42 deletions jobspec/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
},
},
"type": "object",
# NOTE that I removed attributes, I don't see why they need to be required
"required": ["version", "resources", "task"],
# "required": ["version", "resources", "attributes", "tasks"],
"properties": {
"version": {
"description": "the jobspec version",
Expand Down Expand Up @@ -94,54 +92,50 @@
"task": {
"description": "task configuration",
"type": "object",
"maxItems": 1,
"items": {
"type": "object",
"required": ["slot", "count", "command"],
"properties": {
"command": {
"type": ["string", "array"],
"minItems": 1,
"items": {"type": "string"},
},
# This could be embedded as a yaml file, and then
# executed with jobspec <yaml> if it's not wanted here
"transform": {
"type": ["array"],
"minItems": 1,
"items": {
"type": "object",
"properties": {
"step": {"type": "string"},
},
"required": ["step"],
},
},
# RESOURCES AND SCRIPTS ARE EXPERIMENTAL
"resources": {"type": "object"},
"scripts": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "content"],
"properties": {
"name": {"type": "string"},
"content": {"type": "string"},
},
"required": ["slot", "count"],
"properties": {
"command": {
"type": ["string", "array"],
"minItems": 1,
"items": {"type": "string"},
},
# This could be embedded as a yaml file, and then
# executed with jobspec <yaml> if it's not wanted here
"transform": {
"type": ["array"],
"minItems": 1,
"items": {
"type": "object",
"properties": {
"step": {"type": "string"},
},
"required": ["step"],
},
"slot": {"type": "string"},
"count": {
},
# RESOURCES AND SCRIPTS ARE EXPERIMENTAL
"resources": {"type": "object"},
"scripts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": False,
"required": ["name", "content"],
"properties": {
"per_slot": {"type": "integer", "minimum": 1},
"total": {"type": "integer", "minimum": 1},
"name": {"type": "string"},
"content": {"type": "string"},
},
},
},
"additionalProperties": False,
"slot": {"type": "string"},
"count": {
"type": "object",
"additionalProperties": False,
"properties": {
"per_slot": {"type": "integer", "minimum": 1},
"total": {"type": "integer", "minimum": 1},
},
},
},
"additionalProperties": False,
},
},
}
Expand Down

0 comments on commit 914a59c

Please sign in to comment.