Repository navigation
feat(serverless): address an environment on invoke and getTask (RUNSERV-1238) - #12
Conversation
…RV-1238) An app id now names one copy per environment. The client takes serverlessEnvironment, each call can override it, and unset sends nothing so the platform keeps reading production. Waiting polls in the invocation's environment, since a task carries none of its own. Signed-off-by: Rafal Leszko <rafal.leszko@runware.ai>
|
Important Review skippedAuto reviews are disabled on this repository. To trigger a review, include ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Review follow-ups: an invalid serverlessEnvironment now fails in createClient and names the config field, and the query value is encoded. Tests cover the name boundaries, null from untyped JS, the hint without an environment and the smoke test's optional RUNWARE_SERVERLESS_TEST_ENVIRONMENT. Signed-off-by: Rafal Leszko <rafal.leszko@runware.ai>
…RUNSERV-1238) A paused environment answers invoke with a 429 that holds until the budget is raised or the UTC month turns, so retrying it, or sleeping on its Retry-After, only delays the error. It now rejects with a quota error at once; any other 429 is still retried. Signed-off-by: Rafal Leszko <rafal.leszko@runware.ai>
felixsanz
left a comment
There was a problem hiding this comment.
environment reaches both public methods, the fallback order is right, and polling getTask in the environment the task was invoked in is the detail that would have bitten. merging
RUNSERV-1238: an app id now names one copy per environment, so the client has to say which one it means.
createClient({ serverlessEnvironment: 'staging' })sets it for the client;invoke({ environment })andgetTask(appId, taskId, { environment })override it per call.environmentparameter, so the platform readsproductionand existing callers send exactly the same requests as before.serverlessEnvironmentfails increateClient.https://docs.runware.ai/serverless/errors#environment-pausedis now aquotaerror raised at once, not retried and not slept on itsRetry-After; any other 429 is retried as before. The pause PR must use that type.The SDK has no deploy or app reads yet, so invoke and getTask are the whole surface this touches. Mirrors Runware/runware-python#5.
Release note: the prod API (as of
bf039685) predates environments and ignores the parameter, which means a non-production call would reach the production copy. Publish only once prod runs Runware/serverless#787 or later; dev already does. Merge after the RUNSERV-1240 pause work, so the paused type above is live.Tested:
lint,typecheck,bun test(377 passed),build, and a local run against the serverless API frommainwith production and staging copies of one app: each copy's tasks ran on its own consumer and were readable only in their own environment. Against the prod API commit,environment=stagingran on the production copy, hence the release note.