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

Sync from odh to rhoai 2.11 #287

Merged
merged 19 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a315f77
feat: increase QPS and Burst for client (#1031)
zdtsw Jun 3, 2024
5b85a1e
kserve: configure servicemesh before deploying manifests (#1019)
ykaliuta May 24, 2024
308d80f
chore: adds godoc to Feature builder (#1013)
bartoszmajsak May 16, 2024
cc13ff3
fix: wrong path when use devFlag + wrong default value + special name…
zdtsw May 30, 2024
e7e8b8a
chore: moves operator/subscriptions operations to pkg/cluster (#1027)
bartoszmajsak May 30, 2024
8602eca
chore: Open up util functions for context propagation (#1033)
aslakknutsen Jun 4, 2024
22828cb
fix: missing label "opendatahub.io/generated-namespace" on auth (#1038)
zdtsw Jun 5, 2024
362a268
chore: append ownerRef to resources owned by Features (#1039)
cam-garrison Jun 6, 2024
8f69f04
Revert "chore: append ownerRef to resources owned by Features (#1039)"
ykaliuta Jun 6, 2024
5d53ab7
Update Owners-aliases list (#1040)
Sara4994 Jun 10, 2024
63afd8c
RHOAIENG-5426: Updated pull request template with prerequisites (#1042)
Sara4994 Jun 11, 2024
c42f5a4
chore: renames manifests source to location (#1050)
bartoszmajsak Jun 11, 2024
322541e
Fix trustyai changes
VaishnaviHire Jun 18, 2024
0cae42a
cluster: GetPlatform: replace CSV list with OperatorExists calls (#1051)
ykaliuta Jun 12, 2024
e3f0352
chore: remove duplicated platform call in each component (#1055)
zdtsw Jun 14, 2024
c2ca9c6
chore: update toolbox sdk version and remove duplicated addtoschema (…
zdtsw Jun 17, 2024
3689b86
chore: funcs to create kustomize plugins (#1062)
bartoszmajsak Jun 18, 2024
ce062dd
Fix linter errors
VaishnaviHire Jun 18, 2024
2b2e62b
Update scheme
VaishnaviHire Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!--- Provide a general summary of your changes in the Title above -->

Many thanks for submitting your Pull Request ❤️!

Please make sure that your PR meets the following requirements:

- [ ] You have read the [contributors guide](https://github.com/opendatahub-io/opendatahub-operator/blob/incubation/CONTRIBUTING.md)
- [ ] Pull Request contains description of the issue
- [ ] Pull Request contains link to the JIRA issue
- [ ] Pull Request contains link to any dependent or related Pull Request

## Description
<!--- Describe your changes in detail -->

## JIRA issue:
<!--- Link your JIRA and related links here for reference. -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshot or short clip:
<!--- Attach a screenshot or a short clip demonstrating the feature. -->

## Merge criteria:
<!--- This PR will be merged by any repository approver when it meets all the points in the checklist -->
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->

- [ ] Have a meaningful commit 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
2 changes: 1 addition & 1 deletion Dockerfiles/toolbox.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM registry.fedoraproject.org/fedora-toolbox:38

ARG GOLANG_VERSION=1.20
ARG OPERATOR_SDK_VERSION=1.24.1
ARG OPERATOR_SDK_VERSION=1.31.0

ENV GOLANG_VERSION=$GOLANG_VERSION \
OPERATOR_SDK_VERSION=$OPERATOR_SDK_VERSION
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -341,14 +341,13 @@ catalog-push: ## Push a catalog image.
$(MAKE) image-push IMG=$(CATALOG_IMG)

TOOLBOX_GOLANG_VERSION := 1.20
TOOLBOX_OPERATOR_SDK_VERSION := 1.24.1

# Generate a Toolbox container for locally testing changes easily
.PHONY: toolbox
toolbox: ## Create a toolbox instance with the proper Golang and Operator SDK versions
$(IMAGE_BUILDER) build \
--build-arg GOLANG_VERSION=$(TOOLBOX_GOLANG_VERSION) \
--build-arg OPERATOR_SDK_VERSION=$(TOOLBOX_OPERATOR_SDK_VERSION) \
--build-arg OPERATOR_SDK_VERSION=$(OPERATOR_SDK_VERSION) \
-f Dockerfiles/toolbox.Dockerfile -t opendatahub-toolbox .
$(IMAGE_BUILDER) stop opendatahub-toolbox ||:
toolbox rm opendatahub-toolbox ||:
Expand Down
8 changes: 0 additions & 8 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,5 @@ approvers:
- platform
reviewers:
- platform
- serving
- ide
- dashboard
- datasciencepipelines
- modelregistry
- servicemesh
- distributedworkloads
- aiexplainability


40 changes: 9 additions & 31 deletions OWNERS_ALIASES
Original file line number Diff line number Diff line change
@@ -1,41 +1,19 @@
aliases:
platform:
- adelton
- AjayJagan
- ajaypratap003
- asanzgom
- biswassri
- CFSNM
- devguyio
- etirelli
- grdryn
- Jackdelahunt
- LaVLaS
- MarianMacik
- mattmahoneyrh
- Sara4994
- VaishnaviHire
- ykaliuta
- zdtsw
aiexplainability:
- RobGeada
- ruivieira
dashboard:
- andrewballantyne
- lucferbux
datasciencepipelines:
- gmfrasca
- HumairAK
distributedworkloads:
- astefanutti
- dimakis
ide:
- atheo89
- harshad16
modelregistry:
- dhirajsb
- rareddy
- tarilabs
servicemesh:
- aslakknutsen
- bartoszmajsak
- cam-garrison
serving:
- israel-hdez
- VedantMahabaleshwarkar




- zdtsw
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -96,7 +96,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -140,7 +140,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -198,7 +198,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -301,7 +301,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -345,7 +345,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -388,7 +388,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -431,7 +431,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -474,7 +474,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down Expand Up @@ -517,7 +517,7 @@ spec:
items:
properties:
contextDir:
default: ""
default: manifests
description: contextDir is the relative path to
the folder containing manifests in a repository
type: string
Expand Down
2 changes: 1 addition & 1 deletion bundle/tests/scorecard/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stages:
- entrypoint:
- scorecard-test
- basic-check-spec
image: quay.io/operator-framework/scorecard-test:v1.24.1
image: quay.io/operator-framework/scorecard-test:v1.31.0
labels:
suite: basic
test: basic-check-spec-test
Expand Down
21 changes: 12 additions & 9 deletions components/codeflare/codeflare.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ func (c *CodeFlare) GetComponentName() string {
return ComponentName
}

func (c *CodeFlare) ReconcileComponent(ctx context.Context, cli client.Client, logger logr.Logger, owner metav1.Object, dscispec *dsciv1.DSCInitializationSpec, _ bool) error {
func (c *CodeFlare) ReconcileComponent(ctx context.Context,
cli client.Client,
logger logr.Logger,
owner metav1.Object,
dscispec *dsciv1.DSCInitializationSpec,
platform cluster.Platform,
_ bool) error {
l := c.ConfigComponentLogger(logger, ComponentName, dscispec)
var imageParamMap = map[string]string{
"codeflare-operator-controller-image": "RELATED_IMAGE_ODH_CODEFLARE_OPERATOR_IMAGE", // no need mcad, embedded in cfo
Expand All @@ -66,22 +72,19 @@ func (c *CodeFlare) ReconcileComponent(ctx context.Context, cli client.Client, l

enabled := c.GetManagementState() == operatorv1.Managed
monitoringEnabled := dscispec.Monitoring.ManagementState == operatorv1.Managed
platform, err := cluster.GetPlatform(cli)
if err != nil {
return err
}

if enabled {
if c.DevFlags != nil {
// Download manifests and update paths
if err = c.OverrideManifests(string(platform)); err != nil {
if err := c.OverrideManifests(string(platform)); err != nil {
return err
}
}
// check if the CodeFlare operator is installed: it should not be installed
// Both ODH and RHOAI should have the same operator name
dependentOperator := CodeflareOperator

if found, err := deploy.OperatorExists(cli, dependentOperator); err != nil {
if found, err := cluster.OperatorExists(cli, dependentOperator); err != nil {
return fmt.Errorf("operator exists throws error %w", err)
} else if found {
return fmt.Errorf("operator %s is found. Please uninstall the operator before enabling %s component",
Expand Down Expand Up @@ -115,10 +118,10 @@ func (c *CodeFlare) ReconcileComponent(ctx context.Context, cli client.Client, l
}

// inject prometheus codeflare*.rules in to /opt/manifests/monitoring/prometheus/prometheus-configs.yaml
if err = c.UpdatePrometheusConfig(cli, enabled && monitoringEnabled, ComponentName); err != nil {
if err := c.UpdatePrometheusConfig(cli, enabled && monitoringEnabled, ComponentName); err != nil {
return err
}
if err = deploy.DeployManifestsFromPath(cli, owner,
if err := deploy.DeployManifestsFromPath(cli, owner,
filepath.Join(deploy.DefaultManifestPath, "monitoring", "prometheus", "apps"),
dscispec.Monitoring.Namespace,
"prometheus", true); err != nil {
Expand Down
7 changes: 4 additions & 3 deletions components/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"

dsciv1 "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/cluster"
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/common"
)

Expand Down Expand Up @@ -68,9 +69,9 @@ type ManifestsConfig struct {
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=1
URI string `json:"uri,omitempty"`

// contextDir is the relative path to the folder containing manifests in a repository
// contextDir is the relative path to the folder containing manifests in a repository, default value "manifests"
// +optional
// +kubebuilder:default:=""
// +kubebuilder:default:="manifests"
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=2
ContextDir string `json:"contextDir,omitempty"`

Expand All @@ -83,7 +84,7 @@ type ManifestsConfig struct {

type ComponentInterface interface {
ReconcileComponent(ctx context.Context, cli client.Client, logger logr.Logger,
owner metav1.Object, DSCISpec *dsciv1.DSCInitializationSpec, currentComponentStatus bool) error
owner metav1.Object, DSCISpec *dsciv1.DSCInitializationSpec, platform cluster.Platform, currentComponentStatus bool) error
Cleanup(cli client.Client, DSCISpec *dsciv1.DSCInitializationSpec) error
GetComponentName() string
GetManagementState() operatorv1.ManagementState
Expand Down
18 changes: 8 additions & 10 deletions components/dashboard/dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,11 @@ func (d *Dashboard) ReconcileComponent(ctx context.Context,
logger logr.Logger,
owner metav1.Object,
dscispec *dsciv1.DSCInitializationSpec,
platform cluster.Platform,
currentComponentExist bool,
) error {
var l logr.Logger
platform, err := cluster.GetPlatform(cli)
if err != nil {
return err
}

if platform == cluster.SelfManagedRhods || platform == cluster.ManagedRhods {
l = d.ConfigComponentLogger(logger, ComponentNameSupported, dscispec)
} else {
Expand Down Expand Up @@ -126,14 +124,14 @@ func (d *Dashboard) ReconcileComponent(ctx context.Context,

// 2. platform specific RBAC
if platform == cluster.OpenDataHub || platform == "" {
err := cluster.UpdatePodSecurityRolebinding(cli, dscispec.ApplicationsNamespace, "odh-dashboard")
err := cluster.UpdatePodSecurityRolebinding(ctx, cli, dscispec.ApplicationsNamespace, "odh-dashboard")
if err != nil {
return err
}
}

if platform == cluster.SelfManagedRhods || platform == cluster.ManagedRhods {
err := cluster.UpdatePodSecurityRolebinding(cli, dscispec.ApplicationsNamespace, "rhods-dashboard")
err := cluster.UpdatePodSecurityRolebinding(ctx, cli, dscispec.ApplicationsNamespace, "rhods-dashboard")
if err != nil {
return err
}
Expand All @@ -152,7 +150,7 @@ func (d *Dashboard) ReconcileComponent(ctx context.Context,
switch platform {
case cluster.SelfManagedRhods, cluster.ManagedRhods:
// anaconda
if err := cluster.CreateSecret(cli, "anaconda-ce-access", dscispec.ApplicationsNamespace); err != nil {
if err := cluster.CreateSecret(ctx, cli, "anaconda-ce-access", dscispec.ApplicationsNamespace); err != nil {
return fmt.Errorf("failed to create access-secret for anaconda: %w", err)
}
// overlay which including ../../base + anaconda-ce-validator
Expand Down Expand Up @@ -183,7 +181,7 @@ func (d *Dashboard) ReconcileComponent(ctx context.Context,
if err := d.UpdatePrometheusConfig(cli, enabled && monitoringEnabled, ComponentNameSupported); err != nil {
return err
}
if err = deploy.DeployManifestsFromPath(cli, owner,
if err := deploy.DeployManifestsFromPath(cli, owner,
filepath.Join(deploy.DefaultManifestPath, "monitoring", "prometheus", "apps"),
dscispec.Monitoring.Namespace,
"prometheus", true); err != nil {
Expand All @@ -194,11 +192,11 @@ func (d *Dashboard) ReconcileComponent(ctx context.Context,
return nil
default:
// base
if err = deploy.DeployManifestsFromPath(cli, owner, Path, dscispec.ApplicationsNamespace, ComponentName, enabled); err != nil {
if err := deploy.DeployManifestsFromPath(cli, owner, Path, dscispec.ApplicationsNamespace, ComponentName, enabled); err != nil {
return err
}
// ISV
if err = deploy.DeployManifestsFromPath(cli, owner, PathISV, dscispec.ApplicationsNamespace, ComponentName, enabled); err != nil {
if err := deploy.DeployManifestsFromPath(cli, owner, PathISV, dscispec.ApplicationsNamespace, ComponentName, enabled); err != nil {
return err
}
// consolelink
Expand Down
Loading