job_bundle
This module provides functions to work with job bundles locally. For example, you can call read_job_bundle_parameters to get information like the names, types, and default values of a job bundle's parameters.
Use the api.create_job_from_job_bundle function to submit a job bundle to a queue.
apply_job_parameters(job_parameters, job_bundle_dir, parameters, asset_references)
¶
Modifies the provided parameters and asset_references to incorporate the job_parameters and to resolve any relative paths in PATH parameters.
The following actions are taken: - Any job_parameters provided set or replace the "value" key in the corresponding job_bundle_parameters entry. - Any job_parameters for a PATH, that is a relative path, is made absolute by joining with the current working directory. - Any job_bundle_parameters for a PATH, not set by job_parameters, that is a relative path, is made absolute by joining with the job bundle directory. - Any PATH parameters that have IN, OUT, or INOUT assetReferences metadata are added to the appropriate asset_references entries.
create_job_history_bundle_dir(submitter_name, job_name)
¶
Creates a new directory in the configured directory settings.job_history_dir, in which to place a new job bundle for submission.
The directory will look like
<job_history_dir>/YYYY-mm/YYYY-mm-ddTHH-##-<submitter_name>-<job_name>
deadline_yaml_dump(data, stream=None, **kwds)
¶
Works like pyyaml's safe_dump, but saves multi-line strings with the "|" style and defaults to sort_keys=False.
read_job_bundle_parameters(bundle_dir)
¶
Reads the parameter definitions and parameter values from the job bundle. For any relative PATH parameters with data flow where no parameter value is supplied, it sets the value to that path relative to the job bundle directory.
Return format:
[
{
"name": <parameter name>,
<all fields from the the "parameters" value in template.json/yaml>
"value": <if provided from parameter_values.json/yaml>
},
...
]