v1alpha1

package
v0.0.0-...-9b29f16 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the ensemble v1alpha1 API group +kubebuilder:object:generate=true +groupName=ensemble.flux-framework.org

Index

Constants

This section is empty.

Variables

View Source
var (
	MiniclusterType = "minicluster"
	UnknownType     = "unknown"
)
View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "ensemble.flux-framework.org", 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 Algorithm

type Algorithm struct {

	// +kubebuilder:default="workload-demand"
	// +default="workload-demand"
	//+optional
	Name string `json:"name"`

	// Options for the algorithm
	//+optional
	Options map[string]intstr.IntOrString `json:"options"`
}

func (*Algorithm) DeepCopy

func (in *Algorithm) DeepCopy() *Algorithm

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

func (*Algorithm) DeepCopyInto

func (in *Algorithm) DeepCopyInto(out *Algorithm)

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

type Ensemble

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

	Spec   EnsembleSpec   `json:"spec,omitempty"`
	Status EnsembleStatus `json:"status,omitempty"`
}

Ensemble is the Schema for the ensembles API

func (*Ensemble) DeepCopy

func (in *Ensemble) DeepCopy() *Ensemble

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

func (*Ensemble) DeepCopyInto

func (in *Ensemble) DeepCopyInto(out *Ensemble)

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

func (*Ensemble) DeepCopyObject

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

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

func (*Ensemble) RequeueAfter

func (e *Ensemble) RequeueAfter() time.Duration

func (*Ensemble) Validate

func (e *Ensemble) Validate() error

Validate ensures we have data that is needed, and sets defaults if needed

type EnsembleList

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

EnsembleList contains a list of Ensemble

func (*EnsembleList) DeepCopy

func (in *EnsembleList) DeepCopy() *EnsembleList

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

func (*EnsembleList) DeepCopyInto

func (in *EnsembleList) DeepCopyInto(out *EnsembleList)

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

func (*EnsembleList) DeepCopyObject

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

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

type EnsembleSpec

type EnsembleSpec struct {

	// Foo is an example field of Ensemble. Edit ensemble_types.go to remove/update
	Members []Member `json:"members"`

	// After ensemble creation, how long should we reconcile
	// (in other words, how many seconds between checks?)
	// Defaults to 10 seconds
	// +kubebuilder:default=10
	// +default=10
	CheckSeconds int32 `json:"checkSeconds"`

	// Global algorithmt to use, unless a member has a specific algorithm
	//+optional
	Algorithm Algorithm `json:"algorithm"`
}

EnsembleSpec defines the desired state of Ensemble

func (*EnsembleSpec) DeepCopy

func (in *EnsembleSpec) DeepCopy() *EnsembleSpec

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

func (*EnsembleSpec) DeepCopyInto

func (in *EnsembleSpec) DeepCopyInto(out *EnsembleSpec)

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

type EnsembleStatus

type EnsembleStatus struct {

	// These lookup values must be string, so we convert from int32 to it
	// Jobs matrix lookup (what we can mutate)
	Jobs map[string][]Job `json:"jobs"`
}

EnsembleStatus defines the observed state of Ensemble

func (*EnsembleStatus) DeepCopy

func (in *EnsembleStatus) DeepCopy() *EnsembleStatus

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

func (*EnsembleStatus) DeepCopyInto

func (in *EnsembleStatus) DeepCopyInto(out *EnsembleStatus)

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

type Job

type Job struct {

	// Name to identify the job group
	Name string `json:"name"`

	// Command given to flux
	Command string `json:"command"`

	// Number of jobs to run
	// This can be set to 0 depending on the algorithm
	// E.g., some algorithms decide on the number to submit
	// +kubebuilder:default=1
	// +default=1
	//+optional
	Count int32 `json:"count"`

	// Number of nodes for job
	// +kubebuilder:default=1
	// +default=1
	//+optional
	Nodes int32 `json:"nodes"`

	// Number of tasks for the job, defaults to 1
	// Node count cannot be greater than task count
	//+optional
	Tasks int32 `json:"tasks"`

	// Working directory for job group (if unset, uses container default)
	//+optional
	Workdir string `json:"workdir"`

	// Duration of jobs
	// Value of 0 (default) indicates no limit
	//+optional
	Duration int32 `json:"duration"`
}

Job defines a unit of work for the ensemble to munch on. Munch munch munch.

func (*Job) DeepCopy

func (in *Job) DeepCopy() *Job

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

func (*Job) DeepCopyInto

func (in *Job) DeepCopyInto(out *Job)

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

type Member

type Member struct {

	// MiniCluster is of a type MiniCluster, the base unit of an ensemble.
	// We do this because we install a flux metrics API within each MiniCluster to manage it
	// TODO where should the user define the size? Here or with the member?
	// +optional
	MiniCluster minicluster.MiniCluster `json:"minicluster,omitempty"`

	// Definition and customization of the sidecar
	//+optional
	Sidecar Sidecar `json:"sidecar,omitempty"`

	// A member is required to define one or more jobs
	// These are passed into status for further updating
	// Jobs
	Jobs []Job `json:"jobs"`

	// Member specific algorithm to use
	// If not defined, defaults to workload-demand
	//+optional
	Algorithm Algorithm `json:"algorithm"`
}

A member of the ensemble that will run for some number of times, optionally with a maximum or minumum

func (*Member) DeepCopy

func (in *Member) DeepCopy() *Member

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

func (*Member) DeepCopyInto

func (in *Member) DeepCopyInto(out *Member)

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

func (*Member) GetPositiveIntegerOption

func (m *Member) GetPositiveIntegerOption(
	key string,
	defaultValue int,
) int

getPositiveIntegerOption returns an option > 0

func (*Member) GetStringOption

func (m *Member) GetStringOption(
	key string,
	defaultValue string,
) string

getStringOption returns a string option from the member

func (*Member) Size

func (m *Member) Size() int32

Size is a common function to return a member size This should only be used on init, as the size is then stored in status As long as the MiniCluster is not created, the actual spec size won't be used again.

func (*Member) StringToBooleanOption

func (m *Member) StringToBooleanOption(
	key string,
	defaultValue bool,
) bool

getStringOption returns a string option from the member

func (*Member) Type

func (m *Member) Type() string

Helper function get member type

type Sidecar

type Sidecar struct {

	// Baseimage for the sidecar that will monitor the queue.
	// Ensure that the operating systems match!
	// +kubebuilder:default="ghcr.io/converged-computing/ensemble-operator-api:rockylinux9"
	// +default="ghcr.io/converged-computing/ensemble-operator-api:rockylinux9"
	// +optional
	Image string `json:"image"`

	// Always pull the sidecar container (useful for development)
	// +optional
	PullAlways bool `json:"pullAlways"`

	// +kubebuilder:default="50051"
	// +default="50051"
	Port string `json:"port"`

	// +kubebuilder:default=10
	// +default=10
	Workers int32 `json:"workers"`
}

func (*Sidecar) DeepCopy

func (in *Sidecar) DeepCopy() *Sidecar

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

func (*Sidecar) DeepCopyInto

func (in *Sidecar) DeepCopyInto(out *Sidecar)

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