|
|
|
@@ -5,7 +5,7 @@
|
|
|
|
[](https://www.python.org/downloads/)
|
|
|
|
[](https://www.python.org/downloads/)
|
|
|
|
[](https://www.djangoproject.com/)
|
|
|
|
[](https://www.djangoproject.com/)
|
|
|
|
|
|
|
|
|
|
|
|
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).
|
|
|
|
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).
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
@@ -20,6 +20,7 @@ SWatcher is a web dashboard for OpenStack operators. It shows region and host co
|
|
|
|
- [Project structure](#project-structure)
|
|
|
|
- [Project structure](#project-structure)
|
|
|
|
- [Architecture](#architecture)
|
|
|
|
- [Architecture](#architecture)
|
|
|
|
- [Running tests](#running-tests)
|
|
|
|
- [Running tests](#running-tests)
|
|
|
|
|
|
|
|
- [CI](#ci)
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
@@ -48,8 +49,10 @@ Copy [.env.example](.env.example) to `.env` and set as needed. For Docker Compos
|
|
|
|
| `OPENSTACK_REGION_NAME` | OpenStack region (e.g. `cl2k1distlab`). |
|
|
|
|
| `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. |
|
|
|
|
| `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. |
|
|
|
|
| `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 and OpenStack are in [watcher_visio/settings.py](watcher_visio/settings.py).
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
### OpenStack (`clouds.yaml`)
|
|
|
|
### OpenStack (`clouds.yaml`)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -121,6 +124,7 @@ 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 /` | 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/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/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). |
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
@@ -195,3 +199,12 @@ 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.
|
|
|
|
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.
|
|
|
|
|