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

RAI-8289 add suspend/resume functionality to julia sdk #94

Merged
merged 8 commits into from
Feb 16, 2023

Conversation

janrous-rai
Copy link
Contributor

This introduces suspend_engine and resume_engine methods that can suspend and resume engines. Relies on https://github.com/RelationalAI/raicloud-control-plane/pull/4108 to be merged and deployed.

@janrous-rai janrous-rai requested a review from bradlo December 6, 2022 21:32
@janrous-rai janrous-rai changed the title Add suspend/resume functionality RAI-8289 add suspend/resume functionality to julia sdk Dec 16, 2022
@janrous-rai janrous-rai requested review from NHDaly and removed request for bradlo January 30, 2023 18:23
return Dict()
else
return JSON3.read(rsp.body)
end
Copy link
Member

Choose a reason for hiding this comment

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

Do 202s not have a body? Does it not work to do JSON3.read() on an empty body, just in case this changes in the future, or we add a different endpoint that can return 202?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, there's no body for 202. If I call JSON3.read on empty body it throws: ArgumentError: invalid JSON at byte position 0 while parsing type Any: UnexpectedEOF

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm. Thanks for this question. I thought about it some more. The key issue here was that our control plane did not support sending 202 (the correct response) along with the payload. Perhaps this should be addressed too. But in the end, I realized that rather than bypassing JSON3.read based on the response code, I can simply return empty dict if the response payload is empty, so I have modified the code. This works and should be robust enough.

Copy link
Member

Choose a reason for hiding this comment

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

perfect yeah i think that's much more robust. Great change! Thanks for thinking it through 💯

Copy link
Member

Choose a reason for hiding this comment

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

Also it's a bit weird that this function is swallowing the return codes.. those seem useful? 🤷

Copy link
Member

Choose a reason for hiding this comment

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

i know it was like that before you came here. just an observation

Copy link
Member

@NHDaly NHDaly left a comment

Choose a reason for hiding this comment

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

Egggselent. thank you!

@NHDaly NHDaly merged commit 0adc238 into main Feb 16, 2023
@NHDaly NHDaly deleted the jr-suspend-and-resume branch February 16, 2023 17:29
@janrous-rai janrous-rai restored the jr-suspend-and-resume branch February 16, 2023 20:32
@msagarpatel msagarpatel deleted the jr-suspend-and-resume branch March 7, 2023 03:56
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.

2 participants