In this project, we use Celery as workers, RabbitMQ as the broker, Flask as the application and MariaDB as the database. How the overall service workflow works can be seen in figure below.
-
enter
blackbox
folder, run following commandssudo bash chmod +x requirements.sh ./requirements.sh
get the
CONTAINER_ID
of FEniCS, anddocker exec -it CONTAINER_ID /bin/bash
to enter it. Then runchmod +x steps.sh ./steps.sh
inside the container, to have mesh files and the solver well-prepared. Then exit the container and copy them to
/docker/celery/
folder for further using. Arguments related to generating mesh files can be modified insteps.sh
-
Build app and worker images by
docker-compose build
Start all services with N workers by
docker-compose up --scale worker=N
-
Enter one worker by
docker exec -it docker_worker_1 /bin/bash
Call Celery task by
python3 run.py mesh_xml/NAME_OF_A_MESH_XML_FILE
whereNAME_OF_A_MESH_XML_FILE
is any mesh file existing inmesh_xml
Arguments related to the solver can be modified in
/docker/celery/tasks.py
Celery will distribute tasks to workers. Messages about overall calculation process can be shown through RabbitMQ.