How do indicated job status in a handler?
For example in https://docs.runpod.io/serverless/workers/handlers/handler-async
Dopes the job status automatically becomes "COMPLETED" after
async_generator_handler
returns? In general how do you update the status of the job in runpod python sdk?
What I am trying to achieve is to use a single machine at a time for training purposes. I am not sure 1 hour long POST request is a good idea. How should this be done?Asynchronous Handler | RunPod Documentation
RunPod supports the use of asynchronous handlers, enabling efficient handling of tasks that benefit from non-blocking operations. This feature is particularly useful for tasks like processing large datasets, interacting with APIs, or handling I/O-bound operations.
3 Replies
I'm far from an expert here, so take with bath salts, but sounds like you don't need to stream the results back. So using a non-generator handler response and instead calling the run endpoint getting an id back and then periodically checking it's status via polling the status endpoint with that id, which will eventually result in a COMPLETED status and include the resulting data you need to return. You could also use a webhook to do a more push oriented style rather than polling, if you have some other serivce to push a result / notification to.
So basically after async request is made after
async_generator_handler
returned, the status becomes "COMPLETED"?
Also side question, any idea how to log? Prints and python logging seem to get supressedIts normal for logging to be suppressed if your logs are too verbose. Try logging less.