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

[Test][RayJob] Transition to Complete if the JobStatus is STOPPED #1871

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Jan 26, 2024

Why are these changes needed?

This is the test for #1855.

Related issue number

Closes #1866

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@kevin85421 kevin85421 changed the title [Test][RayJob] Transition to Complete if the JobStatus is STOPPED [Test][RayJob] Transition to Complete if the JobStatus is STOPPED Jan 26, 2024
@kevin85421 kevin85421 marked this pull request as ready for review January 26, 2024 02:52
@kevin85421
Copy link
Member Author

cc @astefanutti @andrewsykim

Copy link
Contributor

@astefanutti astefanutti left a comment

Choose a reason for hiding this comment

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

LTGM. This is great!

from ray.job_submission import JobSubmissionClient

print("Sleep 20 seconds to enable the RayJob to transition to RUNNING state")
time.sleep(20)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we pass in submission ID into stop.py and poll the job status until it's RUNNING?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree. Or could we even delete the sleep entirely? Isn't it be guaranteed to be RUNNING at the time this Python code is being executed?

Copy link
Member Author

Choose a reason for hiding this comment

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

RUNNING here refers to JobDeploymentStatus rather than JobStatus.

Isn't it be guaranteed to be RUNNING at the time this Python code is being executed?

JobStatus guaranteed to be RUNNING at the time this Python code is being executed. That's why I said "RayJob transition to RUNNING state" instead of "Ray job".

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, thanks for clarifying. Sleeping in a test isn't ideal but I don't know a better way right now

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we don't have a method to know the JobDeploymentStatus without implementing some RBAC configurations.

@kevin85421 kevin85421 merged commit b47ebbd into ray-project:master Jan 26, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RayJob] Add tests for #1855
4 participants