Usage
In Script Container
Standard Use
Custom Use
To create a custom setup not based on the demo container, this server can be configured by performing the following steps.
Currently, this server app only supports linux & mac environments. |
-
Download the latest release from the releases page and unpack the archive in your project directory.
-
Run the command
./service gen-config
to generate a server configuration template file. This file will be namedconfig.tpl.yml
. -
Edit the configuration file with your desired service name and command configurations.
Check the {file-config-readme}[config file readme] for more information about the configuration file. -
Once you have edited the configuration file, rename it and place it in the desired relative to the service binary.
-
Validate the configuration by running the command
./service check-config --config=path/to/your/config.yml
. This command will validate the configuration and report any errors.Bad Config Example$ ./service --config=config.yml check-config
Config File
Components
1
2
3
4
5
service-name: my service (1)
command:
executable: /some/path/to/your/executable (2)
args: (3)
- <<input-files>> (4)
1 | The display name of the running service | ||
2 | Path to an executable script or binary to be called by the server to process uploaded datasets. | ||
3 | An array of arguments that will be passed to the configured executable.
Each array element is effectively a single, quote wrapped cli arg.
|
||
4 | An Injected Variable |
Command Context
The configured command will be executed in an isolated subshell, but will be provided the same environment as the server itself, meaning it is possible to set environment variables for the script simply by setting them on the docker container.
The output of the script’s stdout
will be piped through the server’s logging
mechanism and will appear in the container logs.
The output of the script’s stderr
will be both piped through the server’s
logging mechanism (like stdout
) but will also be captured for parsing and
returning to the caller.
Variables
<<cwd>>
The working directory for the job that is running in the current request.
/workspace/12345
<<date>>
The current date formatted as YYYY-MM-DD
.
1994-02-13
<<date-time>>
The current datetime in RFC3339 format.
2018-10-31T23:37:18.013557+0500
<<ds-description>>
The user provided description for the current dataset upload.
My dataset upload containing foo and bar
<<ds-name>>
The user provided name for the current dataset upload.
My Dataset 3
<<ds-summary>>
The user provided summary of the current dataset upload.
Some summary text for my dataset upload
<<ds-origin>>
The source/origin of the user dataset should be either galaxy
or direct-upload
.
direct-upload
<<ds-user-id>>
WDK user ID of the user that uploaded the dataset.
123456
<<input-files>>
A space separated list of the files that were unpacked from the uploaded zip or tar file sorted by name ascending.
Examples
dataset.tgz ├─ foo.txt ├─ bar.xml ├─ fizz.json └─ buzz/ └─ fazz.yml
bar.xml buzz fizz.json foo.txt
<<input-files[n]>>
Array style access of the input file list allowing retrieval of a single file name from the input file list.
<<time>>
The current time formatted as HH:MM:SS
.
03:47:58
<<timestamp>>
The current unix timestamp in seconds.
783647299