-
Notifications
You must be signed in to change notification settings - Fork 165
174 lines (149 loc) · 6.02 KB
/
Copy pathweave-trace-tests.yaml
File metadata and controls
174 lines (149 loc) · 6.02 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
name: weave-trace-tests
on:
push:
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
check-which-tests-to-run:
uses: ./.github/workflows/check-which-tests-to-run.yaml
# This duplicates core's Build and Test App / Weave Trace Tests job while
# trace-server still lives in core. Simplify this once trace-server moves into
# weave or the core workflow can be reused directly.
weave-trace-tests:
name: Weave Trace Tests
needs:
- check-which-tests-to-run
if: needs.check-which-tests-to-run.outputs.trace_server_tests == 'true' || github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest-8-cores
timeout-minutes: 45
env:
CORE_DIR: core
COMPOSE_FILE: .github/compose/weave-trace-tests.yaml
COMPOSE_PROJECT_NAME: weave-trace-tests
steps:
- name: Create GitHub App token
id: app-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3
with:
app-id: ${{ vars.WANDBOT_3000_APP_ID }}
private-key: ${{ secrets.WANDBOT_3000_PRIVATE_KEY }}
owner: wandb
repositories: core
permission-contents: read
- name: Checkout core
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
repository: wandb/core
ref: master
path: ${{ env.CORE_DIR }}
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false
- name: Remove core Weave submodule placeholder
run: rm -rf "${CORE_DIR}/services/weave-python/weave-public"
- name: Checkout current weave commit into core
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
path: ${{ env.CORE_DIR }}/services/weave-python/weave-public
persist-credentials: false
- name: Verify overlaid Weave commit
run: |
set -euo pipefail
actual_sha="$(git -C "${CORE_DIR}/services/weave-python/weave-public" rev-parse HEAD)"
echo "core_sha=$(git -C "${CORE_DIR}" rev-parse HEAD)"
echo "weave_sha=${actual_sha}"
test "${actual_sha}" = "${GITHUB_SHA}"
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.WORKLOAD_IDENTITY_SERVICE_ACCOUNT }}
- name: Set up gcloud
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3
- name: Configure Docker auth
run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
- name: Start service containers
working-directory: ${{ env.CORE_DIR }}
run: docker compose up --detach
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
enable-cache: true
cache-dependency-glob: core/services/weave-trace/uv.lock
- name: Install dependencies
working-directory: ${{ env.CORE_DIR }}/services/weave-trace
run: uv sync --group dev --group test --frozen
- name: Pip freeze
working-directory: ${{ env.CORE_DIR }}/services/weave-trace
run: uv pip freeze
- name: Wait for ClickHouse
run: |
set -euo pipefail
for _i in {1..60}; do
if curl --silent --fail --show-error http://localhost:8123/ping; then
echo "ClickHouse is ready"
exit 0
fi
sleep 2
done
echo "::error::ClickHouse did not become ready in time"
exit 1
- name: Wait for Gorilla
run: |
set -euo pipefail
for _i in {1..120}; do
if (curl --silent --fail --show-error http://localhost:8080/ready >/dev/null \
|| curl --silent --fail --show-error http://localhost:8080/healthz >/dev/null) \
&& curl --silent --fail --show-error http://localhost:9015/health >/dev/null; then
echo "Gorilla and fixture service are ready"
exit 0
fi
sleep 2
done
echo "::error::Gorilla did not become ready in time"
exit 1
- name: Wait for Bufstream
run: |
set -euo pipefail
for _i in {1..60}; do
if timeout 5 bash -c "</dev/tcp/localhost/9092"; then
echo "Bufstream is ready"
exit 0
fi
sleep 1
done
echo "::error::Bufstream did not become ready in time"
exit 1
- name: Export API schema
working-directory: ${{ env.CORE_DIR }}/services/weave-trace
run: |
export PYTHONPATH="${GITHUB_WORKSPACE}/${CORE_DIR}/services/weave-python/weave-public${PYTHONPATH:+:${PYTHONPATH}}"
make export-api-schema
- name: Run Weave Trace tests
working-directory: ${{ env.CORE_DIR }}/services/weave-trace
env:
DD_ENV: ci
WB_SERVER_HOST: http://localhost
WF_CLICKHOUSE_HOST: localhost
WEAVE_TRACE_CLICKHOUSE_USE_ASYNC_INSERT: "false"
BUFSTREAM_KAFKA_HOST: localhost
KAFKA_BROKER_HOST: localhost
KAFKA_BROKER_PORT: "9092"
run: |
export PYTHONPATH="${GITHUB_WORKSPACE}/${CORE_DIR}/services/weave-python/weave-public${PYTHONPATH:+:${PYTHONPATH}}"
make test-cov
- name: Dump service logs
if: failure()
working-directory: ${{ env.CORE_DIR }}
run: |
docker compose ps || true
for service in wandb-local clickhouse bufstream; do
echo "::group::${service} logs"
docker compose logs --no-color "${service}" || true
echo "::endgroup::"
done
- name: Stop service containers
if: always()
working-directory: ${{ env.CORE_DIR }}
run: docker compose down --volumes --remove-orphans || true