v1alpha1

package
v0.0.0-...-e41f01c Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the jobs v1alpha1 API group +kubebuilder:object:generate=true +groupName=jobs.converged-computing.org

Index

Constants

View Source
const (
	JobWrappedPod JobWrapped = iota
	JobWrappedJob

	SubmitStatusNew    SubmitStatus = "statusNew"
	SubmitStatusSubmit SubmitStatus = "statusSubmit"
	SubmitStatusError  SubmitStatus = "statusError"
	SubmitStatusCancel SubmitStatus = "statusCancel"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "jobs.converged-computing.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

func GetJobName

func GetJobName(jobType JobWrapped, name string) string

GetJobName creates a job name that appends the type

func NewMutatingWebhook

func NewMutatingWebhook(mainManager manager.Manager) *jobReceiver

NewMutatingWebhook allows us to keep the jobReceiver private If it's public it's exported and kubebuilder tries to add to zz_generated_deepcopy and you get all kinds of terrible errors about admission.Decoder missing DeepCopyInto

func SubmitFluxJob

func SubmitFluxJob(
	ctx context.Context,
	jobType JobWrapped,
	name string,
	namespace string,
	nodes int32,
	containers []corev1.Container,
) error

SubmitFluxJob wraps a pod or job spec into a FluxJob We essentially create a CRD for a a FluxJob

Types

type FluxJob

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

	Spec   FluxJobSpec   `json:"spec,omitempty"`
	Status FluxJobStatus `json:"status,omitempty"`
}

FluxJob is the Schema for the fluxjobs API

func (*FluxJob) DeepCopy

func (in *FluxJob) DeepCopy() *FluxJob

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

func (*FluxJob) DeepCopyInto

func (in *FluxJob) DeepCopyInto(out *FluxJob)

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

func (*FluxJob) DeepCopyObject

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

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

type FluxJobList

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

FluxJobList contains a list of FluxJob

func (*FluxJobList) DeepCopy

func (in *FluxJobList) DeepCopy() *FluxJobList

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

func (*FluxJobList) DeepCopyInto

func (in *FluxJobList) DeepCopyInto(out *FluxJobList)

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

func (*FluxJobList) DeepCopyObject

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

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

type FluxJobSpec

type FluxJobSpec struct {

	// JobSpec is the Flux jobspec
	// +optional
	JobSpec string `json:"jobspec,omitempty"`

	// Type of object that is wrapped
	// +optional
	Type JobWrapped `json:"type"`

	// Original name of the job
	// +optional
	Name string `json:"name"`

	// Object is the underlying pod/job/object specification
	// This currently is assumed that one job has equivalent pods under it
	// +optional
	Object []byte `json:"object,omitempty"`

	// Duration is the maximum runtime of the job
	// +optional
	Duration int32 `json:"duration,omitempty"`

	// If true, we are allowed to ask fluxion for
	// a reservation
	// +optional
	Reservation bool `json:"reservation,omitempty"`

	// Nodes needed for the job
	// +optional
	Nodes int32 `json:"nodes"`

	// Resources assigned
	// +optional
	Resources Resources `json:"resources"`
}

FluxJobSpec defines the desired state of FluxJob A user is not expected to create these -

  1. A job or similar will be submit
  2. It will be intercepted by a webhook here
  3. The webhook will generate the object
  4. The job will go into the fluxqueue
  5. When scheduled, it gets sent with an exact node assignment to the custom scheduler plugin.
  6. Cleanup will need to be handled

A FluxJob is a mapping of a Kubernetes abstraction (e.g., job) into a Flux JobSpec, one that Fluxion can digest.

func (*FluxJobSpec) DeepCopy

func (in *FluxJobSpec) DeepCopy() *FluxJobSpec

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

func (*FluxJobSpec) DeepCopyInto

func (in *FluxJobSpec) DeepCopyInto(out *FluxJobSpec)

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

type FluxJobStatus

type FluxJobStatus struct {
	SubmitStatus SubmitStatus `json:"submitStatus,omitempty"`
}

FluxJobStatus defines the observed state of FluxJob

func (*FluxJobStatus) DeepCopy

func (in *FluxJobStatus) DeepCopy() *FluxJobStatus

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

func (*FluxJobStatus) DeepCopyInto

func (in *FluxJobStatus) DeepCopyInto(out *FluxJobStatus)

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

type JobWrapped

type JobWrapped int

"Enum" to determine what we are wrapping

func (JobWrapped) String

func (w JobWrapped) String() string

String returns the stringified type

type Resources

type Resources struct {

	// Nodes assigned to the job
	// +optional
	Nodes []string `json:"nodes"`
}

func (*Resources) DeepCopy

func (in *Resources) DeepCopy() *Resources

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

func (*Resources) DeepCopyInto

func (in *Resources) DeepCopyInto(out *Resources)

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

type SubmitStatus

type SubmitStatus string

Jump to

Keyboard shortcuts

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