config

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const SupportedSpecVersions = "v0.6.0"

SupportedSpecVersions indicates the version(s) of the DrakeSpec that is/are supported by this package.

Variables

This section is empty.

Functions

This section is empty.

Types

type CPU

type CPU interface {
	// RequestedMillicores returns the requested number of CPU millicores for use
	// by the container.
	RequestedMillicores() int
	// MaxMillicores returns the maximum number of CPU millicores usable by
	// the container.
	MaxMillicores() int
}

CPU is a public interface for container CPU configuration.

type CPUArch

type CPUArch string

CPUArch represents CPU architecture

const (
	// CPUArchAMD64 represents amd64 CPU architecture
	CPUArchAMD64 CPUArch = "amd64"
)

type Config

type Config interface {
	// AllJobs returns a list of all Jobs
	AllJobs() []Job
	// Jobs returns an ordered list of Jobs given the provided jobNames.
	Jobs(jobNames ...string) ([]Job, error)
	// AllPipelines returns a list of all Pipelines
	AllPipelines() []Pipeline
	// Pipelines returns an ordered list of Pipelines given the provided
	// pipelineNames.
	Pipelines(pipelineNames ...string) ([]Pipeline, error)
}

Config is a public interface for the root of the Drake configuration tree.

func NewConfigFromFile

func NewConfigFromFile(configFilePath string) (Config, error)

NewConfigFromFile loads configuration from the specified path and returns it.

func NewConfigFromYAML

func NewConfigFromYAML(yamlBytes []byte) (Config, error)

NewConfigFromYAML loads configuration from the specified YAML bytes.

type Container

type Container interface {
	// Name returns the container's name
	Name() string
	// Image returns the name of the OCI image used by the container
	Image() string
	// ImagePullPolicy returns the name of the pull policy, which indicates
	// whether to settle for existing images (if they already exist) or attempt
	// to refresh them by re-pulling
	ImagePullPolicy() ImagePullPolicy
	// Environment returns container-specific environment variables
	Environment() map[string]string
	// WorkingDirectory returns the container's working directory
	WorkingDirectory() string
	// Command returns the command (entrypoint) that should be run in the
	// container
	Command() []string
	// Args returns the arguments for the command
	Args() []string
	// TTY returns an indicator of whether the container should use TTY or not
	TTY() bool
	// Privileged returns an indicator of whether the container should be
	// privileged
	Privileged() bool
	// MountDockerSocket returns an indicator of whether the container should
	// mount the Docker socket or not
	MountDockerSocket() bool
	// SourceMountPath returns a path to where project source should be mounted
	// into the container
	SourceMountPath() string
	// SharedStorageMountPath returns a path to where shared storage should be
	// mounted into the container
	SharedStorageMountPath() string
	// Returns the resource configuration (CPU and memory) for the container
	Resources() Resources
}

Container is a public interface for container configuration.

type ImagePullPolicy

type ImagePullPolicy string
const (
	ImagePullPolicyIfNotPresent ImagePullPolicy = "IfNotPresent"
	ImagePullPolicyAlways       ImagePullPolicy = "Always"
)

type Job

type Job interface {
	// Name returns the job's name
	Name() string
	// PrimaryContainer returns this job's primary container
	PrimaryContainer() Container
	// SidecarContainers returns this job's sidecar containers
	SidecarContainers() []Container
	// SourceMountMode returns the job's SourceMountMode
	SourceMountMode() SourceMountMode
	// OSFamily returns the job's OSFamily
	OSFamily() OSFamily
	// CPUArch returns the job's CPU architecture
	CPUArch() CPUArch
	// TimeoutSeconds returns the maximum number of seconds to wait for the job to complete.
	// An empty (zero) value disables the timeout.
	TimeoutSeconds() int64
}

Job is a public interface for job configuration.

type Memory

type Memory interface {
	// RequestedMegabytes returns the requested amount of memory (in megabytes)
	// for use by the container.
	RequestedMegabytes() int
	// MaxMegabytes returns the maximum amount of memory (in megabytes) usable
	// by the container.
	MaxMegabytes() int
}

Memory is a public interface for container memory configuration.

type OSFamily

type OSFamily string

OSFamily represents the supported kernels-- linux and windows

const (
	// OSFamilyLinux represents the linux family of operating systems
	OSFamilyLinux OSFamily = "linux"
	// OSFamilyWindows represents the windows family of operating systems
	OSFamilyWindows OSFamily = "windows"
)

type Pipeline

type Pipeline interface {
	// Name returns the pipeline's name
	Name() string
	// Triggers returns all the triggers that can trigger the pipeline
	Triggers() []PipelineTrigger
	// Jobs returns all the jobs that comprise the pipeline
	Jobs() []PipelineJob
}

Pipeline is a public interface for pipeline configuration.

type PipelineJob

type PipelineJob interface {
	Job() Job
	Dependencies() []PipelineJob
}

PipelineJob is a public interface for a job in a pipeline.

type PipelineTrigger

type PipelineTrigger interface {
	SpecURI() string
	SpecVersion() string
	Config() []byte
}

PipelineTrigger is the public interface for a pipeline trigger.

type Resources

type Resources interface {
	// CPU returns container CPU configuration
	CPU() CPU
	// Memory returns container memory configuration
	Memory() Memory
}

Resources is a public interface for container resource configuration.

type SourceMountMode

type SourceMountMode string

SourceMountMode represents the different methods for mounting source code into an OCI container

const (
	// SourceMountModeReadOnly represents source code mounted in read-only fashion
	SourceMountModeReadOnly SourceMountMode = "RO"
	// SourceMountModeCopy represents source code mounted as a writable copy
	SourceMountModeCopy SourceMountMode = "COPY"
	// SourceMountModeReadWrite represents source code mounted in a writeable
	// fashion
	SourceMountModeReadWrite SourceMountMode = "RW"
)

Jump to

Keyboard shortcuts

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