Skip to content

Commit e696838

Browse files
committed
ci: run distributed mode in ci too
1 parent c6c4bac commit e696838

2 files changed

Lines changed: 62 additions & 28 deletions

File tree

.github/workflows/ci.yml

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: ci
22

3-
# Smoke test the testbed on every push and pull request: stand up a
4-
# single-node GreptimeDB (standalone-fs) using the LATEST greptimedb release
5-
# binary and assert that SQL works (a write that round-trips through the
6-
# client port).
3+
# Smoke test the testbed on every push and pull request, in TWO modes, using
4+
# the LATEST greptimedb release binary:
5+
# - standalone-fs : single-node GreptimeDB (local File backend)
6+
# - distributed : postgres -> metasrv -> datanode-{0,1} -> frontend -> haproxy
7+
# Each job asserts SQL works (a write that round-trips through the client port).
78
on:
89
push:
910
pull_request:
@@ -15,7 +16,11 @@ concurrency:
1516

1617
jobs:
1718
smoke:
18-
name: standalone-fs smoke (latest greptimedb release)
19+
name: ${{ matrix.mode }} smoke (latest greptimedb release)
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
mode: [standalone-fs, distributed]
1924
runs-on: ubuntu-latest
2025
timeout-minutes: 30
2126
steps:
@@ -49,25 +54,36 @@ jobs:
4954
install -m 0755 "$bin" ./greptime
5055
./greptime --version
5156
52-
- name: Temporarily strip unreleased iceberg_manifest plugin from config
53-
# config/standalone-fs.toml enables the `iceberg_manifest` plugin, which
54-
# is newer than the latest greptimedb release (the release hard-fails on
55-
# unknown plugin variants). Once the greptimedb patch to tolerate
56-
# unknown plugin options lands, DELETE THIS STEP and the config will
57-
# work against the release as-is.
57+
- name: Temporarily strip unreleased iceberg_manifest plugin from configs
58+
# Several config templates enable the `iceberg_manifest` plugin, which is
59+
# newer than the latest greptimedb release (the release hard-fails on
60+
# unknown plugin variants). Strip it from every config that uses it so
61+
# both the standalone-fs and distributed modes work against the release.
62+
# Once the greptimedb patch to tolerate unknown plugin options lands,
63+
# DELETE THIS STEP and the configs will work as-is.
5864
run: |
59-
sed -i -e '/^\[\[plugins\]\]$/d' -e '/^iceberg_manifest[[:space:]]*=/d' \
60-
config/standalone-fs.toml
61-
echo "Stripped iceberg_manifest plugin block from config/standalone-fs.toml"
65+
for f in config/standalone.toml config/standalone-fs.toml \
66+
config/datanode.toml config/frontend.toml; do
67+
sed -i -e '/^\[\[plugins\]\]$/d' -e '/^iceberg_manifest[[:space:]]*=/d' "$f"
68+
done
69+
echo "Stripped iceberg_manifest plugin block from config templates"
6270
63-
- name: Start standalone-fs and run a SQL smoke test
64-
run: nix develop --command bash ci/smoke.sh
71+
- name: Start ${{ matrix.mode }} and run a SQL smoke test
72+
run: nix develop --command bash ci/smoke.sh ${{ matrix.mode }}
6573

66-
- name: Dump standalone-fs logs on failure
74+
- name: Dump logs on failure
6775
if: failure()
6876
run: |
6977
nix develop --command bash -c 'process-compose process list || true'
70-
nix develop --command bash -c 'process-compose process logs standalone-fs --tail 200 || true' || true
78+
if [ "${{ matrix.mode }}" = "distributed" ]; then
79+
procs="postgres metasrv datanode-0 datanode-1 frontend haproxy"
80+
else
81+
procs="standalone-fs"
82+
fi
83+
for p in $procs; do
84+
echo "==================== logs: $p ===================="
85+
nix develop --command bash -c "process-compose process logs $p --tail 200" || true
86+
done
7187
7288
- name: Tear down
7389
if: always()

ci/smoke.sh

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,43 @@
11
#!/usr/bin/env bash
22
# CI smoke test for the testbed.
33
#
4-
# Starts the single-node standalone-fs server (local File backend — no
5-
# garage/postgres needed) and asserts that at least one SQL statement works
6-
# (a write that round-trips through the client port).
4+
# Starts ONE GreptimeDB deployment mode and asserts that SQL works (a write
5+
# that round-trips through the client PostgreSQL port 11043):
76
#
8-
# Run inside `nix develop` (which provides process-compose, psql and curl):
7+
# standalone-fs single-node GreptimeDB, local File backend (no deps)
8+
# distributed full cluster: postgres -> metasrv -> datanode-{0,1} ->
9+
# frontend -> haproxy (Garage S3 for data, Postgres for
10+
# metadata + metasrv election)
11+
#
12+
# Both modes expose the SAME client ports (11040 HTTP / 11043 PostgreSQL), so
13+
# the SQL checks are identical — only the process-compose target differs.
914
#
10-
# nix develop --command bash ci/smoke.sh
15+
# Usage: ci/smoke.sh [standalone-fs|distributed] (default: standalone-fs)
1116
#
12-
# Expects a `greptime` binary at the project root (GREPTIME_BIN default),
13-
# e.g. downloaded from the latest GreptimeTeam/greptimedb release.
17+
# Run inside `nix develop` (which provides process-compose, psql and curl):
18+
# nix develop --command bash ci/smoke.sh distributed
19+
#
20+
# Expects a `greptime` binary at the project root (GREPTIME_BIN default), e.g.
21+
# downloaded from the latest GreptimeTeam/greptimedb release.
1422
#
1523
# NOTE: this script intentionally does NOT tear the server down on exit — the
1624
# caller (CI workflow) fetches logs on failure and tears down in a later step.
1725
set -euo pipefail
1826

27+
MODE="${1:-standalone-fs}"
1928
HEALTH_WAIT_SECS="${HEALTH_WAIT_SECS:-120}"
2029

21-
echo "==> starting standalone-fs (single-node, local File backend)"
22-
process-compose --tui=false up --detached standalone-fs
30+
case "$MODE" in
31+
standalone-fs) TARGET="standalone-fs" ;;
32+
distributed) TARGET="haproxy" ;;
33+
*)
34+
echo "ERROR: unknown mode '$MODE' (expected: standalone-fs | distributed)" >&2
35+
exit 2
36+
;;
37+
esac
38+
39+
echo "==> starting mode='$MODE' (process-compose target: $TARGET)"
40+
process-compose --tui=false up --detached "$TARGET"
2341

2442
echo "==> waiting for client HTTP port 11040 to become healthy (up to ${HEALTH_WAIT_SECS}s)"
2543
healthy=0
@@ -50,4 +68,4 @@ if [ "${val:-}" != "42" ]; then
5068
exit 1
5169
fi
5270

53-
echo "==> SMOKE TEST PASSED"
71+
echo "==> SMOKE TEST PASSED ($MODE)"

0 commit comments

Comments
 (0)