-
Notifications
You must be signed in to change notification settings - Fork 3
/
gruntfile.yml
100 lines (88 loc) · 4.2 KB
/
gruntfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# A service consists of the following fields:
# endPoint -- REST endpoint, e.g. /rest/service/<endPoint>
# commandLine -- Command line to run
# Some special command line parameters are
# #value -- replace this argument with the parameter from the POST
# <in -- look for an uploaded file
# >out -- the process will generate this file for later download
# ^in -- uploaded file must be a zip file, extract in a directory (called in) and pass directory name as an output
# ~out -- specify out on the command line as a directory, zip contents for download
# description -- description of the endpoint, rendered in Markdown
# defaults -- a hashmap of default values for "#value" parameters
# defaults with a 'list' will show in the GUI with a drop down menu and
# must be specified as text, i.e. '[a, b, c, d]'. Be sure to enclose
# the list in quotes to protect it from YAML parsing
# this example configuration file exposes 2 endpoints, echo and copy
# echo simply echos the input and can be called like this:
# curl -X POST -v --form Message=hi localhost:9901/rest/service/echo
# copy takes input and output files. <in must be provided
# curl -X POST -v --form in=#README.md --form output=R.md localhost:9901/rest/service/copy
# NB: "--form input=#README.md" indicates that curl should send README.md as the form parameter "input"
# and the output filename is set to "R.md"
#
# to retrieve the output data, first find the UUID in the response, and request the file
# wget localhost:9901/rest/job/eab4ab07-c8f7-44f7-b7d8-87dbd7226ea4/file/out
# NB: we request the output file using the "out" parameter, not the filename we requested
# Here is the copy example using jq(http://stedolan.github.io/jq/) to help a bit
#
# id=`curl --silent -X POST --form in=#README.md --form out=small_file.txt localhost:9901/rest/service/copy | jq -r .uuid`
# wget --content-disposition localhost:9901/rest/job/$id/file/output
# The Slicer CLI is supported by grunt, see https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/SlicerExecutionModel for details.
# To expose a Slicer CLI via grunt, add entries like this:
# cli:
# - endPoint: extractskeleton
# executable: /Applications/Slicer.app/Contents/lib/Slicer-4.5/cli-modules/ExtractSkeleton
# - endPoint: blur
# executable: /Applications/Slicer.app/Contents/lib/Slicer-4.5/cli-modules/GaussianBlurImageFilter
#
# This example will create 2 extra endpoints, extractskeleton and blur corresponding to the
# executables at the paths listed.
# This is the hostname:port that the server is running on.
# Used for logging and email
server: localhost:9901
# Cleanup after 30 minutes, default is 120
cleanupTimeInMinutes: 30
# Working directory
# This is the directory path used for working files. If left blank,
# use a system temp directory.
# NB: To run in the pesscara/grunt docker, this must be set to /data
directory: data
# Service name for Consul
name: example
# Report Warn status to Consul when we have more than warnLevel jobs
warnLevel: 3
# Report Critical status to Consul when we have more than criticalLevel jobs
warnLevel: 5
# Mail configuration
mail:
from: noreply@grunt-docker.io
server: smtp.example.com
# username: grunt
# password: <secret>
services:
- endPoint: echo
commandLine: ["echo", "#Message", "#Message2"]
description: print a message
defaults:
Message: "Hi From Grunt"
Message2: "[hi,bye,l8r]"
- endPoint: sleep
commandLine: ["sleep", "#seconds"]
description: Sleep for a while
defaults:
seconds: 300
parameter_descriptions:
seconds: The number of seconds to sleep
- endPoint: copy
commandLine: ["cp", "<input", ">output"]
description: copy a file
parameter_descriptions:
input: The input file
output: The output file, a copy of `input`
- endPoint: copy-dir
commandLine: ["cp", "-r", "-f", "^input", "~output"]
create_empty_output: false
description: copy a file
parameter_descriptions:
input: A zip file containing a directory to copy to `output`
output: A zip file that is a copy of `input`