Skip to content

fix(infra): inject Garage secrets via env, roll back postgres to 17#20

Open
Islanders-Treasure0969 wants to merge 1 commit into
mainfrom
fix/garage-secrets-via-env
Open

fix(infra): inject Garage secrets via env, roll back postgres to 17#20
Islanders-Treasure0969 wants to merge 1 commit into
mainfrom
fix/garage-secrets-via-env

Conversation

@Islanders-Treasure0969
Copy link
Copy Markdown
Owner

Summary

最初の make compose-up で 2 系統のクラッシュが出たので修正。

問題 1: Garage が Invalid RPC secret key で停止

garage.toml 内の rpc_secret = "REPLACE_ME_AT_BOOTSTRAP_via_env" が文字列リテラルとしてそのまま読まれていた。env override を期待していたが配線されてなかった。

問題 2: Postgres 18 が volume layout 非互換で停止

Postgres 18 で on-disk layout が変わり (docker-library/postgres#1259)、/var/lib/postgresql/data への直接 mount を拒否するようになった。3 つの Postgres コンテナが同じ理由で死亡。

Fixes

ファイル 変更
docker/garage/garage.toml rpc_secret / admin_token / metrics_token 行を削除 (env で渡す)
docker/docker-compose.yml (garage) environment: ブロック追加。${VAR:?...} で missing 時の早期失敗
docker/docker-compose.yml (postgres x3) 18-alpine → 17-alpine にロールバック
Makefile compose-up / compose-up-streaming$(OP_RUN) 経由に

Verified locally

  • ✅ postgres / temporal-db / lakekeeper-db / temporal / temporal-ui — Healthy
  • ✅ garage — Started (layout 未割当の quorum 警告は follow-up)
  • ⚠️ lakekeeper — DB migrate ステップは follow-up (Phase 2 で対応)
  • ⚠️ localstack — 起動済み、healthcheck コマンドの修正は follow-up

Follow-ups (後続 PR)

  1. scripts/garage-init.sh で layout assign + bucket create を自動化
  2. Lakekeeper の migrate step (init container or entrypoint hook)
  3. LocalStack 4.14 の healthcheck 修正

Two compose-time bugs surfaced when first running `make compose-up`:

1. Garage refused to start with `Invalid RPC secret key`. The
   `rpc_secret = "REPLACE_ME_AT_BOOTSTRAP_via_env"` placeholder in
   garage.toml was being read literally — no env override was wired.

2. Postgres 18 changed the on-disk layout (PR docker-library/postgres#1259):
   it now refuses to mount at /var/lib/postgresql/data and demands a
   parent-dir mount with versioned subdirs. Three of our four services
   crashed in lockstep ("PostgreSQL data in /var/lib/postgresql/data
   (unused mount/volume)").

Fixes:
- garage.toml: drop `rpc_secret` / `admin_token` / `metrics_token` lines.
  Garage reads `GARAGE_RPC_SECRET` etc. from the environment at start.
- docker-compose.yml: add `environment:` block on the garage service that
  pulls GARAGE_{RPC_SECRET,ADMIN_TOKEN} from the host env, with
  `${VAR:?...}` validation so a missing op-run wrap fails loudly instead
  of silently using empty values.
- docker-compose.yml: revert postgres 18-alpine → 17-alpine (digest pinned).
  Postgres 17 is supported through 2029; the 18 path-shape change is
  better solved in a future PR with proper PGDATA + parent-mount layout.
- Makefile: `compose-up` and `compose-up-streaming` now go through
  `$(OP_RUN)` (and depend on `env-check`), so secrets are always injected.

Verified locally: postgres / temporal-db / lakekeeper-db / temporal /
temporal-ui all healthy. Garage starts cleanly (cluster-layout init is a
follow-up). Lakekeeper DB-migration step is also a follow-up (Phase 2).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Islanders-Treasure0969 Islanders-Treasure0969 enabled auto-merge (squash) May 9, 2026 15:55
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • needs-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 855b675e-a9bc-4b61-a25c-cffd72587d53

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands and usage tips.

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