mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-11 15:23:10 +00:00
Run CLI P2P E2E in Compose CI
This commit is contained in:
@@ -9,6 +9,9 @@ on:
|
||||
- '.github/workflows/cli-deno-tests.yml'
|
||||
- 'src/apps/cli/**'
|
||||
- 'src/lib/src/API/processSetting.ts'
|
||||
- 'src/lib/src/replication/trystero/**'
|
||||
- 'src/lib/src/rpc/**'
|
||||
- 'test/bench-network/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
pull_request:
|
||||
@@ -16,6 +19,9 @@ on:
|
||||
- '.github/workflows/cli-deno-tests.yml'
|
||||
- 'src/apps/cli/**'
|
||||
- 'src/lib/src/API/processSetting.ts'
|
||||
- 'src/lib/src/replication/trystero/**'
|
||||
- 'src/lib/src/rpc/**'
|
||||
- 'test/bench-network/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
workflow_dispatch:
|
||||
@@ -155,3 +161,41 @@ jobs:
|
||||
run: |
|
||||
docker stop couchdb-test minio-test relay-test coturn-test >/dev/null 2>&1 || true
|
||||
docker rm couchdb-test minio-test relay-test coturn-test >/dev/null 2>&1 || true
|
||||
|
||||
compose-p2p-e2e:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Show Docker versions
|
||||
run: |
|
||||
docker --version
|
||||
docker compose version
|
||||
|
||||
- name: Run Compose CLI P2P E2E
|
||||
env:
|
||||
BENCH_COMMAND: cli-p2p-e2e
|
||||
CLI_P2P_E2E_TASK: test:p2p-sync
|
||||
RELAY: ws://nostr-relay:7777/
|
||||
PEERS_TIMEOUT: '20'
|
||||
SYNC_TIMEOUT: '60'
|
||||
LIVESYNC_USE_COTURN: '0'
|
||||
TURN_SERVERS: none
|
||||
LIVESYNC_P2P_PEERS_RETRY: '1'
|
||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
||||
BENCH_LIVESYNC_TEST_TEE: '0'
|
||||
run: docker compose -f test/bench-network/compose.yml run --build --rm bench-runner
|
||||
|
||||
- name: Show Compose diagnostics
|
||||
if: failure()
|
||||
run: |
|
||||
docker compose -f test/bench-network/compose.yml ps
|
||||
docker compose -f test/bench-network/compose.yml logs --no-color couchdb nostr-relay || true
|
||||
|
||||
- name: Stop Compose services
|
||||
if: always()
|
||||
run: docker compose -f test/bench-network/compose.yml down -v --remove-orphans
|
||||
|
||||
@@ -1,24 +1,21 @@
|
||||
# Run the Compose-packaged CLI P2P smoke benchmark.
|
||||
#
|
||||
# This workflow is intentionally non-required at first. It exercises the local
|
||||
# Compose package for CouchDB + Nostr relay + CLI runner, and uploads the
|
||||
# benchmark JSON results for inspection.
|
||||
# This workflow is intentionally manual-only. It exercises the local Compose
|
||||
# package for CouchDB + Nostr relay + CLI runner, and uploads the benchmark JSON
|
||||
# results for inspection without adding benchmark work to pull-request CI.
|
||||
name: cli-p2p-compose-smoke
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/cli-p2p-compose-smoke.yml'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
- 'src/apps/cli/**'
|
||||
- 'test/bench-network/**'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
cases:
|
||||
description: 'Comma-separated benchmark cases'
|
||||
required: false
|
||||
default: 'couchdb-baseline,p2p-direct-local'
|
||||
signalling_cases:
|
||||
description: 'Comma-separated signalling-shim P2P benchmark cases'
|
||||
required: false
|
||||
default: 'p2p-signalling-netem-home-wifi'
|
||||
md_files:
|
||||
description: 'Markdown file count'
|
||||
required: false
|
||||
@@ -63,13 +60,28 @@ jobs:
|
||||
BENCH_PEERS_TIMEOUT: '20'
|
||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
||||
BENCH_LIVESYNC_TEST_TEE: '0'
|
||||
run: docker compose -f test/bench-network/compose.yml run --rm bench-runner
|
||||
run: docker compose -f test/bench-network/compose.yml run --build --rm bench-runner
|
||||
|
||||
- name: Run Compose P2P signalling-shim smoke benchmark
|
||||
env:
|
||||
BENCH_CASES: ${{ inputs.signalling_cases || 'p2p-signalling-netem-home-wifi' }}
|
||||
BENCH_MD_FILE_COUNT: ${{ inputs.md_files || '2' }}
|
||||
BENCH_MD_MIN_SIZE_BYTES: '128'
|
||||
BENCH_MD_MAX_SIZE_BYTES: '256'
|
||||
BENCH_BIN_FILE_COUNT: ${{ inputs.bin_files || '1' }}
|
||||
BENCH_BIN_SIZE_BYTES: '512'
|
||||
BENCH_SYNC_TIMEOUT: '180'
|
||||
BENCH_PEERS_TIMEOUT: '60'
|
||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
||||
BENCH_LIVESYNC_TEST_TEE: '0'
|
||||
NETEM_PROFILE: 'home-wifi'
|
||||
run: docker compose -f test/bench-network/compose.yml --profile signalling-shim run --build --rm bench-runner-signalling-shim
|
||||
|
||||
- name: Show Compose diagnostics
|
||||
if: failure()
|
||||
run: |
|
||||
docker compose -f test/bench-network/compose.yml ps
|
||||
docker compose -f test/bench-network/compose.yml logs --no-color couchdb nostr-relay
|
||||
docker compose -f test/bench-network/compose.yml --profile signalling-shim logs --no-color couchdb nostr-relay p2p-signalling-shim || true
|
||||
|
||||
- name: Upload benchmark results
|
||||
if: always()
|
||||
|
||||
@@ -27,7 +27,8 @@ RUN deno cache --lock=deno.lock \
|
||||
bench-latency-sweep.ts \
|
||||
bench-p2p-split-node.ts \
|
||||
bench-p2p.ts \
|
||||
bench-couchdb.ts
|
||||
bench-couchdb.ts \
|
||||
test-p2p-sync.ts
|
||||
|
||||
COPY test/bench-network/run-bench.sh /usr/local/bin/run-livesync-bench
|
||||
RUN chmod +x /usr/local/bin/run-livesync-bench
|
||||
|
||||
@@ -96,6 +96,13 @@ services:
|
||||
BENCH_PEERS_TIMEOUT: ${BENCH_PEERS_TIMEOUT:-60}
|
||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: ${LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS:-60000}
|
||||
BENCH_LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
|
||||
CLI_P2P_E2E_TASK: ${CLI_P2P_E2E_TASK:-test:p2p-sync}
|
||||
RELAY: ${RELAY:-ws://nostr-relay:7777/}
|
||||
PEERS_TIMEOUT: ${PEERS_TIMEOUT:-20}
|
||||
SYNC_TIMEOUT: ${SYNC_TIMEOUT:-60}
|
||||
LIVESYNC_USE_COTURN: ${LIVESYNC_USE_COTURN:-0}
|
||||
TURN_SERVERS: ${TURN_SERVERS:-none}
|
||||
LIVESYNC_P2P_PEERS_RETRY: ${LIVESYNC_P2P_PEERS_RETRY:-1}
|
||||
volumes:
|
||||
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
|
||||
|
||||
|
||||
@@ -11,9 +11,12 @@ case "${BENCH_COMMAND:-cases}" in
|
||||
p2p-split-node)
|
||||
exec deno task bench:p2p-split-node
|
||||
;;
|
||||
cli-p2p-e2e)
|
||||
exec deno task "${CLI_P2P_E2E_TASK:-test:p2p-sync}"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown BENCH_COMMAND: ${BENCH_COMMAND}" >&2
|
||||
echo "Expected one of: cases, latency-sweep, p2p-split-node" >&2
|
||||
echo "Expected one of: cases, latency-sweep, p2p-split-node, cli-p2p-e2e" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user