This repository hosts the code for a dashboard for the LENS2 dataset using FastAPI and D3.js.
To get started, clone this repository using git clone --recurse-submodules https://github.com/NCAR/LENS2-Dashboard-D3.git
The environment.yml
will allow you to recreate the environment required for this project. You will need conda
installed, which you can find here. This tutorial on conda by ProjectPythia will help you install and understand the basics of environment management with conda.
Once you have conda installed, you can use the following commands to recreate the environment.
cd LENS2-Dashboard-D3 && conda create --prefix ./.env -c conda-forge mamba
This will create a directory called.env
in your local copy of theLENS2-Dashboard-D3
repository and installmamba
in it.mamba
is faster than conda in solving environments.conda activate ./.env && mamba env update --file environment.yml --prefix ./.env
- This will start creating the environemnt in the.env
directory based on theenvironment.yml
file.conda activate ./.env
and voila! you just activated the environment required to run the back-end server. You will still need t
This back-end is tied to the front-end code hosted at the NCAR/d3-CESM-tiling repository. The back-end imports this code as a git submodule. The submodule contents can either be fetched during cloning the back-end this repository by specifying the --recurse-submodules
flag, or manually by executing the following command:
git submodule update --init
Once you have the environment activated, the following commands are required to (1) start a dask cluster, (2) start some dask workers, and (3) start the fastapi server.
dask scheduler --host localhost --port 8786
dask worker --host localhost --nworkers 16 --memory-limit '2GB' localhost:8786
uvicorn --reload app:app
gunicorn -k uvicorn.workers.UvicornWorker app:app