diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea7579..3907fc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ Needs **urbex 0.1.0 or later, major 0**. ### Docs +- **Added**: `komodo.buildCache` in the platform config, the build cache's + pruning in the platform resources, the cookbook and ADR-0027's table. - **Added**: [ADR-0034](docs/decisions/0034-forgejo-lts-forge.md) - Forgejo LTS is the platform's forge, in place of Gitea; the known limitation for platforms installed with 0.1.0, which stay on Gitea diff --git a/docs/cookbook.md b/docs/cookbook.md index f6389fc..f898bf8 100644 --- a/docs/cookbook.md +++ b/docs/cookbook.md @@ -1177,9 +1177,13 @@ An LXC that stops reporting, stopped or destroyed, raises nothing. dashboard and on the LXC (`du -xh / | sort -h | tail`). For an application, give it a bigger disk with `resources.disk`, or a bigger volume with its `size`, and `urbex apply` - ([more resources](#give-a-service-more-cpu-memory-or-disk)). Komodo's - LXC fills with the build cache: a scheduled clean-up is planned - ([urbex-cli#92](https://github.com/urbforge/urbex-cli/issues/92)). + ([more resources](#give-a-service-more-cpu-memory-or-disk)). On + Komodo's LXC the builds' cache is pruned every day (the Stack + `urbex-build-cache`; its log line in Loki says what it freed, `{service="build-cache"}`): + if it fills anyway, lower `komodo.buildCache.keepStorage` or + `keepFor` in `urbex.platform.yaml` and run `urbex bootstrap` (see + [the platform config](reference/platform-config.md)), or give the + LXC a bigger disk. - **Memory.** An LXC's memory is what it uses less the page cache, as `free` and Proxmox show it, against its limit. Give an application more with `resources.memory`; find what grows in *Urbex resources*, diff --git a/docs/decisions/0027-service-conventions.md b/docs/decisions/0027-service-conventions.md index 79f7ac0..9ab09e4 100644 --- a/docs/decisions/0027-service-conventions.md +++ b/docs/decisions/0027-service-conventions.md @@ -200,6 +200,7 @@ where their compose files live and in who can repair them: | Prometheus | `urbex-observability` | `prometheus.` | UI behind Access; remote write internal | platform | | Loki | `urbex-observability` | `loki.` | API behind Access; push internal | platform | | Tunnel (`cloudflared`) | `urbex-tunnel` | `tunnel.` | none (outbound only) | platform | +| Build cache pruning (`docker` CLI, urbforge/urbex-cli#92) | `urbex-komodo` | none (no endpoint) | none | platform | | Periphery | every LXC | - (connects out to Komodo) | internal | agent | | Alloy | every LXC | - (pushes out) | internal | agent | | Quick Tunnel sidecar | a project service's LXC | - | the service's public endpoint | agent | diff --git a/docs/reference/platform-config.md b/docs/reference/platform-config.md index 12af174..dc19e1f 100644 --- a/docs/reference/platform-config.md +++ b/docs/reference/platform-config.md @@ -80,6 +80,9 @@ cloudflare: | `dns.forwarders` | `proxmox.network.dnsServers`, or the gateway | IP addresses Technitium forwards every name outside `dns.zone` to. | | `dns.technitiumUrl` | | ⚠️ Not used: `urbex` finds Technitium itself from the allocated LAN IP. | | `keycloak.baseUrl`, `keycloak.platformRealm` (`platform`) | | ⚠️ Not used yet (SSO). | +| `komodo.buildCache.keepStorage` | `3GB` | The builds' cache on Komodo's LXC is pruned, least recently used first, down to this size (`500MB`, `3GB`...). | +| `komodo.buildCache.keepFor` | `168h` | ...and of what is older than this duration; so are the images no container uses, older than it. An hour or more. | +| `komodo.buildCache.every` | `24h` | How often (the first run 10 minutes after the Stack starts). An hour or more. Changed by `urbex bootstrap`. | | `storage.shares..path` | none | A folder of the Proxmox node that applications mount by name: see [shares](#shares). An absolute path that isn't `/` and has no comma, space or tab. | ## Shares diff --git a/docs/reference/platform-resources.md b/docs/reference/platform-resources.md index 75418ad..572bf9c 100644 --- a/docs/reference/platform-resources.md +++ b/docs/reference/platform-resources.md @@ -30,7 +30,7 @@ in the same pool, with its own kernel ([ADR-0033](../decisions/0033-vm-for-keyct | LXC | Runs | |---|---| | `urbex-gitea` | Forgejo 15 LTS (web, git, container registry; [ADR-0034](../decisions/0034-forgejo-lts-forge.md)) on `:3000`, SSH on `:2222`. The LXC keeps its name from when it ran Gitea. | -| `urbex-komodo` | Komodo Core on `:9120`, its database (FerretDB on PostgreSQL), and a Periphery agent that is also the **builder** (server `urbex-komodo`). | +| `urbex-komodo` | Komodo Core on `:9120`, its database (FerretDB on PostgreSQL), and a Periphery agent that is also the **builder** (server `urbex-komodo`). The Stack `urbex-build-cache` prunes the builds' cache there every `komodo.buildCache.every` (see [the platform config](platform-config.md)). | | `urbex-technitium` | Technitium DNS, web console on `:5380`. | | `urbex-keycloak` | Keycloak on `:8080`, in production mode, from an image the Stack builds once for PostgreSQL; its PostgreSQL 17, reachable only by Keycloak (no port published), with its data on the volume `urbex_keycloak-db` ([ADR-0029](../decisions/0029-keycloak-production-postgresql.md)). | | `urbex-observability` | Prometheus `:9090` (receiving the agents' metrics by remote write), Loki `:3100`, Grafana `:3000` (admin / `grafanaAdminPassword`), with Loki and Prometheus as data sources and the *Urbex logs* and *Urbex resources* dashboards (folder *Urbex*), the reconciler's alerts (folder `urbex`, see [its runbook](../cookbook.md#the-reconciler-holds-applications-back)), and the alerts on every LXC's disk and memory (same folder, see [their runbook](../cookbook.md#a-disk-is-filling-up-or-a-machine-is-running-out-of-memory)). A change to their files recreates Grafana and Prometheus at the next `urbex bootstrap`. |