-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (118 loc) · 5.55 KB
/
performance.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: "Performance Tests"
on:
pull_request:
branches: [ main, develop ]
workflow_dispatch:
env:
INFLUX_TOKEN: ${{ secrets.INFLUX_TOKEN }}
WT_METRICS_DIR: "${{ github.workspace }}/telegraf/metrics"
jobs:
test:
runs-on: [self-hosted, wind-tunnel]
strategy:
fail-fast: false
matrix:
scenario: [ zome_call_single_value, single_write_many_read, write_read, write_query, local_signals, write_validated ]
include:
- scenario: dht_sync_lag
extra-args: "--agents 2 --behaviour write:1 --behaviour record_lag:1"
- scenario: app_install
extra-args: "--agents 2 --behaviour minimal:1 --behaviour large:1"
- scenario: first_call
extra-args: "--agents 1 --behaviour local:1"
steps:
- uses: actions/checkout@v4
- name: Smoke test - ${{ matrix.scenario }}
id: run_test
run: |
# Start a sandbox conductor and run it in the background
nix develop .#ci -c bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &"
RUST_LOG=info nix run .#${{ matrix.scenario }} -- --connection-string ws://localhost:8888 --duration 120 --no-progress --reporter influx-file ${{ matrix.extra-args }} > >(tee logs/scenario-stdout.log) 2> >(tee logs/scenario-stderr.log >&2)
pkill hc && pkill holochain && pkill lair-keystore
RUN_ID=$(grep -m1 "#RunId" logs/scenario-stdout.log | sed 's/#RunId: \[\(.\+\)\]/\1/')
echo "RUN_ID=$RUN_ID" >> "$GITHUB_OUTPUT"
echo "# Run ID: $RUN_ID" >> $GITHUB_STEP_SUMMARY
- name: Run Telegraf to upload influx metrics
run: |
if ! nix run nixpkgs#telegraf -- --config telegraf/runner-telegraf.conf --once > >(tee logs/telegraf-stdout.log) 2> >(tee logs/telegraf-stderr.log >&2)
then
echo "::group::Telegraf errors"
status=1
# Print errors as such in GitHub logs.
grep "E!" logs/telegraf-stderr.log | xargs -l echo "::error ::"
echo "::endgroup::"
fi
echo "::group::Telegraf warnings"
# Print warnings as such in GitHub logs.
grep "W!" logs/telegraf-stderr.log | xargs -l echo "::warning ::"
echo "::endgroup::"
exit ${status-0}
- name: Upload logs as artifacts
if: success() || failure()
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: "logs_${{ matrix.scenario }}"
path: |
logs/scenario-stdout.log
logs/scenario-stderr.log
logs/telegraf-stdout.log
logs/telegraf-stderr.log
- name: Output Path to logs in summary
run: echo "# Logs: [${{ steps.upload-artifact.outputs.artifact-id }}](${{ steps.upload-artifact.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY
trycp-test:
runs-on: [self-hosted, wind-tunnel]
strategy:
fail-fast: false
matrix:
scenario: [ trycp_write_validated, remote_call_rate, validation_receipts ]
include:
- scenario: two_party_countersigning
extra-args: "--behaviour initiate:1 --behaviour participate:1"
steps:
- uses: actions/checkout@v4
- name: Smoke test - ${{ matrix.scenario }}
id: run_test
run: |
set -x
# Start local network services
nix develop .#ci -c bash -c "hc-run-local-services --bootstrap-port 4422 --signal-port 4423 &"
# Start a TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && start_trycp &"
RUST_LOG=warn CONDUCTOR_CONFIG="CI" MIN_PEERS=2 nix run .#${{ matrix.scenario }} -- --targets targets-ci.yaml --instances-per-target 2 --duration 120 --no-progress --reporter influx-file ${{ matrix.extra-args }} > >(tee logs/scenario-stdout.log) 2> >(tee logs/scenario-stderr.log >&2)
# Stop the TryCP instance
nix develop .#ci -c bash -c "source ./scripts/trycp.sh && stop_trycp"
# Stop local network services
pkill hc-run-local
RUN_ID=$(grep -m1 "#RunId" logs/scenario-stdout.log | sed 's/#RunId: \[\(.\+\)\]/\1/')
echo "RUN_ID=$RUN_ID" >> "$GITHUB_OUTPUT"
echo "# Run ID: $RUN_ID" >> $GITHUB_STEP_SUMMARY
- name: Run Telegraf to upload influx metrics
run: |
if ! nix run nixpkgs#telegraf -- --config telegraf/runner-telegraf.conf --once > >(tee logs/telegraf-stdout.log) 2> >(tee logs/telegraf-stderr.log >&2)
then
echo "::group::Telegraf errors"
status=1
# Print errors as such in GitHub logs.
grep "E!" logs/telegraf-stderr.log | xargs -l echo "::error ::"
echo "::endgroup::"
fi
echo "::group::Telegraf warnings"
# Print warnings as such in GitHub logs.
grep "W!" logs/telegraf-stderr.log | xargs -l echo "::warning ::"
echo "::endgroup::"
exit ${status-0}
- name: Upload logs as artifacts
if: success() || failure()
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: "logs_${{ matrix.scenario }}"
path: |
logs/scenario-stdout.log
logs/scenario-stderr.log
logs/telegraf-stdout.log
logs/telegraf-stderr.log
logs/${{ steps.run_test.outputs.RUN_ID }}/
- name: Output Path to logs in summary
run: echo "# Logs: [${{ steps.upload-artifact.outputs.artifact-id }}](${{ steps.upload-artifact.outputs.artifact-url }})" >> $GITHUB_STEP_SUMMARY