-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
return Dict() | ||
else | ||
return JSON3.read(rsp.body) | ||
end |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 💯
There was a problem hiding this comment.
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? 🤷
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Egggselent. thank you!
This introduces
suspend_engine
andresume_engine
methods that can suspend and resume engines. Relies on https://github.com/RelationalAI/raicloud-control-plane/pull/4108 to be merged and deployed.