mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-30 11:22:34 +00:00
* docs: v0.16.1 — minions worker deployment guide (from #287) New docs/guides/minions-deployment.md covering persistent worker deploy patterns (watchdog cron, inline --follow for cron-only workloads) plus the sharp edges of running gbrain jobs work against Supabase in production. Addresses a real gap: existing minions docs (minions-fix.md, minions-shell-jobs.md) cover schema repair and shell-job security, not deploy patterns. With v0.16.0's durable agent runtime, the persistent worker is now load-bearing for subagent + subagent_aggregator handlers too, so a supervised deploy story matters. Pre-landing accuracy pass corrected five factual bugs against current source: - max_stalled column default (5, not 1 or 3) - stalled-jobs smoke-test query (active, not waiting) - watchdog SIGTERM-to-SIGKILL grace (10s minimum, not 2s) - cron env pattern (crontab env lines, not source ~/.bashrc) - --follow exit semantics (blocks until submitted job is terminal, not until queue is empty) Docs-only. No code changed. Zero migration required. Contributed by a downstream agent fork via #287. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: credit Wintermute correctly in v0.16.1 CHANGELOG Wintermute is gbrain's own OpenClaw instance running in production, not a community contributor. The original CHANGELOG framing ("community contributor @wintermute") understated the funnier truth: the agent built on top of the project wrote the deploy guide for the project after hitting its sharp edges in production. Dogfooding with extra steps. Co-Authored-By: Wintermute (OpenClaw) <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: rewrite minions deployment guide for agent line-by-line execution Fixes 12 findings from reading v0.16.1 guide as-an-agent would: Real bugs: - Crontab syntax wrong for user crontabs (6-field format dumped into `crontab -e` got "bad minute" or parsed `user` as the command). Now two labeled blocks: 5-field for `crontab -e`, 6-field for `/etc/crontab`. - Watchdog restart loop (old shutdown lines in unrotated log re-matched every 5 min forever). New `minion-watchdog.sh` writes 2-line PID file (PID + restart epoch) and only considers log lines newer than the epoch. Regex rewritten explicit (mawk rejects `{n}` intervals). - Credentials in world-readable /etc/crontab. Secrets move to /etc/gbrain.env (mode 600), referenced via BASH_ENV in crontab. Structural: - Preconditions block (5 fail-fast checks). - "Which option?" decision tree. - Template variable table (6 vars documented). - Upgrade section (v0.13.x -> v0.16.2 checklist). - Option 3: systemd.service + Procfile + fly.toml.partial snippets. - Uninstall section. - `--follow` example uses `gbrain embed --stale` (a real command) instead of the fictional `gbrain enrich`. - Dead-end "Proposed CLI flags (not yet implemented)" replaced with a "Tune per-job today" callout pointing at flags that exist. - Known Issues rewritten as imperatives. Also wires `docs/guides/minions-deployment.md` into `scripts/llms-config.ts` under the Configuration section so remote agents fetching llms.txt / llms-full.txt see the guide by name. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: bump version and changelog (v0.16.2) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: sync v0.16.2 CHANGELOG with the actual --follow example in the guide The shipped docs/guides/minions-deployment.md uses `gbrain embed --stale` (a real command) but the v0.16.2 CHANGELOG entry still referenced `gbrain enrich --brain $GBRAIN_WORKSPACE` (the older draft). Bring the CHANGELOG in line with what actually shipped. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
36 lines
1.3 KiB
Bash
36 lines
1.3 KiB
Bash
# /etc/gbrain.env — secrets + env for the gbrain worker.
|
|
#
|
|
# Install:
|
|
# sudo install -m 600 -o $GBRAIN_WORKER_USER -g $GBRAIN_WORKER_USER \
|
|
# gbrain.env.example /etc/gbrain.env
|
|
# sudoedit /etc/gbrain.env # fill in real values
|
|
#
|
|
# Referenced from crontab via BASH_ENV=/etc/gbrain.env, or from systemd
|
|
# via EnvironmentFile=/etc/gbrain.env. Never commit real secrets.
|
|
|
|
# --- Required ---------------------------------------------------------------
|
|
|
|
# Postgres connection string. For Supabase transaction pooler, include
|
|
# prepare=false (see CLAUDE.md #284/#286).
|
|
DATABASE_URL=postgresql://user:pass@host:6543/db?prepare=false
|
|
|
|
# --- Required if you submit `shell` jobs ------------------------------------
|
|
# Only the worker process needs this. Submitters do not.
|
|
GBRAIN_ALLOW_SHELL_JOBS=1
|
|
|
|
# --- Optional ---------------------------------------------------------------
|
|
|
|
# LLM provider keys (needed for `subagent` handler, transcription, enrichment).
|
|
# ANTHROPIC_API_KEY=
|
|
# OPENAI_API_KEY=
|
|
|
|
# Custom handler plugins (see docs/guides/plugin-handlers.md).
|
|
# GBRAIN_PLUGIN_PATH=/etc/gbrain/plugins
|
|
|
|
# Pool size tuning for Supabase transaction pooler (default 10; drop to 2
|
|
# if you hit MaxClients during upgrade subprocess spawns).
|
|
# GBRAIN_POOL_SIZE=2
|
|
|
|
# Connection-level concurrency cap for Anthropic Messages API.
|
|
# GBRAIN_ANTHROPIC_MAX_INFLIGHT=4
|