Skip to content

Commit fcaeb2a

Browse files
committed
ci: send Slack notification on nightly failures + modernize workflow
1 parent c22ab88 commit fcaeb2a

2 files changed

Lines changed: 28 additions & 23 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ on:
44
workflow_dispatch: # Activate this workflow manually
55
schedule:
66
- cron: "0 0 * * *"
7+
# TODO: REMOVE TRIGGER AFTER TESTING
8+
pull_request:
79

810
jobs:
911
generate-matrix:
10-
runs-on: ubuntu-latest
12+
runs-on: ubuntu-slim
1113
outputs:
12-
matrix_v2: ${{ steps.generator.outputs.matrix_v2 }}
14+
matrix: ${{ steps.generator.outputs.matrix }}
1315
steps:
14-
- uses: actions/checkout@v4
15-
- uses: actions/setup-python@v5
16+
- uses: actions/checkout@v6
17+
- uses: actions/setup-python@v6
1618
with:
1719
python-version: "3.11"
1820
- id: generator
@@ -23,7 +25,7 @@ jobs:
2325
VERSION=$(gh api /repos/deepset-ai/haystack/releases | \
2426
jq -r '[.[].tag_name | select(test("^v2.[0-9]+.[0-9]+$"))] | first')
2527
NOTEBOOKS=$(python ./scripts/generate_matrix.py --haystack-version "$VERSION" --include-main)
26-
echo "matrix_v2={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT"
28+
echo "matrix={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT"
2729
2830
run-tutorials:
2931
needs: generate-matrix
@@ -33,7 +35,7 @@ jobs:
3335
strategy:
3436
max-parallel: 2
3537
fail-fast: false
36-
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix_v2) }}
38+
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
3739

3840
env:
3941
HAYSTACK_TELEMETRY_ENABLED: "False"
@@ -44,7 +46,12 @@ jobs:
4446

4547
steps:
4648
- name: Checkout
47-
uses: actions/checkout@v4
49+
uses: actions/checkout@v6
50+
51+
- name: Setup Python and uv
52+
uses: astral-sh/setup-uv@v7
53+
with:
54+
python-version: "3.11"
4855

4956
- name: Install common dependencies
5057
run: |
@@ -54,12 +61,12 @@ jobs:
5461
libsndfile1 \
5562
ffmpeg
5663
57-
pip install nbconvert ipython
64+
uv pip install nbconvert ipython
5865
5966
- name: Install tutorial dependencies
6067
if: toJSON(matrix.dependencies) != '[]'
6168
run: |
62-
pip install "${{ join(matrix.dependencies, '" "')}}"
69+
uv pip install "${{ join(matrix.dependencies, '" "')}}"
6370
6471
- name: Convert notebook to Python
6572
run: |
@@ -77,19 +84,8 @@ jobs:
7784
python "$NOTEBOOK"
7885
fi
7986
80-
- name: Send Failure to Datadog
87+
- name: Notify Slack on nightly failure
8188
if: failure()
82-
uses: masci/datadog@v1
89+
uses: deepset-ai/notify-slack-action@v1
8390
with:
84-
api-key: ${{ secrets.CORE_DATADOG_API_KEY }}
85-
api-url: https://api.datadoghq.eu
86-
events: |
87-
- title: "Tutorial ${{ matrix.notebook }} failed"
88-
text: "Branch ${{ github.ref_name }} tests failed"
89-
alert_type: "error"
90-
source_type_name: "Github"
91-
host: ${{ github.repository_owner }}
92-
tags:
93-
- "project:${{ github.repository }}"
94-
- "name:${{ matrix.notebook }}"
95-
- "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
91+
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }}

tutorials/27_First_RAG_Pipeline.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@
7676
"Initialize a DocumentStore to index your documents. A DocumentStore stores the Documents that the question answering system uses to find answers to your questions. In this tutorial, you'll be using the `InMemoryDocumentStore`."
7777
]
7878
},
79+
{
80+
"cell_type": "code",
81+
"execution_count": null,
82+
"metadata": {},
83+
"outputs": [],
84+
"source": [
85+
"raise Exception(\"let's make this fail\")"
86+
]
87+
},
7988
{
8089
"cell_type": "code",
8190
"execution_count": 3,

0 commit comments

Comments
 (0)