project-codeflare / codeflare-operator

Operator for installation and lifecycle management of CodeFlare distributed workload stack
Apache License 2.0
7 stars 45 forks source link

Check if workerGroupSpec is not empty before accessing it #549

Closed ChristianZaccaria closed 6 months ago

ChristianZaccaria commented 6 months ago

Issue link

Jira: https://issues.redhat.com/browse/RHOAIENG-6614

What changes have been made

Verification steps

  1. Have all components deployed including this version of the CFO and Kueue.
  2. Deploy KubeRay-Operator in the same namespace as referenced in the DSCI default-dsci
  3. In the KubeRay repo, run the previously failing test: go test -timeout 30m -v ./test/e2e/rayjob_lightweight_test.go ./test/e2e/support.go
  4. Test should pass.

Checks

sutaakar commented 6 months ago

@ChristianZaccaria Can you please provide a unit test verifying the changes?

ChristianZaccaria commented 6 months ago

@sutaakar I added unit tests covering these changes. Please let me know if there are other test cases I should be covering here.

Also, I am thinking of adding a RayCluster template in the test support file and perhaps append items to it in the tests to reduce the amount of code in the test file. Is this a good approach or what is the best practices on this? Thank you! :)

sutaakar commented 6 months ago

@ChristianZaccaria Creating one valid RayCluster CR and then modify it is a possible approach, may increase test readability.

ChristianZaccaria commented 6 months ago

@sutaakar latest changes include one positive test for each "main" function, and several negative tests to cover the full functionality of the raycluster_webhook.go file.

sutaakar commented 6 months ago

@ChristianZaccaria Can you also adjust test-unit Makefile target to run the new unit test (currently it doesn't run anything). That way the unit test will be executed for PRs.

Otherwise this PR looks great, good job.

ChristianZaccaria commented 6 months ago

@sutaakar I made the last few changes, tests are now running as part of this PR check in the Unit tests workflow. Thank you!

ChristianZaccaria commented 6 months ago

I made a PR to move the core functions used here to the codeflare-common repository. Should we merge that and then make the changes here or what is the appropriate approach? Thanks @sutaakar

sutaakar commented 6 months ago

/lgtm

I made a https://github.com/project-codeflare/codeflare-common/pull/48 used here to the codeflare-common repository. Should we merge that and then make the changes here or what is the appropriate approach?

That is up to you, can be merged now and refactored later or it can wait.

sutaakar commented 6 months ago

/lgtm

sutaakar commented 6 months ago

/approve

openshift-ci[bot] commented 6 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sutaakar

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: - ~~[OWNERS](https://github.com/project-codeflare/codeflare-operator/blob/main/OWNERS)~~ [sutaakar] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment