R
RunPod•3mo 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•3mo 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
mehar5484•3mo 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
mehar5484•3mo 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•3mo 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
mehar5484•3mo 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•3mo ago
It's done automatically
mehar5484
mehar5484•3mo ago
Okay, Thankyou 🙂
Want results from more Discord servers?
Add your server
More Posts
Keeping reverse proxy hostname between destroy/startHello, I'm using network storage for my pod. My use case doesn't require the container to be up 24/Inconsistent performance of local runpods and production runpodsI tested my docker image locally using runpod and it worked fine, but after I uploaded the image to base_image in dockerless serverlesswhen "runpodctl project dev", use runpod/pytorch:2.0.1-py3.10-cuda11.8.0-devel-ubuntu22.04 as base_iServerless After Docker Image Pull, Error (failed to register layer: Container ID 197609 cannot...)detail system logs ```plaintext 2024-03-13T07:42:28Z ffd6a93e8d50 Extracting [=====================Cuda 12.0 version template is missingCan you please let me know on how to get Pytorch 2.0.1 and Cuda 12.0, this template i was using for Failed Serverless Jobs drain Complete BalanceHi, just like this GitHub issue (https://github.com/runpod-workers/worker-vllm/issues/29), I had myNot able to connect to Web Terminal after increasing the container disk size of the podI created a GPU pod, and was able to connect to Web Terminal fine. However, due to disk space issueServerless multi gpuI have a model deployed on 2 48 GB GPUs and 1 worker. It ran correctly for the first time with cuda Need to move credit from personal account to team accountHello, we wanted to add credit to the team account, but it wasn't clear we were adding to personal aHow can i make a follow up question to the endpointHow can i make a follow up question to the endpoint like a thread. Eg: Chat in chatGPT