Skip to content

Commit

Permalink
Map component versions to RHOAI status for better visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ugiordan committed Jan 27, 2025
1 parent 63d4eab commit 1e08139
Show file tree
Hide file tree
Showing 52 changed files with 1,281 additions and 28 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and configure these applications.
- [Usage](#usage)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Configuration](#configuration)
- [Developer Guide](#developer-guide)
- [Pre-requisites](#pre-requisites)
- [Download manifests](#download-manifests)
Expand Down Expand Up @@ -74,6 +75,26 @@ Additionally installing `Authorino operator` & `Service Mesh operator` enhances

3. Create [DataScienceCluster](#example-datasciencecluster) CR to enable components


### Configuration

- in ODH 2.23.1, we introduced a new feature which allows user to use their own application namespace than default one "opendatahub".

1. for new cluster, as this cluster has not been used for ODH or RHOAI.
Here we use namespace A for example as targeted application namespace, please follow below steps before install ODH operator:

- create namespace A
- add label `opendatahub.io/application-namespace: true` onto namespace A. Only one namespace in the cluster can have this label.
- install ODH operator either from UI or by GitOps/CLI
- once Operator is up and running, manually create DSCI CR by set `.spec.applicationsNamespace:A`
- wait till DSCI status update to "Ready"
- continue to create DSC CR

2. for upgrade case, as ODH is running in the cluster.

Be aware: to switch to a different application namespace can cause more issues and require manual cleanup, therefore we suggest this to be done for new cluster.


## Developer Guide

#### Pre-requisites
Expand Down
16 changes: 16 additions & 0 deletions apis/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package common

import (
operatorv1 "github.com/openshift/api/operator/v1"
"github.com/operator-framework/api/pkg/lib/version"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand Down Expand Up @@ -70,6 +71,16 @@ type Status struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`
}

// ComponentReleaseStatus represents the detailed status of a component release.
// +kubebuilder:object:generate=true
type ComponentReleaseStatus struct {
// +required
// +kubebuilder:validation:Required
Name string `json:"name"`
Version version.OperatorVersion `json:"version,omitempty"`
RepoURL string `json:"repoUrl,omitempty"`
}

type WithStatus interface {
GetStatus() *Status
}
Expand All @@ -78,6 +89,11 @@ type WithDevFlags interface {
GetDevFlags() *DevFlags
}

type WithReleases interface {
GetReleaseStatus() *[]ComponentReleaseStatus
SetReleaseStatus(status []ComponentReleaseStatus)
}

type PlatformObject interface {
client.Object
WithStatus
Expand Down
16 changes: 16 additions & 0 deletions apis/common/zz_generated.deepcopy.go

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

11 changes: 11 additions & 0 deletions apis/components/v1alpha1/codeflare_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ const (

// CodeFlareCommonStatus defines the shared observed state of CodeFlare
type CodeFlareCommonStatus struct {
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// CodeFlareStatus defines the observed state of CodeFlare
Expand Down Expand Up @@ -70,6 +75,12 @@ func (c *CodeFlare) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *CodeFlare) GetReleaseStatus() *[]common.ComponentReleaseStatus { return &c.Status.Releases }

func (c *CodeFlare) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

func init() {
SchemeBuilder.Register(&CodeFlare{}, &CodeFlareList{})
}
Expand Down
11 changes: 11 additions & 0 deletions apis/components/v1alpha1/dashboard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ type DashboardSpec struct {
// DashboardCommonStatus defines the shared observed state of Dashboard
type DashboardCommonStatus struct {
URL string `json:"url,omitempty"`
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// DashboardStatus defines the observed state of Dashboard
Expand Down Expand Up @@ -79,6 +84,12 @@ func (c *Dashboard) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *Dashboard) GetReleaseStatus() *[]common.ComponentReleaseStatus { return &c.Status.Releases }

func (c *Dashboard) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// +kubebuilder:object:root=true

// DashboardList contains a list of Dashboard
Expand Down
13 changes: 13 additions & 0 deletions apis/components/v1alpha1/datasciencepipelines_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ type DataSciencePipelinesCommonSpec struct {

// DataSciencePipelinesCommonStatus defines the shared observed state of DataSciencePipelines
type DataSciencePipelinesCommonStatus struct {
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// DataSciencePipelinesStatus defines the observed state of DataSciencePipelines
Expand All @@ -71,6 +76,14 @@ func (c *DataSciencePipelines) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *DataSciencePipelines) GetReleaseStatus() *[]common.ComponentReleaseStatus {
return &c.Status.Releases
}

func (c *DataSciencePipelines) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// +kubebuilder:object:root=true

// DataSciencePipelinesList contains a list of DataSciencePipelines
Expand Down
13 changes: 13 additions & 0 deletions apis/components/v1alpha1/kserve_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ type KserveCommonStatus struct {
// DefaultDeploymentMode is the value of the defaultDeploymentMode field
// as read from the "deploy" JSON in the inferenceservice-config ConfigMap
DefaultDeploymentMode string `json:"defaultDeploymentMode,omitempty"`
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// KserveStatus defines the observed state of Kserve
Expand Down Expand Up @@ -109,6 +114,14 @@ func (c *Kserve) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *Kserve) GetReleaseStatus() *[]common.ComponentReleaseStatus {
return &c.Status.Releases
}

func (c *Kserve) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// +kubebuilder:object:root=true

// KserveList contains a list of Kserve
Expand Down
12 changes: 12 additions & 0 deletions apis/components/v1alpha1/kueue_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ type KueueCommonSpec struct {

// KueueCommonStatus defines the shared observed state of Kueue
type KueueCommonStatus struct {
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// KueueStatus defines the observed state of Kueue
Expand All @@ -80,10 +85,17 @@ func init() {
func (c *Kueue) GetDevFlags() *common.DevFlags {
return c.Spec.DevFlags
}

func (c *Kueue) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *Kueue) GetReleaseStatus() *[]common.ComponentReleaseStatus { return &c.Status.Releases }

func (c *Kueue) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// DSCKueue contains all the configuration exposed in DSC instance for Kueue component
type DSCKueue struct {
common.ManagementSpec `json:",inline"`
Expand Down
14 changes: 14 additions & 0 deletions apis/components/v1alpha1/modelmeshserving_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ type ModelMeshServingCommonSpec struct {

// ModelMeshServingCommonStatus defines the shared observed state of ModelMeshServing
type ModelMeshServingCommonStatus struct {
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// ModelMeshServingStatus defines the observed state of ModelMeshServing
Expand All @@ -80,10 +85,19 @@ func init() {
func (c *ModelMeshServing) GetDevFlags() *common.DevFlags {
return c.Spec.DevFlags
}

func (c *ModelMeshServing) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *ModelMeshServing) GetReleaseStatus() *[]common.ComponentReleaseStatus {
return &c.Status.Releases
}

func (c *ModelMeshServing) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// DSCModelMeshServing contains all the configuration exposed in DSC instance for ModelMeshServing component
type DSCModelMeshServing struct {
common.ManagementSpec `json:",inline"`
Expand Down
11 changes: 10 additions & 1 deletion apis/components/v1alpha1/modelregistry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ type ModelRegistrySpec struct {

// ModelRegistryCommonStatus defines the shared observed state of ModelRegistry
type ModelRegistryCommonStatus struct {
RegistriesNamespace string `json:"registriesNamespace,omitempty"`
RegistriesNamespace string `json:"registriesNamespace,omitempty"`
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// ModelRegistryStatus defines the observed state of ModelRegistry
Expand Down Expand Up @@ -83,6 +84,14 @@ func (c *ModelRegistry) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *ModelRegistry) GetReleaseStatus() *[]common.ComponentReleaseStatus {
return &c.Status.Releases
}

func (c *ModelRegistry) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// +kubebuilder:object:root=true

// ModelRegistryList contains a list of ModelRegistry
Expand Down
12 changes: 12 additions & 0 deletions apis/components/v1alpha1/ray_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ type RayCommonSpec struct {

// RayCommonStatus defines the shared observed state of Ray
type RayCommonStatus struct {
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// RayStatus defines the observed state of Ray
Expand All @@ -80,10 +85,17 @@ func init() {
func (c *Ray) GetDevFlags() *common.DevFlags {
return c.Spec.DevFlags
}

func (c *Ray) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *Ray) GetReleaseStatus() *[]common.ComponentReleaseStatus { return &c.Status.Releases }

func (c *Ray) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// DSCRay contains all the configuration exposed in DSC instance for Ray component
type DSCRay struct {
common.ManagementSpec `json:",inline"`
Expand Down
14 changes: 14 additions & 0 deletions apis/components/v1alpha1/trainingoperator_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ type TrainingOperatorCommonSpec struct {

// TrainingOperatorCommonStatus defines the shared observed state of TrainingOperator
type TrainingOperatorCommonStatus struct {
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// TrainingOperatorStatus defines the observed state of TrainingOperator
Expand All @@ -80,10 +85,19 @@ func init() {
func (c *TrainingOperator) GetDevFlags() *common.DevFlags {
return c.Spec.DevFlags
}

func (c *TrainingOperator) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *TrainingOperator) GetReleaseStatus() *[]common.ComponentReleaseStatus {
return &c.Status.Releases
}

func (c *TrainingOperator) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// DSCTrainingOperator contains all the configuration exposed in DSC instance for TrainingOperator component
type DSCTrainingOperator struct {
common.ManagementSpec `json:",inline"`
Expand Down
12 changes: 12 additions & 0 deletions apis/components/v1alpha1/trustyai_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ type TrustyAICommonSpec struct {

// TrustyAICommonStatus defines the shared observed state of TrustyAI
type TrustyAICommonStatus struct {
// +patchMergeKey=name
// +patchStrategy=merge
// +listType=map
// +listMapKey=name
Releases []common.ComponentReleaseStatus `json:"releases,omitempty"`
}

// TrustyAIStatus defines the observed state of TrustyAI
Expand All @@ -80,10 +85,17 @@ func init() {
func (c *TrustyAI) GetDevFlags() *common.DevFlags {
return c.Spec.DevFlags
}

func (c *TrustyAI) GetStatus() *common.Status {
return &c.Status.Status
}

func (c *TrustyAI) GetReleaseStatus() *[]common.ComponentReleaseStatus { return &c.Status.Releases }

func (c *TrustyAI) SetReleaseStatus(releases []common.ComponentReleaseStatus) {
c.Status.Releases = releases
}

// DSCTrustyAI contains all the configuration exposed in DSC instance for TrustyAI component
type DSCTrustyAI struct {
common.ManagementSpec `json:",inline"`
Expand Down
Loading

0 comments on commit 1e08139

Please sign in to comment.