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

Convert job_manager to be async #27123

Merged
merged 8 commits into from
Aug 6, 2022
Merged

Convert job_manager to be async #27123

merged 8 commits into from
Aug 6, 2022

Conversation

alanwguo
Copy link
Contributor

Updates jobs api
Updates snapshot api
Updates state api

Increases jobs api version to 2

Signed-off-by: Alan Guo [email protected]

Why are these changes needed?

follow-up for #25902 (comment)

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Updates jobs api
Updates snapshot api
Updates state api

Increases jobs api version to 2

Signed-off-by: Alan Guo <[email protected]>
@rkooo567
Copy link
Contributor

nice! I will review this today

Copy link
Contributor

@architkulkarni architkulkarni left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for the quick followup!

Comment on lines +404 to +407
if not self._job_info_client:
self._job_info_client = JobInfoStorageClient(
self._dashboard_head.gcs_aio_client
)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we lazily construct this? add comment for future reader

Comment on lines 4 to 7
# Version 1 -> 2: - Renamed job_id to submission_id.
# - Changed list_jobs sdk/cli/api to return a list
# instead of a dictionary.
CURRENT_VERSION = "2"
Copy link
Contributor

Choose a reason for hiding this comment

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

is this intended? or an artifact of stacked PRs? please make this a separate PR either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Intended but yes, an orthogonal change. Will separate.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. LGTM to merge after this is resolved.

@edoakes edoakes added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Jul 29, 2022
Signed-off-by: Alan Guo <[email protected]>
@alanwguo alanwguo removed the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Jul 30, 2022
@rkooo567
Copy link
Contributor

rkooo567 commented Aug 1, 2022

I will take a look at the PR tomorrow (please ping me if I dont')

@edoakes edoakes added the @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. label Aug 1, 2022
Copy link
Contributor

@rkooo567 rkooo567 left a comment

Choose a reason for hiding this comment

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

One comment to handle... Other things LGTM.

self.JOB_DATA_KEY.format(job_id=job_id),
async def put_info(self, job_id: str, data: JobInfo):
await self._gcs_aio_client.internal_kv_put(
self.JOB_DATA_KEY.format(job_id=job_id).encode(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, do you know what happens if you don't specify encode ? Does it just fail?

Copy link
Contributor

Choose a reason for hiding this comment

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

Little concerned the original _internal_kv_put has a runtime type conversion & checking, but it doesn't I know this PR handles that correctly, but just in case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, without encode, there is an error that gets thrown.

dashboard/modules/job/common.py Outdated Show resolved Hide resolved
@alanwguo alanwguo added v2.0.0-pick and removed @author-action-required The PR author is responsible for the next step. Remove tag to send back to the reviewer. labels Aug 5, 2022
return {
job_id: job_info
for job_id, job_info in await asyncio.gather(
*[get_job_info(job_id) for job_id in job_ids]
Copy link
Contributor

Choose a reason for hiding this comment

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

Btw, this is not a blocker for the PR. But I wonder @iycheng do we have APIs to get a list of entities from the internal kv?

Signed-off-by: Alan Guo <[email protected]>
@alanwguo
Copy link
Contributor Author

alanwguo commented Aug 6, 2022

@rkooo567 @architkulkarni @edoakes , please merge!

@rkooo567 rkooo567 merged commit 326b5bd into master Aug 6, 2022
@rkooo567 rkooo567 deleted the aguo/jobs-fast-follow branch August 6, 2022 02:33
alanwguo added a commit that referenced this pull request Aug 6, 2022
Updates jobs api
Updates snapshot api
Updates state api

Increases jobs api version to 2

Signed-off-by: Alan Guo [email protected]

Why are these changes needed?
follow-up for #25902 (comment)
@alanwguo alanwguo mentioned this pull request Aug 6, 2022
7 tasks
scv119 pushed a commit that referenced this pull request Aug 6, 2022
Updates jobs api
Updates snapshot api
Updates state api

Increases jobs api version to 2

Signed-off-by: Alan Guo [email protected]

Why are these changes needed?
follow-up for #25902 (comment)
Stefan-1313 pushed a commit to Stefan-1313/ray_mod that referenced this pull request Aug 18, 2022
Updates jobs api
Updates snapshot api
Updates state api

Increases jobs api version to 2

Signed-off-by: Alan Guo [email protected]

Why are these changes needed?
follow-up for ray-project#25902 (comment)

Signed-off-by: Stefan van der Kleij <[email protected]>
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.

None yet

6 participants