Skip to content

Commit

Permalink
feat: Add ModelRegistry component (opendatahub-io#775) (opendatahub-i…
Browse files Browse the repository at this point in the history
…o#776)

Squashed commit due to buildability since ComponentInterface has
changed.

Other patches squashed as well to avoid double squashing due to
merge policy.

modelregistry: regenerate autogenerated files

Run `make generate manifests` after all the changes

Signed-off-by: Yauheni Kaliuta <[email protected]>

feat: Add ModelRegistry component (opendatahub-io#775) (opendatahub-io#776)

* feat: Add ModelRegistry component (opendatahub-io#775)

* fix: Fix modelregistry odh overlays path

* fix: fix dsc_create_test tests err nil check

* fix: refactor ModelRegistry.ReconcileComponent for new parameters

* chore: added modelregistry to README.md

* fix: add missing rbac rules for deploymentconfigs and daemonsets

* chore: code lint cleanup

* fix: added check for nil DevFlags in model-registry component

* fix: add nil check for dscispec.DevFlags in model-registry ReconcileComponent

* fix: remove RBAC rules for daemonsets and deploymentconfigs

* fix(chore): fix lint errors in dsc_deletion_test.go

(cherry picked from commit 112d3f1)
Signed-off-by: Yauheni Kaliuta <[email protected]>

modelregistry: partial: chore: removes SetImageParamsMap from ComponentInterface (opendatahub-io#897)

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <[email protected]>
Date:   Thu Mar 7 15:43:37 2024 +0100

    chore: removes SetImageParamsMap from ComponentInterface (opendatahub-io#897)

    As it's not used by any component, acting as a simple pass-return loop.

    This makes the API contract a bit cleaner.

Signed-off-by: Yauheni Kaliuta <[email protected]>

modelregistry: partial: chore: remove the need of passing rest config (opendatahub-io#895)

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <[email protected]>
Date:   Fri Mar 8 17:40:54 2024 +0100

    chore: remove the need of passing rest config (opendatahub-io#895)

    * chore: fixes ComponentInterface docs

    By removing reference to non-existing func. This function has been in
    use outside of this component.

    * fix: removes rest config

    As we are already using client.Client interface we do not have to
    instantiate other typed clients to e.g. list resources using their own
    funcs. Generic client.Client is sufficient for these needs.

    Additionally this change adds ctx propogation for these calls.

Signed-off-by: Yauheni Kaliuta <[email protected]>

modelregistry: partial: feat(logger): for both controller level and component level (opendatahub-io#837)

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <[email protected]>
Date:   Mon Apr 1 22:06:16 2024 +0200

    feat(logger): for both controller level and component level (opendatahub-io#837)

    * feat(logger): for both controller level and component level

    Signed-off-by: Wen Zhou <[email protected]>

    * update(logger): use logr instead of uber's zap

    Signed-off-by: Wen Zhou <[email protected]>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <[email protected]>

    * update: use zap.Options for both and tune levels

    Signed-off-by: Wen Zhou <[email protected]>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <[email protected]>
    Signed-off-by: Zhou, Wen <[email protected]>

    ---------

    Signed-off-by: Wen Zhou <[email protected]>
    Signed-off-by: Zhou, Wen <[email protected]>

Signed-off-by: Yauheni Kaliuta <[email protected]>

update(modelregistry): rename image name (opendatahub-io#877)

Signed-off-by: Wen Zhou <[email protected]>
(cherry picked from commit b4e4d6f)

modelregistry: partial: chore: cleanup duplicated functions packages and add more for godoc (opendatahub-io#981)

Partial application of already applied

commit 96c85f2
Author: Wen Zhou <[email protected]>
Date:   Tue Apr 23 14:05:24 2024 +0200

    chore: cleanup duplicated functions packages and add more for godoc (opendatahub-io#981)

    * chore: cleanup duplicated functions/package and add godoc

    - move GetPlatform() from deploy package to cluster package
    - move const ManagedRhods SelfManagedRhods OpenDataHub from deploy to cluster package
    - move WaitForDeploymentAvailable() monitoring package to cluster package
    - remove monitoring package
    - move UpdatePodSecurityRolebinding() from common package to cluster package
    - deprecate GetDomain from common package, to only use GetDomain from cluster package.
    - remove gvk package, move its GVK to cluster package
    - move DeleteExistingSubscription() from deploy package to upgrade package
    - do not export getSubscription()

    Signed-off-by: Wen Zhou <[email protected]>

    * update: remove gvk into one file but under cluster package

    Signed-off-by: Wen Zhou <[email protected]>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <[email protected]>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <[email protected]>

    ---------

    Signed-off-by: Wen Zhou <[email protected]>

Signed-off-by: Yauheni Kaliuta <[email protected]>

feat(mr): create namespace for Model Registry (opendatahub-io#930)

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <[email protected]>

* fix: rebase

Signed-off-by: Zhou, Wen <[email protected]>

* update: code review comments

Signed-off-by: Wen Zhou <[email protected]>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <[email protected]>

* update: remove label to keep namespace even opreator is uninstalled

Signed-off-by: Wen Zhou <[email protected]>

---------

Signed-off-by: Wen Zhou <[email protected]>
Signed-off-by: Zhou, Wen <[email protected]>
(cherry picked from commit 1188ce1)

feat(mr): add model registry odh extras manifests, fixes RHOAIENG-5112 (opendatahub-io#953)

(cherry picked from commit 7c3e81b)

modelregistry: partial: chore: Open up util functions for context propagation (opendatahub-io#1033)

Partial application of already applied

commit 105adae
Author: Aslak Knutsen <[email protected]>
Date:   Tue Jun 4 15:16:21 2024 +0200

    chore: Open up util functions for context propagation (opendatahub-io#1033)

    context should be determined by the caller and propagated
    down the call chain.

Signed-off-by: Yauheni Kaliuta <[email protected]>

modelregistry: partial: chore: remove duplicated platform call in each component (opendatahub-io#1055)

Partial application of already applied

commit 1b04761
Author: Wen Zhou <[email protected]>
Date:   Fri Jun 14 14:47:33 2024 +0200

    chore: remove duplicated platform call in each component (opendatahub-io#1055)

    - get in DSC and pass into compoment

    Signed-off-by: Wen Zhou <[email protected]>

Signed-off-by: Yauheni Kaliuta <[email protected]>

modelregistry: update api docs

run `make api-docs`
add +groupName=datasciencecluster.opendatahub.io

On backporting of
1b86e42 ("Update readme.md  (opendatahub-io#890)")

Signed-off-by: Yauheni Kaliuta <[email protected]>

modelregistry: partial: chore(lint): enable contextcheck and containedctx (opendatahub-io#1070)

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <[email protected]>
Date:   Tue Jun 25 17:15:13 2024 +0200

    chore(lint): enable contextcheck and containedctx (opendatahub-io#1070)

    * chore(lint): enable contextcheck

    Signed-off-by: Luca Burgazzoli <[email protected]>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <[email protected]>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <[email protected]>

Signed-off-by: Yauheni Kaliuta <[email protected]>

refactor: dashboard with new manifests structure (opendatahub-io#1065)

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <[email protected]>
Date:   Tue Jul 2 16:56:25 2024 +0200

    refactor: dashboard with new manifests structure (opendatahub-io#1065)

    * refactor: dashboard with new manifests structure

    - change type of platform, skip convert to string
    - add more support for ApplyParam() to
      not only take ENV but also anything from ExtraParamMaps
    * update: simplify override function
    * update: add value for Unknown platform
    ---------

    Signed-off-by: Wen Zhou <[email protected]>

Signed-off-by: Yauheni Kaliuta <[email protected]>

feat: add managed model registry prometheus config handling logic, part of RHOAIENG-4273 (opendatahub-io#1150)

(cherry picked from commit 72fc80f)

Adjusted Kueue and TrainingOperator rules

Signed-off-by: Yauheni Kaliuta <[email protected]>

feat: add default cert for model registry, fixes RHOAIENG-9909 (opendatahub-io#1165)

Conflicts: ApplyParams arguments due to missing:
  d84cd33 ("update: remove unnecessary param from ApplyParams() (opendatahub-io#1180)")

* feat: add default cert for model registry, fixes RHOAIENG-9909

* fix: fixed lint errors

* fix: add servicemesh feature check for MR, add MR enable check in e2e default cert test

* fix: changed MR servicemesh status check to look for Managed state

* fix: ignore missing model-registry default cert if already removed

(cherry picked from commit 4c411a6)

feat: add servicemeshmember for model registry namespace, fixes RHOAIENG-11831 (opendatahub-io#1202)

* feat: add servicemeshmember for model registry namespace, fixes RHOAIENG-11831

* fix: ignore error if MR smm already exists

* code cleanup for readability

Co-authored-by: Bartosz Majsak <[email protected]>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <[email protected]>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <[email protected]>
(cherry picked from commit 8f3d013)

feat: add managed model registry prometheus job, metrics, and alering rules, fixes RHOAIENG-4273

(cherry picked from commit f811d67)

modelregistry: partial: fix: add check for all platform offering on components

Partial application of

ab7e04e ("fix: add check for all platform offering on components (opendatahub-io#1205)")

ModelRegistry related.

Signed-off-by: Yauheni Kaliuta <[email protected]>

feat: added shared registries namespace property in model registry dsc component, fixes RHOAIENG-12335 (opendatahub-io#1221)

* feat: added shared registries namespace property in model registry dsc component, fixes RHOAIENG-12335

Signed-off-by: Dhiraj Bokde <[email protected]>

* fix: added registriesNamespace property in references to model registry component in docs, samples, etc.

Signed-off-by: Dhiraj Bokde <[email protected]>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <[email protected]>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <[email protected]>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <[email protected]>

* debug: make registriesNamespace omitempty so apiserver will set the default value, clean testDSCCreation with more log messages

Signed-off-by: Dhiraj Bokde <[email protected]>

* update: modelregistry with namespace

- add namespace for rhoai case
- remove omitemptry on namespace: if user does not set it, it will get default value to use.
  since its type is string

Signed-off-by: Wen Zhou <[email protected]>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <[email protected]>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <[email protected]>

* fix: make registriesNamespace immutability check dynamic in cel validation rule

* fix: refactor validation rule, set registriesNamespace to optional, add patch func in modelregistry to set default value

* fix: add defaulting webhook including envtest, remove patch from modelregistry component

* fix: add namespace name pattern for registriesNamespace, allow empty string to replace with default value

* fix: use unique webhook names

* fix: don't change existing validating webhook name to avoid upgrade issues

* feat: add model registry registriesNamespace in DSC status

* update:

- move ModelRegistryStatus from ModelReg into status
- update validation rule for namespace:
  - when update is to removed/unmanaged modelreg: regardless previous state, can change name and set to removed
  - upgrade 2.13 to 2.14 when no NS set in 2.13
  - when update is from remove/unmanaged: e.g change from removed to managed and change name at the same tie
  - keep same namespace, regardless state
- reduce print on passed allowed webhook request
- set to omitemptry so required is not add in the CSV
- fix review comments:
  - move update status after reconcile is successful
  - set to use const for caching on ModeReg namespace

Signed-off-by: Wen Zhou <[email protected]>

---------

Signed-off-by: Dhiraj Bokde <[email protected]>
Signed-off-by: Wen Zhou <[email protected]>
Co-authored-by: Wen Zhou <[email protected]>
(cherry picked from commit dd3df21)

fix: only replace/set default model reg namespace by webhook if component is enabled

- when modelreg is not set in DSC
- when modelreg is set to be Removed
these two cases should not block operation, for backwards compataible

Signed-off-by: Wen Zhou <[email protected]>
(cherry picked from commit 03f6c0b)
  • Loading branch information
dhirajsb authored and ykaliuta committed Sep 18, 2024
1 parent b5902ba commit 270971d
Show file tree
Hide file tree
Showing 28 changed files with 959 additions and 30 deletions.
1 change: 1 addition & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ resources:
path: github.com/opendatahub-io/opendatahub-operator/v2/apis/datasciencecluster/v1
version: v1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
version: "3"
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,17 @@ spec:
managementState: Managed
modelmeshserving:
managementState: Managed
modelregistry:
managementState: Managed
registriesNamespace: "odh-model-registries"
ray:
managementState: Managed
trainingoperator:
managementState: Managed
workbenches:
managementState: Managed
modelregistry:
managementState: Managed
```

2. Enable only Dashboard and Workbenches
Expand Down
15 changes: 15 additions & 0 deletions apis/datasciencecluster/v1/datasciencecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ import (
"github.com/opendatahub-io/opendatahub-operator/v2/components/kserve"
"github.com/opendatahub-io/opendatahub-operator/v2/components/kueue"
"github.com/opendatahub-io/opendatahub-operator/v2/components/modelmeshserving"
"github.com/opendatahub-io/opendatahub-operator/v2/components/modelregistry"
"github.com/opendatahub-io/opendatahub-operator/v2/components/ray"
"github.com/opendatahub-io/opendatahub-operator/v2/components/trainingoperator"
"github.com/opendatahub-io/opendatahub-operator/v2/components/trustyai"
"github.com/opendatahub-io/opendatahub-operator/v2/components/workbenches"
"github.com/opendatahub-io/opendatahub-operator/v2/controllers/status"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/cluster"
)

Expand Down Expand Up @@ -80,6 +82,15 @@ type Components struct {

//Training Operator component configuration.
TrainingOperator trainingoperator.TrainingOperator `json:"trainingoperator,omitempty"`

// ModelRegistry component configuration.
ModelRegistry modelregistry.ModelRegistry `json:"modelregistry,omitempty"`
}

// ComponentsStatus defines the custom status of DataScienceCluster components.
type ComponentsStatus struct {
// ModelRegistry component status
ModelRegistry *status.ModelRegistryStatus `json:"modelregistry,omitempty"`
}

// DataScienceClusterStatus defines the observed state of DataScienceCluster.
Expand All @@ -101,6 +112,10 @@ type DataScienceClusterStatus struct {
// List of components with status if installed or not
InstalledComponents map[string]bool `json:"installedComponents,omitempty"`

// Expose component's specific status
// +optional
Components ComponentsStatus `json:"components,omitempty"`

// Version and release type
Release cluster.Release `json:"release,omitempty"`
}
Expand Down
23 changes: 23 additions & 0 deletions apis/datasciencecluster/v1/zz_generated.deepcopy.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,63 @@ spec:
pattern: ^(Managed|Unmanaged|Force|Removed)$
type: string
type: object
modelregistry:
description: ModelRegistry component configuration.
properties:
devFlags:
description: Add developer fields
properties:
manifests:
description: List of custom manifests for the given component
items:
properties:
contextDir:
default: ""
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
sourcePath:
default: ""
description: 'sourcePath is the subpath within contextDir
where kustomize builds start. Examples include
any sub-folder or path: `base`, `overlays/dev`,
`default`, `odh` etc'
type: string
uri:
default: ""
description: uri is the URI point to a git repo
with tag/branch. e.g https://github.com/org/repo/tarball/<tag/branch>
type: string
type: object
type: array
type: object
managementState:
description: "Set to one of the following values: \n - \"Managed\"
: the operator is actively managing the component and trying
to keep it active. It will only upgrade the component if
it is safe to do so \n - \"Removed\" : the operator is actively
managing the component and will not install it, or if it
is installed, the operator will try to remove it"
enum:
- Managed
- Removed
pattern: ^(Managed|Unmanaged|Force|Removed)$
type: string
registriesNamespace:
default: odh-model-registries
description: Namespace for model registries to be installed,
configurable only once when model registry is enabled, defaults
to "odh-model-registries"
maxLength: 63
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?)?$
type: string
type: object
x-kubernetes-validations:
- message: RegistriesNamespace is immutable when model registry
is Managed
rule: (self.managementState != 'Managed') || (oldSelf.registriesNamespace
== '') || (oldSelf.managementState != 'Managed')|| (self.registriesNamespace
== oldSelf.registriesNamespace)
ray:
description: Ray component configuration.
properties:
Expand Down Expand Up @@ -566,6 +623,16 @@ spec:
status:
description: DataScienceClusterStatus defines the observed state of DataScienceCluster.
properties:
components:
description: Expose component's specific status
properties:
modelregistry:
description: ModelRegistry component status
properties:
registriesNamespace:
type: string
type: object
type: object
conditions:
description: Conditions describes the state of the DataScienceCluster
resource.
Expand Down
50 changes: 50 additions & 0 deletions bundle/manifests/rhods-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ metadata:
"modelmeshserving": {
"managementState": "Managed"
},
"modelregistry": {
"managementState": "Managed"
"registriesNamespace": "odh-model-registries"
},
"ray": {
"managementState": "Managed"
},
Expand Down Expand Up @@ -1032,6 +1036,32 @@ spec:
- update
- use
- watch
- apiGroups:
- modelregistry.opendatahub.io
resources:
- modelregistries
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- modelregistry.opendatahub.io
resources:
- modelregistries/finalizers
verbs:
- update
- apiGroups:
- modelregistry.opendatahub.io
resources:
- modelregistries/status
verbs:
- get
- patch
- update
- apiGroups:
- monitoring.coreos.com
resources:
Expand Down Expand Up @@ -1793,6 +1823,26 @@ spec:
name: Red Hat
version: 2.14.0
webhookdefinitions:
- admissionReviewVersions:
- v1
containerPort: 443
deploymentName: opendatahub-operator-controller-manager
failurePolicy: Fail
generateName: mutate.operator.opendatahub.io
rules:
- apiGroups:
- datasciencecluster.opendatahub.io
apiVersions:
- v1
operations:
- CREATE
- UPDATE
resources:
- datascienceclusters
sideEffects: None
targetPort: 9443
type: MutatingAdmissionWebhook
webhookPath: /mutate-opendatahub-io-v1
- admissionReviewVersions:
- v1
containerPort: 443
Expand Down
2 changes: 2 additions & 0 deletions components/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ func (c *Component) UpdatePrometheusConfig(_ client.Client, logger logr.Logger,
TrustyAIARules string `yaml:"trustyai-alerting.rules"`
KserveRRules string `yaml:"kserve-recording.rules"`
KserveARules string `yaml:"kserve-alerting.rules"`
ModelRegistryRRules string `yaml:"model-registry-operator-recording.rules"`
ModelRegistryARules string `yaml:"model-registry-operator-alerting.rules"`
} `yaml:"data"`
}
var configMap ConfigMap
Expand Down
Loading

0 comments on commit 270971d

Please sign in to comment.