Job and HySDS IO Specifications
Michael Cayanan edited this page on Jul 11 · 30 revisions
Page Navigation |
---|
Confidence Level TBD This article has not been reviewed for accuracy, timeliness, or completeness. Check that this information is valid before acting on it. |
---|
HySDS provides capabilities to automatically manage, and continuously integrate the jobs that are in the system. In order to do that, it separates job and interface. The job-spec
is used to specify a job type and the hysds-io
is used to specify a job type's interface of input/output parameters. HySDS utilizes docker to encapsulate job types and execute them on workers.
Job Specification (job-spec.json.*)
The job-spec
contains the job specific information and points to the container specification that can run this job. There can be many job specifications to a single container specification.
The job specification is a JSON field and requires several metadata fields in order for the job to be used in the HySDS system.
JSON Parameters
key | constraint | type | description |
---|---|---|---|
| required | string | executable path inside container |
| required | array | list of param objects required to run this job (see " |
| optional | object | mapping of host file/directory into container (see " |
| optional | array | list of dependency image objects (see " |
| optional | array | list of recommended queues |
| required | string | minimum free disk usage required to run job specified as "\d+(GB|MB|KB)", e.g. "100GB", "20MB", "10KB" |
| required | int | soft execution time limit in seconds; worker will send a catchable exception to task to allow for cleanup before being killed; effectively a sigterm by the worker to the job; one caveat when determining the soft time limit of your job type: also include time for verdi operations such as docker image loading (on first job), input localization, dataset publishing, triage, etc. |
| required | int | hard execution time limit in seconds; worker will send an uncatchable exception to the task and will force terminate it; effectively a sigkill by the worker to the job; one caveat when determining the hard time limit of your job type: make sure it's at least 60 seconds greater than the |
| optional | array | list of strings specifying pre-processor functions to run; behavior depends on |
| optional | boolean | if set to true, default builtin pre-processors (currently [ |
| optional | array | list of strings specifying post-processor functions to run; behavior depends on |
| optional | boolean | if set to true, default builtin post-processors (currently [ |
| optional | object | mapping of container runtime options (see " |
param
Object
key | constraint | type | description |
---|---|---|---|
| required | string | parameter name |
| required | string |
|
imported_worker_files
Object
key | key type | value | value type |
---|---|---|---|
path to file or directory on host | string | path to file or directory in container | string |
path to file or directory on host | string | one item list of path to file or directory in container | array |
path to file or directory on host | string | two item list of path to file or directory in container and mount mode: | array |
dependency_image
Object
key | constraint | type | description |
---|---|---|---|
| required | string | docker image name and tag, e.g. docker.io/centos:7 |
| optional | string | url to docker image location or null; if null or unspecified, image will be pulled from dockerhub e.g. "docker pull docker.io/centos:7"; use |
| optional | object | same as |
runtime_options
Object
key | key type | value | value type |
---|---|---|---|
gpus | string | GPU devices to add to the container ('all' to pass all GPUs); maps to docker option --gpus gpu-request | string |
Syntax
Example
HySDS IO Specification (hysds-io.json.*)
The hysds-io
file is designed to create a wiring to the specified params
defined in the job-spec
. It specifies the from-where as opposed to the to-where, which is specified by the job-spec. It has several fields defined in its JSON syntax.
JSON Parameters
key | constraint | type | description |
---|---|---|---|
| optional | string | component web interface to display this job type in ( |
| optional | string | label to be used when this job type is displayed in web interfaces ( |
| optional | string | specifies if the job should be submitted once per product in query or once per job submission; |
| optional | boolean | set to |
| optional | string | action type to expose job as; |
| optional | array | list of strings specifying account user IDs allowed to run this job type from the web interfaces ( |
| required | array | list of matching param objects from |
A Note on submission_type
: iteration
and individual
Iteration jobs submit one job for each of the faceted results in the selected set (tosca
or figaro
). This means that each parameter using "dataset_jpath:" (see below) submits a unique job where the value of that parameter corresponds to an individual product from the faceted set.
Individual jobs simply submit one job, no matter how many products are faceted. If "dataset_jpath:" is specified, the corresponding values are aggregated into a list, and that becomes the value for the parameter below.
params
Object
key | constraint | type | description |
---|---|---|---|
| required | string | parameter name; should match corresponding parameter name in |
| required | string |
|
| required if | string | hard-coded parameter value |
| optional | string | possible values: |
| optional | string | default value to use (for HySDS v3: must be string even if it's a number) (v4) if |
| optional | boolean | parameter is optional and can be left blank |
| optional | string | value to use as a hint when displaying the form input |
| required if | array | list of string values to enumerate via a dropdown list in the form input |
| optional | string | a lambda function to process the value during submission |
| required if | string | regex to use to filter on front component of respective container, |
from
Specification
Value | Description |
---|---|
| hard-coded parameter value found in |
| comes from operator or submitter of job; usually displayed as input boxes on the web UI forms for |
| comes from an ElasticSearch result, e.g. in |
Valid Param Types
Value | Description |
---|---|
| a text string, will be kept as text |
| a real number |
| a date in ISO8601 format: |
| a date with time in ISO8601 format: |
| true or false in a drop down |
| one of a set of options in a drop down; must specify |
| an e-mail address, will be treated as "text" |
| same as text, but displayed larger with the textarea HTML tag |
| auto-populated from the facet view leaflet tool into context |
| auto-populated from the facet view query into context |
| a version of an existing container registered in the Mozart API; must define "version_regex" field |
| a version of an existing |
| a version of an existing |
| if |
A note on type conversion and default values
Due to a limitation in ElasticSearch mappings, hysds-io "default_values" should be represented as JSON strings. This parallels the input from the user which will come through as a string. Internally the system will convert the value into its type
within python. This happens just before the call to a lambda
function and thus the user can expect proper types inside the lambda function.
Certain types default to python strings. these types include: container_version
, hysdsio_version
, jobspec_version
, date
, datetime
, text
, string
, textbox
, enum
, and email
.
All numbers are converted into floats due to the nature of JSON which does not distinguish between integer and float values. If a python integer is needed by the job, supply a lambda like so lambda x: int(x)
.
Syntax
Example
Related Articles: |
---|
Have Questions? Ask a HySDS Developer: |
Anyone can join our public Slack channel to learn more about HySDS. JPL employees can join #HySDS-Community
|
JPLers can also ask HySDS questions at Stack Overflow Enterprise
|
Page Information: |
---|
Was this page useful? |
Contribution History:
|
Subject Matter Expert: @Lan Dang @Hook Hua @Namrata Malarout |
Find an Error? Is this document outdated or inaccurate? Please contact the assigned Page Maintainer: @Lan Dang |