Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ resources:
kind: Descheduling
path: github.com/cobaltcore-dev/cortex/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
controller: true
domain: cortex
group: cortex.cloud
kind: Step
path: github.com/cobaltcore-dev/cortex/api/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
controller: true
Expand Down
1 change: 1 addition & 0 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ helm_repo(
)

########### Dependency CRDs
# Make sure the local cluster is running if you are running into startup issues here.
url = 'https://raw.githubusercontent.com/cobaltcore-dev/openstack-hypervisor-operator/refs/heads/main/charts/openstack-hypervisor-operator/crds/hypervisor-crd.yaml'
local('curl ' + url + ' | kubectl apply -f -')

Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/decision_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type DecisionSpec struct {

type StepResult struct {
// object reference to the scheduler step.
StepRef corev1.ObjectReference `json:"stepRef"`
StepName string `json:"stepName"`
// Activations of the step for each host.
Activations map[string]float64 `json:"activations"`
}
Expand Down
55 changes: 51 additions & 4 deletions api/v1alpha1/pipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,58 @@ package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)

type StepInPipeline struct {
// Reference to the step.
Ref corev1.ObjectReference `json:"ref"`
type DisabledValidationsSpec struct {
// Whether to validate that no subjects are removed or added from the scheduler
// step. This should only be disabled for scheduler steps that remove subjects.
// Thus, if no value is provided, the default is false.
SameSubjectNumberInOut bool `json:"sameSubjectNumberInOut,omitempty"`
// Whether to validate that, after running the step, there are remaining subjects.
// This should only be disabled for scheduler steps that are expected to
// remove all subjects.
SomeSubjectsRemain bool `json:"someSubjectsRemain,omitempty"`
}

type StepType string

const (
// Step for assigning weights to hosts.
StepTypeWeigher StepType = "weigher"
// Step for filtering hosts.
StepTypeFilter StepType = "filter"
// Step for generating descheduling recommendations.
StepTypeDescheduler StepType = "descheduler"
)

type WeigherSpec struct {
// The validations to disable for this step. If none are provided, all
// applied validations are enabled.
// +kubebuilder:validation:Optional
DisabledValidations DisabledValidationsSpec `json:"disabledValidations,omitempty"`
}

type StepSpec struct {
// The type of the scheduler step.
Type StepType `json:"type"`
// If the type is "weigher", this contains additional configuration for it.
// +kubebuilder:validation:Optional
Weigher *WeigherSpec `json:"weigher,omitempty"`

// The name of the scheduler step in the cortex implementation.
Impl string `json:"impl"`
// Additional configuration for the extractor that can be used
// +kubebuilder:validation:Optional
Opts runtime.RawExtension `json:"opts,omitempty"`
// Knowledges this step depends on to be ready.
// +kubebuilder:validation:Optional
Knowledges []corev1.ObjectReference `json:"knowledges,omitempty"`
// Additional description of the step which helps understand its purpose
// and decisions made by it.
// +kubebuilder:validation:Optional
Description string `json:"description,omitempty"`

// Whether this step is mandatory for the pipeline to be runnable.
// +kubebuilder:default=true
Mandatory bool `json:"mandatory"`
Expand Down Expand Up @@ -41,7 +88,7 @@ type PipelineSpec struct {
// The type of the pipeline.
Type PipelineType `json:"type"`
// The ordered list of steps that make up this pipeline.
Steps []StepInPipeline `json:"steps,omitempty"`
Steps []StepSpec `json:"steps,omitempty"`
}

const (
Expand Down
126 changes: 0 additions & 126 deletions api/v1alpha1/step_types.go

This file was deleted.

104 changes: 4 additions & 100 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading