fauxpilot icon indicating copy to clipboard operation
fauxpilot copied to clipboard

modify build dir of copilot_proxy

Open luanshaotong opened this issue 3 years ago • 6 comments

After setup, models directory can take up a lot of space. It will take long time to build copilot_proxy image for "Sending build context to Docker daemon". This commit changes build directory to ./copilot_proxy, to avoid sending build context in root directory.

luanshaotong avatar Oct 11 '22 15:10 luanshaotong

This problem is also caused by #49, I think it's a good idea to rollback it and do the same PR after a while. At least it might be better for posting this image on DockerHub.

Frederisk avatar Oct 14 '22 14:10 Frederisk

Is the issue here mainly with the mymodels directory? If so, maybe a cleaner fix would be to just add that to our existing .dockerignore file?

moyix avatar Oct 14 '22 14:10 moyix

If using ignore files, we need to write something like this:

**/* # ignore every files
!copilot_proxy/* # except in the copilot_proxy

It's ugly. Or have any other ideas? 🤔

Frederisk avatar Oct 14 '22 15:10 Frederisk

I'm ok with doing the docker build from the copilot_proxy dir, it makes a lot of sense! How is that related to #49 though? I think I was the one who set up the Dockerfile this way :)

moyix avatar Oct 14 '22 17:10 moyix

Hmm, I mention #49 because: in 6b69437b7e95d5d7c3efb88bdda0d5a8248bd95c, context has moved from the original location to the current folder.

Frederisk avatar Oct 15 '22 04:10 Frederisk

A boring solution could be to move the Dockerfiles to the root, move models to converter, by having the Dockerfiles in the root, we can also have dockerignores per Dockerfile while keeping the convenience of building from the root.

e.g.

api.Dockerfile
api.dockerignore

converter.Dockerfile
converter.dockerignore

fdegier avatar Oct 19 '22 15:10 fdegier

Thanks for your contribution @luanshaotong !

fdegier avatar Feb 13 '23 15:02 fdegier