4 Commits

Author SHA1 Message Date
1c61b70fb9 Merge pull request 'develop' (#4) from develop into main
All checks were successful
CI / ci (push) Successful in 18s
Docker build and release / build-and-push (push) Successful in 39s
Docker build and release / release (push) Successful in 14s
Reviewed-on: #4
2026-02-12 20:32:18 +03:00
81038e94d5 Merge pull request 'develop' (#3) from develop into main
Some checks failed
CI / ci (push) Successful in 14s
Docker build and release / build-and-push (push) Failing after 13s
Docker build and release / release (push) Has been skipped
Reviewed-on: #3
2026-02-07 18:15:54 +03:00
3433fa2fb8 Merge pull request 'Update Docker build workflow to enforce lowercase repository names' (#2) from develop into main
Some checks failed
Docker build and release / build-and-push (push) Failing after 1m57s
Docker build and release / release (push) Has been skipped
CI / ci (push) Successful in 14s
Reviewed-on: #2
2026-02-07 18:10:06 +03:00
7246f54263 Merge pull request 'develop' (#1) from develop into main
Some checks failed
CI / ci (push) Successful in 14s
Docker build and release / build-and-push (push) Failing after 8s
Docker build and release / release (push) Has been skipped
Reviewed-on: #1
2026-02-07 18:06:50 +03:00
3 changed files with 2 additions and 22 deletions

View File

@@ -6,9 +6,4 @@
# PROMETHEUS_URL=http://127.0.0.1:1234/
# OPENSTACK_CLOUD=distlab
# OPENSTACK_REGION_NAME=cl2k1distlab
# WATCHER_ENDPOINT_NAME=infra-optim
# WATCHER_INTERFACE_NAME=public
# SECRET_KEY=your-secret-key
# Optional cache TTL (seconds); defaults in watcher_visio/settings.py
# DASHBOARD_CACHE_TTL=120
# SOURCE_STATUS_CACHE_TTL=30

View File

@@ -5,7 +5,7 @@
[![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
[![Django 5.2](https://img.shields.io/badge/django-5.2-green.svg)](https://www.djangoproject.com/)
Watcher Visio is a web dashboard for OpenStack operators. It shows region and host counts, physical/virtual CPU and RAM usage, VM statistics, top flavors, and OpenStack Watcher audit results with migration recommendations and CPU load charts per host. Data is pulled from OpenStack (SDK and Watcher API) and Prometheus (node_exporter, libvirt, placement metrics).
SWatcher is a web dashboard for OpenStack operators. It shows region and host counts, physical/virtual CPU and RAM usage, VM statistics, top flavors, and OpenStack Watcher audit results with migration recommendations and CPU load charts per host. Data is pulled from OpenStack (SDK and Watcher API) and Prometheus (node_exporter, libvirt, placement metrics).
---
@@ -20,7 +20,6 @@ Watcher Visio is a web dashboard for OpenStack operators. It shows region and ho
- [Project structure](#project-structure)
- [Architecture](#architecture)
- [Running tests](#running-tests)
- [CI](#ci)
---
@@ -49,10 +48,8 @@ Copy [.env.example](.env.example) to `.env` and set as needed. For Docker Compos
| `OPENSTACK_REGION_NAME` | OpenStack region (e.g. `cl2k1distlab`). |
| `USE_MOCK_DATA` | Set to `true`/`1`/`yes` to serve mock data (no OpenStack/Prometheus). Useful for local/dev. |
| `SECRET_KEY` | Django secret key; override in production. |
| `WATCHER_ENDPOINT_NAME` | Watcher service type (default: `infra-optim`). |
| `WATCHER_INTERFACE_NAME` | Watcher API interface (default: `public`). |
Defaults for Prometheus, OpenStack, and Watcher are in [watcher_visio/settings.py](watcher_visio/settings.py). Cache TTLs: `DASHBOARD_CACHE_TTL` (120 s) for stats/audits, `SOURCE_STATUS_CACHE_TTL` (30 s) for source-status; override in settings if needed.
Defaults for Prometheus and OpenStack are in [watcher_visio/settings.py](watcher_visio/settings.py).
### OpenStack (`clouds.yaml`)
@@ -124,7 +121,6 @@ Source: [static/css/main.css](static/css/main.css). Output: `static/css/output.c
| `GET /` | Dashboard page. With `USE_MOCK_DATA=true`, rendered with mock context; otherwise skeleton, with data loaded via the API. |
| `GET /api/stats/` | JSON: region, pCPU/vCPU, pRAM/vRAM, VM stats, top flavors. Cached for `DASHBOARD_CACHE_TTL` seconds (see settings). |
| `GET /api/audits/` | JSON: `{ "audits": [ ... ] }` — list of Watcher audits with migrations and chart data (host labels, cpu_current, cpu_projected). Same cache TTL. |
| `GET /api/source-status/` | JSON: status of data sources (Prometheus, OpenStack) — `ok` / `error` / `mock` per source. Cached for `SOURCE_STATUS_CACHE_TTL` seconds (see settings). |
---
@@ -199,12 +195,3 @@ docker compose -f docker-compose.yml -f docker-compose.dev.yml run --rm watcher-
```
With the base compose only, the container uses the code baked into the image at build time. After code or test changes, either rebuild the image or use the dev override above so tests see the latest files.
---
## CI
Pipelines are in [.gitea/workflows/](.gitea/workflows/):
- **ci.yml** — on push/PR to `main` and `develop`: set up Python 3.12, install dependencies, run Ruff lint, `python manage.py test dashboard`, and Bandit security check.
- **docker-build.yml** — on push to `main`: build Docker image, push to Gitea Container Registry, create a release with a version tag.

View File

@@ -78,5 +78,3 @@ Returns:
- `CACHE_KEY_AUDITS` — serialized audits list
- `CACHE_KEY_CURRENT_CLUSTER` — raw current_cluster (host_labels, cpu_current lists)
- `CACHE_KEY_SOURCE_STATUS` — source status result
TTL for stats and audits is set by `DASHBOARD_CACHE_TTL` in `watcher_visio/settings.py` (default 120 s). TTL for source-status is set by `SOURCE_STATUS_CACHE_TTL` (default 30 s).