orchestrator.YAMLCompiler

class orchestrator.YAMLCompiler(schema_validator=None, ambiguity_resolver=None)[source]

Bases: object

Compiles YAML definitions into executable pipelines.

The compiler handles: - YAML parsing and validation - Template processing with Jinja2 - AUTO tag detection and resolution - Pipeline object construction

__init__(schema_validator=None, ambiguity_resolver=None)[source]

Initialize YAML compiler.

Parameters:
  • schema_validator (Optional[SchemaValidator]) – Schema validator instance

  • ambiguity_resolver (Optional[AmbiguityResolver]) – Ambiguity resolver instance

Methods

__init__([schema_validator, ambiguity_resolver])

Initialize YAML compiler.

compile(yaml_content[, context, ...])

Compile YAML content to Pipeline object.

detect_auto_tags(content)

Detect AUTO tags in content.

get_template_variables(yaml_content)

Extract template variables from YAML content.

has_auto_tags(obj)

Check if object contains AUTO tags.

validate_yaml(yaml_content)

Validate YAML content without compilation.

__init__(schema_validator=None, ambiguity_resolver=None)[source]

Initialize YAML compiler.

Parameters:
  • schema_validator (Optional[SchemaValidator]) – Schema validator instance

  • ambiguity_resolver (Optional[AmbiguityResolver]) – Ambiguity resolver instance

async compile(yaml_content, context=None, resolve_ambiguities=True)[source]

Compile YAML content to Pipeline object.

Parameters:
  • yaml_content (str) – YAML content as string

  • context (Optional[Dict[str, Any]]) – Template context variables

  • resolve_ambiguities (bool) – Whether to resolve AUTO tags

Return type:

Pipeline

Returns:

Compiled Pipeline object

Raises:

YAMLCompilerError – If compilation fails

detect_auto_tags(content)[source]

Detect AUTO tags in content.

Parameters:

content (str) – Content to search

Return type:

List[str]

Returns:

List of AUTO tag contents

has_auto_tags(obj)[source]

Check if object contains AUTO tags.

Parameters:

obj (Any) – Object to check

Return type:

bool

Returns:

True if AUTO tags are found

validate_yaml(yaml_content)[source]

Validate YAML content without compilation.

Parameters:

yaml_content (str) – YAML content to validate

Return type:

bool

Returns:

True if valid, False otherwise

get_template_variables(yaml_content)[source]

Extract template variables from YAML content.

Parameters:

yaml_content (str) – YAML content

Return type:

List[str]

Returns:

List of template variable names