engine

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2018 License: Apache-2.0 Imports: 6 Imported by: 21

Documentation

Overview

Package engine implements core engine of Aptomi, which does policy resolution (resolve), diff calculation between states (diff), and state enforcement by applying actions (apply).

Index

Constants

View Source
const (
	// RevisionStatusInProgress represents Revision status with apply in progress
	RevisionStatusInProgress = "inprogress"
	// RevisionStatusSuccess represents Revision status with apply successfully finished
	RevisionStatusSuccess = "success"
	// RevisionStatusError represents Revision status with apply finished with error
	RevisionStatusError = "error"
)

Variables

View Source
var (
	// ActionObjects is a list of informational objects for all actions
	ActionObjects = []*runtime.Info{
		component.CreateActionObject,
		component.UpdateActionObject,
		component.DeleteActionObject,
		component.AttachDependencyActionObject,
		component.DetachDependencyActionObject,
		component.EndpointsActionObject,
		global.PostProcessActionObject,
	}

	// Objects is the list of informational objects for all objects in the engine
	Objects = runtime.AppendAll([]*runtime.Info{
		PolicyDataObject,
		RevisionObject,
		resolve.ComponentInstanceObject,
	}, ActionObjects)
)

PolicyDataKey is the default key for the policy object (there is only one policy exists but with multiple generations)

View Source
var PolicyDataObject = &runtime.Info{
	Kind:        "policy",
	Storable:    true,
	Versioned:   true,
	Constructor: func() runtime.Object { return &PolicyData{} },
}

PolicyDataObject is an informational data structure with Kind and Constructor for PolicyData

RevisionKey is the default key for the Revision object (there is only one Revision exists but with multiple generations)

View Source
var RevisionObject = &runtime.Info{
	Kind:        "revision",
	Storable:    true,
	Versioned:   true,
	Constructor: func() runtime.Object { return &Revision{} },
}

RevisionObject is Info for Revision

Functions

This section is empty.

Types

type PolicyData

type PolicyData struct {
	runtime.TypeKind `yaml:",inline"`
	Metadata         PolicyDataMetadata

	// Objects stores all policy objects in map: namespace -> kind -> name -> generation
	Objects map[string]map[string]map[string]runtime.Generation
}

PolicyData is a struct which contains references to a generation for each object included into the policy

func (*PolicyData) Add

func (policyData *PolicyData) Add(obj lang.Base)

Add adds an object to PolicyData

func (*PolicyData) AsColumns added in v0.1.2

func (policyData *PolicyData) AsColumns() map[string]string

AsColumns returns PolicyData representation as columns

func (*PolicyData) GetDefaultColumns added in v0.1.2

func (policyData *PolicyData) GetDefaultColumns() []string

GetDefaultColumns returns default set of columns to be displayed

func (*PolicyData) GetGeneration

func (policyData *PolicyData) GetGeneration() runtime.Generation

GetGeneration returns PolicyData generation

func (*PolicyData) GetName

func (policyData *PolicyData) GetName() string

GetName returns PolicyData name

func (*PolicyData) GetNamespace

func (policyData *PolicyData) GetNamespace() string

GetNamespace returns PolicyData namespace

func (*PolicyData) Remove

func (policyData *PolicyData) Remove(obj lang.Base) bool

Remove deletes an object from PolicyData

func (*PolicyData) SetGeneration

func (policyData *PolicyData) SetGeneration(gen runtime.Generation)

SetGeneration sets PolicyData generation

type PolicyDataMetadata

type PolicyDataMetadata struct {
	Generation runtime.Generation
	UpdatedAt  time.Time
	UpdatedBy  string
}

PolicyDataMetadata is the metadata for PolicyData object that includes generation

type Revision

type Revision struct {
	runtime.TypeKind `yaml:",inline"`
	Metadata         runtime.GenerationMetadata

	// Policy represents generation of the corresponding policy
	Policy runtime.Generation

	Status    string
	Progress  RevisionProgress
	AppliedAt time.Time
}

Revision is a "milestone" in applying

func (*Revision) GetGeneration

func (revision *Revision) GetGeneration() runtime.Generation

GetGeneration returns Revision generation

func (*Revision) GetName

func (revision *Revision) GetName() string

GetName returns Revision name

func (*Revision) GetNamespace

func (revision *Revision) GetNamespace() string

GetNamespace returns Revision namespace

func (*Revision) SetGeneration

func (revision *Revision) SetGeneration(gen runtime.Generation)

SetGeneration returns Revision generation

type RevisionProgress

type RevisionProgress struct {
	Current int
	Total   int
}

RevisionProgress represents revision applying progress

Directories

Path Synopsis
Package actual defines a state updater, which reacts to changes in actual state done by engine applier.
Package actual defines a state updater, which reacts to changes in actual state done by engine applier.
Package apply implements state enforcer, which executes a list of actions to move from actual state to desired state, performing actual deployment of services and configuration of the underlying cloud components.
Package apply implements state enforcer, which executes a list of actions to move from actual state to desired state, performing actual deployment of services and configuration of the underlying cloud components.
action
Package action defines a base action (actions get born a result of policy diff calculation), as well as context which gets passed to all actions during apply phase.
Package action defines a base action (actions get born a result of policy diff calculation), as well as context which gets passed to all actions during apply phase.
action/component
Package component defines all component-specific actions, which get generated by the policy diff when component changes occur for specific component instances.
Package component defines all component-specific actions, which get generated by the policy diff when component changes occur for specific component instances.
action/global
Package global defines a global post-processing action, which gets generated by the policy diff only once after processing all component instances.
Package global defines a global post-processing action, which gets generated by the policy diff only once after processing all component instances.
Package diff allows Aptomi to determine the difference between actual state (running on the cloud) and desired state (that Aptomi wants to enforce), generating a list of actions to reconcile the difference.
Package diff allows Aptomi to determine the difference between actual state (running on the cloud) and desired state (that Aptomi wants to enforce), generating a list of actions to reconcile the difference.
Package progress implements progress indicators, which are used during state enforcement while running actions and plugins to estimate progress and show completion percentage to the user.
Package progress implements progress indicators, which are used during state enforcement while running actions and plugins to estimate progress and show completion percentage to the user.
Package resolve is a heart of Aptomi that performs policy resolution, taking policy and service consumption intents as input, producing a set of components to be instantiated in the cloud (desired state) as output, along with their discovery parameters, code parameters, and component instance graph.
Package resolve is a heart of Aptomi that performs policy resolution, taking policy and service consumption intents as input, producing a set of components to be instantiated in the cloud (desired state) as output, along with their discovery parameters, code parameters, and component instance graph.

Jump to

Keyboard shortcuts

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