DevOps: Cloud Agent Postgres — postgresql-client, yieldomega role, bootstrap verify #287

Closed
opened 2026-06-03 13:43:01 +00:00 by PlasticDigits · 9 comments
PlasticDigits commented 2026-06-03 13:43:01 +00:00 (Migrated from gitlab.com)

Problem

Agents consistently hit Postgres-related failures on Cloud VMs:

  • psql: command not found ( postgresql-client not installed ).
  • Connection refused on 127.0.0.1:5433 (no server, wrong port, or Docker yieldomega-pg never started).
  • permission denied to create database ( yieldomega role missing CREATEDB ).
  • Unclear whether to use Docker yieldomega-pg vs host PostgreSQL 16 (AGENTS.md manual setup is easy to miss).

Stack and verify scripts assume:

Setting Default
Host / port 127.0.0.1:5433 (PG_HOST_PORT)
User / password yieldomega / password
App DB yieldomega_indexer
Test DB yieldomega_indexer_test
DATABASE_URL postgres://yieldomega:password@127.0.0.1:5433/yieldomega_indexer

Scripts using psql (not only docker exec): verify-podium-live-anvil.sh, verify-vault-funding-anvil.sh, verify-wallet-profile-anvil.sh, start-local-anvil-stack.sh DB reset paths.

Goals

  1. One bootstrap path that installs client tools and ensures DB + role + test login on Cloud Agent images (when Docker is unavailable or skipped per [#issue-docker]).
  2. psql on PATH and a smoke check: psql "$DATABASE_URL" -c 'SELECT 1'.
  3. yieldomega role with CREATEDB, both databases, documented test login.
  4. Clear PASS/FAIL/SKIP in agent verification matrix (AGENTS.md § Cloud agent verification).

A. Script: scripts/bootstrap-cloud-postgres-native.sh (or extend bootstrap-cloud-vm-toolchain.sh)

  • apt-get install -y postgresql-16 postgresql-client (when sudo available).
  • Configure port 5433 (same as AGENTS.md snippet).
  • Create role yieldomega / password password, CREATEDB.
  • CREATE DATABASE yieldomega_indexer and yieldomega_indexer_test owned by yieldomega.
  • Idempotent (safe to re-run).

B. Script: scripts/verify-cloud-postgres.sh

  • command -v psql
  • pg_isready -h 127.0.0.1 -p "${PG_HOST_PORT:-5433}"
  • psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -c 'SELECT 1'
  • Optional: psql as yieldomega can CREATE DATABASE / DROP DATABASE (CREATEDB smoke).
  • Export hints: DATABASE_URL, YIELDOMEGA_PG_TEST_URL.

C. Wire into Cloud bootstrap

D. Docs

  • AGENTS.md: link bootstrap script instead of long manual-only sudo block where possible.
  • Agent MR checklist template: Postgres → verify-cloud-postgres.sh → PASS/FAIL.

Acceptance criteria

  • After bootstrap on a VM without Docker, psql exists and psql "$DATABASE_URL" -c 'SELECT 1' succeeds.
  • yieldomega can drop/recreate yieldomega_indexer via psql (CREATEDB).
  • bash scripts/verify-podium-live-anvil.sh (or smallest indexer smoke) PASS using host Postgres only.
  • Bootstrap is idempotent (second run does not error).
  • AGENTS.md + .cursor/environment.json reference the automated path.
  • Docker socket / yieldomega-pg container: separate issue (Cloud Agent Docker API).
  • #281 — Foundry-only tasks do not require Postgres; keep matrix honest.

Labels

devops, testing, cloud-agent, indexer

## Problem Agents **consistently** hit Postgres-related failures on Cloud VMs: - `psql: command not found` ( **`postgresql-client`** not installed ). - Connection refused on `127.0.0.1:5433` (no server, wrong port, or Docker `yieldomega-pg` never started). - `permission denied to create database` ( **`yieldomega`** role missing **`CREATEDB`** ). - Unclear whether to use Docker **`yieldomega-pg`** vs **host PostgreSQL 16** ([`AGENTS.md`](AGENTS.md) manual setup is easy to miss). Stack and verify scripts assume: | Setting | Default | |---------|---------| | Host / port | `127.0.0.1:5433` (`PG_HOST_PORT`) | | User / password | `yieldomega` / `password` | | App DB | `yieldomega_indexer` | | Test DB | `yieldomega_indexer_test` | | `DATABASE_URL` | `postgres://yieldomega:password@127.0.0.1:5433/yieldomega_indexer` | Scripts using **`psql`** (not only `docker exec`): [`verify-podium-live-anvil.sh`](scripts/verify-podium-live-anvil.sh), [`verify-vault-funding-anvil.sh`](scripts/verify-vault-funding-anvil.sh), [`verify-wallet-profile-anvil.sh`](scripts/verify-wallet-profile-anvil.sh), [`start-local-anvil-stack.sh`](scripts/start-local-anvil-stack.sh) DB reset paths. ## Goals 1. **One bootstrap path** that installs client tools and ensures DB + role + test login on Cloud Agent images (when Docker is unavailable or skipped per [#issue-docker]). 2. **`psql` on PATH** and a smoke check: `psql "$DATABASE_URL" -c 'SELECT 1'`. 3. **`yieldomega` role** with `CREATEDB`, both databases, documented test login. 4. Clear **PASS/FAIL/SKIP** in agent verification matrix ([`AGENTS.md`](AGENTS.md) § Cloud agent verification). ## Recommended direction ### A. Script: `scripts/bootstrap-cloud-postgres-native.sh` (or extend `bootstrap-cloud-vm-toolchain.sh`) - `apt-get install -y postgresql-16 postgresql-client` (when sudo available). - Configure port **5433** (same as AGENTS.md snippet). - Create role **`yieldomega`** / password **`password`**, **`CREATEDB`**. - `CREATE DATABASE yieldomega_indexer` and `yieldomega_indexer_test` owned by **`yieldomega`**. - Idempotent (safe to re-run). ### B. Script: `scripts/verify-cloud-postgres.sh` - `command -v psql` - `pg_isready -h 127.0.0.1 -p "${PG_HOST_PORT:-5433}"` - `psql "$DATABASE_URL" -v ON_ERROR_STOP=1 -c 'SELECT 1'` - Optional: `psql` as `yieldomega` can `CREATE DATABASE` / `DROP DATABASE` (CREATEDB smoke). - Export hints: `DATABASE_URL`, `YIELDOMEGA_PG_TEST_URL`. ### C. Wire into Cloud bootstrap - [`.cursor/environment.json`](.cursor/environment.json): run native Postgres bootstrap when Docker verify fails **or** always as parallel path for indexer QA. - Update [`scripts/verify-cloud-vm-toolchain.sh`](scripts/verify-cloud-vm-toolchain.sh) with Postgres row (not only Docker). ### D. Docs - [`AGENTS.md`](AGENTS.md): link bootstrap script instead of long manual-only `sudo` block where possible. - Agent MR checklist template: Postgres → `verify-cloud-postgres.sh` → PASS/FAIL. ## Acceptance criteria - [ ] After bootstrap on a VM **without Docker**, `psql` exists and `psql "$DATABASE_URL" -c 'SELECT 1'` succeeds. - [ ] `yieldomega` can drop/recreate `yieldomega_indexer` via `psql` (CREATEDB). - [ ] [`bash scripts/verify-podium-live-anvil.sh`](scripts/verify-podium-live-anvil.sh) (or smallest indexer smoke) **PASS** using host Postgres only. - [ ] Bootstrap is idempotent (second run does not error). - [ ] [`AGENTS.md`](AGENTS.md) + [`.cursor/environment.json`](.cursor/environment.json) reference the automated path. ## Related - Docker socket / `yieldomega-pg` container: separate issue (Cloud Agent Docker API). - [#281](https://gitlab.com/PlasticDigits/yieldomega/-/issues/281) — Foundry-only tasks do **not** require Postgres; keep matrix honest. ## Labels `devops`, `testing`, `cloud-agent`, `indexer`
PlasticDigits commented 2026-06-03 13:43:13 +00:00 (Migrated from gitlab.com)

Related: #288 (Docker API / yieldomega-pg). Native Postgres bootstrap in this issue is the primary path when Docker is unavailable.

Related: #288 (Docker API / yieldomega-pg). Native Postgres bootstrap in this issue is the primary path when Docker is unavailable.
ghost1 commented 2026-06-03 13:59:31 +00:00 (Migrated from gitlab.com)

mentioned in commit 4740bda2be9182af6c116f67ebc99a942a571856

mentioned in commit 4740bda2be9182af6c116f67ebc99a942a571856
PlasticDigits commented 2026-06-03 14:00:35 +00:00 (Migrated from gitlab.com)

mentioned in merge request !420

mentioned in merge request !420
ghost1 commented 2026-06-03 14:15:03 +00:00 (Migrated from gitlab.com)

mentioned in commit 34408980ee

mentioned in commit 34408980eee16d64527c303880d65d73c7c7ab16
PlasticDigits commented 2026-06-03 14:15:39 +00:00 (Migrated from gitlab.com)

mentioned in merge request !421

mentioned in merge request !421
PlasticDigits commented 2026-06-03 14:23:40 +00:00 (Migrated from gitlab.com)

mentioned in commit c6820b64aa

mentioned in commit c6820b64aa6aa8c047492c1f79de37edfa46bad4
PlasticDigits (Migrated from gitlab.com) closed this issue 2026-06-03 14:23:40 +00:00
PlasticDigits commented 2026-06-03 14:45:33 +00:00 (Migrated from gitlab.com)

mentioned in issue #288

mentioned in issue #288
PlasticDigits commented 2026-06-08 08:45:13 +00:00 (Migrated from gitlab.com)

mentioned in commit f0b344bcc1

mentioned in commit f0b344bcc17d1d5d648ff4850638df0284236434
PlasticDigits commented 2026-06-25 20:07:28 +00:00 (Migrated from gitlab.com)

mentioned in issue #351

mentioned in issue #351
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
code/yieldomega#287
No description provided.