planner

package
v1.36.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolvePromotionDependencies added in v1.32.0

func ResolvePromotionDependencies(
	jobInstances map[string]*model.JobInstance,
	compInstances map[string][]*model.ComponentInstance,
	environments map[string]model.Environment,
) error

ResolvePromotionDependencies resolves environment promotion dependencies into DAG edges (same-plan) or gates (cross-plan) on job instances.

Types

type CompositionInfo

type CompositionInfo struct {
	Type              string
	DefaultJob        *model.JobSpec
	ExecutionProfiles map[string]model.ExecutionProfile
	JobMap            map[string]*model.JobSpec
}

CompositionInfo holds the default job for a composition

type JobGraph

type JobGraph struct {
	// contains filtered or unexported fields
}

JobGraph represents the DAG of job instances with cycle detection and topological sorting

func NewJobGraph

func NewJobGraph(jobs map[string]*model.JobInstance) *JobGraph

NewJobGraph creates a new job graph from job instances

func (*JobGraph) DetectCycles

func (g *JobGraph) DetectCycles() error

DetectCycles performs cycle detection on the job dependency graph using DFS

func (*JobGraph) TopologicalSort

func (g *JobGraph) TopologicalSort() ([]string, error)

TopologicalSort performs topological sorting of jobs using Kahn's algorithm Returns sorted job IDs in execution order

type JobPlanner

type JobPlanner struct {
	// contains filtered or unexported fields
}

JobPlanner binds components to jobs and creates instances

func NewJobPlanner

func NewJobPlanner(compositions map[string]*CompositionInfo) *JobPlanner

NewJobPlanner creates a new job planner from a composition registry

func (*JobPlanner) PlanJobs

func (jp *JobPlanner) PlanJobs(instances map[string][]*model.ComponentInstance) (map[string]*model.JobInstance, error)

PlanJobs creates job instances from component instances

type TemplateContext added in v1.36.0

type TemplateContext struct {
	CompInst *model.ComponentInstance
	JobID    string
	JobName  string
}

TemplateContext gathers all data needed to build the template dot map.

func (*TemplateContext) Build added in v1.36.0

func (tc *TemplateContext) Build() map[string]interface{}

Build returns the map[string]interface{} used as dot in text/template.Execute.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL