Skip to content

Commit 1972cb6

Browse files
committed
Add gh action to send slack message
1 parent cc4db55 commit 1972cb6

File tree

3 files changed

+64
-184
lines changed

3 files changed

+64
-184
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Send Notification
2+
description: "Send a notification to Slack"
3+
inputs:
4+
source_name:
5+
description: "name of the failed job (i.e runBenchmark)"
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- uses: slackapi/[email protected]
12+
with:
13+
payload: |
14+
{
15+
"text": "CI benchmarks (${{ inputs.source_name }}) run status: ${{ job.status }}",
16+
"blocks": [
17+
{
18+
"type": "section",
19+
"text": {
20+
"type": "mrkdwn",
21+
"text": "CI benchmarks (${{ inputs.source_name }}) failed because of *${{ steps.benches.outputs.failed }}*."
22+
}
23+
},
24+
{
25+
"type": "section",
26+
"text": {
27+
"type": "mrkdwn",
28+
"text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*."
29+
}
30+
},
31+
{
32+
"type": "section",
33+
"text": {
34+
"type": "mrkdwn",
35+
"text": "Engine: *${{ steps.benches.outputs.engine_name }}*."
36+
}
37+
},
38+
{
39+
"type": "section",
40+
"text": {
41+
"type": "mrkdwn",
42+
"text": "Dataset: *${{ steps.benches.outputs.dataset }}*."
43+
}
44+
},
45+
{
46+
"type": "section",
47+
"text": {
48+
"type": "mrkdwn",
49+
"text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
50+
}
51+
}
52+
]
53+
}
54+
env:
55+
SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }}
56+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

.github/workflows/continuous-benchmark-2.yaml

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -71,51 +71,7 @@ jobs:
7171
- name: Fail job if any of the benches failed
7272
if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout'
7373
run: exit 1
74-
- name: Send Notification
74+
- uses: ./.github/workflows/actions/send-slack-msg
7575
if: failure() || cancelled()
76-
uses: slackapi/[email protected]
7776
with:
78-
payload: |
79-
{
80-
"text": "CI benchmarks (runLoadTimeBenchmark) run status: ${{ job.status }}",
81-
"blocks": [
82-
{
83-
"type": "section",
84-
"text": {
85-
"type": "mrkdwn",
86-
"text": "CI benchmarks (runLoadTimeBenchmark) failed because of *${{ steps.benches.outputs.failed }}*."
87-
}
88-
},
89-
{
90-
"type": "section",
91-
"text": {
92-
"type": "mrkdwn",
93-
"text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*."
94-
}
95-
},
96-
{
97-
"type": "section",
98-
"text": {
99-
"type": "mrkdwn",
100-
"text": "Engine: *${{ steps.benches.outputs.engine_name }}*."
101-
}
102-
},
103-
{
104-
"type": "section",
105-
"text": {
106-
"type": "mrkdwn",
107-
"text": "Dataset: *${{ steps.benches.outputs.dataset }}*."
108-
}
109-
},
110-
{
111-
"type": "section",
112-
"text": {
113-
"type": "mrkdwn",
114-
"text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
115-
}
116-
}
117-
]
118-
}
119-
env:
120-
SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }}
121-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
77+
source_name: "runLoadTimeBenchmark"

.github/workflows/continuous-benchmark.yaml

Lines changed: 6 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -63,54 +63,10 @@ jobs:
6363
- name: Fail job if any of the benches failed
6464
if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout'
6565
run: exit 1
66-
- name: Send Notification
66+
- uses: ./.github/workflows/actions/send-slack-msg
6767
if: failure() || cancelled()
68-
uses: slackapi/[email protected]
6968
with:
70-
payload: |
71-
{
72-
"text": "CI benchmarks (runBenchmark) run status: ${{ job.status }}",
73-
"blocks": [
74-
{
75-
"type": "section",
76-
"text": {
77-
"type": "mrkdwn",
78-
"text": "CI benchmarks (runBenchmark) failed because of *${{ steps.benches.outputs.failed }}*."
79-
}
80-
},
81-
{
82-
"type": "section",
83-
"text": {
84-
"type": "mrkdwn",
85-
"text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*."
86-
}
87-
},
88-
{
89-
"type": "section",
90-
"text": {
91-
"type": "mrkdwn",
92-
"text": "Engine: *${{ steps.benches.outputs.engine_name }}*."
93-
}
94-
},
95-
{
96-
"type": "section",
97-
"text": {
98-
"type": "mrkdwn",
99-
"text": "Dataset: *${{ steps.benches.outputs.dataset }}*."
100-
}
101-
},
102-
{
103-
"type": "section",
104-
"text": {
105-
"type": "mrkdwn",
106-
"text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
107-
}
108-
}
109-
]
110-
}
111-
env:
112-
SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }}
113-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
69+
source_name: "runBenchmark"
11470
runTenantsBenchmark:
11571
runs-on: ubuntu-latest
11672
needs: runBenchmark
@@ -154,54 +110,10 @@ jobs:
154110
- name: Fail job if any of the benches failed
155111
if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout'
156112
run: exit 1
157-
- name: Send Notification
113+
- uses: ./.github/workflows/actions/send-slack-msg
158114
if: failure() || cancelled()
159-
uses: slackapi/[email protected]
160115
with:
161-
payload: |
162-
{
163-
"text": "CI benchmarks (runTenantsBenchmark) run status: ${{ job.status }}",
164-
"blocks": [
165-
{
166-
"type": "section",
167-
"text": {
168-
"type": "mrkdwn",
169-
"text": "CI benchmarks (runTenantsBenchmark) failed because of *${{ steps.benches.outputs.failed }}*."
170-
}
171-
},
172-
{
173-
"type": "section",
174-
"text": {
175-
"type": "mrkdwn",
176-
"text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*."
177-
}
178-
},
179-
{
180-
"type": "section",
181-
"text": {
182-
"type": "mrkdwn",
183-
"text": "Engine: *${{ steps.benches.outputs.engine_name }}*."
184-
}
185-
},
186-
{
187-
"type": "section",
188-
"text": {
189-
"type": "mrkdwn",
190-
"text": "Dataset: *${{ steps.benches.outputs.dataset }}*."
191-
}
192-
},
193-
{
194-
"type": "section",
195-
"text": {
196-
"type": "mrkdwn",
197-
"text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
198-
}
199-
}
200-
]
201-
}
202-
env:
203-
SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }}
204-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
116+
source_name: "runTenantsBenchmark"
205117
runParallelBenchmark:
206118
runs-on: ubuntu-latest
207119
needs: runTenantsBenchmark
@@ -245,51 +157,7 @@ jobs:
245157
- name: Fail job if any of the benches failed
246158
if: steps.benches.outputs.failed == 'error' || steps.benches.outputs.failed == 'timeout'
247159
run: exit 1
248-
- name: Send Notification
160+
- uses: ./.github/workflows/actions/send-slack-msg
249161
if: failure() || cancelled()
250-
uses: slackapi/[email protected]
251162
with:
252-
payload: |
253-
{
254-
"text": "CI benchmarks (runParallelBenchmark) run status: ${{ job.status }}",
255-
"blocks": [
256-
{
257-
"type": "section",
258-
"text": {
259-
"type": "mrkdwn",
260-
"text": "CI benchmarks (runParallelBenchmark) failed because of *${{ steps.benches.outputs.failed }}*."
261-
}
262-
},
263-
{
264-
"type": "section",
265-
"text": {
266-
"type": "mrkdwn",
267-
"text": "Qdrant version: *${{ steps.benches.outputs.qdrant_version }}*."
268-
}
269-
},
270-
{
271-
"type": "section",
272-
"text": {
273-
"type": "mrkdwn",
274-
"text": "Engine: *${{ steps.benches.outputs.engine_name }}*."
275-
}
276-
},
277-
{
278-
"type": "section",
279-
"text": {
280-
"type": "mrkdwn",
281-
"text": "Dataset: *${{ steps.benches.outputs.dataset }}*."
282-
}
283-
},
284-
{
285-
"type": "section",
286-
"text": {
287-
"type": "mrkdwn",
288-
"text": "View the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>"
289-
}
290-
}
291-
]
292-
}
293-
env:
294-
SLACK_WEBHOOK_URL: ${{ secrets.CI_ALERTS_CHANNEL_WEBHOOK_URL }}
295-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
163+
source_name: "runParallelBenchmark"

0 commit comments

Comments
 (0)