tatm.config Config API Reference

class tatm.config.EnvironmentConfig(modules: List[str] | None = None, conda_env: str | None = None, venv: str | None = None, singularity_image: str | None = None)

Bases: object

Environment configuration for compute jobs.

conda_env: str | None = None
modules: List[str] | None = None
singularity_image: str | None = None
venv: str | None = None
class tatm.config.MetadataBackendConfig(type: str | None = None, args: dict = <factory>)

Bases: object

Configuration for the metadata backend.

args: dict

Arguments to pass to the metadata backend constructor.

type: str | None = None

Type of metadata backend to use.

class tatm.config.SlurmConfig(partition: str = '???', account: str | None = '???', qos: str | None = None, slurm_bin_dir: str = '/usr/bin/')

Bases: object

Cluster specific configuration for Slurm.

account: str | None = '???'

Account to charge jobs to.

partition: str = '???'

Partition to submit jobs to.

qos: str | None = None

Quality of Service to use for the job.

slurm_bin_dir: str = '/usr/bin/'

Directory containing the Slurm binaries.

class tatm.config.TatmConfig(backend: tatm.compute.job.Backend = <Backend.slurm: 'slurm'>, slurm: tatm.config.SlurmConfig = <factory>, environment: tatm.config.EnvironmentConfig = <factory>, metadata_backend: tatm.config.MetadataBackendConfig = <factory>)

Bases: object

backend: Backend = 'slurm'

Backend to use for compute jobs.

environment: EnvironmentConfig

Environment configuration for compute jobs.

metadata_backend: MetadataBackendConfig
slurm: SlurmConfig

Slurm specific configuration.

tatm.config.load_base_config() TatmConfig

Load the base configuration for TATM. First checks for a configuration file at /etc/tatm/config.yaml, then checks for a configuration file at $TATM_BASE_DIR/config/config.yaml and merges them together, with the latter taking precedence. Finally, it checks for a configuration file at $TATM_BASE_CONFIG and merges it with the previous configuration, with the latter again taking precedence. If no configuration files are found, an empty configuration is returned.

Returns:

Loaded configuration.

Return type:

TatmConfig

tatm.config.load_config(config_paths: List[str] | str | None = None, overrides: List[str] | str | None = None) TatmConfig

Load the configuration from the provided paths.

Parameters:
  • config_paths – List of paths to load the configuration from.

  • overrides – List of overrides to apply to the configuration

Returns:

Loaded configuration.

Return type:

TatmConfig