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

feat: Mapping component versions to RHOAI releases #1299

Open
wants to merge 14 commits into
base: incubation
Choose a base branch
from

Conversation

Sara4994
Copy link
Contributor

@Sara4994 Sara4994 commented Oct 11, 2024

<!---
Many thanks for submitting your Pull Request ❤️!

Please complete the following sections for a smooth review.
-->

Description

The PR is a first step to the feature initiative tracked in JIRA and this PR adds feature to capture RHOAI release versions from all the components(that are supported by DSC) repositories and include it in the DSC status.

JIRA: https://issues.redhat.com/browse/RHOAIENG-12619

How Has This Been Tested?

To test with DevFlags:

  • In a forked version of the components repository and create an .env file in config/manifest directory, have it in your branch.
  • Point that forked repository as a DevFlag like this
  • Build and deploy the changes into the cluster.
  • Create DSCI and DSC instances and you will be able see the status.components get updated with component upstream release details like below

`
apiVersion: datasciencecluster.opendatahub.io/v1
kind: DataScienceCluster
metadata:

spec:
components:

status:
components:
datasciencepipelines
upstreamReleases:
- name: datasciencepipelines
displayName: Red Hat Build of Kubeflow Pipelines
version: 2.2.0
repoUrl: https://github.com/opendatahub-io/data-science-pipelines
`

Screenshot or short clip

Screenshot 2024-10-26 at 12 12 59 PM

Merge criteria

  • You have read the contributors guide.
  • Commit messages are meaningful - have a clear and concise summary and detailed explanation of what was changed and why.
  • Pull Request contains a description of the solution, a link to the JIRA issue, and to any dependent or related Pull Request.
  • 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

Copy link

openshift-ci bot commented Oct 11, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from sara4994. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@ykaliuta
Copy link
Contributor

It's still draft, isn't it?

@lburgazzoli
Copy link
Contributor

@Sara4994 I'd like to see this kind of steps to be performed only once i.e. at initialization time as component version won't change during the lifetime of the operator.

Copy link
Contributor

This PR can't be merged just yet 😢

Please run make generate manifests api-docs and commit the changes.

For more info: https://github.com/opendatahub-io/opendatahub-operator/actions/runs/11404123045

@Sara4994 Sara4994 force-pushed the update-component-status branch 3 times, most recently from 3a935ab to 210bde1 Compare October 20, 2024 19:42
components/codeflare/codeflare.go Outdated Show resolved Hide resolved
components/datasciencepipelines/datasciencepipelines.go Outdated Show resolved Hide resolved
components/ray/ray.go Outdated Show resolved Hide resolved
Copy link
Contributor

This PR can't be merged just yet 😢

Please run make generate manifests api-docs and commit the changes.

For more info: https://github.com/opendatahub-io/opendatahub-operator/actions/runs/11445735405

Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Please upload report for BASE (incubation@bde4b4e). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...atasciencecluster/datasciencecluster_controller.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             incubation    #1299   +/-   ##
=============================================
  Coverage              ?   19.09%           
=============================================
  Files                 ?       30           
  Lines                 ?     3368           
  Branches              ?        0           
=============================================
  Hits                  ?      643           
  Misses                ?     2656           
  Partials              ?       69           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sara4994 Sara4994 force-pushed the update-component-status branch from cfea723 to 8181671 Compare October 21, 2024 17:56
Copy link
Contributor

This PR can't be merged just yet 😢

Please run make generate manifests api-docs and commit the changes.

For more info: https://github.com/opendatahub-io/opendatahub-operator/actions/runs/11445853071

@Sara4994 Sara4994 force-pushed the update-component-status branch 4 times, most recently from f3bb873 to 21bdd88 Compare October 21, 2024 18:19
@VaishnaviHire VaishnaviHire requested a review from zdtsw October 21, 2024 20:02
@Sara4994 Sara4994 force-pushed the update-component-status branch from e311476 to 7dcd0e4 Compare October 26, 2024 08:56
@zdtsw
Copy link
Member

zdtsw commented Oct 27, 2024

do not checkin manager binary

Copy link
Member

@zdtsw zdtsw left a comment

Choose a reason for hiding this comment

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

some small parts, otherwise i am fine with the changes.

controllers/status/status.go Outdated Show resolved Hide resolved
controllers/status/status.go Outdated Show resolved Hide resolved
controllers/status/status.go Show resolved Hide resolved
controllers/status/status.go Outdated Show resolved Hide resolved
@Sara4994 Sara4994 force-pushed the update-component-status branch 2 times, most recently from 73bdce6 to 6600709 Compare October 28, 2024 14:10
@Sara4994 Sara4994 force-pushed the update-component-status branch from 04bee7b to 12889bd Compare October 28, 2024 17:28
@Sara4994
Copy link
Contributor Author

/test opendatahub-operator-e2e

Copy link
Contributor

This PR can't be merged just yet 😢

Please run make generate manifests api-docs and commit the changes.

For more info: https://github.com/opendatahub-io/opendatahub-operator/actions/runs/11579205049

@Sara4994 Sara4994 force-pushed the update-component-status branch from 68e228a to 89d0ef9 Compare October 29, 2024 17:29
@Sara4994
Copy link
Contributor Author

Sara4994 commented Oct 29, 2024

@ykaliuta @zdtsw @VaishnaviHire @lburgazzoli I have tweaked GetReleaseVersion function to read release info from an yaml file instead of an env.

Reason: few components have got multiple upstreams, reading release info of multiple upstreams from an env would be tricky, whereas with yaml we could group the info based on the upstream, and it would be easy to fetch the details at our end. So made it as yaml file.

Please feel free to share your thoughts.

@Sara4994
Copy link
Contributor Author

Sara4994 commented Nov 1, 2024

/cc @grdryn

@openshift-ci openshift-ci bot requested a review from grdryn November 1, 2024 12:28
Copy link
Member

@grdryn grdryn left a comment

Choose a reason for hiding this comment

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

/hold

(at least until ./manager is removed from the patch set)

controllers/status/status.go Outdated Show resolved Hide resolved
manager Outdated Show resolved Hide resolved
pkg/common/common.go Outdated Show resolved Hide resolved
controllers/status/status.go Outdated Show resolved Hide resolved
components/codeflare/codeflare.go Outdated Show resolved Hide resolved
controllers/status/status.go Outdated Show resolved Hide resolved
@grdryn
Copy link
Member

grdryn commented Nov 4, 2024

/unhold

It looks like, for better or worse, the merge automation in this repo will squash all commits in a PR into a single commit, when merging, so the fact that the manager binary was added and then removed in separate commits won't matter: those should cancel each other out and it won't exist in the final history.

controllers/status/status.go Outdated Show resolved Hide resolved
controllers/status/status.go Outdated Show resolved Hide resolved
controllers/status/status.go Outdated Show resolved Hide resolved
@Sara4994 Sara4994 force-pushed the update-component-status branch from 99da1f1 to 0dd61dc Compare November 4, 2024 12:57
@Sara4994 Sara4994 force-pushed the update-component-status branch from 0dd61dc to 0a8ed69 Compare November 4, 2024 12:59

// GetReleaseVersion reads odh_metadata.yaml file and parses release information.
// If version is not set or set to "", return empty {}.
func GetReleaseVersion(defaultManifestPath string, componentName string) ComponentStatus {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think GetReleaseVersion should return a []ComponentReleaseStatus not the entire ComponentStatus

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lburgazzoli but incase of yaml file not present in the components repo, we discussed to show empty struct against component names. such error conditions are handled in the functions itself so as returning empty struct. When returning []ComponentReleaseStatus , will have to handle error cases in components.

Copy link
Contributor

Choose a reason for hiding this comment

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

you can return an empty list, if you sue omitempty in the tags, then it won't not show up

Copy link
Contributor Author

@Sara4994 Sara4994 Nov 5, 2024

Choose a reason for hiding this comment

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

@lburgazzoli yep, have made this changes now. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think GetReleaseVersion should return a []ComponentReleaseStatus not the entire ComponentStatus

If it returns ReleaseStatus, why it's still called GetReleaseVersion? (asked @Sara4994 already)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ykaliuta renamed it now. thanks

componentReleaseStatus := make([]ComponentReleaseStatus, 0)

yamlData, err := os.ReadFile(filepath.Join(defaultManifestPath, componentName, "odh_metadata.yaml"))
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need to distinguish between a file not present from an error, in this case we are swallowing it and I'm not sure that's the right approach as it could hide some other errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is done

@Sara4994 Sara4994 force-pushed the update-component-status branch 2 times, most recently from ef0129c to 4807565 Compare November 5, 2024 11:26
@Sara4994 Sara4994 force-pushed the update-component-status branch from 4807565 to 13f55fd Compare November 6, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

7 participants