R
RunPod•7mo ago
wilStark43

Convert from cog to worker

I have a docker image created with the cog template and it works locally. I would like to convert it to run on serverless. I managed to convert by uploading to replicate and then using cog-worker but I would like to convert directly from local docker.
Solution:
in theory all you would need is to edit this part of dockerfile FROM r8.im/${COG_REPO}/${COG_MODEL}@sha256:${COG_VERSION}...
Jump to solution
16 Replies
Solution
Madiator2011
Madiator2011•7mo ago
in theory all you would need is to edit this part of dockerfile FROM r8.im/${COG_REPO}/${COG_MODEL}@sha256:${COG_VERSION}
wilStark43
wilStark43OP•7mo ago
So I would add FROM local image ? How would it be ?
Madiator2011
Madiator2011•7mo ago
FROM yourimagename I do not know what your image is named
wilStark43
wilStark43OP•7mo ago
I'm creating it, let's see if it works! 😅
Madiator2011
Madiator2011•7mo ago
other idea would be to fully rewritte worker to runpod packages but most likely it's paid gig
digigoblin
digigoblin•7mo ago
Not rewrite the runpod packages, rewrite the cog worker to use the RunPod SDK instead of being a cog worker
nerdylive
nerdylive•7mo ago
ohhh ya i read that wrong thats what i did for other template
digigoblin
digigoblin•7mo ago
Its pretty easy to adapt a cog worker to runpod if you are familiar with coding in Python
wilStark43
wilStark43OP•7mo ago
@Papa Madiator I modified the Dockerfile and it worked. thank you very much for the suggestion.
nerdylive
nerdylive•7mo ago
Wait without a handler code ? How did you do that
wilStark43
wilStark43OP•7mo ago
I had already configured predict.py and cog.yaml so cog-worker itself took care of everything.
nerdylive
nerdylive•7mo ago
Ohh ya
Patarapoom
Patarapoom•6mo ago
@wilStark43 Hi, I'd like to convert cog to runpod worker locally too. Can you show me the modified Dockerfile, thanks.
digigoblin
digigoblin•6mo ago
RunPod Blog
Serverless | Migrating and Deploying Cog Images on RunPod Serverles...
Switching cloud platforms or migrating existing models can often feel like a Herculean task, especially when it necessitates additional developmental efforts. This guide aims to simplify this process for individuals who have deployed models via replicate.com or utilized the Cog framework. Through a few straightforward steps, you'll learn how
Patarapoom
Patarapoom•6mo ago
Thankyou, I've read it. Now I have a repo with cog.yaml and predict.py on my computer. I want to convert it to rundpod worker. The blog use cog repo on replicate to build the runpod worker.
Madiator2011
Madiator2011•6mo ago
you can always build image locally and replace tag with local image tag
Want results from more Discord servers?
Add your server