mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-22 20:11:53 +00:00
a2ab216531
* chore(Celery): add basic Celery worker with broker only * chore(Celery): saving progress. Not able to schedule tasks * fix(Celery): add celery app for use by django * fix(Celery): register tasks * fix(Docker): add celery workers to docker-compose * chore(Celery): add django-celery-results backend to store results using Django ORM * fix(Celery): get app config the correct way * fix(Docker): start connecting docker Celery workers to Valkey not yet operational * fix(Celery): get celery & django to work in docker-compose * docs(Celery): document how to run Celery in development environment includes changes to support the configuration and deployment of Celery worker and its dependencies, Valkey and Postgres. * fix(GHA): add valkey to CI services * fix(GHA): add valkey to CI services * fix(GHA): add valkey-cli ping to CI services * fix(GHA): use right port for valkey * fix(Views): remove debug task code * test(Celery): start adding celery task tests not yet working! * fix(pyproject): rollback django upgrade * fix(docker): updated docker runtime and env vars based on feedback from #20 * fix(Dockerfile): include dependencies for psutil psutil was introduced by pytest-celery * fix(Backend): PRWLR-4013 fix celery settings structure * fix(Celery): update celery app to work with new settings structure * fix(Views): remove debug task code * fix(Config): remove debug code * fix(Celery): update celery app name when running worker --------- Co-authored-by: Víctor Fernández Poyatos <victor@prowler.com>
41 lines
786 B
Bash
Executable File
41 lines
786 B
Bash
Executable File
#!/bin/sh
|
|
|
|
|
|
apply_migrations() {
|
|
echo "Applying database migrations..."
|
|
poetry run python manage.py migrate --database admin
|
|
}
|
|
|
|
start_dev_server() {
|
|
echo "Starting the development server..."
|
|
poetry run python manage.py runserver 0.0.0.0:"${DJANGO_PORT:-8080}"
|
|
}
|
|
|
|
start_prod_server() {
|
|
echo "Starting the Gunicorn server..."
|
|
poetry run gunicorn -c config/guniconf.py config.wsgi:application
|
|
}
|
|
|
|
start_worker() {
|
|
echo "Starting the development worker..."
|
|
poetry run python -m celery -A config.celery worker -l "${DJANGO_LOGGING_LEVEL:-info}"
|
|
}
|
|
|
|
case "$1" in
|
|
dev)
|
|
apply_migrations
|
|
start_dev_server
|
|
;;
|
|
prod)
|
|
apply_migrations
|
|
start_prod_server
|
|
;;
|
|
worker)
|
|
start_worker
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {dev|prod|worker}"
|
|
exit 1
|
|
;;
|
|
esac
|