diff --git a/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml b/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml index 614ff4278a9..71419ebd683 100644 --- a/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml +++ b/bundle/manifests/datasciencecluster.opendatahub.io_datascienceclusters.yaml @@ -361,49 +361,6 @@ spec: pattern: ^(Managed|Unmanaged|Force|Removed)$ type: string type: object - trustyai: - description: TrustyAI component configuration. - properties: - devFlags: - description: Add developer fields - properties: - manifests: - description: List of custom manifests for the given component - items: - properties: - contextDir: - default: "" - description: contextDir is the relative path to - the folder containing manifests in a repository - type: string - sourcePath: - default: "" - description: 'sourcePath is the subpath within contextDir - where kustomize builds start. Examples include - any sub-folder or path: `base`, `overlays/dev`, - `default`, `odh` etc' - type: string - uri: - default: "" - description: uri is the URI point to a git repo - with tag/branch. e.g https://github.com/org/repo/tarball/ - type: string - type: object - type: array - type: object - managementState: - description: "Set to one of the following values: \n - \"Managed\" - : the operator is actively managing the component and trying - to keep it active. It will only upgrade the component if - it is safe to do so \n - \"Removed\" : the operator is actively - managing the component and will not install it, or if it - is installed, the operator will try to remove it" - enum: - - Managed - - Removed - pattern: ^(Managed|Unmanaged|Force|Removed)$ - type: string - type: object workbenches: description: Workbenches component configuration. properties: diff --git a/components/codeflare/codeflare.go b/components/codeflare/codeflare.go index 256f5ca1b16..349ec53a7ec 100644 --- a/components/codeflare/codeflare.go +++ b/components/codeflare/codeflare.go @@ -4,7 +4,6 @@ package codeflare import ( "fmt" - "path/filepath" dsci "github.com/opendatahub-io/opendatahub-operator/v2/apis/dscinitialization/v1" @@ -17,7 +16,7 @@ import ( var ( ComponentName = "codeflare" - CodeflarePath = deploy.DefaultManifestPath + "/" + ComponentName + "/base" + CodeflarePath = deploy.DefaultManifestPath + "/" + ComponentName + "/manifests" CodeflareOperator = "codeflare-operator" RHCodeflareOperator = "rhods-codeflare-operator" ) @@ -52,9 +51,8 @@ var _ components.ComponentInterface = (*CodeFlare)(nil) func (c *CodeFlare) ReconcileComponent(cli client.Client, owner metav1.Object, dscispec *dsci.DSCInitializationSpec) error { var imageParamMap = map[string]string{ - "odh-codeflare-operator-image": "RELATED_IMAGE_ODH_CODEFLARE_OPERATOR_IMAGE", - "odh-mcad-controller-image": "RELATED_IMAGE_ODH_MCAD_CONTROLLER_IMAGE", - "namespace": dscispec.ApplicationsNamespace, + "odh-codeflare-operator-controller-image": "RELATED_IMAGE_ODH_CODEFLARE_OPERATOR_IMAGE", // no need mcad, embedded in cfo + "namespace": dscispec.ApplicationsNamespace, } platform, err := deploy.GetPlatform(cli) if err != nil { @@ -71,20 +69,18 @@ func (c *CodeFlare) ReconcileComponent(cli client.Client, owner metav1.Object, d // check if the CodeFlare operator is installed // codeflare operator not installed // overwrite dependent operator if downstream not match upstream - if platform == deploy.SelfManagedRhods || platform == deploy.ManagedRhods { - dependentOperator = RHCodeflareOperator - } - if found, err := deploy.OperatorExists(cli, dependentOperator); err != nil { - return err - } else if !found { - return fmt.Errorf("operator %s not found. Please install the operator before enabling %s component", - dependentOperator, ComponentName) - } + // No need check operator, we will install it + // if found, err := deploy.OperatorExists(cli, dependentOperator); err != nil { + // return err + // } else if !found { + // return fmt.Errorf("operator %s not found. Please install the operator before enabling %s component", + // dependentOperator, ComponentName) + // } // Update image parameters only when we do not have customized manifests set if dscispec.DevFlags.ManifestsUri == "" && len(c.DevFlags.Manifests) == 0 { - if err := deploy.ApplyParams(CodeflarePath, c.SetImageParamsMap(imageParamMap), true); err != nil { + if err := deploy.ApplyParams(CodeflarePath+"/base", c.SetImageParamsMap(imageParamMap), true); err != nil { return err } } @@ -92,14 +88,22 @@ func (c *CodeFlare) ReconcileComponent(cli client.Client, owner metav1.Object, d err = deploy.DeployManifestsFromPath(cli, owner, CodeflarePath, dscispec.ApplicationsNamespace, c.GetComponentName(), operatorv1.Managed) return err case operatorv1.Unmanaged: + if platform == deploy.SelfManagedRhods || platform == deploy.ManagedRhods { + dependentOperator = RHCodeflareOperator + } if dscispec.DevFlags.ManifestsUri == "" && len(c.DevFlags.Manifests) == 0 { - if err := deploy.ApplyParams(CodeflarePath, c.SetImageParamsMap(imageParamMap), true); err != nil { + if err := deploy.ApplyParams(CodeflarePath+"/base", c.SetImageParamsMap(imageParamMap), true); err != nil { return err } } - // Deploy Codeflare if it is unmanaged - err = deploy.DeployManifestsFromPath(cli, owner, CodeflarePath, dscispec.ApplicationsNamespace, c.GetComponentName(), operatorv1.Unmanaged) - return err + // check if CFO already there + if found, err := deploy.OperatorExists(cli, dependentOperator); err != nil { + return err + } else if found { + // TODO: event: tell user to delete it + fmt.Printf("user need to uninstall: " + dependentOperator) + return nil + } } return nil } diff --git a/get_all_manifests.sh b/get_all_manifests.sh index 0dcb1e34580..6ca92f08ec1 100755 --- a/get_all_manifests.sh +++ b/get_all_manifests.sh @@ -11,8 +11,7 @@ MANIFESTS_TARBALL_URL="${GITHUB_URL}/${MANIFEST_ORG}/odh-manifests/tarball/${MAN # component: dsp, kserve, dashbaord, cf/ray. in the format of "repo-org:repo-name:branch-name:source-folder:target-folder" # TODO: modelmesh, kserve, etc declare -A COMPONENT_MANIFESTS=( - # ["codeflare"]="opendatahub-io:codeflare-operator:main:config:codeflare" - ["codeflare"]="opendatahub-io:distributed-workloads:main:codeflare-stack:codeflare" + ["codeflare"]="opendatahub-io:codeflare-operator:main:config:codeflare" ["ray"]="opendatahub-io:kuberay:master:ray-operator/config:ray" ["data-science-pipelines-operator"]="opendatahub-io:data-science-pipelines-operator:main:config:data-science-pipelines-operator" ["odh-dashboard"]="opendatahub-io:odh-dashboard:incubation:manifests:odh-dashboard"