Changeset View
Changeset View
Standalone View
Standalone View
dockerfiles/swh-listers-worker/entrypoint.sh
Show All 39 Lines | *) | ||||
if psql -lqt | cut -d \| -f 1 | grep -qw ${POSTGRES_DB}; then | if psql -lqt | cut -d \| -f 1 | grep -qw ${POSTGRES_DB}; then | ||||
echo Database already exists, nothing to do | echo Database already exists, nothing to do | ||||
else | else | ||||
echo Creating database | echo Creating database | ||||
createdb ${POSTGRES_DB} | createdb ${POSTGRES_DB} | ||||
echo Initialize database | echo Initialize database | ||||
python -m swh.lister.cli --create-tables --with-data \ | python -m swh.lister.cli \ | ||||
--db-url postgres://${PGUSER}@${PGHOST}/${POSTGRES_DB} \ | --db-url postgres://${PGUSER}@${PGHOST}/${POSTGRES_DB} \ | ||||
all | all | ||||
fi | fi | ||||
echo Starting the swh-lister Celery worker for ${SWH_WORKER_INSTANCE} | echo Starting the swh-lister Celery worker for ${SWH_WORKER_INSTANCE} | ||||
exec python -m celery worker \ | exec python -m celery worker \ | ||||
--app=swh.scheduler.celery_backend.config.app \ | --app=swh.scheduler.celery_backend.config.app \ | ||||
--pool=prefork --events \ | --pool=prefork --events \ | ||||
--concurrency=${CONCURRENCY} \ | --concurrency=${CONCURRENCY} \ | ||||
--maxtasksperchild=${MAX_TASKS_PER_CHILD} \ | --maxtasksperchild=${MAX_TASKS_PER_CHILD} \ | ||||
-Ofair --loglevel=${LOGLEVEL} --without-gossip \ | -Ofair --loglevel=${LOGLEVEL} --without-gossip \ | ||||
--without-mingle --without-heartbeat \ | --without-mingle --without-heartbeat \ | ||||
--hostname "${SWH_WORKER_INSTANCE}@%h" | --hostname "${SWH_WORKER_INSTANCE}@%h" | ||||
;; | ;; | ||||
esac | esac |