v1alpha1

package
v0.0.0-...-f651028 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MediaFileDoneSuffix = "_done"
	ConfigMapFileName   = "file-list.txt"
)
View Source
const (
	ClustercodeTaskIdLabelKey = "clustercode.github.io/task-id"
)

Variables

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

	// 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 Blueprint

type Blueprint struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   BlueprintSpec   `json:"spec,omitempty"`
	Status BlueprintStatus `json:"status,omitempty"`
}

Blueprint is the Schema for the Blueprint API

func (*Blueprint) DeepCopy

func (in *Blueprint) DeepCopy() *Blueprint

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

func (*Blueprint) DeepCopyInto

func (in *Blueprint) DeepCopyInto(out *Blueprint)

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

func (*Blueprint) DeepCopyObject

func (in *Blueprint) DeepCopyObject() runtime.Object

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

func (*Blueprint) GetServiceAccountName

func (in *Blueprint) GetServiceAccountName() string

GetServiceAccountName retrieves a ServiceAccount name that would go along with this Blueprint.

func (*Blueprint) IsMaxParallelTaskLimitReached

func (in *Blueprint) IsMaxParallelTaskLimitReached() bool

IsMaxParallelTaskLimitReached will return true if the count of current task has reached MaxParallelTasks.

type BlueprintList

type BlueprintList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Blueprint `json:"items"`
}

BlueprintList contains a list of Blueprints.

func (*BlueprintList) DeepCopy

func (in *BlueprintList) DeepCopy() *BlueprintList

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

func (*BlueprintList) DeepCopyInto

func (in *BlueprintList) DeepCopyInto(out *BlueprintList)

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

func (*BlueprintList) DeepCopyObject

func (in *BlueprintList) DeepCopyObject() runtime.Object

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

type BlueprintSpec

type BlueprintSpec struct {
	Storage          StorageSpec `json:"storage,omitempty"`
	MaxParallelTasks int         `json:"maxParallelTasks,omitempty"`

	Suspend                 bool                `json:"suspend,omitempty"`
	TaskConcurrencyStrategy ClustercodeStrategy `json:"taskConcurrencyStrategy,omitempty"`

	Scan    ScanSpec    `json:"scan,omitempty"`
	Encode  EncodeSpec  `json:"encode,omitempty"`
	Cleanup CleanupSpec `json:"cleanup,omitempty"`
}

BlueprintSpec specifies Clustercode settings

func (*BlueprintSpec) DeepCopy

func (in *BlueprintSpec) DeepCopy() *BlueprintSpec

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

func (*BlueprintSpec) DeepCopyInto

func (in *BlueprintSpec) DeepCopyInto(out *BlueprintSpec)

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

type BlueprintStatus

type BlueprintStatus struct {
	Conditions   []metav1.Condition `json:"conditions,omitempty"`
	CurrentTasks []TaskRef          `json:"currentTasks,omitempty"`
}

func (*BlueprintStatus) DeepCopy

func (in *BlueprintStatus) DeepCopy() *BlueprintStatus

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

func (*BlueprintStatus) DeepCopyInto

func (in *BlueprintStatus) DeepCopyInto(out *BlueprintStatus)

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

type CleanupSpec

type CleanupSpec struct {
	// PodTemplate contains a selection of fields to customize the spawned ffmpeg-based pods.
	// Some fields will be overwritten:
	//  * Volumes and volume mounts will be set based on StorageSpec.
	//  * Container args of the `ffmpeg` container will be set based on SplitCommandArgs, TranscodeCommandArgs, MergeCommandArgs.
	PodTemplate PodTemplate `json:"podTemplate,omitempty"`
}

func (*CleanupSpec) DeepCopy

func (in *CleanupSpec) DeepCopy() *CleanupSpec

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

func (*CleanupSpec) DeepCopyInto

func (in *CleanupSpec) DeepCopyInto(out *CleanupSpec)

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

type ClusterCodeUrl

type ClusterCodeUrl string

func ToUrl

func ToUrl(root, path string) ClusterCodeUrl

func (ClusterCodeUrl) GetPath

func (u ClusterCodeUrl) GetPath() string

func (ClusterCodeUrl) GetRoot

func (u ClusterCodeUrl) GetRoot() string

func (ClusterCodeUrl) String

func (u ClusterCodeUrl) String() string

func (ClusterCodeUrl) StripSubPath

func (u ClusterCodeUrl) StripSubPath(subpath string) string

type ClustercodeCountStrategy

type ClustercodeCountStrategy struct {
	MaxCount int `json:"maxCount,omitempty"`
}

func (*ClustercodeCountStrategy) DeepCopy

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

func (*ClustercodeCountStrategy) DeepCopyInto

func (in *ClustercodeCountStrategy) DeepCopyInto(out *ClustercodeCountStrategy)

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

type ClustercodeSliceRef

type ClustercodeSliceRef struct {
	JobName    string `json:"jobName,omitempty"`
	SliceIndex int    `json:"sliceIndex"`
}

func (*ClustercodeSliceRef) DeepCopy

func (in *ClustercodeSliceRef) DeepCopy() *ClustercodeSliceRef

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

func (*ClustercodeSliceRef) DeepCopyInto

func (in *ClustercodeSliceRef) DeepCopyInto(out *ClustercodeSliceRef)

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

type ClustercodeStrategy

type ClustercodeStrategy struct {
	ConcurrentCountStrategy *ClustercodeCountStrategy `json:"concurrentCountStrategy,omitempty"`
}

func (*ClustercodeStrategy) DeepCopy

func (in *ClustercodeStrategy) DeepCopy() *ClustercodeStrategy

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

func (*ClustercodeStrategy) DeepCopyInto

func (in *ClustercodeStrategy) DeepCopyInto(out *ClustercodeStrategy)

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

type ClustercodeTaskId

type ClustercodeTaskId string

func (ClustercodeTaskId) AsLabels

func (id ClustercodeTaskId) AsLabels() labels.Set

func (ClustercodeTaskId) String

func (id ClustercodeTaskId) String() string

type ContainerTemplate

type ContainerTemplate struct {
	// Name of the container specified as a DNS_LABEL.
	// Each container in a pod must have a unique name (DNS_LABEL).
	Name string `json:"name"`

	// Image name.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	Image string `json:"image,omitempty"`

	// Command Entrypoint array.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	Command []string `json:"command,omitempty"`

	// Args to the entrypoint.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	Args []string `json:"args,omitempty"`

	// EnvFrom is a List of sources to populate environment variables in the container.
	EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"`

	// Env is a list of environment variables to set in the container.
	Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// ImagePullPolicy.
	// One of Always, Never, IfNotPresent.
	// Defaults to Always if `latest` tag is specified, or `IfNotPresent` otherwise.
	// More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

	// VolumeMounts to mount into the container's filesystem.
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath"`

	// Compute Resources required by this container.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`

	// SecurityContext defines the security options the container should be run with.
	// If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext.
	// More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
	SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
}

func (*ContainerTemplate) DeepCopy

func (in *ContainerTemplate) DeepCopy() *ContainerTemplate

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

func (*ContainerTemplate) DeepCopyInto

func (in *ContainerTemplate) DeepCopyInto(out *ContainerTemplate)

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

func (*ContainerTemplate) ToContainer

func (in *ContainerTemplate) ToContainer() corev1.Container

ToContainer returns a native Container based from the template.

type EncodeSpec

type EncodeSpec struct {
	SplitCommandArgs     []string `json:"splitCommandArgs"`
	TranscodeCommandArgs []string `json:"transcodeCommandArgs"`
	MergeCommandArgs     []string `json:"mergeCommandArgs"`

	// PodTemplate contains a selection of fields to customize the spawned ffmpeg-based pods.
	// Some fields will be overwritten:
	//  * Volumes and volume mounts will be set based on StorageSpec, if the claim names are given.
	//  * Container args of the `ffmpeg` container will be set based on SplitCommandArgs, TranscodeCommandArgs, MergeCommandArgs.
	PodTemplate PodTemplate `json:"podTemplate,omitempty"`

	// SliceSize is the time in seconds of the slice lengths.
	// Higher values yield lower parallelization but less overhead.
	// Lower values yield high parallelization but more overhead.
	// If SliceSize is higher than the total length of the media, there may be just 1 slice with effectively no parallelization.
	SliceSize int `json:"sliceSize,omitempty"`
}

func (*EncodeSpec) DeepCopy

func (in *EncodeSpec) DeepCopy() *EncodeSpec

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

func (*EncodeSpec) DeepCopyInto

func (in *EncodeSpec) DeepCopyInto(out *EncodeSpec)

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

type PodMetadata

type PodMetadata struct {
	// Map of string keys and values that can be used to organize and categorize (scope and select) objects.
	// This will only affect labels on the pod, not the pod selector.
	// Labels will be merged with internal labels used by crossplane, and labels with a `clustercode.github.io` key might be overwritten.
	// More info: http://kubernetes.io/docs/user-guide/labels
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations is an unstructured key value map stored with a Pod that may be set by external tools to store and retrieve arbitrary metadata.
	// More info: http://kubernetes.io/docs/user-guide/annotations
	Annotations map[string]string `json:"annotations,omitempty"`
}

func (*PodMetadata) DeepCopy

func (in *PodMetadata) DeepCopy() *PodMetadata

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

func (*PodMetadata) DeepCopyInto

func (in *PodMetadata) DeepCopyInto(out *PodMetadata)

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

type PodTemplate

type PodTemplate struct {

	// Metadata that will be added to the Job's Pod.
	Metadata *PodMetadata `json:"metadata,omitempty"`

	// PodSecurityContext holds pod-level security attributes and common container settings.
	// Defaults to empty.
	// See type description for default values of each field.
	PodSecurityContext *corev1.PodSecurityContext `json:"podSecurityContext,omitempty"`

	// Containers configures the init containers within a Pod.
	InitContainers []ContainerTemplate `json:"initContainers,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// Containers configures the containers within a Pod.
	Containers []ContainerTemplate `json:"containers,omitempty" patchStrategy:"merge" patchMergeKey:"name"`

	// List of volumes that can be mounted by containers belonging to the pod.
	// More info: https://kubernetes.io/docs/concepts/storage/volumes
	Volumes []corev1.Volume `json:"volumes,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}

func (*PodTemplate) DeepCopy

func (in *PodTemplate) DeepCopy() *PodTemplate

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

func (*PodTemplate) DeepCopyInto

func (in *PodTemplate) DeepCopyInto(out *PodTemplate)

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

type ScanSpec

type ScanSpec struct {
	Schedule            string   `json:"schedule"`
	MediaFileExtensions []string `json:"mediaFileExtensions,omitempty"`
}

func (*ScanSpec) DeepCopy

func (in *ScanSpec) DeepCopy() *ScanSpec

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

func (*ScanSpec) DeepCopyInto

func (in *ScanSpec) DeepCopyInto(out *ScanSpec)

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

type StorageSpec

type StorageSpec struct {
	// SourcePvc is a reference to the PVC which contains the source media files to encode.
	// If `sourcePvc.claimName` is empty, then you need to specify a pod template that configures a volume named "source".
	SourcePvc VolumeRef `json:"sourcePvc"`
	// SourcePvc is a reference to the PVC which contains the intermediate media files as part of the splitting and merging.
	// If `intermediatePvc.claimName` is empty, then you need to specify a pod template that configures a volume named "intermediate".
	IntermediatePvc VolumeRef `json:"intermediatePvc"`
	// SourcePvc is a reference to the PVC which contains the final result files.
	// If `targetPvc.claimName` is empty, then you need to specify a pod template that configures a volume named "target".
	TargetPvc VolumeRef `json:"targetPvc"`
}

func (*StorageSpec) DeepCopy

func (in *StorageSpec) DeepCopy() *StorageSpec

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

func (*StorageSpec) DeepCopyInto

func (in *StorageSpec) DeepCopyInto(out *StorageSpec)

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

type Task

type Task struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TaskSpec   `json:"spec,omitempty"`
	Status TaskStatus `json:"status,omitempty"`
}

Task is a projection out of a Blueprint

func (*Task) DeepCopy

func (in *Task) DeepCopy() *Task

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

func (*Task) DeepCopyInto

func (in *Task) DeepCopyInto(out *Task)

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

func (*Task) DeepCopyObject

func (in *Task) DeepCopyObject() runtime.Object

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

type TaskList

type TaskList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Task `json:"items"`
}

TaskList contains a list of Task

func (*TaskList) DeepCopy

func (in *TaskList) DeepCopy() *TaskList

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

func (*TaskList) DeepCopyInto

func (in *TaskList) DeepCopyInto(out *TaskList)

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

func (*TaskList) DeepCopyObject

func (in *TaskList) DeepCopyObject() runtime.Object

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

type TaskRef

type TaskRef struct {
	TaskName string `json:"taskName,omitempty"`
}

func (*TaskRef) DeepCopy

func (in *TaskRef) DeepCopy() *TaskRef

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

func (*TaskRef) DeepCopyInto

func (in *TaskRef) DeepCopyInto(out *TaskRef)

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

type TaskSpec

type TaskSpec struct {
	TaskId               ClustercodeTaskId   `json:"taskId,omitempty"`
	Storage              StorageSpec         `json:"storage,omitempty"`
	SourceUrl            ClusterCodeUrl      `json:"sourceUrl,omitempty"`
	TargetUrl            ClusterCodeUrl      `json:"targetUrl,omitempty"`
	Suspend              bool                `json:"suspend,omitempty"`
	Encode               EncodeSpec          `json:"encode,omitempty"`
	Cleanup              CleanupSpec         `json:"cleanup,omitempty"`
	ServiceAccountName   string              `json:"serviceAccountName,omitempty"`
	FileListConfigMapRef string              `json:"fileListConfigMapRef,omitempty"`
	ConcurrencyStrategy  ClustercodeStrategy `json:"concurrencyStrategy,omitempty"`
	SlicesPlannedCount   int                 `json:"slicesPlannedCount,omitempty"`
}

TaskSpec defines the desired state of Task.

func (*TaskSpec) DeepCopy

func (in *TaskSpec) DeepCopy() *TaskSpec

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

func (*TaskSpec) DeepCopyInto

func (in *TaskSpec) DeepCopyInto(out *TaskSpec)

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

type TaskStatus

type TaskStatus struct {
	Conditions           []metav1.Condition    `json:"conditions,omitempty"`
	SlicesScheduledCount int                   `json:"slicesScheduledCount,omitempty"`
	SlicesFinishedCount  int                   `json:"slicesFinishedCount,omitempty"`
	SlicesScheduled      []ClustercodeSliceRef `json:"slicesScheduled,omitempty"`
	SlicesFinished       []ClustercodeSliceRef `json:"slicesFinished,omitempty"`
}

func (*TaskStatus) DeepCopy

func (in *TaskStatus) DeepCopy() *TaskStatus

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

func (*TaskStatus) DeepCopyInto

func (in *TaskStatus) DeepCopyInto(out *TaskStatus)

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

type VolumeRef

type VolumeRef struct {
	// ClaimName is the name of the PVC.
	ClaimName string `json:"claimName"`
	// SubPath is an optional path within the referenced PVC.
	// This is useful if the same PVC is shared.
	SubPath string `json:"subPath,omitempty"`
}

func (*VolumeRef) DeepCopy

func (in *VolumeRef) DeepCopy() *VolumeRef

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

func (*VolumeRef) DeepCopyInto

func (in *VolumeRef) DeepCopyInto(out *VolumeRef)

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

Jump to

Keyboard shortcuts

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