core.config.template_loader

Custom YAML loader with template and include support for jobmon logging configuration.

Classes

TemplateLoader

Custom YAML loader that supports !include and !template directives.

Functions

include_constructor(→ Any)

Include another YAML file.

template_constructor(→ Any)

Reference a template from the templates directory.

load_all_templates(→ Dict[str, Any])

Load all template files from the templates directory.

load_logconfig_with_templates(→ Dict[str, Any])

Load a logconfig file with template support.

load_yaml_with_templates(→ Dict[str, Any])

Convenience function to load any YAML file with template support.

Module Contents

class core.config.template_loader.TemplateLoader(stream: Any)

Bases: yaml.SafeLoader

Custom YAML loader that supports !include and !template directives.

Initialize TemplateLoader with a YAML stream.

core.config.template_loader.include_constructor(loader: TemplateLoader, node: yaml.nodes.ScalarNode) Any

Include another YAML file.

core.config.template_loader.template_constructor(loader: TemplateLoader, node: yaml.nodes.ScalarNode) Any

Reference a template from the templates directory.

core.config.template_loader.load_all_templates(config_root: str) Dict[str, Any]

Load all template files from the templates directory.

Note: Core templates have been removed in favor of programmatic generation. This function now primarily supports user-provided templates via !include.

core.config.template_loader.load_logconfig_with_templates(config_path: str) Dict[str, Any]

Load a logconfig file with template support.

Supports: - !include path/to/file.yaml - !template template_name - YAML merge operators (<<)

Parameters:

config_path – Path to the main logconfig file

Returns:

Fully resolved configuration dictionary

core.config.template_loader.load_yaml_with_templates(file_path: str) Dict[str, Any]

Convenience function to load any YAML file with template support.