Skip to content

feat: gitops-demo — minimal multi-instance compose for the git-sync workflow - #14

Open
Bierchermuesli wants to merge 12 commits into
mainfrom
feature/gitops-demo
Open

feat: gitops-demo — minimal multi-instance compose for the git-sync workflow#14
Bierchermuesli wants to merge 12 commits into
mainfrom
feature/gitops-demo

Conversation

@Bierchermuesli

@Bierchermuesli Bierchermuesli commented Jul 26, 2026

Copy link
Copy Markdown

Summary

A minimal, parameterized neops stack to exercise the neops_git_sync enterprise module (see zebbra/neops-core#2212) end-to-end across multiple instances synced to different branches of one task repository.

  • One compose file (gitops-demo/docker-compose.yml) + one env file per instance (envs/*.env) — compose project isolation gives each instance its own containers/network/volumes. Backend and legacy frontend are built locally from sibling checkouts, shared across instances via a fixed image tag.
  • Four instances on two branches: dev-main + cust-dev on dev (bidirectional), dev-prod + cust-prod on prod (cust-prod pull-only — git is the source of truth there).
  • 5-minute periodic pull registered via beat (NEOPS_GIT_SYNC_AUTO_PULL_MIGRATION), cheap thanks to the ls-remote fast path added in the git-sync branch.
  • neops_netbox enabled by default since the demo repo's tasks use its providers.
  • README documents setup, the neops_git_sync credentials bootstrap command, and the promotion flow (dev → prod merge).

Related

  • zebbra/neops-core#2212 (git-sync module)
  • zebbra/neops-legacy-frontend#29 (Git Sync page + snackbar)

Test plan

  • docker compose config validates for all four env files
  • Backend + frontend images build clean from this compose
  • Manually exercised: credentials bootstrap, push-all, pull, promotion via branch merge, periodic pull firing
  • Reviewer: make build && make up INSTANCE=dev-main, confirm http://localhost:8081 loads

Replace the separate docker-compose.metrics.yml overlay with a single
file using Docker Compose profiles. Run base services with
`docker compose up`, add the full observability stack with
`--profile metrics`. Move metrics documentation to metrics/README.md.
Also gitignore docker-compose.override.yml for local customisations.
One parameterized compose file + four env files (dev-main, dev-prod,
cust-dev, cust-prod). Each instance is an isolated compose project
(own postgres/redis/elasticsearch/backend/worker/beat/frontend) bound
to its git-sync branch; cust-prod runs pull-only (git as source of
truth). Backend and legacy frontend are built locally from sibling
checkouts and shared between instances via a fixed image tag.
local-dev and cust-dev share dev; local-prod and cust-prod follow prod
(cust-prod pull-only). Promotion = merge dev into prod on the git host.
NEOPS_GIT_SYNC_AUTO_PULL_MIGRATION registers the PeriodicTask at
migrate time; the ls-remote fast path makes the 1-minute interval
essentially free when the branch has not moved.
… add retention + logentry panels

The task execution/failure metrics are gauges without _total now (DB
snapshots that shrink with retention) and the failure breakdowns cover
a 7-day lookback:

- rename all references; replace increase()/rate() on those series
  with clamp_min(delta(...), 0) so retention pruning can't produce
  phantom spikes
- replace the duration heatmap (increase over a snapshot histogram was
  meaningless) with p50/p90/p99 histogram_quantile timeseries
- retitle 'Top failure codes (all time)' to '(last 7 days)'
- fix the task variable on the per-task custom metrics dashboard

vmalert: replace NeopsHighTaskFailureRate — it could never fire
(rate() on a gauge and state="FAILURE" doesn't match the lowercase
state values) — with per-task NeopsTaskFailed/NeopsTaskPartialFailed
on neops_task_last_state; add NeopsRetentionBacklogHigh and
NeopsOversizedLogWrites (opt-in logentry counter, rate-safe).

Dashboard additions: 'Execution Retention' row (enabled/cutoff/backlog/
oldest age) and 'Task Logging (LogEntry)' row (bytes + oversized writes
per task, opt-in via NEOPS_METRICS_LOG_SIZE_TRACKING).

README: document the >=1.18.7-beta.6 requirement and rename, and that
the fetched community Django dashboards need the now-default-off
NEOPS_METRICS_INSTRUMENT_HTTP/DB flags plus a single-worker backend.
New 'Operational' row above the custom metrics on neops / Custom
Metrics — by Task, so a task's health and its template-pushed metrics
live on one screen:

- stats: last finished state (mapped successful/partial_failed/failed),
  time since last finished run, last duration, executions stored,
  success last 24h (clamped snapshot delta), failures in the 7d window
- state-timeline of neops_task_last_state (same styling as the
  overview dashboard)
- timeseries: executions per hour by state, duration trend, failures
  by exception code
… default

neops-core's NEOPS_METRICS_LOOKBACK_DAYS is a freshness window for all
task-scoped metrics now, defaulting to 1 day — panel titles no longer
hardcode '7 days'/'7d'; descriptions reference the setting. README
documents the window semantics and the alert caveat for tasks running
less often than the window.
README still referenced customer-dev/customer-prod from before the
dev/prod branch simplification, and the old Tools-page panel that was
replaced by the dedicated /git page.
…git_sync credentials subcommand

zebbra/neops-core#2212 dropped its bespoke credentials subcommand in
favor of the generalized zebbra/neops-core#2233.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant