Documentation ¶
Index ¶
- Variables
- type Auth
- type Backend
- type BackendInfo
- type BackendOptions
- type Config
- type Conn
- type ContextKey
- type HostAlias
- type KubernetesBackendOptions
- type Network
- type Port
- type Resources
- type SecProfile
- type SecProfileType
- type Secret
- type SecurityContext
- type Stage
- type State
- type Step
- type StepType
- type TaintEffect
- type Toleration
- type TolerationOperator
- type Volume
Constants ¶
This section is empty.
Variables ¶
var ErrNoCliContextFound = errors.New("no CliContext in context found")
Functions ¶
This section is empty.
Types ¶
type Auth ¶
type Auth struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Email string `json:"email,omitempty"` }
Auth defines registry authentication credentials.
type Backend ¶
type Backend interface { // Name returns the name of the backend. Name() string // IsAvailable check if the backend is available. IsAvailable(ctx context.Context) bool // Load loads the backend engine. Load(ctx context.Context) (*BackendInfo, error) // SetupWorkflow sets up the workflow environment. SetupWorkflow(ctx context.Context, conf *Config, taskUUID string) error // StartStep starts the workflow step. StartStep(ctx context.Context, step *Step, taskUUID string) error // WaitStep waits for the workflow step to complete and returns // the completion results. WaitStep(ctx context.Context, step *Step, taskUUID string) (*State, error) // TailStep tails the workflow step logs. TailStep(ctx context.Context, step *Step, taskUUID string) (io.ReadCloser, error) // DestroyStep destroys the workflow step. DestroyStep(ctx context.Context, step *Step, taskUUID string) error // DestroyWorkflow destroys the workflow environment. DestroyWorkflow(ctx context.Context, conf *Config, taskUUID string) error }
Backend defines a container orchestration backend and is used to create and manage container resources.
type BackendInfo ¶
type BackendInfo struct {
Platform string
}
BackendInfo represents the reported information of a loaded backend
type BackendOptions ¶
type BackendOptions struct {
Kubernetes KubernetesBackendOptions `json:"kubernetes,omitempty"`
}
BackendOptions defines advanced options for specific backends
type Config ¶
type Config struct { Stages []*Stage `json:"pipeline"` // workflow stages Networks []*Network `json:"networks"` // network definitions Volumes []*Volume `json:"volumes"` // volume definitions Secrets []*Secret `json:"secrets"` // secret definitions }
Config defines the runtime configuration of a workflow.
type ContextKey ¶
type ContextKey struct{}
ContextKey is just an empty struct. It exists so CliContext can be an immutable public variable with a unique type. It's immutable because nobody else can create a ContextKey, being unexported.
var CliContext ContextKey
CliContext is the context key to pass cli context to backends if needed
type KubernetesBackendOptions ¶
type KubernetesBackendOptions struct { Resources Resources `json:"resouces,omitempty"` ServiceAccountName string `json:"serviceAccountName,omitempty"` NodeSelector map[string]string `json:"nodeSelector,omitempty"` Tolerations []Toleration `json:"tolerations,omitempty"` SecurityContext *SecurityContext `json:"securityContext,omitempty"` }
KubernetesBackendOptions defines all the advanced options for the kubernetes backend
type Network ¶
type Network struct {
Name string `json:"name,omitempty"`
}
Network defines a container network.
type Resources ¶
type Resources struct { Requests map[string]string `json:"requests,omitempty"` Limits map[string]string `json:"limits,omitempty"` }
Resources defines two maps for kubernetes resource definitions
type SecProfile ¶ added in v2.2.0
type SecProfile struct { Type SecProfileType `json:"type,omitempty"` LocalhostProfile string `json:"localhostProfile,omitempty"` }
type SecProfileType ¶ added in v2.2.0
type SecProfileType string
const ( SecProfileTypeRuntimeDefault SecProfileType = "RuntimeDefault" SecProfileTypeLocalhost SecProfileType = "Localhost" )
type Secret ¶
type Secret struct { Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` Mask bool `json:"mask,omitempty"` }
Secret defines a runtime secret
type SecurityContext ¶
type SecurityContext struct { Privileged *bool `json:"privileged,omitempty"` RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` RunAsUser *int64 `json:"runAsUser,omitempty"` RunAsGroup *int64 `json:"runAsGroup,omitempty"` FSGroup *int64 `json:"fsGroup,omitempty"` SeccompProfile *SecProfile `json:"seccompProfile,omitempty"` ApparmorProfile *SecProfile `json:"apparmorProfile,omitempty"` }
type Stage ¶
type Stage struct {
Steps []*Step `json:"steps,omitempty"`
}
Stage denotes a collection of one or more steps.
type State ¶
type State struct { // Container exit code ExitCode int `json:"exit_code"` // Container exited, true or false Exited bool `json:"exited"` // Container is oom killed, true or false OOMKilled bool `json:"oom_killed"` // Container error Error error }
State defines a container state.
type Step ¶
type Step struct { Name string `json:"name"` UUID string `json:"uuid"` Type StepType `json:"type,omitempty"` Image string `json:"image,omitempty"` Pull bool `json:"pull,omitempty"` Detached bool `json:"detach,omitempty"` Privileged bool `json:"privileged,omitempty"` WorkingDir string `json:"working_dir,omitempty"` Environment map[string]string `json:"environment,omitempty"` Entrypoint []string `json:"entrypoint,omitempty"` Commands []string `json:"commands,omitempty"` ExtraHosts []HostAlias `json:"extra_hosts,omitempty"` Volumes []string `json:"volumes,omitempty"` Tmpfs []string `json:"tmpfs,omitempty"` Devices []string `json:"devices,omitempty"` Networks []Conn `json:"networks,omitempty"` DNS []string `json:"dns,omitempty"` DNSSearch []string `json:"dns_search,omitempty"` MemSwapLimit int64 `json:"memswap_limit,omitempty"` MemLimit int64 `json:"mem_limit,omitempty"` ShmSize int64 `json:"shm_size,omitempty"` CPUQuota int64 `json:"cpu_quota,omitempty"` CPUSet string `json:"cpu_set,omitempty"` OnFailure bool `json:"on_failure,omitempty"` OnSuccess bool `json:"on_success,omitempty"` Failure string `json:"failure,omitempty"` AuthConfig Auth `json:"auth_config,omitempty"` NetworkMode string `json:"network_mode,omitempty"` Ports []Port `json:"ports,omitempty"` BackendOptions BackendOptions `json:"backend_options,omitempty"` }
Step defines a container process.
type TaintEffect ¶
type TaintEffect string
const ( TaintEffectNoSchedule TaintEffect = "NoSchedule" TaintEffectPreferNoSchedule TaintEffect = "PreferNoSchedule" TaintEffectNoExecute TaintEffect = "NoExecute" )
type Toleration ¶
type Toleration struct { Key string `json:"key,omitempty"` Operator TolerationOperator `json:"operator,omitempty"` Value string `json:"value,omitempty"` Effect TaintEffect `json:"effect,omitempty"` TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"` }
Defines Kubernetes toleration
type TolerationOperator ¶
type TolerationOperator string
const ( TolerationOpExists TolerationOperator = "Exists" TolerationOpEqual TolerationOperator = "Equal" )