The RecipeRadar backend provides data persistence and modeling services.
It provides endpoints to support the following functionality:
The service is composed of two Kubernetes deployments:
backend-deployment
- gunicorn
web podsbackend-worker-deployment
- celery
task workersMake sure to follow the RecipeRadar infrastructure setup to ensure all cluster dependencies are available in your environment.
To install development tools and run linting and tests locally, execute the following commands:
$ make lint tests
To deploy the service to the local infrastructure environment, execute the following commands:
$ make
$ make deploy
For the search engine to correctly index recipe data, an OpenSearch mapping needs to be configured for the recipe
index. This can be done using the update-recipe-index.py
script:
# For an OpenSearch instance running on 'localhost' on the default port
$ venv/bin/python scripts/update-recipe-index.py --hostname localhost --index recipes
Sometimes -- for example, during schema upgrades or other changes which need careful co-ordination between the search engine, API, and background task workers, it can be useful to pause the workers temporarily.
Since the workers are a Kubernetes deployment
, a straightforward way to do this is to scale the deployment down to zero temporarily:
$ kubectl scale deployments/backend-worker-deployment --replicas 0