Skip to content

WHOIGit/rtodd_gliders_site

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

111 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glider App

Web application for visualizing WHOI Spray autonomous underwater glider deployments. Built with Dash, Plotly, and Flask. Displays real-time and archived glider tracks, sensor profiles, and research publications.

Deployment

The app runs in Docker on racing at /opt/gliderapp.

Build and launch

ssh racing
cd /opt/gliderapp
git fetch && git pull
docker compose up --build --force-recreate -d

This builds a Python 3.12 image, installs dependencies, and starts gunicorn on port 8050. The container restarts automatically unless explicitly stopped.

If the codebase changes, these are also the steps needed to deploy the code changes.

Key details

  • Port: 8050
  • WSGI server: gunicorn
  • Volumes: ./data and ./config are mounted read-only into the container
  • Environment: PROD=1 and DEBUG=0 are set in compose.yml

Configuration

Config files live in config/ and are mounted into the container at runtime. Changes take effect after restarting the container (docker compose up --force-recreate -d).

File Purpose
config/homepage.html Home page content (rendered as raw HTML)
config/datapage.html Data page content (rendered as raw HTML)
config/people.yml Team members — names, roles, emails, websites, and portrait image filenames
config/people-imgs/ Portrait images referenced by people.yml
config/map_regions.yml Map view presets (center coordinates, zoom level)
config/publications.html Publications list (generated by the bibtex module — see below)

Environment variables

Set in compose.yml for production; override in .env for local development.

Variable Default Description
PROD 1 Enables production routing (/dashapp/ prefix)
DEBUG 0 Debug mode
PORTRAITS_DEFAULT default.jpg Fallback portrait image
PUBLICATIONS_HTML_PATH config/publications.html Path to publications HTML
HOME_HTML_PATH config/homepage.html Path to home page HTML
DATAPAGE_HTML_PATH config/datapage.html Path to data page HTML

Local Development

Run the app directly with Python (no Docker needed):

PROD=0 DEBUG=1 python src/app.py

The app will be available at http://localhost:8050.

BibTeX Module

The bibtex/ directory contains a pipeline for converting a BibTeX bibliography into formatted HTML for the publications page.

Prerequisites

  • pandoc — install with sudo apt install pandoc pandoc-citeproc (Debian/Ubuntu)
  • Python 3 environment with beautifulsoup4 and lxml

Usage

./bibtex/bib2html.sh bibtex/input/refs.bib

This generates bibtex/output/publications.html. To write directly to config:

./bibtex/bib2html.sh bibtex/input/refs.bib config/publications.html

What it does

  1. pandoc converts the .bib file to HTML using the AGU citation style (american-geophysical-union.csl). The frontmatter.md file includes nocite: '@*' so all entries are rendered.
  2. reformat.py post-processes the HTML:
    • Groups references under year headings (newest first)
    • Cleans up DOI links (https://doi.org/10.xxxx/yyydoi: 10.xxxx/yyy)
    • Bolds author names listed in bibtex/input/bold_authors.txt
    • Strips <html>/<body> tags for embedding

Files

bibtex/
├── input/
│   ├── refs.bib              # Main bibliography
│   └── bold_authors.txt      # Authors to bold (one per line, e.g. "Todd, R. E.")
├── output/
│   └── publications.html     # Generated output
├── american-geophysical-union.csl  # Citation style
├── frontmatter.md            # Pandoc frontmatter
├── bib2html.sh               # Conversion script
└── reformat.py               # Post-processing script

Updating publications

  1. Edit bibtex/input/refs.bib (add/remove BibTeX entries)
  2. Run ./bibtex/bib2html.sh bibtex/input/refs.bib config/publications.html
  3. Commit and deploy
    • docker compose up --force-recreate -d

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors