The Cuizinart is a cloud-based platform that provides an interactive portal for researchers to "slice and dice" large NetCDF datasets across the GWF program and beyond. The platform provides an easy-to-use interface similar to Google Maps: researchers select products and variables of interest, provide geographical bounds, and after a short wait, are delivered a custom dataset that meets their exact specifications.
For the production setup of Cuizinart and CaSPAr, refer to https://github.com/gwf-uwaterloo/production.
- Install packages:
pip install -r requirements.txt - PySpark backend:
- Make sure
$SPARK_HOMEis set - Run
geopyspark install-jar
- Make sure
- Frontend: Run
npm installinfrontend
-
Create a file
.envin the base folder, as described indocs/env.md -
Create an ssh keyfile that will be used to transfer requests to the remote data processing engine:
- Run
ssh-keygen -f cuizinart/.id_rsa -t rsa -N '' - Transfer the created
.id_rsa.pubto the remote server
- Run
-
If not using Docker: Create the metadata database:
- In a
psqlshell, type:create database cuizinart - In the base directory, run
flask db init,flask db migrate,flask db upgradeto create the tables. - Run
flask pyspark-init <pwd>to create a user for the PySpark slicer.
- In a
Currently, we have a development deployment in tuna under /home/mgauch/dev-cuizinart/ (running the master branch, no nginx server) and
- a cuizinart production deployment in
/home/mgauch/cuizinart-prod/(running thecuizinart-prodbranch) - a CaSPAr production deployment in
/home/mgauch/caspar-prod/(running thecaspar-prodbranch). The production deployments are accessed through an nginx server, deployed from/home/mgauch/production. Once code is known to run fine ondev-cuizinart, wegit mergemasterinto*-prod.
- Run
docker-compose upor start containerscuizinart,postgres,pysparkas needed. - To deploy code changes, run
docker-compose stop cuizinart,docker-compose build cuizinart,docker-compose up cuizinart.
-
Serving the frontend:
- For development and debugging, run
npm startincuizinart/frontend/to start the frontend server on port 3000. - To deploy for production, run
npm run buildincuininart/frontend/
- For development and debugging, run
-
Run
python cuizinart/main.pyto start the backend facade. In case you chosenpm run buildin the previous step, this Flask app will serve the webpage. -
Run
python cuizinart_pyspark/pyspark_app.pyto start the PySpark cuizinart.
- Run
flask users create <email> --password <pwd> -a. (When using Docker, you need to run this in thecuizinartcontainer.)