job.configuration package¶
Subpackages¶
- job.configuration.data package
- job.configuration.interface package
- Submodules
- job.configuration.interface.exceptions module
- job.configuration.interface.job_interface module
- job.configuration.interface.job_interface_1_0 module
- job.configuration.interface.job_interface_1_1 module
- job.configuration.interface.job_interface_1_2 module
- job.configuration.interface.job_interface_1_3 module
- job.configuration.interface.scale_file module
- Module contents
- job.configuration.json package
- job.configuration.results package
Submodules¶
job.configuration.configuration module¶
Defines the class that represents a job configuration
-
class
job.configuration.configuration.
JobConfiguration
¶ Bases:
object
Represents the configuration for running a job
-
add_mount
(mount_config)¶ Adds the given mount configuration
Parameters: mount_config ( job.configuration.mount.MountConfig
) – The mount configuration to add:raises
job.configuration.exceptions.InvalidJobConfiguration
: If the mount is a duplicate
-
add_output_workspace
(output, workspace)¶ Adds the given output_workspace
Parameters: - output (string) – The output name
- workspace (string) – The workspace name
:raises
job.configuration.exceptions.InvalidJobConfiguration
: If the output is a duplicate
-
add_setting
(setting_name, setting_value)¶ Adds the given setting value
Parameters: - setting_name (string) – The setting name
- setting_value (string) – The setting value
:raises
job.configuration.exceptions.InvalidJobConfiguration
: If the setting is a duplicate or invalid
-
get_mount_volume
(mount_name, volume_name, container_path, mode)¶ Returns the volume that has been configured for the given mount name. If the given mount is not defined in this configuration, None is returned.
Parameters: - mount_name (string) – The name of the mount defined in the job type
- volume_name (string) – The name of the volume
- container_path (string) – The path within the container onto which the volume will be mounted
- mode (string) – Either ‘ro’ for read-only or ‘rw’ for read-write
Returns: The volume that should be mounted into the job container, possibly None
Return type:
-
get_output_workspace
(output)¶ Returns the name of the output workspace that is configured to store the products for the given output name, possibly None
Parameters: output (string) – The name of the output Returns: The name of the workspace for storing the output products, possibly None Return type: string
-
get_setting_value
(name)¶ Returns the value of the given setting if defined in this configuration, otherwise returns None
Parameters: name (string) – The name of the setting Returns: The value of the setting, possibly None Return type: string
-
merge_recipe_config
(recipe_config)¶ Merges a recipe configuration object values into this job configuration, overriding any common fields
Parameters: recipe_config (dict) – The recipe config dictionary :raises
recipe.configuration.exceptions.InvalidRecipeConfiguration
: If the recipe_config is invalid
-
remove_secret_settings
(manifest)¶ Removes and returns the secret setting values from this job configuration
Parameters: manifest ( job.seed.manifest.SeedManifest
) – The Seed manifestReturns: A dict of secret settings where the key is the setting name and the value is the secret setting value Return type: dict
-
validate
(manifest)¶ Validates the configuration against the given Seed manifest. This will perform database queries.
Parameters: manifest ( job.seed.manifest.SeedManifest
) – The Seed manifestReturns: A list of warnings discovered during validation Return type: list()
:raises
job.configuration.exceptions.InvalidJobConfiguration
: If the configuration is invalid
-
job.configuration.exceptions module¶
Defines exceptions that can occur when interacting with job configuration
-
exception
job.configuration.exceptions.
InvalidJobConfiguration
(name, description)¶ Bases:
util.exceptions.ValidationException
Exception indicating that the provided job configuration was invalid
job.configuration.mount module¶
Defines the configuration for a mount that will be mounted into a job’s container
-
class
job.configuration.mount.
HostMountConfig
(name, host_path)¶ Bases:
job.configuration.mount.MountConfig
Defines the configuration for a host mount
-
validate
()¶
-
-
class
job.configuration.mount.
MountConfig
(name, mount_type)¶ Bases:
object
Defines the configuration for a job’s mount
-
validate
()¶ Validates this mount configuration
Returns: A list of warnings discovered during validation Return type: list()
:raises
job.configuration.exceptions.InvalidJobConfiguration
: If the configuration is invalid
-
-
class
job.configuration.mount.
VolumeMountConfig
(name, driver=None, driver_opts=None)¶ Bases:
job.configuration.mount.MountConfig
Defines the configuration for a volume mount