pipeline

package
v0.0.0-...-2027b31 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: Apache-2.0 Imports: 50 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDeploymentTimeoutSeconds = 30 * 6
View Source
var TEST_SUBSCRIPTION_ID = "test"

Functions

func GetAllRequiredAzureClients

func GetAllRequiredAzureClients(ctx context.Context, pipelines map[string]*types.Pipeline, subscriptions map[string]string) (map[string]string, error)

func Inspect

func Inspect(p *types.Pipeline, ctx context.Context, options *InspectOptions) error

func KubeConfig

func KubeConfig(ctx context.Context, subscriptionID, resourceGroup, aksClusterName string) (string, error)

func NewStepInspectScopes

func NewStepInspectScopes(subscriptions map[string]string) map[string]StepInspectScope

func RunStep

func RunStep(id graph.Identifier, s types.Step, ctx context.Context, executionTarget ExecutionTarget, options *StepRunOptions, state *ExecutionState) (Output, DetailsProducer, error)

Types

type ARMExecutionDetails

type ARMExecutionDetails struct {
	Operations []Operation `json:"operations,omitempty"`
}

type ArmOutput

type ArmOutput map[string]any

func (ArmOutput) GetValue

func (o ArmOutput) GetValue(key string) (*OutPutValue, error)

type BaseRunOptions

type BaseRunOptions struct {
	Cloud                    string
	Configuration            configtypes.Configuration
	NoPersist                bool
	DeploymentTimeoutSeconds int
	StepCacheDir             string
	BicepClient              *bicep.LSPClient

	SubscriptionIdToAzureConfigDirectory map[string]string
}

type DetailsProducer

type DetailsProducer func(ctx context.Context) (*ExecutionDetails, error)

func DetermineOperationsForResourceGroupDeployment

func DetermineOperationsForResourceGroupDeployment(client *armresources.DeploymentOperationsClient, resourceGroup, deploymentName string) DetailsProducer

func DetermineOperationsForSubscriptionDeployment

func DetermineOperationsForSubscriptionDeployment(client *armresources.DeploymentOperationsClient, deploymentName string) DetailsProducer

type ExecutionDetails

type ExecutionDetails struct {
	ARM *ARMExecutionDetails `json:"arm,omitempty"`
}

type ExecutionInfo

type ExecutionInfo struct {
	QueuedAt   string `json:"queuedAt"`
	StartedAt  string `json:"startedAt"`
	FinishedAt string `json:"finishedAt"`
	Preempted  bool   `json:"preempted"`
	RunCount   int    `json:"runCount"`
	State      string `json:"state"`
}

type ExecutionState

type ExecutionState struct {
	*sync.RWMutex

	Executed sets.Set[graph.Identifier]
	Queued   sets.Set[graph.Identifier]
	Outputs  Outputs

	Timing  map[graph.Identifier]*ExecutionInfo
	Details map[graph.Identifier]*ExecutionDetails
	Logging map[graph.Identifier][]byte
}

type ExecutionTarget

type ExecutionTarget interface {
	GetSubscriptionID() string
	GetResourceGroup() string
	GetRegion() string
}

type Executor

type Executor func(id graph.Identifier, s types.Step, ctx context.Context, executionTarget ExecutionTarget, options *StepRunOptions, state *ExecutionState) (Output, DetailsProducer, error)

type Identifier

type Identifier struct {
	ServiceGroup  string `json:"serviceGroup"`
	ResourceGroup string `json:"resourceGroup"`
	Step          string `json:"step"`
}

func (Identifier) String

func (i Identifier) String() string

type InspectOptions

type InspectOptions struct {
	Scope          string
	Format         string
	Step           string
	Region         string
	Configuration  configtypes.Configuration
	ScopeFunctions map[string]StepInspectScope
	OutputFile     io.Writer
	Concurrency    int

	Service     *topology.Service
	TopologyDir string
}

InspectOptions contains the options for the Inspect method

type NodeInfo

type NodeInfo struct {
	Identifier Identifier        `json:"identifier"`
	Info       ExecutionInfo     `json:"info"`
	Details    *ExecutionDetails `json:"details,omitempty"`
}

type Operation

type Operation struct {
	// OperationType is what the operation did - known values: "Create", "Read", "EvaluateDeploymentOutput"
	OperationType string `json:"operationType"`

	// StartTimestamp is the time at which the operation started, formatted as RFC3339 date+time: 2025-11-05T13:16:20.624264+00:00
	StartTimestamp string `json:"startTimestamp"`
	// Duration is the time taken to run the operation, formatted as RFC3339 duration: PT3M12.9884364S
	Duration string `json:"duration"`

	// Resource defines the object of this operation.
	Resource *Resource `json:"resource,omitempty"`

	// Children holds the child operations when the resource is another deployment.
	Children []Operation `json:"children,omitempty"`
}

Operation describes an ARM deployment rollout operation taken to realize a template.

type OutPutValue

type OutPutValue struct {
	Type  string `json:"type"`
	Value any    `json:"value"`
}

type Output

type Output interface {
	GetValue(key string) (*OutPutValue, error)
}

type Outputs

type Outputs map[string]map[string]map[string]Output

Outputs stores output values indexed by service group, resource group and step name.

func RunEntrypoint

func RunEntrypoint(topo *topology.Topology, entrypoint *topology.Entrypoint, pipelines map[string]*types.Pipeline, ctx context.Context, options *PipelineRunOptions, executor Executor) (Outputs, error)

func RunPipeline

func RunPipeline(service *topology.Service, pipeline *types.Pipeline, ctx context.Context, options *PipelineRunOptions, executor Executor) (Outputs, error)

type PipelineRunOptions

type PipelineRunOptions struct {
	BaseRunOptions

	Step                  string
	Region                string
	Environment           string
	Stamp                 string
	SubsciptionLookupFunc SubscriptionLookup

	TopologyDir string
	Concurrency int

	TimingOutputFile string
	JUnitOutputFile  string

	AbortIfRegionalExist bool
	RegionRGNames        []string // Specific RG names to check for concurrent execution prevention
}

type Resource

type Resource struct {
	// ResourceType is the resource provider and resource name, like "Microsoft.KeyVault/vaults".
	ResourceType string `json:"resourceType"`
	// ResourceGroup is the Azure resource group in which the resource exists.
	ResourceGroup string `json:"resourceGroup"`
	// Name is the name of the resource.
	Name string `json:"name"`
}

type ShellOutput

type ShellOutput string

func (ShellOutput) GetValue

func (o ShellOutput) GetValue(_ string) (*OutPutValue, error)

type StepRunOptions

type StepRunOptions struct {
	BaseRunOptions
	PipelineDirectory string
	RetryAttempt      int // 0 for first attempt, >0 for retries
	Environment       string
	Stamp             string
}

type SubscriptionLookup

type SubscriptionLookup func(ctx context.Context, subscriptionName string) (string, error)

func LookupSubscriptionID

func LookupSubscriptionID(subscriptions map[string]string) SubscriptionLookup

Jump to

Keyboard shortcuts

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