v1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package v1 contains API Schema definitions for the pipelines v1 API group +groupName=meta.gst.io

Package v1 contains API Schema definitions for the pipelines v1 API group +kubebuilder:object:generate=true +groupName=meta.gst.io

Index

Constants

View Source
const (
	// DefaultRegion if none is provided for any configurations
	DefaultRegion = "us-east-1"
	// AccessKeyIDKey is the key in secrets where the access key ID is stored.
	AccessKeyIDKey = "access-key-id"
	// SecretAccessKeyKey is the key in secrets where the secret access key is stored.
	SecretAccessKeyKey = "secret-access-key"
	// DefaultGSTDebug is the default GST_DEBUG value set in the environment for pipelines.
	DefaultGSTDebug = "4"
	// DefaultDotInterval is the default interval to query a pipeline for graphs.
	DefaultDotInterval = 3
)

Default Values

View Source
const (
	// JobPipelineLabel is the label on a job to denote the Transform pipeline that initiated
	// it.
	JobPipelineLabel = "pipelines.gst.io/pipeline"
	// JobPipelineKindLabel is the label where the type of the pipeline is stored.
	JobPipelineKindLabel = "pipelines.gst.io/kind"
	// JobObjectLabel is the label on a job to denote the object key it is processing.
	JobObjectLabel = "pipelines.gst.io/object"
	// JobBucketLabel is the label on a job to denote the bucket where the object is that
	// is being processed.
	JobBucketLabel = "pipelines.gst.io/bucket"
)

Labels

View Source
const (
	// The environment variable where the access key id for the src bucket is stored.
	MinIOSrcAccessKeyIDEnvVar = "MINIO_SRC_ACCESS_KEY_ID"
	// The environment variable where the secret access key for the src bucket is stored.
	MinIOSrcSecretAccessKeyEnvVar = "MINIO_SRC_SECRET_ACCESS_KEY"
	// The environment variable where the access key id for the sink bucket is stored.
	MinIOSinkAccessKeyIDEnvVar = "MINIO_SINK_ACCESS_KEY_ID"
	// The environment variable where the secret access key for the sink bucket is stored.
	MinIOSinkSecretAccessKeyEnvVar = "MINIO_SINK_SECRET_ACCESS_KEY"
	// The environment variable where the pipeline config is serialized and set.
	JobPipelineConfigEnvVar = "GST_PIPELINE_CONFIG"
	// The environment variable where the source object is serialized and set.
	JobSrcObjectsEnvVar = "GST_PIPELINE_SRC_OBJECT"
	// The environment variable where the sink objects are serialized and set.
	JobSinkObjectsEnvVar = "GST_PIPELINE_SINK_OBJECTS"
	// The environment variable where the name of the pipeline being watched is set for watcher
	// processes.
	WatcherPipelineNameEnvVar = "GST_WATCH_PIPELINE_NAME"
	// The environment variable where the pipeline kind is set for the watcher processes.
	WatcherPipelineKindEnvVar = "GST_WATCH_PIPELINE_KIND"
)

Environment Variables

View Source
const (
	JobCreationSpecAnnotation = "pipelines.gst.io/creation-spec"
)

Annotations

View Source
const LinkToAudioOut = "audio-out"

LinkToAudioOut is used during split pipelines to designate the src of an audio sink

View Source
const LinkToVideoOut = "video-out"

LinkToVideoOut is used during split pipelines to designate the src of a video sink

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "meta.gst.io", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type DebugConfig

type DebugConfig struct {
	// The level of log output to produce from the gstreamer process. This value gets set to
	// the GST_DEBUG variable. Defaults to INFO level (4). Higher numbers mean more output.
	LogLevel int `json:"logLevel,omitempty"`
	// Dot specifies to dump a dot file of the pipeline layout for debugging. The extending
	// object allows for additional configurations to the output.
	Dot *DotConfig `json:"dot,omitempty"`
}

DebugConfig represents debug configurations for a GStreamer pipeline.

func (*DebugConfig) DeepCopy

func (in *DebugConfig) DeepCopy() *DebugConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DebugConfig.

func (*DebugConfig) DeepCopyInto

func (in *DebugConfig) DeepCopyInto(out *DebugConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DotConfig

type DotConfig struct {
	// The path to save files. The configuration other than the path is assumed to be that of
	// the source of the pipeline. For example, for a MinIO source, this should be a prefix in
	// the same bucket as the source (but not overlapping with the watch prefix otherwise an infinite
	// loop will happen). The files will be saved in directories matching the source object's name with
	// the _debug suffix.
	Path string `json:"path,omitempty"`
	// Specify to also render the pipeline graph to images in the given format. Accepted formats are
	// png, svg, or jpg.
	Render string `json:"render,omitempty"`
	// Whether to save timestamped versions of the pipeline layout. This will produce a new graph for every
	// interval specified by Interval. The default is to only keep the latest graph.
	Timestamped bool `json:"timestamped,omitempty"`
	// The interval in seconds to save pipeline graphs. Defaults to every 3 seconds.
	Interval int `json:"interval,omitempty"`
}

DotConfig represents a configuration for the dot output of a pipeline.

func (*DotConfig) DeepCopy

func (in *DotConfig) DeepCopy() *DotConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DotConfig.

func (*DotConfig) DeepCopyInto

func (in *DotConfig) DeepCopyInto(out *DotConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ElementConfig

type ElementConfig struct {
	// The name of the element. See the GStreamer plugin documentation for a comprehensive
	// list of all the plugins available. Custom pipeline images can also be used that are
	// prebaked with additional plugins.
	Name string `json:"name,omitempty"`
	// Applies an alias to this element in the pipeline configuration. This allows you to specify an
	// element block with this value as the name and have it act as a "goto" or "linkto" while building
	// the pipeline. Note that the aliases "video-out" and "audio-out" are reserved for internal use.
	Alias string `json:"alias,omitempty"`
	// The alias to an element to treat as this configuration. Useful for directing the output of elements
	// with multiple src pads, such as decodebin.
	GoTo string `json:"goto,omitempty"`
	// The alias to an element to link the previous element's sink pad to. Useful for directing the branches of
	// a multi-stream pipeline to a muxer. A linkto almost always needs to be followed by a goto, except when
	// the element being linked to is next in the pipeline, in which case you can omit the linkto entirely.
	LinkTo string `json:"linkto,omitempty"`
	// Optional properties to apply to this element. To not piss off the CRD generator values are
	// declared as a string, but almost anything that can be passed to gst-launch-1.0 will work.
	// Caps will be parsed from their string representation.
	Properties map[string]string `json:"properties,omitempty"`
}

ElementConfig represents the configuration of a single element in a transform pipeline.

func (*ElementConfig) DeepCopy

func (in *ElementConfig) DeepCopy() *ElementConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ElementConfig.

func (*ElementConfig) DeepCopyInto

func (in *ElementConfig) DeepCopyInto(out *ElementConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GstElementConfig

type GstElementConfig struct {
	*ElementConfig
	// contains filtered or unexported fields
}

GstElementConfig is an extension of the ElementConfig struct providing private fields for internal tracking while building a dynamic pipeline.

func (*GstElementConfig) AddPeer

func (e *GstElementConfig) AddPeer(peer *GstElementConfig)

AddPeer will add a peer to this configuration. It is used for determining which sink pads to pair with dynamically added src pads.

func (*GstElementConfig) DeepCopy

func (in *GstElementConfig) DeepCopy() *GstElementConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GstElementConfig.

func (*GstElementConfig) DeepCopyInto

func (in *GstElementConfig) DeepCopyInto(out *GstElementConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*GstElementConfig) GetPeers

func (e *GstElementConfig) GetPeers() []*GstElementConfig

GetPeers returns the peers registered for this element.

func (*GstElementConfig) GetPipelineName

func (e *GstElementConfig) GetPipelineName() string

GetPipelineName returns the name that was assigned to this element by the pipeline.

func (*GstElementConfig) SetPipelineName

func (e *GstElementConfig) SetPipelineName(name string)

SetPipelineName sets the name that was assigned to this element by the pipeline for later reference.

type GstLaunchConfig

type GstLaunchConfig []*GstElementConfig

GstLaunchConfig is a slice of ElementConfigs that contain internal fields used for dynamic linking.

func (GstLaunchConfig) DeepCopy

func (in GstLaunchConfig) DeepCopy() GstLaunchConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GstLaunchConfig.

func (GstLaunchConfig) DeepCopyInto

func (in GstLaunchConfig) DeepCopyInto(out *GstLaunchConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (GstLaunchConfig) GetByAlias

func (g GstLaunchConfig) GetByAlias(alias string) *GstElementConfig

GetByAlias returns the configuration for the element at the given alias

type MinIOConfig

type MinIOConfig struct {
	// The MinIO endpoint *without* the leading `http(s)://`.
	Endpoint string `json:"endpoint,omitempty"`
	// Do not use TLS when communicating with the MinIO API.
	InsecureNoTLS bool `json:"insecureNoTLS,omitempty"`
	// A base64-endcoded PEM certificate chain to use when verifying the certificate
	// supplied by the MinIO server.
	EndpointCA string `json:"endpointCA,omitempty"`
	// Skip verification of the certificate supplied by the MinIO server.
	InsecureSkipVerify bool `json:"insecureSkipVerify,omitempty"`
	// The region to connect to in MinIO.
	Region string `json:"region,omitempty"`
	// In the context of a src config, the bucket to watch for objects to pass through
	// the pipeline. In the context of a sink config, the bucket to save processed objects.
	Bucket string `json:"bucket,omitempty"`
	// In the context of a src config, a directory prefix to match for objects to be sent
	// through the pipeline. An empty value means ALL objects in the bucket, or the equivalent of
	// `/`. In the context of a sink config, a go-template to use for the destination name. The
	// template allows sprig functions and is passed the value "SrcName" representing the base of the key
	// of the object that triggered the pipeline, and "SrcExt" with the extension. An empty value represents
	// using the same key as the source which would only work for objects being processed to different
	// buckets and prefixes.
	Prefix string `json:"key,omitempty"`
	// A regular expression to filter out items placed in the `key`. Only makes sense in the context of a src
	// config. This can be useful when chaining pipelines. You may want to exclude the "*_tmp" expression to
	// filter out the temporary objects created while the miniosink is rendering the output of a pipeline, since
	// it first creates chunked objects, and then pieces them together with the ComposeObject API.
	Exclude string `json:"exclude,omitempty"`
	// The secret that contains the credentials for connecting to MinIO. The secret must contain
	// two keys. The `access-key-id` key must contain the contents of the Access Key ID. The
	// `secret-access-key` key must contain the contents of the Secret Access Key.
	CredentialsSecret *corev1.LocalObjectReference `json:"credentialsSecret,omitempty"`
}

MinIOConfig defines a source or sink location for pipelines.

func (*MinIOConfig) DeepCopy

func (in *MinIOConfig) DeepCopy() *MinIOConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MinIOConfig.

func (*MinIOConfig) DeepCopyInto

func (in *MinIOConfig) DeepCopyInto(out *MinIOConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MinIOConfig) GetBucket

func (m *MinIOConfig) GetBucket() string

GetBucket returns the bucket for this configuration.

func (*MinIOConfig) GetCredentials

func (m *MinIOConfig) GetCredentials(client client.Client, namespace string) (accessKeyID, secretAccessKey string, err error)

GetCredentials attemps to retrieve the access key ID and secret access key for this config.

func (*MinIOConfig) GetCredentialsSecret

func (m *MinIOConfig) GetCredentialsSecret() (string, error)

GetCredentialsSecret returns the name of the credentials secret.

func (*MinIOConfig) GetDestinationKey

func (m *MinIOConfig) GetDestinationKey(objectKey string) string

GetDestinationKey computes what the destination object's name should be based on the given source object name. If a template is present and it fails to execute, it is logged and the default behavior is returned.

func (*MinIOConfig) GetEndpoint

func (m *MinIOConfig) GetEndpoint() string

GetEndpoint returns the API endpoint for this configuration.

func (*MinIOConfig) GetExcludeRegex

func (m *MinIOConfig) GetExcludeRegex() *regexp.Regexp

GetExcludeRegex returns the regex to use for excluding objects, or nil if not present or any error.

func (*MinIOConfig) GetPrefix

func (m *MinIOConfig) GetPrefix() string

GetPrefix returns the prefix for this configuration.

func (*MinIOConfig) GetRegion

func (m *MinIOConfig) GetRegion() string

GetRegion returns the region to connect the client to.

func (*MinIOConfig) GetRootCAs

func (m *MinIOConfig) GetRootCAs() (*x509.CertPool, error)

GetRootCAs returns an x509.CertPool for any provided CA certificates.

func (*MinIOConfig) GetRootPEM

func (m *MinIOConfig) GetRootPEM() ([]byte, error)

GetRootPEM returns the raw PEM of the root certificate included in the configuration.

func (*MinIOConfig) GetSecure

func (m *MinIOConfig) GetSecure() bool

GetSecure returns whether to use HTTPS for API communication.

func (*MinIOConfig) GetSkipVerify

func (m *MinIOConfig) GetSkipVerify() bool

GetSkipVerify returns where to skip TLS verification of the server certificate.

func (*MinIOConfig) GetStaticCredentials

func (m *MinIOConfig) GetStaticCredentials(client client.Client, namespace string) (*credentials.Credentials, error)

GetStaticCredentials attempts to return API credentials for MinIO using the given client looking in the given namespace.

type Object

type Object struct {
	// The actual name for the object being read or written to. In the context of
	// a source object this is pulled from a watch event. In the context of a destination
	// this is computed by the controller from the user supplied configuration.
	Name string `json:"name"`
	// The endpoint and bucket configurations for the object.
	Config *SourceSinkConfig `json:"config"`
	// The type of the stream for this object. Only applies to sinks. For a split transform
	// pipeline there will be an Object for each stream. Otherwise there will be a single
	// object with a StreamTypeAll.
	StreamType StreamType `json:"streamType"`
}

Object represents either a source or destination object for a job.

func (*Object) DeepCopy

func (in *Object) DeepCopy() *Object

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Object.

func (*Object) DeepCopyInto

func (in *Object) DeepCopyInto(out *Object)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PipelineConfig

type PipelineConfig struct {
	// The image to use to run a/v processing pipelines.
	Image string `json:"image,omitempty"`
	// Debug configurations for the pipeline
	Debug *DebugConfig `json:"debug,omitempty"`
	// A list of element configurations in the order they will be used in the pipeline.
	// Using these is mutually exclusive with a decodebin configuration. This only really
	// works for linear pipelines. That is to say, not the syntax used by `gst-launch-1.0` that
	// allows naming elements and referencing them later in the pipeline. For complex handling
	// of multiple streams decodebin will still be better to work with for now, despite its
	// shortcomings.
	Elements []*ElementConfig `json:"elements,omitempty"`
	// Resource restraints to place on jobs created for this pipeline.
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
}

PipelineConfig represents a series of elements through which to pass the contents of processed objects.

func (*PipelineConfig) DeepCopy

func (in *PipelineConfig) DeepCopy() *PipelineConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineConfig.

func (*PipelineConfig) DeepCopyInto

func (in *PipelineConfig) DeepCopyInto(out *PipelineConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*PipelineConfig) DoDotDump

func (p *PipelineConfig) DoDotDump() bool

DoDotDump returns true if the pipeline has DOT debugging enabled.

func (*PipelineConfig) GetDotInterval

func (p *PipelineConfig) GetDotInterval() time.Duration

GetDotInterval returns the interval in seconds to query for pipeline graphs.

func (*PipelineConfig) GetDotPath

func (p *PipelineConfig) GetDotPath(srcKey string) string

GetDotPath returns the path to save dot graphs based on the given source key.

func (*PipelineConfig) GetDotRenderFormat

func (p *PipelineConfig) GetDotRenderFormat() string

GetDotRenderFormat returns the image format that the dot graphs should be encoded to when uploading alongside the raw format.

func (*PipelineConfig) GetElements

func (p *PipelineConfig) GetElements() GstLaunchConfig

GetElements returns the elements for this pipeline.

func (*PipelineConfig) GetGSTDebug

func (p *PipelineConfig) GetGSTDebug() string

GetGSTDebug returns the string value of the level to set to GST_DEBUG.

func (*PipelineConfig) GetImage

func (p *PipelineConfig) GetImage() string

GetImage returns the container image to use for the gstreamer pipelines.

func (*PipelineConfig) TimestampDotGraphs

func (p *PipelineConfig) TimestampDotGraphs() bool

TimestampDotGraphs returns true if timestamped dot images should be saved.

type PipelineKind

type PipelineKind string

PipelineKind represents a type of pipeline.

type PipelineReference

type PipelineReference struct {
	// Name is the name of the Pipeline CR
	Name string `json:"name"`
	// Kind is the type of the Pipeline CR
	Kind PipelineKind `json:"kind"`
}

PipelineReference is used to refer to the pipeline that holds the configuration for a given job.

func (*PipelineReference) DeepCopy

func (in *PipelineReference) DeepCopy() *PipelineReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PipelineReference.

func (*PipelineReference) DeepCopyInto

func (in *PipelineReference) DeepCopyInto(out *PipelineReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PipelineState

type PipelineState string

PipelineState represents the state of a Pipeline CR.

const (
	// PipelineInSync represents that the pipeline configuration is in sync with the watchers.
	PipelineInSync PipelineState = "InSync"
)

type SourceSinkConfig

type SourceSinkConfig struct {
	// Configurations for a MinIO source or sink
	MinIO *MinIOConfig `json:"minio,omitempty"`
}

SourceSinkConfig is used to declare configurations related to the retrieval or saving of pipeline objects.

func (*SourceSinkConfig) DeepCopy

func (in *SourceSinkConfig) DeepCopy() *SourceSinkConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceSinkConfig.

func (*SourceSinkConfig) DeepCopyInto

func (in *SourceSinkConfig) DeepCopyInto(out *SourceSinkConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StreamType

type StreamType string

StreamType represents a type of stream found in a source input, or designated for an output.

const (
	// StreamTypeAll represents all possible output streams.
	StreamTypeAll StreamType = "all"
	// StreamTypeVideo represents a video stream.
	StreamTypeVideo StreamType = "video"
	// StreamTypeAudio represents an audio stream.
	StreamTypeAudio StreamType = "audio"
)

Jump to

Keyboard shortcuts

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