ecsjobs.config module¶
-
class
ecsjobs.config.
Config
[source]¶ Bases:
object
-
YAML_EXTNS
= ['.yml', '.yaml']¶ File extensions to consider as YAML config files.
-
_get_multipart_config
(bucket, prefix)[source]¶ Retrieve each piece of a multipart config from S3; return the combined configuration (i.e. the corresponding single-dict config).
Parameters: Returns: combined configuration dict
Return type:
-
_get_yaml_from_s3
(bucket, key)[source]¶ Retrieve the contents of a file from S3 and deserialize the YAML.
Parameters: Returns: deserialized YAML file contents
Return type:
-
_global_defaults
= {'email_subject': 'ECSJobs Report', 'failure_command': None, 'failure_html_path': None, 'inter_poll_sleep_sec': 10, 'max_total_runtime_sec': 3600}¶ Default values for global configuration settings.
-
_key_is_yaml
(key)[source]¶ Test whether or not the specified S3 key is a YAML file.
Parameters: key (str) – key in S3 Returns: whether key is a YAML file Return type: bool
-
_load_config
()[source]¶ Check environment variables; call either
_load_config_s3()
or_load_config_local()
.Raises: RuntimeError
-
_load_config_local
(conf_path)[source]¶ Load configuration from the local filesystem. Sets
self._raw_conf
.Parameters: conf_path (str) – path to configuration on local FS
-
_load_config_s3
(bucket_name, key_name)[source]¶ Retrieve and load configuration from S3. Sets
self._raw_conf
.Parameters:
-
_load_yaml_from_disk
(path)[source]¶ Load a YAML file from disk and return the contents.
Parameters: path (str) – path to load from Returns: deserialized YAML file contents Return type: dict
-
get_global
(k)[source]¶ Return the value of the specified global configuration setting, from the global configuration (if present) or else from the global defaults.
Parameters: k – configuration key to get Returns: value of global config setting
-
jobs
¶ Return the list of
ecsjobs.jobs.base.Job
instances.Returns: list of jobs Return type: list
-