R
RunPod•9mo ago
mehar5484

How do i restart worker automatically or using some script?

I have used this GitHub repository at https://github.com/runpod-workers/worker-template to implemet CI/CD. I'm encountering an error in the testing part, but for now, I'll overlook it. From what I understand of this code, it creates a Docker image and pushes it to Docker Hub. It also tests an already deployed model. However, when pushing a new image, the worker should restart as the current endpoint is using the old cached Docker image. How can I ensure that I get inference from the latest Docker image?
GitHub
GitHub - runpod-workers/worker-template: 🚀 | A simple worker that c...
🚀 | A simple worker that can be used as a starting point to build your own custom RunPod Endpoint API worker. - runpod-workers/worker-template
8 Replies
ashleyk
ashleyk•9mo ago
Use version tags for your serverless images, don't push to the same tag. Then do a new deployment to update to the new tag when you push a new image. When you do a new deployment, your previous workers will go "stale" and the new ones will show as "latest" and the "latest" ones will handle the requests from the queue. Eventually all the "stale" workers will be replaced.
mehar5484
mehar5484OP•9mo ago
@ashleyk Thank you for your response. Could you also provide a documentation link or some guidance on how to make a new release on Runpod using Python?
mehar5484
mehar5484OP•9mo ago
@ashleyk What I understand is that I just need to change the "imageName" field, specifically the tag from "latest" to a new tag, and it will create a new release. Is that correct? Also the link is for tamplate, i need to update endpoint too. will this work for both?
ashleyk
ashleyk•9mo ago
Don't ever use latest tag in serverless, its bad practice and a terrible idea. Use version tags. latest tag is fine for pods, but you are in for a world of pain if you do it in serverless. Change tag from 1.0.0 to 1.0.1 etc.
mehar5484
mehar5484OP•9mo ago
@ashleyk The last thing I want to ask is regarding the link you provided for modifying a serverless template. Suppose I've created a template with a Docker image, like "runpod/serverless-hello-world:v1.0.0" If I want to make a new release, I'll need to use the "Modify serverless Template" curl request and change the tag to the latest one, for example, "runpod/serverless-hello-world:v1.0.1". After this, how do I make a new release for the endpoint? Is it automatically done for the endpoint or do I need to follow the "Modify an existing Serverless Endpoint" process?
ashleyk
ashleyk•9mo ago
It's done automatically
mehar5484
mehar5484OP•9mo ago
Okay, Thankyou 🙂
Want results from more Discord servers?
Add your server