common

package
Version: v2.0.0-alpha1+incompat... Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// WorkflowControllerConfigMapKey is the key in the configmap to retrieve workflow configuration from.
	// Content encoding is expected to be YAML.
	WorkflowControllerConfigMapKey = "config"

	// Container names used in the workflow pod
	MainContainerName = "main"
	InitContainerName = "init"
	WaitContainerName = "wait"

	// PodMetadataVolumeName is the volume name defined in a workflow pod spec to expose pod metadata via downward API
	PodMetadataVolumeName = "podmetadata"

	// PodMetadataAnnotationsVolumePath is volume path for metadata.annotations in the downward API
	PodMetadataAnnotationsVolumePath = "annotations"
	// PodMetadataMountPath is the directory mount location for DownwardAPI volume containing pod metadata
	PodMetadataMountPath = "/argo/" + PodMetadataVolumeName
	// PodMetadataAnnotationsPath is the file path containing pod metadata annotations. Examined by argoexec
	PodMetadataAnnotationsPath = PodMetadataMountPath + "/" + PodMetadataAnnotationsVolumePath

	// DockerLibVolumeName is the volume name for the /var/lib/docker host path volume
	DockerLibVolumeName = "docker-lib"
	// DockerLibHostPath is the host directory path containing docker runtime state
	DockerLibHostPath = "/var/lib/docker"
	// DockerSockVolumeName is the volume name for the /var/run/docker.sock host path volume
	DockerSockVolumeName = "docker-sock"

	// AnnotationKeyNodeName is the pod metadata annotation key containing the workflow node name
	AnnotationKeyNodeName = wfv1.CRDFullName + "/node-name"
	// AnnotationKeyTemplate is the pod metadata annotation key containing the container template as JSON
	AnnotationKeyTemplate = wfv1.CRDFullName + "/template"
	// AnnotationKeyOutputs is the pod metadata annotation key containing the container outputs
	AnnotationKeyOutputs = wfv1.CRDFullName + "/outputs"

	// LabelKeyArgoWorkflow is the pod metadata label to indidcate this pod is part of a workflow
	LabelKeyArgoWorkflow = wfv1.CRDFullName + "/argo-workflow"
	// LabelKeyWorkflow is the pod metadata label to indidcate the associated workflow name
	LabelKeyWorkflow = wfv1.CRDFullName + "/workflow"

	// ExecutorArtifactBaseDir is the base directory in the init container in which artifacts will be copied to.
	// Each artifact will be named according to its input name (e.g: /argo/inputs/artifacts/CODE)
	ExecutorArtifactBaseDir = "/argo/inputs/artifacts"

	// InitContainerMainFilesystemDir is a path made available to the init container such that the init container
	// can access the same volume mounts used in the main container. This is used for the purposes of artifact loading
	// (when there is overlapping paths between artifacts and volume mounts)
	InitContainerMainFilesystemDir = "/mainctrfs"

	// ScriptTemplateEmptyDir is the path of the emptydir which will be shared between init/main container for script templates
	ScriptTemplateEmptyDir = "/argo/script"
	// ScriptTemplateSourcePath is the path which init will write the source file to and the main container will execute
	ScriptTemplateSourcePath = "/argo/script/source"

	// EnvVarHostIP contains the host IP which the container is executing on.
	// Used to communicate with kubelet directly (rather than API server).
	// Kubelet enables the wait sidekick to determine
	EnvVarHostIP = "ARGO_HOST_IP"
	// EnvVarPodIP contains the IP of the pod (currently unused)
	EnvVarPodIP = "ARGO_POD_IP"
	// EnvVarPodName contains the name of the pod (currently unused)
	EnvVarPodName = "ARGO_POD_NAME"
	// EnvVarNamespace contains the namespace of the pod (currently unused)
	EnvVarNamespace = "ARGO_NAMESPACE"
)

Variables

View Source
var (
	// TODO: replace 'latest' tag with argo.Version when close to release
	DefaultControllerImage = "argoproj/workflow-controller:latest"
	DefaultExecutorImage   = "argoproj/argoexec:latest"
	// DefaultWorkflowControllerDeploymentName is the default deployment name of the workflow controller
	DefaultControllerDeploymentName = "workflow-controller"
	// DefaultControllerNamespace is the default location where the workflow controller is installed
	DefaultControllerNamespace = "kube-system"
)

Functions

func DefaultConfigMapName

func DefaultConfigMapName(controllerName string) string

DefaultConfigMapName returns a formulated name for a configmap name based on the workflow-controller deployment name

func ExecPodContainer

func ExecPodContainer(restConfig *rest.Config, namespace string, pod string, container string, stdout bool, stderr bool, command ...string) (remotecommand.Executor, error)

ExecPodContainer runs a command in a container in a pod and returns the remotecommand.Executor

func FindOverlappingVolume

func FindOverlappingVolume(tmpl *wfv1.Template, path string) *apiv1.VolumeMount

FindOverlappingVolume looks an artifact path, checks if it overlaps with any user specified volumeMounts in the template, and returns the deepest volumeMount (if any).

func GetExecutorOutput

func GetExecutorOutput(exec remotecommand.Executor) (string, string, error)

GetExecutorOutput returns the output of an remotecommand.Executor

func KillPodContainer

func KillPodContainer(restConfig *rest.Config, namespace string, pod string, container string) error

KillPodContainer is a convenience funtion to issue a kill signal to a container in a pod It gives a 15 second grace period before issuing SIGKILL NOTE: this only works with containers that have sh

func ValidateWorkflow

func ValidateWorkflow(wf *wfv1.Workflow) error

func VerifyUniqueNonEmptyNames

func VerifyUniqueNonEmptyNames(slice interface{}) error

VerifyUniqueNonEmptyNames accepts a slice of structs and verifies that the Name field of the structs are unique and non-empty

Types

This section is empty.

Jump to

Keyboard shortcuts

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