-
Notifications
You must be signed in to change notification settings - Fork 165
266 lines (254 loc) · 9.38 KB
/
Copy pathnightly-tests.yaml
File metadata and controls
266 lines (254 loc) · 9.38 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
name: nightly-tests
on:
schedule:
# Run at midnight UTC
- cron: "0 0 * * *"
# Allow manual triggering
workflow_dispatch:
inputs:
shards:
description: "Comma-separated list of shards to run (leave empty for all)"
required: false
default: ""
jobs:
nightly-tests:
name: Nightly Tests
timeout-minutes: 30
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
env:
MAX_ATTEMPTS: 3
strategy:
matrix:
python-version-major: ["3"]
python-version-minor: [
"10",
"11",
"12",
"13",
#
]
shard:
[
"trace",
"flow",
"trace_server",
"trace_server_bindings",
"anthropic",
"bedrock",
"cerebras",
"cohere",
"crewai",
"dspy",
"groq",
"google_genai",
"instructor",
"langchain",
"litellm",
"llamaindex",
"mistral",
"notdiamond",
"openai",
"scorers",
"verifiers_test",
"vertexai",
"pandas_test",
"fastmcp",
"smolagents",
"autogen_tests",
]
exclude:
# verifiers_test dependencies require Python >= 3.11.
- python-version-major: "3"
python-version-minor: "10"
shard: "verifiers_test"
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Filter shards if specified
id: filter_shards
run: |
INPUT_SHARDS="${{ github.event.inputs.shards }}"
if [ -n "$INPUT_SHARDS" ]; then
echo "Running specific shards: $INPUT_SHARDS"
if [[ ! ",$INPUT_SHARDS," == *",${{ matrix.shard }},"* ]]; then
echo "Skipping ${{ matrix.shard }} as it's not in the specified list"
echo "skip=true" >> $GITHUB_OUTPUT
exit 0
fi
fi
echo "Running shard: ${{ matrix.shard }}"
echo "skip=false" >> $GITHUB_OUTPUT
- name: Start ClickHouse
if: steps.filter_shards.outputs.skip != 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
image=$(.github/scripts/ch-image.sh)
docker run --detach --rm --name weave_clickhouse \
--env CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 \
--env CLICKHOUSE_USER=default \
--env CLICKHOUSE_PASSWORD= \
--env CLICKHOUSE_DB=default \
--publish 8123:8123 \
-v ${{ github.workspace }}/tests/trace_server/conftest_lib/test_overrides.xml:/etc/clickhouse-server/users.d/test_overrides.xml:ro \
"$image"
for _i in {1..30}; do
if wget -q -O- 'http://localhost:8123/ping' >/dev/null; then
echo "clickhouse is healthy"
exit 0
fi
sleep 1
done
docker logs weave_clickhouse
exit 1
- name: Enable debug logging
if: steps.filter_shards.outputs.skip != 'true'
run: echo "ACTIONS_STEP_DEBUG=true" >> $GITHUB_ENV
- name: Set up Python ${{ matrix.python-version-major }}.${{ matrix.python-version-minor }}
if: steps.filter_shards.outputs.skip != 'true'
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: ${{ matrix.python-version-major }}.${{ matrix.python-version-minor }}
- name: Install dependencies
if: steps.filter_shards.outputs.skip != 'true'
run: |
python -m pip install --upgrade pip
pip install nox uv
- name: Check if shard needs trace_server markers
id: check_trace_markers
if: steps.filter_shards.outputs.skip != 'true'
run: |
# Shards that are in the regular test matrix and need trace_server markers
TRACE_SERVER_SHARDS="flow trace_server trace_server_bindings anthropic cerebras cohere crewai dspy groq google_genai google_ai_studio instructor langchain litellm llamaindex mistral notdiamond openai openai_agents vertexai bedrock scorers pandas_test huggingface smolagents fastmcp autogen_tests trace trace_no_server"
if [[ " $TRACE_SERVER_SHARDS " =~ " ${{ matrix.shard }} " ]]; then
echo "needs_markers=true" >> $GITHUB_OUTPUT
else
echo "needs_markers=false" >> $GITHUB_OUTPUT
fi
- name: Run nox (Clickhouse Trace Server)
if: steps.filter_shards.outputs.skip != 'true' && steps.check_trace_markers.outputs.needs_markers == 'true'
env:
WEAVE_SENTRY_ENV: ci
CI: 1
WEAVE_USE_MEMRAY: 1
WF_CLICKHOUSE_HOST: localhost
WEAVE_SERVER_DISABLE_ECOSYSTEM: 1
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DD_TRACE_ENABLED: false
run: |
.github/scripts/retry.sh nox -e "tests-${{ matrix.python-version-major }}.${{ matrix.python-version-minor }}(shard='${{ matrix.shard }}')" -- \
-m "trace_server"
- name: Run nox (No marker filters for integration-only shards)
if: steps.filter_shards.outputs.skip != 'true' && steps.check_trace_markers.outputs.needs_markers == 'false'
env:
WEAVE_SENTRY_ENV: ci
CI: 1
WEAVE_USE_MEMRAY: 1
WF_CLICKHOUSE_HOST: localhost
WEAVE_SERVER_DISABLE_ECOSYSTEM: 1
WANDB_API_KEY: ${{ secrets.WANDB_API_KEY }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
DD_TRACE_ENABLED: false
run: |
.github/scripts/retry.sh nox -e "tests-${{ matrix.python-version-major }}.${{ matrix.python-version-minor }}(shard='${{ matrix.shard }}')"
nightly-tests-replicated-1s3r:
name: Nightly Tests (replicated 1s3r)
permissions:
contents: read
uses: ./.github/workflows/nightly-replicated-leg.yaml
with:
topology: "1s3r"
ch_port: "8130"
use_distributed: false
shards: ${{ github.event.inputs.shards }}
secrets: inherit
nightly-tests-replicated-2s2r:
name: Nightly Tests (replicated 2s2r)
permissions:
contents: read
uses: ./.github/workflows/nightly-replicated-leg.yaml
with:
topology: "2s2r"
ch_port: "8131"
use_distributed: true
shards: ${{ github.event.inputs.shards }}
secrets: inherit
slack-notification:
name: Slack Notification
needs:
- nightly-tests
- nightly-tests-replicated-1s3r
- nightly-tests-replicated-2s2r
runs-on: ubuntu-latest
if: always()
steps:
- name: Determine Result and Failed Jobs
id: result
env:
NEEDS: "${{ toJson(needs) }}"
run: |
jq -C . <<< "${NEEDS}" # debug
# Check if any job failed
has_failure=$(
jq -r '
.[]
| select(.result == "failure")
| "true"
' <<< "${NEEDS}" | head -n1
)
if [ "$has_failure" = "true" ]; then
echo "status=failure" >> $GITHUB_OUTPUT
failed_jobs=$(
jq -r '
to_entries
| [
.[]
| select(.value.result == "failure")
| .key
]
| join(", ")
' <<< "${NEEDS}"
)
echo "failed_jobs=$failed_jobs" >> $GITHUB_OUTPUT
else
echo "status=success" >> $GITHUB_OUTPUT
fi
- name: Send Slack Notification on Failure
if: steps.result.outputs.status == 'failure'
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
with:
channel-id: "C09CE03J867"
slack-message: |
<!subteam^S06HYJNN7SL> :x: Nightly Tests failed!
*Repository:* ${{ github.repository }}
*Commit:* ${{ github.sha }}
*Failed Jobs:* ${{ steps.result.outputs.failed_jobs }}
*Build:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
env:
SLACK_BOT_TOKEN: ${{ secrets.WANDB_CI_SLACK_BOT_TOKEN }}
- name: Send Slack Notification on Success
if: steps.result.outputs.status == 'success'
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
with:
channel-id: "C09CE03J867"
slack-message: |
:white_check_mark: Nightly Tests passed!
*Repository:* ${{ github.repository }}
*Commit:* ${{ github.sha }}
*Build:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
env:
SLACK_BOT_TOKEN: ${{ secrets.WANDB_CI_SLACK_BOT_TOKEN }}