Centralized API for accessing release and support lifecycle information for all Canonical products.
Canonical products have different release cadences and support models. This API provides a single source of truth for release dates and support lifecycles.
The simplest way to run the API locally is using dotrun:
docker-compose up -d
dotrunOnce the server has started, you can visit http://0.0.0.0:8040/ in your browser.
After you close the server with <ctrl>+c you should run docker-compose down to stop the database.
- Docker
- Python 3.10+
dotrun(see https://github.com/canonical/dotrun)
dotrun installIf you need to run migrations locally, use a host-local virtualenv:
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip setuptools==69.5.1
pip install -r requirements.txtdocker-compose up -d
dotrun serveThe API will start at http://0.0.0.0:8040/ with a health endpoint at /v1/health.
On Linux, DATABASE_URL in .env uses localhost.
On macOS and Windows, Docker networking can behave differently. If the API
cannot connect to Postgres, create a local override file .env.local and set:
DATABASE_URL=postgresql://postgres:pw@host.docker.internal:5433/products_dbRun migrations from the host virtualenv (not through dotrun exec):
source .venv/bin/activate
set -a && source .env && set +a
export FLASK_APP=webapp.app
docker-compose up -d postgres
flask db upgradeUseful checks:
flask db current
flask db headsNote: avoid dotrun exec flask db ... for local migrations, as that runtime may use a different network/path context than the host .env values.
dotrun testOn Linux, TEST_DATABASE_URL in .env uses localhost.
On macOS and Windows, Docker networking can behave differently. If tests cannot
connect to Postgres, create a local override file .env.local and set:
TEST_DATABASE_URL=postgresql://postgres:pw@host.docker.internal:5433/test_products_dbdotrun lint-python # Run linters
dotrun format-python # Auto-format Python codeapp.py– WSGI entrypoint for production serverswebapp/app.py– Flask application usingFlaskBaserequirements.txt– Python dependenciespackage.json– Node.js scripts and development tasks