mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-14 16:45:59 +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'
|
- '.github/workflows/cli-deno-tests.yml'
|
||||||
- 'src/apps/cli/**'
|
- 'src/apps/cli/**'
|
||||||
- 'src/lib/src/API/processSetting.ts'
|
- 'src/lib/src/API/processSetting.ts'
|
||||||
|
- 'src/lib/src/replication/trystero/**'
|
||||||
|
- 'src/lib/src/rpc/**'
|
||||||
|
- 'test/bench-network/**'
|
||||||
- 'package.json'
|
- 'package.json'
|
||||||
- 'package-lock.json'
|
- 'package-lock.json'
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -16,6 +19,9 @@ on:
|
|||||||
- '.github/workflows/cli-deno-tests.yml'
|
- '.github/workflows/cli-deno-tests.yml'
|
||||||
- 'src/apps/cli/**'
|
- 'src/apps/cli/**'
|
||||||
- 'src/lib/src/API/processSetting.ts'
|
- 'src/lib/src/API/processSetting.ts'
|
||||||
|
- 'src/lib/src/replication/trystero/**'
|
||||||
|
- 'src/lib/src/rpc/**'
|
||||||
|
- 'test/bench-network/**'
|
||||||
- 'package.json'
|
- 'package.json'
|
||||||
- 'package-lock.json'
|
- 'package-lock.json'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -155,3 +161,41 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
docker stop couchdb-test minio-test relay-test coturn-test >/dev/null 2>&1 || true
|
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
|
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.
|
# Run the Compose-packaged CLI P2P smoke benchmark.
|
||||||
#
|
#
|
||||||
# This workflow is intentionally non-required at first. It exercises the local
|
# This workflow is intentionally manual-only. It exercises the local Compose
|
||||||
# Compose package for CouchDB + Nostr relay + CLI runner, and uploads the
|
# package for CouchDB + Nostr relay + CLI runner, and uploads the benchmark JSON
|
||||||
# benchmark JSON results for inspection.
|
# results for inspection without adding benchmark work to pull-request CI.
|
||||||
name: cli-p2p-compose-smoke
|
name: cli-p2p-compose-smoke
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- '.github/workflows/cli-p2p-compose-smoke.yml'
|
|
||||||
- 'package.json'
|
|
||||||
- 'package-lock.json'
|
|
||||||
- 'src/apps/cli/**'
|
|
||||||
- 'test/bench-network/**'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
cases:
|
cases:
|
||||||
description: 'Comma-separated benchmark cases'
|
description: 'Comma-separated benchmark cases'
|
||||||
required: false
|
required: false
|
||||||
default: 'couchdb-baseline,p2p-direct-local'
|
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:
|
md_files:
|
||||||
description: 'Markdown file count'
|
description: 'Markdown file count'
|
||||||
required: false
|
required: false
|
||||||
@@ -63,13 +60,28 @@ jobs:
|
|||||||
BENCH_PEERS_TIMEOUT: '20'
|
BENCH_PEERS_TIMEOUT: '20'
|
||||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: '60000'
|
||||||
BENCH_LIVESYNC_TEST_TEE: '0'
|
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
|
- name: Show Compose diagnostics
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
docker compose -f test/bench-network/compose.yml ps
|
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
|
- name: Upload benchmark results
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ RUN deno cache --lock=deno.lock \
|
|||||||
bench-latency-sweep.ts \
|
bench-latency-sweep.ts \
|
||||||
bench-p2p-split-node.ts \
|
bench-p2p-split-node.ts \
|
||||||
bench-p2p.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
|
COPY test/bench-network/run-bench.sh /usr/local/bin/run-livesync-bench
|
||||||
RUN chmod +x /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}
|
BENCH_PEERS_TIMEOUT: ${BENCH_PEERS_TIMEOUT:-60}
|
||||||
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: ${LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS:-60000}
|
LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS: ${LIVESYNC_P2P_RELAY_READY_TIMEOUT_MS:-60000}
|
||||||
BENCH_LIVESYNC_TEST_TEE: ${BENCH_LIVESYNC_TEST_TEE:-0}
|
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:
|
volumes:
|
||||||
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
|
- ./bench-results:/workspace/src/apps/cli/testdeno/bench-results
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,12 @@ case "${BENCH_COMMAND:-cases}" in
|
|||||||
p2p-split-node)
|
p2p-split-node)
|
||||||
exec deno task bench: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 "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
|
exit 2
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user