coco-annotator
coco-annotator copied to clipboard
Multiple coco instances on the same host
I am trying to run 2 coco installations on the same machine. The first installation perfectly works using your default docker-compose file. But to make the second install run on the same host without conflict, I need to "instantiate" the docker-compose file by updating, the container names (webserver-dev, workers-dev, messageq-dev, database-dev) , the volume names (mongodb_data-dev), the network name (cooannotator-dev) and the mapped UI port (xxx:5000. But at docker-compose start, the web server keeps restarting again and again.
Not sure this is a COCO issue.. I maybe missed something somewhere (hostname, env variable in docker-compose?) since it still refers to "database" and "messageq" ... (but no documentation about that).
The logs:
| [2020-07-13 13:50:46 +0000] [10] [ERROR] Exception in worker process
annotator_webclient-dev | Traceback (most recent call last):
annotator_webclient-dev | File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
annotator_webclient-dev | worker.init_process()
annotator_webclient-dev | File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/geventlet.py", line 102, in init_process
annotator_webclient-dev | super(EventletWorker, self).init_process()
annotator_webclient-dev | File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
annotator_webclient-dev | self.load_wsgi()
annotator_webclient-dev | File "/usr/local/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
annotator_webclient-dev | self.wsgi = self.app.wsgi()
annotator_webclient-dev | File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
annotator_webclient-dev | self.callable = self.load()
annotator_webclient-dev | File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
annotator_webclient-dev | return self.load_wsgiapp()
annotator_webclient-dev | File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
annotator_webclient-dev | return util.import_app(self.app_uri)
annotator_webclient-dev | File "/usr/local/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
annotator_webclient-dev | import(module)
annotator_webclient-dev | File "/workspace/webserver/init.py", line 63, in
........
[2020-07-13 13:50:39,816: ERROR/MainProcess] consumer: Cannot connect to amqp://user:**@messageq:5672//: failed to resolve broker hostname. annotator_workers-dev | Trying again in 16.00 seconds... annotator_workers-dev |
........
If you have any idea .. (thxx again) Regards Michael
pymongo.errors.ServerSelectionTimeoutError: database:27017: [Errno -2] Name or service not known
You should also change the names of the service/docker volumes, the db cannot connect
As you can see in my docker-compose.yml, there is no "database" occurence... Moreover, from the annotator_webclient-dev container, I cannot ping database, but I can ping database-dev. "database" (and messageq) is probably hardcoded somewhere... or maybe an env variable can be set at the docker-compose.yml level to target the right names ....
Take a look at https://github.com/jsbroks/coco-annotator/blob/master/backend/config/config.py you will need to change some values
Thanks a lot.. I replaced 2 "database" occurences by "database-dev" ... and I docker-compose up again... but still the same error ("database:27017: [Errno -2] Name or service not known"). Even If I think I covered all occurences (.txt below)
(thx again for your help)
if you make changes in coco code, you must use docker-compose.build.yml because normal docker-compose.yml get images from docker repo without your changes