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

Defer retrieving GetRayJobId in test #89

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

sutaakar
Copy link
Contributor

@sutaakar sutaakar commented Aug 22, 2023

GetRayJobId call needs to be deferred to make sure that job id is stored by KubeRay cluster.

Description

TestRayCluster test was failing on log storage line. Log storage function was deferred, however its arguments are resolved in realtime, causing GetRayJobId to be resolved before KubeRay operator had a chance to store job id in RayJob CR.

Moving the whole log storage line into separate function makes sure that RayJob CR is fully initialized.

How Has This Been Tested?

Manually.

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • 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

@astefanutti
Copy link
Contributor

/lgtm

@astefanutti
Copy link
Contributor

That makes me think whether we should update the Ray API helper function signatures to take the Job namespace and name, instead of the Job id, and do the retrieval from within the helper function.

@winklerm
Copy link

/approve

@sutaakar
Copy link
Contributor Author

That makes me think whether we should update the Ray API helper function signatures to take the Job namespace and name, instead of the Job id, and do the retrieval from within the helper function.

@astefanutti The problem is that there are two options of submitting the job - CR or REST API. In case of REST API there is no CR created, so helper wouldn't be able to obtain job id in that case from namespace and name.

@astefanutti
Copy link
Contributor

That makes me think whether we should update the Ray API helper function signatures to take the Job namespace and name, instead of the Job id, and do the retrieval from within the helper function.

@astefanutti The problem is that there are two options of submitting the job - CR or REST API. In case of REST API there is no CR created, so helper wouldn't be able to obtain job id in that case from namespace and name.

Ah right. So we could (re-)add the WriteRayJobLogs function in ray.go that would handle the RayJob case, and delegate to WriteRayJobAPILogs in ray_api.go. WDYT?

@astefanutti
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Aug 23, 2023
@astefanutti
Copy link
Contributor

/approve

@openshift-ci
Copy link

openshift-ci bot commented Aug 23, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: astefanutti, winklerm

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

@openshift-merge-robot openshift-merge-robot merged commit a6578fc into opendatahub-io:main Aug 23, 2023
1 check passed
@sutaakar sutaakar deleted the defer branch August 23, 2023 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants