Skip to content

Commit

Permalink
Updated input and output data schema and examples to use explicit fil…
Browse files Browse the repository at this point in the history
…es/json members as opposed to type identified objects.
  • Loading branch information
gisjedi committed Jun 13, 2016
1 parent fed31e1 commit 2d96662
Show file tree
Hide file tree
Showing 5 changed files with 369 additions and 298 deletions.
159 changes: 78 additions & 81 deletions examples/complete/jobpack.json
Original file line number Diff line number Diff line change
@@ -1,83 +1,80 @@
{
"manifestVersion": "0.0.1",
"jobs":
[
{
"name": "my-algorithm",
"version": "1.0.0",
"title": "My first algorithm",
"description": "Reads an HDF5 file and outputs two TIFF images, a CSV and manifest containing cell_count",
"tag": ["hdf5", "tiff", "csv", "image processing"],
"authorName": "John Doe",
"authorUrl": "http://www.example.com",
"timeout": 3600,
"cpus": 10.0,
"mem": 10240.0,
"storage": 0.0,
"interface": {
"cmd": "/app/job.sh",
"args": "${INPUT_FILE} ${JOB_OUTPUT_DIR}",
"inputData": [
{
"name": "INPUT_FILE",
"type": "file",
"required": true,
"content": {
"mediaType": [ "image/x-hdf5-image" ]
}
}
],
"outputData": [
{
"name": "output_file_tiffs",
"type": "file",
"required": true,
"content": {
"mediaType": "image/tiff",
"count": "2",
"pattern": "outfile*.tif"
}
},
{
"name": "output_file_csv",
"type": "file",
"required": true,
"content": {
"mediaType": "text/csv",
"pattern": "outfile*.csv"
}
},
{
"name": "cell_count",
"type": "json",
"required": true,
"content": {
"key": "cell_count",
"type": "integer"
}
}
]
},
"errorMapping": [
{
"code": 1,
"title": "Error Name",
"description": "Error Description",
"category": "system"
},
{
"code": 2,
"title": "Error Name",
"description": "Error Description",
"category": "data"
},
{
"code": 3,
"title": "Error Name",
"description": "Error Description",
"category": "algorithm"
}
]
}
]
"manifestVersion": "0.0.1",
"jobs": [
{
"name": "my-algorithm",
"version": "1.0.0",
"title": "My first algorithm",
"description": "Reads an HDF5 file and outputs two TIFF images, a CSV and manifest containing cell_count",
"tag": [
"hdf5",
"tiff",
"csv",
"image processing"
],
"authorName": "John Doe",
"authorUrl": "http://www.example.com",
"timeout": 3600,
"cpus": 10.0,
"mem": 10240.0,
"storage": 0.0,
"interface": {
"cmd": "/app/job.sh",
"args": "${INPUT_FILE} ${JOB_OUTPUT_DIR}",
"inputData": {
"files": [
{
"name": "INPUT_FILE",
"required": true,
"mediaType": [
"image/x-hdf5-image"
]
}
]
},
"outputData": {
"files": [
{
"name": "output_file_tiffs",
"mediaType": "image/tiff",
"count": "2",
"pattern": "outfile*.tif"
},
{
"name": "output_file_csv",
"mediaType": "text/csv",
"pattern": "outfile*.csv"
}
],
"json": [
{
"name": "cell_count",
"key": "cellCount",
"type": "integer"
}
]
}
},
"errorMapping": [
{
"code": 1,
"title": "Error Name",
"description": "Error Description",
"category": "system"
},
{
"code": 2,
"title": "Error Name",
"description": "Error Description",
"category": "data"
},
{
"code": 3,
"title": "Error Name",
"description": "Error Description",
"category": "algorithm"
}
]
}
]
}
2 changes: 1 addition & 1 deletion examples/random-number/jobpack.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"cpus": 0.1,
"mem": 1.0,
"interface": {
"cmd": "/app/job.sh",
"cmd": "/app/job.sh"
}
}
]
Expand Down
91 changes: 44 additions & 47 deletions examples/watermark/jobpack.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,46 @@
{
"manifestVersion": "0.0.1",
"jobs":
[
{
"name": "image-watermark",
"version": "0.1.0",
"title": "Image Watermarker",
"description": "Processes an input PNG and outputs watermarked PNG.",
"authorName": "John Doe",
"timeout": 30,
"cpus": 1.0,
"mem": 64.0,
"interface": {
"cmd": "/app/watermark.py",
"args": "${INPUT_IMAGE} ${JOB_OUTPUT_DIR}",
"inputData": [
{
"name": "INPUT_IMAGE",
"type": "file",
"required": true,
"content": {
"mediaType": [ "image/png" ]
}
}
],
"outputData": [
{
"name": "OUTPUT_IMAGE",
"type": "file",
"required": true,
"content": {
"mediaType": "image/png",
"pattern": "*_watermark.png"
}
}
]
},
"errorMapping": [
{
"code": 1,
"title": "Image Corrupt",
"description": "Image input is not recognized as a valid PNG.",
"category": "data"
}
]
}
]
"manifestVersion": "0.0.1",
"jobs": [
{
"name": "image-watermark",
"version": "0.1.0",
"title": "Image Watermarker",
"description": "Processes an input PNG and outputs watermarked PNG.",
"authorName": "John Doe",
"timeout": 30,
"cpus": 1.0,
"mem": 64.0,
"interface": {
"cmd": "/app/watermark.py",
"args": "${INPUT_IMAGE} ${JOB_OUTPUT_DIR}",
"inputData": {
"files": [
{
"name": "INPUT_IMAGE",
"mediaType": [
"image/png"
]
}
]
},
"outputData": {
"files": [
{
"name": "OUTPUT_IMAGE",
"mediaType": "image/png",
"pattern": "*_watermark.png"
}
]
}
},
"errorMapping": [
{
"code": 1,
"title": "Image Corrupt",
"description": "Image input is not recognized as a valid PNG.",
"category": "data"
}
]
}
]
}
Loading

0 comments on commit 2d96662

Please sign in to comment.