Skip to content

Commit

Permalink
Merge pull request #245 from VaishnaviHire/sync_upstream_2.9.0
Browse files Browse the repository at this point in the history
Sync upstream 2.9.0
  • Loading branch information
VaishnaviHire committed Apr 17, 2024
2 parents 56b1946 + b98201c commit c2daf91
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 16 deletions.
7 changes: 7 additions & 0 deletions bundle/manifests/rhods-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ metadata:
certified: "False"
containerImage: quay.io/opendatahub/opendatahub-operator:v2.0.0
createdAt: "2023-8-23T00:00:00Z"
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "false"
features.operators.openshift.io/proxy-aware: "false"
features.operators.openshift.io/tls-profiles: "false"
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
olm.skipRange: '>=1.0.0 <2.0.0'
operatorframework.io/initialization-resource: |-
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ metadata:
certified: "False"
containerImage: quay.io/opendatahub/opendatahub-operator:v2.0.0
createdAt: "2023-8-23T00:00:00Z"
features.operators.openshift.io/disconnected: "true"
features.operators.openshift.io/fips-compliant: "false"
features.operators.openshift.io/proxy-aware: "false"
features.operators.openshift.io/tls-profiles: "false"
features.operators.openshift.io/token-auth-aws: "false"
features.operators.openshift.io/token-auth-azure: "false"
features.operators.openshift.io/token-auth-gcp: "false"
olm.skipRange: '>=1.0.0 <2.0.0'
operatorframework.io/initialization-resource: |-
{
Expand Down
38 changes: 34 additions & 4 deletions controllers/datasciencecluster/datasciencecluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (r *DataScienceClusterReconciler) Reconcile(ctx context.Context, req ctrl.R
return ctrl.Result{}, nil
}
// Check preconditions if this is an upgrade
if instance.Status.Phase == status.PhaseReady {
if instance.Status.Phase == status.PhaseReady || instance.Status.Phase == status.PhaseError {
// Check for existence of Argo Workflows if DSP is
if instance.Spec.Components.DataSciencePipelines.ManagementState == v1.Managed {
if err := datasciencepipelines.UnmanagedArgoWorkFlowExists(ctx, r.Client); err != nil {
Expand Down Expand Up @@ -455,7 +455,7 @@ func (r *DataScienceClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
Owns(&admv1.MutatingWebhookConfiguration{}).
Owns(&admv1.ValidatingWebhookConfiguration{}, builder.WithPredicates(modelMeshwebhookPredicates)).
Owns(&corev1.ServiceAccount{}, builder.WithPredicates(saPredicates)).
Watches(&source.Kind{Type: &dsci.DSCInitialization{}}, handler.EnqueueRequestsFromMapFunc(r.watchDataScienceClusterResources)).
Watches(&source.Kind{Type: &dsci.DSCInitialization{}}, handler.EnqueueRequestsFromMapFunc(r.watchDataScienceClusterForDSCI)).
Watches(&source.Kind{Type: &corev1.ConfigMap{}}, handler.EnqueueRequestsFromMapFunc(r.watchDataScienceClusterResources), builder.WithPredicates(configMapPredicates)).
Watches(&source.Kind{Type: &apiextensionsv1.CustomResourceDefinition{}}, handler.EnqueueRequestsFromMapFunc(r.watchDataScienceClusterResources),
builder.WithPredicates(argoWorkflowCRDPredicates)).
Expand All @@ -464,6 +464,29 @@ func (r *DataScienceClusterReconciler) SetupWithManager(mgr ctrl.Manager) error
Complete(r)
}

func (r *DataScienceClusterReconciler) watchDataScienceClusterForDSCI(a client.Object) []reconcile.Request {
instanceList := &dsc.DataScienceClusterList{}
err := r.Client.List(context.TODO(), instanceList)
if err != nil {
return nil
}
var requestName string
switch {
case len(instanceList.Items) == 1:
requestName = instanceList.Items[0].Name
case len(instanceList.Items) == 0:
requestName = "default-dsc"
default:
return nil
}
// When DSCI CR gets created, trigger reconcile function
if a.GetObjectKind().GroupVersionKind().Kind == "DSCInitialization" || a.GetName() == "default-dsci" {
return []reconcile.Request{{
NamespacedName: types.NamespacedName{Name: requestName},
}}
}
return nil
}
func (r *DataScienceClusterReconciler) watchDataScienceClusterResources(a client.Object) []reconcile.Request {
instanceList := &dsc.DataScienceClusterList{}
err := r.Client.List(context.TODO(), instanceList)
Expand All @@ -480,7 +503,7 @@ func (r *DataScienceClusterReconciler) watchDataScienceClusterResources(a client
return nil
}

if a.GetObjectKind().GroupVersionKind().Kind == "CustomResourceDefinition" {
if a.GetObjectKind().GroupVersionKind().Kind == "CustomResourceDefinition" || a.GetName() == datasciencepipelines.ArgoWorkflowCRD {
return []reconcile.Request{{
NamespacedName: types.NamespacedName{Name: requestName},
}}
Expand All @@ -491,7 +514,6 @@ func (r *DataScienceClusterReconciler) watchDataScienceClusterResources(a client
if err != nil {
return nil
}

if a.GetNamespace() == operatorNs {
labels := a.GetLabels()
if val, ok := labels[upgrade.DeleteConfigMapLabel]; ok && val == "true" {
Expand All @@ -501,6 +523,14 @@ func (r *DataScienceClusterReconciler) watchDataScienceClusterResources(a client
}
return nil
}

// Trigger reconcile function when DSCInitialization from Missing to Valid
if a.GetObjectKind().GroupVersionKind().Kind == "DSCInitialization" {
return []reconcile.Request{{
NamespacedName: types.NamespacedName{Name: requestName},
}}
}

return nil
}

Expand Down
24 changes: 12 additions & 12 deletions get_all_manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ MANIFEST_ORG="red-hat-data-services"
# component: notebook, dsp, kserve, dashbaord, cf/ray, trustyai, modelmesh.
# in the format of "repo-org:repo-name:branch-name:source-folder:target-folder".
declare -A COMPONENT_MANIFESTS=(
["codeflare"]="red-hat-data-services:codeflare-operator:rhoai-2.8:config:codeflare"
["ray"]="red-hat-data-services:kuberay:rhoai-2.8:ray-operator/config:ray"
["kueue"]="red-hat-data-services:kueue:rhoai-2.8:config:kueue"
["data-science-pipelines-operator"]="red-hat-data-services:data-science-pipelines-operator:rhoai-2.8:config:data-science-pipelines-operator"
["kf-notebook-controller"]="red-hat-data-services:kubeflow:rhoai-2.8:components/notebook-controller/config:odh-notebook-controller/kf-notebook-controller"
["odh-notebook-controller"]="red-hat-data-services:kubeflow:rhoai-2.8:components/odh-notebook-controller/config:odh-notebook-controller/odh-notebook-controller"
["notebooks"]="red-hat-data-services:notebooks:rhoai-2.8:manifests:/jupyterhub/notebooks"
["trustyai"]="red-hat-data-services:trustyai-service-operator:rhoai-2.8:config:trustyai-service-operator"
["model-mesh"]="red-hat-data-services:modelmesh-serving:rhoai-2.8:config:model-mesh"
["odh-model-controller"]="red-hat-data-services:odh-model-controller:rhoai-2.8:config:odh-model-controller"
["kserve"]="red-hat-data-services:kserve:rhoai-2.8:config:kserve"
["odh-dashboard"]="red-hat-data-services:odh-dashboard:rhoai-2.8:manifests:dashboard"
["codeflare"]="red-hat-data-services:codeflare-operator:rhoai-2.9:config:codeflare"
["ray"]="red-hat-data-services:kuberay:rhoai-2.9:ray-operator/config:ray"
["kueue"]="red-hat-data-services:kueue:rhoai-2.9:config:kueue"
["data-science-pipelines-operator"]="red-hat-data-services:data-science-pipelines-operator:rhoai-2.9:config:data-science-pipelines-operator"
["kf-notebook-controller"]="red-hat-data-services:kubeflow:rhoai-2.9:components/notebook-controller/config:odh-notebook-controller/kf-notebook-controller"
["odh-notebook-controller"]="red-hat-data-services:kubeflow:rhoai-2.9:components/odh-notebook-controller/config:odh-notebook-controller/odh-notebook-controller"
["notebooks"]="red-hat-data-services:notebooks:rhoai-2.9:manifests:/jupyterhub/notebooks"
["trustyai"]="red-hat-data-services:trustyai-service-operator:rhoai-2.9:config:trustyai-service-operator"
["model-mesh"]="red-hat-data-services:modelmesh-serving:rhoai-2.9:config:model-mesh"
["odh-model-controller"]="red-hat-data-services:odh-model-controller:rhoai-2.9:config:odh-model-controller"
["kserve"]="red-hat-data-services:kserve:rhoai-2.9:config:kserve"
["odh-dashboard"]="red-hat-data-services:odh-dashboard:rhoai-2.9:manifests:dashboard"
)

# Allow overwriting repo using flags component=repo
Expand Down

0 comments on commit c2daf91

Please sign in to comment.