원클릭으로
tilt
// Interact with the PeerDB Tilt dev environment. Use when the user wants to check service status, enable/disable resources, trigger builds or tests, view logs, or manage the local development infrastructure.
// Interact with the PeerDB Tilt dev environment. Use when the user wants to check service status, enable/disable resources, trigger builds or tests, view logs, or manage the local development infrastructure.
| name | tilt |
| description | Interact with the PeerDB Tilt dev environment. Use when the user wants to check service status, enable/disable resources, trigger builds or tests, view logs, or manage the local development infrastructure. |
| argument-hint | [action] [resource...] |
| allowed-tools | Bash(tilt *) Bash(./tilt.sh) Bash(docker ps *) Bash(tail *) Bash(python3 *) Read Monitor ScheduleWakeup |
You are managing PeerDB's local Tilt dev environment via the CLI.
All tilt CLI commands MUST use --port 10352:
tilt --port 10352 <subcommand> [args...]
Use the tilt.sh script at the project root to start Tilt, keep it running until you choose to stop it.
To top, kill the script execution.
If the script was stopped for some reason but Tilt is still running, use tilt down to stop.
| Action | Command |
|---|---|
| List all resources with status | tilt --port 10352 get uiresource |
| Get JSON resource detail | tilt --port 10352 get uiresource -o json |
| Enable a resource | tilt --port 10352 enable <name> |
| Disable a resource | tilt --port 10352 disable <name> |
| Trigger (run) a resource | tilt --port 10352 trigger <name> (accepts exactly one resource; for multiple, issue one command per resource, e.g. for r in a b c; do tilt --port 10352 trigger "$r"; done) |
| Stream logs | tilt --port 10352 logs -f <name> |
| Recent logs | tilt --port 10352 logs --since 5m <name> |
| Tail N lines | tilt --port 10352 logs --tail 200 <name> |
| Wait for ready | tilt --port 10352 wait --for=condition=Ready uiresource/<name> |
NOTE: For wait commands, use --timeout 10 to avoid waiting indefinitely. It's better to iterate over several wait attempts with shorter timeouts than to risk getting stuck on a single long wait.
Tilt manages Docker Compose services defined in docker-compose-dev.yml (core PeerDB) and ancillary-docker-compose.yml (test databases + infra). Environment variables for tests are in .env at the project root and are auto-loaded by Go tests.
| Label | Purpose | Examples |
|---|---|---|
PeerDB | Core services (always running) | flow-api, flow-worker, flow-snapshot-worker, catalog, temporal, minio |
Ancillary-DB | Data stores (manual start) | postgres, clickhouse, mongodb, mysql-gtid, mysql-pos, mariadb |
Ancillary-DB-Provisioning | DB setup scripts (auto after DB starts) | provision-postgres, provision-clickhouse, provision-mongodb, provision-mysql-gtid, provision-mysql-pos, provision-mariadb |
Ancillary-TestInfra | Test infrastructure (manual start, needed by SSH keepalive and chaos tests) | toxiproxy, openssh |
Test | Test launchers (manual trigger) | e2e_postgres, e2e_mysql-gtid, connector_clickhouse, ... |
Monitoring | Observability | dozzle |
E2E tests (run go test ./e2e/ with a specific -run pattern):
| Resource | Test pattern | Required ancillary DBs |
|---|---|---|
e2e_postgres | TestGenericCH_PG | postgres, clickhouse |
e2e_mysql-gtid | TestGenericCH_MySQL | mysql-gtid, clickhouse |
e2e_mysql-pos | TestGenericCH_MySQL | mysql-pos, clickhouse |
e2e_mariadb | TestGenericCH_MySQL | mariadb, clickhouse |
e2e_mongodb | TestMongoClickhouseSuite | mongodb, clickhouse |
e2e_switchboard-postgres | TestSwitchboardPostgres | postgres, clickhouse |
e2e_switchboard-mysql-gtid | TestSwitchboardMySQL | mysql-gtid, clickhouse |
e2e_switchboard-mysql-pos | TestSwitchboardMySQL | mysql-pos, clickhouse |
e2e_switchboard-mariadb | TestSwitchboardMySQL | mariadb, clickhouse |
e2e_switchboard-mongodb | TestSwitchboardMongo | mongodb, clickhouse |
e2e_peer-flow-postgres | ^TestPeerFlowE2ETestSuitePG_CH$ | postgres, clickhouse |
e2e_peer-flow-mysql-gtid | ^TestPeerFlowE2ETestSuiteMySQL_CH$ | mysql-gtid, clickhouse |
e2e_peer-flow-mysql-pos | ^TestPeerFlowE2ETestSuiteMySQL_CH$ | mysql-pos, clickhouse |
e2e_peer-flow-mariadb | ^TestPeerFlowE2ETestSuiteMySQL_CH$ | mariadb, clickhouse |
e2e_api-postgres | TestApiPg | postgres, clickhouse |
e2e_api-mysql-gtid | TestApiMy | mysql-gtid, postgres, clickhouse |
e2e_api-mysql-pos | TestApiMy | mysql-pos, postgres, clickhouse |
e2e_api-mariadb | TestApiMy | mariadb, postgres, clickhouse |
e2e_api-mongodb | TestApiMongo | mongodb, clickhouse |
All e2e tests also depend on core PeerDB services: flow-api, flow-worker, catalog, and provision-clickhouse.
Connector tests (run go test ./connectors/<connector>/...):
| Resource | Package | Required ancillary DBs |
|---|---|---|
connector_postgres | connectors/postgres | postgres |
connector_mongo | connectors/mongo | mongodb |
connector_mysql | connectors/mysql | mysql-gtid |
connector_clickhouse | connectors/clickhouse | clickhouse |
Connector tests only depend on catalog + their specific DB.
MySQL tests use env var overrides to select flavor:
| Flavor | CI_MYSQL_PORT | CI_MYSQL_VERSION |
|---|---|---|
| mysql-gtid | from CI_MYSQL_GTID_PORT in .env | from CI_MYSQL_GTID_VERSION |
| mysql-pos | from CI_MYSQL_POS_PORT in .env | from CI_MYSQL_POS_VERSION |
| mariadb | from CI_MARIADB_PORT in .env | from CI_MARIADB_VERSION |
Some tests require toxiproxy and/or openssh from the Ancillary-TestInfra label. These are manually started like ancillary DBs.
Toxiproxy (network chaos proxy, admin port 18474):
connectors/postgres/ssh_keepalive_test.go and connectors/mysql/ssh_keepalive_test.go to simulate network failures (down, latency, reset_peer)e2e/api_test.go and e2e/cancel_table_addition_test.go for latency injection during CDC flows9902, 9904, 42001-42005 (MySQL), 49001-49003 (Postgres)OpenSSH (SSH tunnel server, port 2222, user testuser / password testpass):
Examples of tests requiring these services:
| Test file | Needs |
|---|---|
connectors/postgres/ssh_keepalive_test.go | toxiproxy + openssh + postgres |
connectors/mysql/ssh_keepalive_test.go | toxiproxy + openssh + mysql-gtid |
e2e/api_test.go (toxiproxy tests) | toxiproxy + postgres + clickhouse |
e2e/cancel_table_addition_test.go (toxiproxy tests) | toxiproxy + postgres + clickhouse |
Note: Tests that exercise toxiproxy or openssh can leave these services in an inconsistent state (e.g., lingering proxies, injected toxics, stuck SSH sessions) after failures or interruptions. If subsequent tests using them behave strangely (unexpected timeouts, refused connections, latency that shouldn't be there), recycle the affected resource before re-running:
tilt --port 10352 disable toxiproxy
tilt --port 10352 enable toxiproxy
tilt --port 10352 disable openssh
tilt --port 10352 enable openssh
tilt --port 10352 wait --for=condition=Ready uiresource/toxiproxy --timeout=60s
tilt --port 10352 wait --for=condition=Ready uiresource/openssh --timeout=60s
tilt --port 10352 get uiresource -o json | python3 -c "
import json, sys
data = json.load(sys.stdin)
for item in data.get('items', []):
name = item['metadata']['name']
labels = item.get('metadata', {}).get('labels', {})
runtime = item.get('status', {}).get('runtimeStatus', 'unknown')
update = item.get('status', {}).get('updateStatus', 'unknown')
enabled = not item.get('status', {}).get('disableStatus', {}).get('disabled', False)
state = 'enabled' if enabled else 'disabled'
print(f'{name}: runtime={runtime} update={update} ({state}) labels={list(labels.keys())}')
"
Ancillary databases are NOT auto-started. Enable them before running tests:
tilt --port 10352 enable postgres clickhouse
Wait for them and their provisioning to complete:
tilt --port 10352 wait --for=condition=Ready uiresource/postgres --timeout=120s
tilt --port 10352 wait --for=condition=Ready uiresource/provision-postgres --timeout=120s
For test infrastructure:
tilt --port 10352 enable toxiproxy openssh
tilt --port 10352 wait --for=condition=Ready uiresource/toxiproxy --timeout=60s
tilt --port 10352 wait --for=condition=Ready uiresource/openssh --timeout=60s
When the user provides $ARGUMENTS:
status, list, overview): show a summary of all resources grouped by label with their health.logs e2e_postgres, enable postgres, trigger e2e_mysql-gtid): execute that tilt command.e2e_postgres, connector_clickhouse, postgres): show its status, logs, and health.cleanup, destroy): run the cleanup commands to stop containers, teardown Tilt environment, and remove volumes.start, up): start Tilt according to the instructions above.stop, shutdown): stop Tilt gracefully according to the instructions above.To wipe all PeerDB Docker volumes (for a fresh start), first stop containers then remove volumes:
tilt --port 10352 disable --all
docker compose -f docker-compose-dev.yml -f ancillary-docker-compose.yml down
docker volume ls | awk '{print $2}' | grep peerdb | xargs docker volume rm -f
The Tilt UI also has a "Wipe ancillary volumes" button in the nav bar that removes ancillary DB volumes only (without touching core PeerDB volumes).
-f, use a timeout or --since to avoid blocking indefinitely.trigger. For multiple, run separate commands or use a loop in bash.Debug failing PeerDB e2e and connector tests locally. Use when the user wants to investigate test failures, run specific tests, isolate flaky tests, or troubleshoot test issues. Uses the /tilt skill for infrastructure management.
Updates dependencies in the PeerDB repository