full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

prestart.sh scaling to multiple nodes

Open totalhack opened this issue 5 years ago • 1 comments

Apologies if I'm just missing something, but I'm trying to understand how prestart.sh might scale to multiple nodes. It looks like it runs before the startup of the underlying fastapi container, but what is preventing it from running multiple times across multiple nodes? If a common database was in use I imagine that would cause issues with alembic or the initial_data.py script (on first startup anyway). Thanks for your help.

totalhack avatar Oct 06 '20 16:10 totalhack

im scaling celeryworker, running backend solo on a local volume so it only inits on first time startup. removing initials from celery and scaling it across x nodes in a multi host cluster. works like a charm.

you could also do persistent glusterfs volumes to combat the inits.

haviduck avatar Oct 07 '20 02:10 haviduck