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: add support for trainingoperator to component #1342

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Nov 5, 2024

Description

https://issues.redhat.com/browse/RHOAIENG-13185

How Has This Been Tested?

Screenshot or short clip

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

codecov bot commented Nov 5, 2024

Codecov Report

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

Please upload report for BASE (feature-operator-refactor@d96d039). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...atasciencecluster/datasciencecluster_controller.go 0.00% 7 Missing ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##             feature-operator-refactor    #1342   +/-   ##
============================================================
  Coverage                             ?   25.76%           
============================================================
  Files                                ?       55           
  Lines                                ?     4402           
  Branches                             ?        0           
============================================================
  Hits                                 ?     1134           
  Misses                               ?     3129           
  Partials                             ?      139           

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

tests/e2e/kfto_test.go Outdated Show resolved Hide resolved
@zdtsw zdtsw force-pushed the jira/13185 branch 6 times, most recently from bad61c5 to a9ae1cf Compare November 8, 2024 11:37
@zdtsw
Copy link
Member Author

zdtsw commented Nov 8, 2024

/retest-required

@zdtsw zdtsw requested a review from lburgazzoli November 10, 2024 14:04
README.md Outdated
@@ -412,7 +412,7 @@ Example commands to run test suite for the dashboard `component` only, with the
make run-nowebhook
```
```shell
make e2e-test -e OPERATOR_NAMESPACE=<namespace> -e E2E_TEST_FLAGS="--test-operator-controller=false --test-webhook=false --test-component=dashboard"
make e2e-test -e OPERATOR_NAMESPACE=<namespace> -e E2E_TEST_FLAGS="--test-operator-controller=false --test-webhook=false --test-component=dashboard,ray,modelregistry, trainingoperator"
Copy link
Contributor

Choose a reason for hiding this comment

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

this does need to be changed, the example is about running a test for a single component (line 409)

Copy link
Member Author

Choose a reason for hiding this comment

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

reverted

"dashboard": dashboardTestSuite,
"ray": rayTestSuite,
"modelregistry": modelRegistryTestSuite,
"trainingoperator": kftoTestSuite,
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe rename the suite test to trainingoperatorTestSuite for consistency

Copy link
Member Author

Choose a reason for hiding this comment

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

done

main.go Outdated
@@ -66,6 +66,7 @@ import (
dashboardctrl "github.com/opendatahub-io/opendatahub-operator/v2/controllers/components/dashboard"
modelregistryctrl "github.com/opendatahub-io/opendatahub-operator/v2/controllers/components/modelregistry"
rayctrl "github.com/opendatahub-io/opendatahub-operator/v2/controllers/components/ray"
kftoctrl "github.com/opendatahub-io/opendatahub-operator/v2/controllers/components/trainingoperator"
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe rename the import alias to trainingoperatorctrl

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@lburgazzoli
Copy link
Contributor

looks good, minor note, maybe replace kfto with trainingoperator for consistency

@zdtsw zdtsw force-pushed the jira/13185 branch 2 times, most recently from 312e767 to b962226 Compare November 11, 2024 09:44
@lburgazzoli
Copy link
Contributor

looks good, minor note, maybe replace kfto with trainingoperator for consistency

looks like there are still a number of kfto prefixes, here an there

➜ git grep kft b9622262
b9622262:controllers/components/trainingoperator/trainingoperator_controller_actions.go:        kfto, ok := rr.Instance.(*componentsv1.TrainingOperator)
b9622262:controllers/components/trainingoperator/trainingoperator_controller_actions.go:        if kfto.Spec.DevFlags == nil {
b9622262:controllers/components/trainingoperator/trainingoperator_controller_actions.go:        if len(kfto.Spec.DevFlags.Manifests) != 0 {
b9622262:controllers/components/trainingoperator/trainingoperator_controller_actions.go:                manifestConfig := kfto.Spec.DevFlags.Manifests[0]
b9622262:controllers/datasciencecluster/datasciencecluster_controller.go:                kfto := trainingoperatorctrl.GetComponentCR(instance)
b9622262:controllers/datasciencecluster/datasciencecluster_controller.go:                return r.apply(ctx, instance, kfto), instance.Spec.Components.TrainingOperator.ManagementState == operatorv1.Managed
b9622262:tests/e2e/trainingoperator_test.go:        kftoCtx := TrainingOperatorTestCtx{}
b9622262:tests/e2e/trainingoperator_test.go:        kftoCtx.testCtx, err = NewTestContext()
b9622262:tests/e2e/trainingoperator_test.go:        testCtx := kftoCtx.testCtx
b9622262:tests/e2e/trainingoperator_test.go:                        err = kftoCtx.testTrainingOperatorCreation()
b9622262:tests/e2e/trainingoperator_test.go:                        err = kftoCtx.validateTrainingOperator()
b9622262:tests/e2e/trainingoperator_test.go:                        err = kftoCtx.testOwnerReferences()
b9622262:tests/e2e/trainingoperator_test.go:                        err = kftoCtx.validateTrainingOperatorReady()
b9622262:tests/e2e/trainingoperator_test.go:                        err = kftoCtx.testUpdateOnTrainingOperatorResources()
b9622262:tests/e2e/trainingoperator_test.go:                        err = kftoCtx.testUpdateTrainingOperatorComponentDisabled()
b9622262:tests/e2e/trainingoperator_test.go:                kfto := &componentsv1.TrainingOperator{}
b9622262:tests/e2e/trainingoperator_test.go:                err := tc.testCtx.customClient.Get(ctx, key, kfto)
b9622262:tests/e2e/trainingoperator_test.go:                return kfto.Status.Phase == readyStatus, nil
b9622262:tests/e2e/trainingoperator_test.go:        var kftoDeploymentName string
b9622262:tests/e2e/trainingoperator_test.go:                        kftoDeploymentName = appDeployments.Items[0].Name
b9622262:tests/e2e/trainingoperator_test.go:                                return fmt.Errorf("error getting enabled component: %s its deployment 'ReadyReplicas'", kftoDeploymentName)
b9622262:tests/e2e/trainingoperator_test.go:                kfto := &componentsv1.TrainingOperator{}
b9622262:tests/e2e/trainingoperator_test.go:                err = tc.testCtx.customClient.Get(ctx, client.ObjectKey{Name: tc.testTrainingOperatorInstance.Name}, kfto)
b9622262:tests/e2e/trainingoperator_test.go:        _, err = tc.testCtx.kubeClient.AppsV1().Deployments(tc.testCtx.applicationsNamespace).Get(tc.testCtx.ctx, kftoDeploymentName, metav1.GetOptions{})
b9622262:tests/e2e/trainingoperator_test.go:                kftoDeploymentName,

@zdtsw zdtsw force-pushed the jira/13185 branch 2 times, most recently from db21cd2 to 56b4277 Compare November 11, 2024 17:06
@zdtsw
Copy link
Member Author

zdtsw commented Nov 11, 2024

/test opendatahub-operator-e2e

@zdtsw
Copy link
Member Author

zdtsw commented Nov 12, 2024

trainingoperator

variable name updated

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
@openshift-ci openshift-ci bot added the lgtm label Nov 12, 2024
Copy link

openshift-ci bot commented Nov 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lburgazzoli

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

@zdtsw
Copy link
Member Author

zdtsw commented Nov 12, 2024

/test opendatahub-operator-e2e

@openshift-merge-bot openshift-merge-bot bot merged commit 4dead12 into opendatahub-io:feature-operator-refactor Nov 12, 2024
10 checks passed
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.

3 participants