A Dash-based web app to visualize NGEN model output for the Dangermond Preserve in Santa Barbara County, CA.
The app includes an Anaconda-based environment.yml
as well as requirements.txt
. The Anaconda environment is useful for local development, while the pip-based requirements.txt
is included in the Docker image for deployment.
-
Clone the repository:
git clone https://github.com/LynkerIntel/TNC_dangermond_webapp.git
-
Create a Conda environment (or use any Python environment):
conda create --file environment.yml
-
Activate the environment:
conda activate tnc_web_env
-
Set up AWS credentials (if running locally):
- Ensure you have local AWS credentials with access to the
tnc_dangermond
bucket. - Edit your AWS credentials file:
vi ~/.aws/credentials
- If the app resources are hosted in a different bucket or an alternative cloud service, update
./data_loader.py
with the appropriate base directory or request method.
- Ensure you have local AWS credentials with access to the
-
Navigate to the project directory:
cd TNC_dangermond_webapp
-
Run the application:
python application.py
-
Clone the repository:
git clone https://github.com/LynkerIntel/TNC_dangermond_webapp.git
-
With Docker installed, start the container:
docker compose up --build
The app is deployed for testing and development with a free render
server instance, via Dockerhub image.
The container is built via docker-compose.yml
which attaches secrets to the container via an .env
and exposes port 10000. The .env
should contain AWS credentials (or alternative data location) in order to access the S3 bucket. Note that render.com uses amd64
architecture, which is defined in the Dockerfile
. For deployment elsewhere, such as ECS, this should be updated to the proper platform.
The data required to run the app is a series of parquet files (and .csv). These are monthly aggregations (in the case of ngen model output) as well as a repackaging of groundwater data from the dendra repository. The total storage size is only around ~15mb. The files are:
/tnc-dangermond/webapp_resources/cfe_20241103_troute_cat23.parquet
/tnc-dangermond/webapp_resources/cfe_routed_flow_monthly_af.parquet
/tnc-dangermond/webapp_resources/cfe_routed_flow_monthly_cfs.parquet
/tnc-dangermond/webapp_resources/flow_17593507_mean_estimated_1982_2023.csv
/tnc-dangermond/webapp_resources/gw_level_raw_hourly_feet.parquet
/tnc-dangermond/webapp_resources/ngen_validation_20241103_monthly.nc