Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme.md #890

Merged
merged 10 commits into from
Mar 11, 2024
Merged

Conversation

AjayJagan
Copy link
Contributor

Updates the Readme.md file.

Description

  • Pre-requisite operators and their installation for every component
  • API documentation of every field in DSCI and DSC

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@openshift-ci openshift-ci bot requested review from aslakknutsen and dhirajsb March 5, 2024 10:40
README.md Outdated
You can also use operator to create default DSCI CR by removing env variable DISABLE_DSC_CONFIG from CSV following restart operator pod.

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

### API overview
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How was this overview created? Is there a command or something that could be included in the Makefile or similar. Else I suspect this will be out of date before this commit hit the main branch..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to do it manually 😓

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess whenever a new section in the API is created, it can be updated right. We can add it as a guideline in the contribution docs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AjayJagan Can you see a way to make it into a command? What's the source for the info?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source is the the CRDs generated in the manifests folder

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bartoszmajsak I'd hold of a little on it just because.. maybe, just maybe we'll include it in api with some upcoming feature rework.. hehe

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AjayJagan hmm.. yeah, it's not really it's own group but part of DSCI.. What happens if you copy the groupversion_info.go from the dsci folder over to infrastructure as well?

@bartoszmajsak Was it perhaps intended that it could be included on both dsci and dsc level? It seems to only be dsci atm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aslakknutsen Yep that works :D

Copy link
Contributor

@bartoszmajsak bartoszmajsak Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it perhaps intended that it could be included on both dsci and dsc level? It seems to only be dsci atm.

@aslakknutsen it's used in both actually, transitively, e.g.

Serving infrav1.ServingSpec `json:"serving,omitempty"`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in that case, how do we link it to 2 group versions 🤔

@zdtsw
Copy link
Member

zdtsw commented Mar 6, 2024

@AjayJagan just to be sure: we will cover readme https://github.com/opendatahub-io/opendatahub-operator/blob/e7b7c999bfaa24b147d14838dc83873dac17112f/components/README.md too ,or the scope is only for the top readme?

@AjayJagan
Copy link
Contributor Author

@AjayJagan just to be sure: we will cover readme https://github.com/opendatahub-io/opendatahub-operator/blob/e7b7c999bfaa24b147d14838dc83873dac17112f/components/README.md too ,or the scope is only for the top readme?

Sure @zdtsw , I will cover them as well

@AjayJagan AjayJagan force-pushed the update-readme branch 3 times, most recently from 902574d to f8c4b9a Compare March 7, 2024 08:03
@bartoszmajsak
Copy link
Contributor

With #894 now merged I was thinking we that should automate the kubebuilder assets generation and documentation process as a GH Action for example.

From time to time we face the problem that PR gets merged with changes to godoc (or even struct) of CRD, but manifests do not reflect it as we forgot to run appropriate make targets before opening the PR, resulting in a follow-up PR with those changes. Instead of reminding the author to do this manually we can help them with little automation here.

I think we can make a github action reacting on changes of apis/ folder only:

on:
  pull_request:
    paths:
      - 'apis/**'

which will do the following

  • runs make generate manifests
  • if any changes - commit changes with a message e.g. gh-action: updates kubebuilder assets
  • runs make api-docs
  • if any changes - commit changes with a message e.g. gh-action: updates api docs
  • pushes back to PR branch or fail with PR comment if contributors are not allowed to do so

WDYT?

Makefile Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@AjayJagan
Copy link
Contributor Author

With #894 now merged I was thinking we that should automate the kubebuilder assets generation and documentation process as a GH Action for example.

From time to time we face the problem that PR gets merged with changes to godoc (or even struct) of CRD, but manifests do not reflect it as we forgot to run appropriate make targets before opening the PR, resulting in a follow-up PR with those changes. Instead of reminding the author to do this manually we can help them with little automation here.

I think we can make a github action reacting on changes of apis/ folder only:

on:
  pull_request:
    paths:
      - 'apis/**'

which will do the following

  • runs make generate manifests
  • if any changes - commit changes with a message e.g. gh-action: updates kubebuilder assets
  • runs make api-docs
  • if any changes - commit changes with a message e.g. gh-action: updates api docs
  • pushes back to PR branch or fail with PR comment if contributors are not allowed to do so

WDYT?

cool idea! can I include this as a part of this PR itself?

@bartoszmajsak
Copy link
Contributor

can I include this as a part of this PR itself?

@AjayJagan let's avoid scope creep and try to keep PRs focused. I think this would be a good follow-up improvement and if the team agrees this is beneficial for the project by all means go for it. I can help you with some pointers as we did release automation using gh-actions with similar steps (committing stuff back to the PR branch). Here's how it worked in action maistra/istio-workspace#1126 (see comments and commits in the history line)

@AjayJagan
Copy link
Contributor Author

can I include this as a part of this PR itself?

@AjayJagan let's avoid scope creep and try to keep PRs focused. I think this would be a good follow-up improvement and if the team agrees this is beneficial for the project by all means go for it. I can help you with some pointers as we did release automation using gh-actions with similar steps (committing stuff back to the PR branch). Here's how it worked in action maistra/istio-workspace#1126 (see comments and commits in the history line)

Yep makes sense. I can take up the follow up PR. WDYT @VaishnaviHire @zdtsw

README.md Outdated

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

## Dev Preview

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can get rid of Dev Preview section and dev-preview.md. It was created when we did not have odh releases for v2

@@ -63,12 +83,12 @@ Refer [Dev-Preview.md](./docs/Dev-Preview.md) for testing preview features.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given above change, Developer Guide can be moved to --> ## Developer Guide

@VaishnaviHire VaishnaviHire removed the request for review from dhirajsb March 7, 2024 18:05
@AjayJagan AjayJagan force-pushed the update-readme branch 2 times, most recently from 87b08f3 to 52b6c9d Compare March 8, 2024 10:58
@VaishnaviHire
Copy link
Member

/lgtm

Copy link

openshift-ci bot commented Mar 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zdtsw

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Mar 9, 2024
@VaishnaviHire VaishnaviHire merged commit 1b86e42 into opendatahub-io:incubation Mar 11, 2024
6 of 7 checks passed
zdtsw referenced this pull request in zdtsw-forking/rhods-operator Mar 15, 2024
* Update readme.md

* update links to the respective schemas

* use crd-ref-doc for api doc generation

* update readme docs

* update pr based on comments

* change k8s version

* remove dev preview

* update doc to get kserve value

* add @build back in makefile

* add make api-docs under ##@ Development
VaishnaviHire pushed a commit to VaishnaviHire/opendatahub-operator that referenced this pull request Mar 19, 2024
* Update readme.md

* update links to the respective schemas

* use crd-ref-doc for api doc generation

* update readme docs

* update pr based on comments

* change k8s version

* remove dev preview

* update doc to get kserve value

* add @build back in makefile

* add make api-docs under ##@ Development

(cherry picked from commit cb7a6fe)
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Jun 24, 2024
…o#776)

Squashed commit due to buildability since ComponentInterface has changed.

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: update api docs

run `make api-docs`

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

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Jun 24, 2024
…o#776)

Squashed commit due to buildability since ComponentInterface has changed.

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Aug 27, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Aug 27, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(cherry picked from commit 8f3d013)
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Aug 27, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(cherry picked from commit 8f3d013)

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

(cherry picked from commit f811d67)
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Aug 28, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(cherry picked from commit 8f3d013)

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

(cherry picked from commit f811d67)
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Aug 29, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(cherry picked from commit 8f3d013)

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

(cherry picked from commit f811d67)
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Aug 29, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(cherry picked from commit 8f3d013)

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

(cherry picked from commit f811d67)
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 2, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(cherry picked from commit 8f3d013)

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

(cherry picked from commit f811d67)
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 2, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 18, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>

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 <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 18, 2024
…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 <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>

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 <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)

Update autogenerated files

run  `make generate manifests api-docs`

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 20, 2024
…o#776)

Squashed commit due to buildability since ComponentInterface has
changed.

Other patches squashed as well to avoid possible double squashing on
merging.

modelregistry: regenerate autogenerated files

Run `make generate manifests` after all the changes

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>

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 <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)

Update autogenerated files

run  `make generate manifests api-docs`

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: replace odh-model-registries with rhoai-model-registries

Fix names of default registries namespace treewide.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

tests: e2e: disable modelregistry

It is not GA yet, disable for now to avoid possible problems.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

get_all_manifests.sh: modelregistry: use rhoai-2.14 branch

Use versioned branch/tag like other components.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 21, 2024
…o#776)

Squashed commit due to buildability since ComponentInterface has
changed.

Other patches squashed as well to avoid possible double squashing on
merging.

modelregistry: regenerate autogenerated files

Run `make generate manifests` after all the changes

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>

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 <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)

Update autogenerated files

run  `make generate manifests api-docs`

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: replace odh-model-registries with rhoai-model-registries

Fix names of default registries namespace treewide.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

tests: e2e: disable modelregistry

It is not GA yet, disable for now to avoid possible problems.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

get_all_manifests.sh: modelregistry: use rhoai-2.14 branch

Use versioned branch/tag like other components.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

Revert "get_all_manifests.sh: modelregistry: use rhoai-2.14 branch"

There is no yet rhoai-2.14 branch for modelregistry.

This reverts commit 4c7d83a.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 24, 2024
…o#776)

Squashed commit due to buildability since ComponentInterface has
changed.

Other patches squashed as well to avoid possible double squashing on
merging.

modelregistry: regenerate autogenerated files

Run `make generate manifests` after all the changes

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>

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 <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)

Update autogenerated files

run  `make generate manifests api-docs`

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: replace odh-model-registries with rhoai-model-registries

Fix names of default registries namespace treewide.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

tests: e2e: disable modelregistry

It is not GA yet, disable for now to avoid possible problems.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

get_all_manifests.sh: modelregistry: use rhoai-2.14 branch

Use versioned branch/tag like other components.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

Revert "get_all_manifests.sh: modelregistry: use rhoai-2.14 branch"

There is no yet rhoai-2.14 branch for modelregistry.

This reverts commit 4c7d83a.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 24, 2024
…o#776)

Squashed commit due to buildability since ComponentInterface has
changed.

Other patches squashed as well to avoid possible double squashing on
merging.

modelregistry: regenerate autogenerated files

Run `make generate manifests` after all the changes

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>

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 <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)

Update autogenerated files

run  `make generate manifests api-docs`

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: replace odh-model-registries with rhoai-model-registries

Fix names of default registries namespace treewide.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

tests: e2e: disable modelregistry

It is not GA yet, disable for now to avoid possible problems.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

get_all_manifests.sh: modelregistry: use rhoai-2.14 branch

Use versioned branch/tag like other components.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 25, 2024
…o#776)

Squashed commit due to buildability since ComponentInterface has
changed.

Other patches squashed as well to avoid possible double squashing on
merging.

Set management state to Removed since it is not

modelregistry: regenerate autogenerated files

Run `make generate manifests` after all the changes

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>

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 <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)

Update autogenerated files

run  `make generate manifests api-docs`

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: replace odh-model-registries with rhoai-model-registries

Fix names of default registries namespace treewide.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

tests: e2e: disable modelregistry

It is not GA yet, disable for now to avoid possible problems.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

get_all_manifests.sh: modelregistry: use rhoai-2.14 branch

Use versioned branch/tag like other components.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

Update config/samples/datasciencecluster_v1_datasciencecluster.yaml

Co-authored-by: Wen Zhou <wenzhou@redhat.com>

Update bundle/manifests/rhods-operator.clusterserviceversion.yaml

Co-authored-by: Wen Zhou <wenzhou@redhat.com>
ykaliuta pushed a commit to ykaliuta/opendatahub-operator that referenced this pull request Sep 25, 2024
…o#776)

Squashed commit due to buildability since ComponentInterface has
changed.

Other patches squashed as well to avoid possible double squashing on
merging.

Set management state to Removed since it is not

modelregistry: regenerate autogenerated files

Run `make generate manifests` after all the changes

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(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 <aslak@4fs.no>
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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
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 <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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 <ykaliuta@redhat.com>

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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 <ykaliuta@redhat.com>

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 <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)

Update autogenerated files

run  `make generate manifests api-docs`

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: replace odh-model-registries with rhoai-model-registries

Fix names of default registries namespace treewide.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

tests: e2e: disable modelregistry

It is not GA yet, disable for now to avoid possible problems.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

get_all_manifests.sh: modelregistry: use rhoai-2.14 branch

Use versioned branch/tag like other components.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

Update config/samples/datasciencecluster_v1_datasciencecluster.yaml

Co-authored-by: Wen Zhou <wenzhou@redhat.com>

Update bundle/manifests/rhods-operator.clusterserviceversion.yaml

Co-authored-by: Wen Zhou <wenzhou@redhat.com>

modelregistry: keep registriesNamespace as odh except CSV

It makes less divergency with ODH and default does not matter as
soon as CSV has RHOAI version.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
openshift-merge-bot bot referenced this pull request in red-hat-data-services/rhods-operator Sep 26, 2024
Squashed commit due to buildability since ComponentInterface has
changed.

Other patches squashed as well to avoid possible double squashing on
merging.

Set management state to Removed since it is not

modelregistry: regenerate autogenerated files

Run `make generate manifests` after all the changes

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

feat: Add ModelRegistry component (#775) (#776)

* feat: Add ModelRegistry component (#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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d10a764
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
Date:   Thu Mar 7 15:43:37 2024 +0100

    chore: removes SetImageParamsMap from ComponentInterface (#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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit ca7fa98
Author: Bartosz Majsak <bartosz.majsak@gmail.com>
Date:   Fri Mar 8 17:40:54 2024 +0100

    chore: remove the need of passing rest config (#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 <ykaliuta@redhat.com>

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

Partial application of already applied

commit d8a83a2
Author: Wen Zhou <wenzhou@redhat.com>
Date:   Mon Apr 1 22:06:16 2024 +0200

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

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: do not log error only print

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move setting into common function

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>
    Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

update(modelregistry): rename image name (#877)

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(cherry picked from commit b4e4d6f)

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

Partial application of already applied

commit 96c85f2
Author: Wen Zhou <wenzhou@redhat.com>
Date:   Tue Apr 23 14:05:24 2024 +0200

    chore: cleanup duplicated functions packages and add more for godoc (#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 <wenzhou@redhat.com>

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

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: rename variable, removing GVK from it

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    * update: move gvk into a sub package under cluster

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

    ---------

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

* feat(mr): create namespace for smm

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix: rebase

Signed-off-by: Zhou, Wen <wenzhou@redhat.com>

* update: code review comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* fix(doc): wrong comments

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

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

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Zhou, Wen <wenzhou@redhat.com>
(cherry picked from commit 1188ce1)

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

(cherry picked from commit 7c3e81b)

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

Partial application of already applied

commit 105adae
Author: Aslak Knutsen <aslak@4fs.no>
Date:   Tue Jun 4 15:16:21 2024 +0200

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

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

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied

commit 1b04761
Author: Wen Zhou <wenzhou@redhat.com>
Date:   Fri Jun 14 14:47:33 2024 +0200

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

    - get in DSC and pass into compoment

    Signed-off-by: Wen Zhou <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: update api docs

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

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

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Partial application of already applied:

commit 06e21a4
Author: Luca Burgazzoli <lburgazzoli@users.noreply.github.com>
Date:   Tue Jun 25 17:15:13 2024 +0200

    chore(lint): enable contextcheck and containedctx (#1070)

    * chore(lint): enable contextcheck

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * chore(lint): enable containedctx

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

    * Fix PR review findings

    * Fix rebase

    ---------

    Signed-off-by: Luca Burgazzoli <lburgazzoli@gmail.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

refactor: dashboard with new manifests structure (#1065)

Partial application of already applied:

commit 438f4c2
Author: Wen Zhou <wenzhou@redhat.com>
Date:   Tue Jul 2 16:56:25 2024 +0200

    refactor: dashboard with new manifests structure (#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 <wenzhou@redhat.com>

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

(cherry picked from commit 72fc80f)

Adjusted Kueue and TrainingOperator rules

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

Conflicts: ApplyParams arguments due to missing:
  d84cd33 ("update: remove unnecessary param from ApplyParams() (#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 (#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 <bartosz.majsak@gmail.com>

* Avoid shadowing package name in variable

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>

* chore: rename createServicemeshMember to enrollToServiceMesh, add log messages

---------

Co-authored-by: Bartosz Majsak <bartosz.majsak@gmail.com>
(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 (#1205)")

ModelRegistry related.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

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

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: updated api-overview.md

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: add missing field in setupDSCInstance()

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* fix: added debug log for failing e2e test

* debug: added log messages in test dsc creation

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

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

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>

* 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 <wenzhou@redhat.com>

* fix: test need to update for modelreg namespace

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: cleanup debug info in test cases

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* 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 <wenzhou@redhat.com>

---------

Signed-off-by: Dhiraj Bokde <dhirajsb@users.noreply.github.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Co-authored-by: Wen Zhou <wenzhou@redhat.com>
(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 <wenzhou@redhat.com>
(cherry picked from commit 03f6c0b)

Update autogenerated files

run  `make generate manifests api-docs`

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

modelregistry: replace odh-model-registries with rhoai-model-registries

Fix names of default registries namespace treewide.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

tests: e2e: disable modelregistry

It is not GA yet, disable for now to avoid possible problems.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

get_all_manifests.sh: modelregistry: use rhoai-2.14 branch

Use versioned branch/tag like other components.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>

Update config/samples/datasciencecluster_v1_datasciencecluster.yaml

Co-authored-by: Wen Zhou <wenzhou@redhat.com>

Update bundle/manifests/rhods-operator.clusterserviceversion.yaml

Co-authored-by: Wen Zhou <wenzhou@redhat.com>

modelregistry: keep registriesNamespace as odh except CSV

It makes less divergency with ODH and default does not matter as
soon as CSV has RHOAI version.

Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants