common

package
v0.9.2-beta Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Resync period for controllers
	ResyncPeriod = time.Minute * 5

	// EnvStagePodName is an environment which represents pod name.
	EnvStagePodName = "POD_NAME"
	// EnvWorkflowrunName is an environment which represents workflowrun name.
	EnvWorkflowrunName = "WORKFLOWRUN_NAME"
	// EnvStagePodName is an environment which represents stage name.
	EnvStageName = "STAGE_NAME"
	// EnvWorkloadContainerName is an environment which represents the workload container name.
	EnvWorkloadContainerName = "WORKLOAD_CONTAINER_NAME"
	// EnvNamespace is an environment which represents namespace.
	EnvNamespace = "NAMESPACE"
	// EnvCycloneServerAddr is an environment which represents cyclone server address.
	EnvCycloneServerAddr = "CYCLONE_SERVER_ADDR"

	// Default Cyclone Server address
	DefaultCycloneServerAddr = "native-cyclone-server"

	// Container name prefixes for sidecar. There are two kinds of sidecars in workflow:
	// - Those added automatically by Cyclone such as coordinator, resource resolvers.
	// - Those specified by users in stage spec as workload.
	CycloneSidecarPrefix  = "cyclone-sidecar-"
	WorkloadSidecarPrefix = "workload-sidecar-"

	// Coordinator container name.
	CoordinatorSidecarName = CycloneSidecarPrefix + "coordinator"

	// Paths in resource resolver containers.
	// Default data path in resource resolver container.
	ResolverDefaultDataPath = "/workspace/data"
	// Name of the notify directory where coordinator would create ok file there.
	ResolverNotifyDir = "notify"
	// Notify directory path in resource resolver container.
	ResolverNotifyDirPath = "/workspace/notify"

	ResourcePullCommand = "pull"
	ResourcePushCommand = "push"

	WorkflowLabelName         = "cyclone.io/workflow"
	WorkflowRunLabelName      = "cyclone.io/workflow-name"
	PodLabelSelector          = "cyclone.io/workflow==true"
	WorkflowRunAnnotationName = "cyclone.io/workflowrun"
	GCAnnotationName          = "cyclone.io/gc"
	StageAnnotationName       = "cyclone.io/stage"

	// Paths in coordinator container.
	CoordinatorResolverPath         = "/workspace/resolvers"
	CoordinatorResourcesPath        = "/workspace/resolvers/resources"
	CoordinatorResolverNotifyPath   = "/workspace/resolvers/notify"
	CoordinatorResolverNotifyOkPath = "/workspace/resolvers/notify/ok"
	CoordinatorArtifactsPath        = "/workspace/artifacts"

	// Name of the default PV used by all workflow stages.
	DefaultPvVolumeName = "default-pv"
	// Name of the emptyDir volume shared between coordinator and sidecar containers, e.g.
	// image resolvers. Coordinator would notify resolvers that workload containers have
	// finished their work, so that resource resolvers can push resources.
	CoordinatorSidecarVolumeName = "coordinator-sidecar-volume"
	// Volume name to mount host /var/run/docker.sock to container, it's used by coordinator.
	DockerSockVolume = "docker-sock"
	// Volume for config.json in secret.
	DockerConfigJsonVolume = "cyclone-docker-secret-volume"

	// Path of docker socket file
	DockerSockPath = "/var/run/docker.sock"

	DockerConfigPath     = "/root/.docker"
	DockerConfigJsonFile = "config.json"

	// ContainerStateTerminated represents container is stopped.
	ContainerStateTerminated ContainerState = "Terminated"
	// ContainerStateInitialized represents container is Running or Stopped, not Init or Creating.
	ContainerStateInitialized ContainerState = "Initialized"
)
View Source
const (
	GCContainerName = "gc"
	GCDataPath      = "/workspace"
)

Constants for GC pod.

View Source
const (
	// EventSourceWfrController represents events send from workflowrun controller.
	EventSourceWfrController string = "WorkflowRunController"
	// EventSourceWfrController represents events send from coordinator.
	EventSourceCoordinator string = "CycloneCoordinator"
)
View Source
const (
	// The path that we will mount PV on in container.
	StageMountPath = "/__cyclone__workspace"

	// Path of artifacts in coordinator container
	CoordinatorWorkspacePath = "/workspace/"
)

Variables

This section is empty.

Functions

func ArtifactPath

func ArtifactPath(wfr, stage, artifact string) string

ArtifactPath gets the path of a artifact in PV.

func ArtifactsPath

func ArtifactsPath(wfr, stage string) string

ArtifactsPath gets the path of artifacts in PV

func GetEventRecorder

func GetEventRecorder(client clientset.Interface, component string) record.EventRecorder

GetEventRecorder get the event recorder object. Create it of not exists yet.

func InputResourceVolumeName

func InputResourceVolumeName(name string) string

func NonCoordinator

func NonCoordinator(name string) bool

NonCoordinator selects all containers except coordinator.

func NonWorkloadSidecar

func NonWorkloadSidecar(name string) bool

NonWorkloadSidecar selects all containers except workload sidecars.

func OnlyWorkload

func OnlyWorkload(name string) bool

OnlyWorkload selects only workload containers.

func OutputResourceVolumeName

func OutputResourceVolumeName(name string) string

func Pass

func Pass(name string, selectors []ContainerSelector) bool

Pass check whether the given container name passes the given selectors.

func ResourcePath

func ResourcePath(wfr, resource string) string

ResourcePath gets the path of a resource in PV

func StagePath

func StagePath(wfr, stage string) string

StagePath gets the path of a stage in PV

func WorkflowRunsPath

func WorkflowRunsPath() string

WorkflowRuns data path in PV

Types

type ContainerSelector

type ContainerSelector func(name string) bool

type ContainerState

type ContainerState string

ContainerState represents container state.

Jump to

Keyboard shortcuts

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