cog
cog copied to clipboard
Custom Dockerfile / Docker images
It would be nice if you could specify a starting docker image instead of dependencies and system_packages in the cog.yaml. That would be helpful for use cases where you have your own build process that produces an image you want to use, but you're still interested in using cog for everything else it provides.
👍 We have been thinking of some escape route. Some ideas:
- Some way of using the predictor/HTTP server/queue worker independently
- Some way to "eject" the Dockerfile so you can do it all yourself
- Some way of specifying your own image/Dockerfile in
cog.yaml
The risk is things breaking in weird ways because the base image isn't quite what Cog expects, so it'll need some big "you better know what you're doing if you touch this!" warnings.
Out of interest – what things do you want from Cog on your own images? Is it just the predictor/HTTP server/queue worker, or is the CLI and some other things too?
Makes sense! One thing that occurs is if the output of the generator was a "Dockerfile.lock", like poetry.lock or equivalent. Then it would be relatively straightforward to run the build once and add some custom logic to the generated Dockerfile rather than saying "I promise this image has the same starting dependencies." That said, I'd be happy with "supply your starting image, it'd better be like either python or cuda-XX" too.
I am not sure which pieces are best for me, since I haven't been able to adopt it for my real use cases yet without having more control over the build, but a few things are big draws:
- the builtin queuing without sacrificing the ability to locally use http (and not having to write that custom over and over again)
- the CLI syntax for prediction -- not that I'd be too put out using the same syntax without the
cogsugar, I just like the interface's handling of paths and such
Wondering if this ever went anywhere? Looking to cog'ify a nerfstudio image that has an existing docker file and wondering if I'm just reproducing existing work