Docker software stack for MBON server serving early-alert dashboards.
For more detailed documentation please see ./documentation/
.
Below is a list of "product" instances that are built with this framework. Each "product" instance is built on a git branch in this repository, based off of the master branch.
Name | git branch | status | URL | Description |
---|---|---|---|---|
SEUS Monitoring Dash | client-seus |
✔️ up | http://seus-dashboard.marine.usf.edu:3000 | Cram in tons of data from MBON, NERRS, & GR NMS. |
FGB NMS Sentinel Sites Dash | client-fgb |
✔️ up | http://fgbnms-dashboard.marine.usf.edu:3000 | Monitoring a ring of sites around the Flower Garden Banks National Marine Sanctuary where anomalously high values of chlorophyll-a concentration, for example, can be detected from satellite imagery before reaching the reefs. |
FK NMS | client-fk |
✔️ up | http://fknms-dashboard.marine.usf.edu:3000 | Monitoring of satellite, bouy, & river discharge data around the Florida Keys National Marine Sanctuary. |
FWRI SCTLD Dashboard | client-fwc |
❌ project ended | http://fwc-dashboard.marine.usf.edu:3000 | Monitoring the spread of stony coral tissue loss disease in the Florida Keys. |
Herein we use the terms dashboard "framework" for something that people can use to build their own "products". An example product: "A dashboard so show fish population correlated with nutrient data and satellite imagery". Versus the framework: "The stack that someone could install, configure, and populate the DB to build the aforementioned product."
The "master" branch of the repository is the framework used to build products. This framework contains the common core of software configuration and setup for any product build.
The client-*
branches (eg client-fgbnms, client-fk_water_quality, client-fknms, client-fwc) are products ready to be cloned built with minimal configuration.
For details on how to work within this organizational setup see the basic-workflow section below.
docker-compose.yml
handles most configuration.
The subdirectories (eg erddap, nginx, etc) contain container-specific files.
In general you will configure your stack by:
- Modifying
docker-compose.yml
and container-specific configuration files inside of./erddap/
,./grafana/
, etc. Directions for this is included within aREADME.md
file inside of each directory. Changes made to these files should be version controlled using git. - Setting up docker volumes so that data can persist when containers are recreated. Volumes are generally too large for git, so you should manage backups of these directories. A strategy for this is not included.
- Setting passwords & configuration in
.env
. This file should not be added to git for security reasons. A backup strategy for this file is not included.
It is suggested that you configure each container one-at-a-time. To do this simply comment out the relevant sections of docker-compose.yml.
- install docker & docker & the docker compose plugin
- add permissions to run docker for current user
sudo usermod -aG docker ${USER}
- copy code from github to your machine
git clone https://github.com/marinebon/mbon-dashboard-server.git -b client-fknms
- NOTE: be sure to choose the right branch name (
client-fknms
,client-fgbns
, etc)
- NOTE: be sure to choose the right branch name (
cd mbon-dashboard-server
git submodule update --init --recursive --remote
- Adjust settings. Products built on the mbon-dashboard-server base framework (like the FKNMS dashboard on the
client-fknms
branch) will already have configuration for these set up. Please take the REQUIRED steps below and use the OPTIONAL configuration options to further customize your usage as needed.- REQUIRED set passwords in the environment
.env
file.- see the
documentation/example_env_file
for an example.
- see the
- REQUIRED: create data dir for PostgreSQL - see
./postgres/README.md
- OPTIONAL: connect ERDDAP to your data - see
./erddap/README.md
- REQUIRED set passwords in the environment
- run initialization containers:
docker compose up airflow-init
- you will get a permissions error, so now you can chmod all the files that were created and run it again:
chmod -R 777 airflow/ influxdb/ grafana/ postgres/ && docker compose up airflow-init
- that should run without error and exit
- you will get a permissions error, so now you can chmod all the files that were created and run it again:
- start everything up:
docker compose up --build -d
- REQUIRED: toggle "on" airflow processing DAGs - see issue #12
- test it out (assuming your hostname is "localhost")
- http://localhost/ should show "welcome to nginx"
- http://localhost:8080/ should show a 404 from tomcat
- http://localhost:8080/erddap should show ERDDAP's page
- http://localhost:8086/health should show status report from InfluxDB
- http://localhost:3000/login should show grafana login
- http://localhost:5000 should show a data submission form from mbon_data_uploader
- http://localhost:8888 should show airflow login & admin dashboard after logging in
- steps for after things are running
4. OPTIONAL: load data into InfluxDB - see
./influxdb/README.md
5. OPTIONAL: modify grafana dashboards - see./grafana/README.md
SSL Certs set up using certbot & letsEncrypt. Must be done once for each server.
sudo certbot certonly --standalone
sudo cp /etc/letsencrypt/live/mbon-dashboards.marine.usf.edu/fullchain.pem certs/.
sudo cp /etc/letsencrypt/live/mbon-dashboards.marine.usf.edu/privkey.pem certs/.
502: bad gateway
error: this means that grafana can't connect to the timeseries database (influxDB).- check {URL}:8086/health to ensure InfluxDB okay
- check connection urls in the config, firewalls, etc
- check airflow jobs to ensure ingest is working.
The workflow here is to do any non-site-specific work on the master branch.
Each client installation then has a client-*
branch coming off of the master branch.
To update a client branch to use the latest master git rebase
is used.
- modify
docker-compose.yml
or files within container folders docker-compose up --build -d
to update what's runninggit pull
thengit commit
your changes- do not commit your
.env
or hostname changes toerddap/setup.xml
- do not commit your
git branch
to be see if you are on the right branchgit branch client-*-backup-1
to create new backup branchgit fetch
so git knows about remote repo changesgit rebase origin/master
to prepend changes from master- resolve any merge issues
git push --force-with-lease origin client-*
- !!! be careful with force pushing; it deletes history
- docker-compose
~> 1.28.5
. Not sure exactly the min version but1.21.2
was tested and does not work. - ERDDAP generally requires > 8GB memory and more is better.