An API to create and manage workflows using Celery tasks.
This is a ReST API wrapper of sca_rhythm.Workflow
- Clone the repo -
git cloneandcd rhythm_api - Generate Keys:
cd keys; ./genkeys.sh - Create .env:
cp .env.example .env - Start the server -
docker compose up -d mongo queue api
- Clone the repo -
git cloneandcd rhythm_api - Install poetry
- Start Mongo and RabbitMQ -
docker compose up -d - Generate Keys:
cd keys; ./genkeys.sh - Create .env:
cp .env.example .env - Start the server -
poetry run devoruvicorn rhythm_api.main:app --reload
docker compose run --rm mongobackupBackup are in db/backups
# PWD - go to project root where the docker-compose.yml is
mkdir -p db/mongodump
cp mongo/*.json db/mongodump/
docker-compose up mongo -d
docker-compose exec mongo bash
$ cd /opt/sca/app/mongodump
$ mongoimport --uri 'mongodb://root:example@localhost:27017/?authSource=admin' --jsonArray --db celery --collection celery_taskmeta --file celery_taskmeta.json
$ mongoimport --uri 'mongodb://root:example@localhost:27017/?authSource=admin' --jsonArray --db celery --collection workflow_meta --file workflow_meta.jsonsudo docker compose -f "docker-compose-prod.yml" exec api python -m rhythm_api.scripts.issue_token --sub <app-id>Production deployment of Uvicorn
gunicorn -k uvicorn.workers.UvicornWorker --bind :5001 --workers 1 --threads 1 --timeout 0 rhythm_api.main:apppython -m celery -A tests.tasks worker --concurrency 2This will start celery workers to run tasks in tests.tasks
poetry update is not installing the latest version of sca-rhythm. The workaround is
- update
pyproject.tomlwith the latest version ofsca-rhythm pip uninstall sca-rhythmpoetry cache clear pypi --all- poetry update