9
9
generate-matrix :
10
10
runs-on : ubuntu-latest
11
11
outputs :
12
- matrix_v1 : ${{ steps.generator.outputs.matrix_v1 }}
13
12
matrix_v2 : ${{ steps.generator.outputs.matrix_v2 }}
14
13
steps :
15
14
- uses : actions/checkout@v4
@@ -20,84 +19,12 @@ jobs:
20
19
env :
21
20
GH_TOKEN : ${{ github.token }}
22
21
run : |
23
- # Get tutorial notebooks for v1
24
- VERSION=$(gh api /repos/deepset-ai/haystack/releases | \
25
- jq -r '[.[].tag_name | select(test("^v1.[0-9]+.[0-9]+$"))] | first')
26
- NOTEBOOKS=$(python ./scripts/generate_matrix.py --haystack-version "$VERSION")
27
- echo "matrix_v1={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT"
28
-
29
22
# Get tutorial notebooks for v2
30
23
VERSION=$(gh api /repos/deepset-ai/haystack/releases | \
31
24
jq -r '[.[].tag_name | select(test("^v2.[0-9]+.[0-9]+$"))] | first')
32
25
NOTEBOOKS=$(python ./scripts/generate_matrix.py --haystack-version "$VERSION" --include-main)
33
26
echo "matrix_v2={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT"
34
27
35
- run-tutorials-v1 :
36
- needs : generate-matrix
37
- runs-on : ubuntu-latest
38
- container : deepset/haystack:base-cpu-${{ matrix.haystack_version }}
39
-
40
- services :
41
- elasticsearch :
42
- image : elasticsearch:7.9.2
43
- env :
44
- discovery.type : " single-node"
45
- ES_JAVA_OPTS : " -Xms128m -Xmx256m"
46
-
47
- strategy :
48
- max-parallel : 2
49
- fail-fast : false
50
- matrix : ${{ fromJSON(needs.generate-matrix.outputs.matrix_v1) }}
51
-
52
- env :
53
- HAYSTACK_TELEMETRY_ENABLED : " False"
54
- ELASTICSEARCH_HOST : " elasticsearch"
55
- HF_API_KEY : ${{ secrets.HF_API_KEY }}
56
- OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
57
-
58
- steps :
59
- - name : Checkout
60
- uses : actions/checkout@v4
61
-
62
- - name : Install dependencies
63
- # remove pip install pyzmq when this is resolved https://github.com/zeromq/pyzmq/issues/1764
64
- run : |
65
- apt-get update && apt-get install -y build-essential gcc libsndfile1 ffmpeg && rm -rf /var/lib/apt/lists/*
66
- pip install "numpy<2"
67
- pip install pyzmq==23.2.1
68
- pip install nbconvert ipython
69
- pip install "pyworld<=0.2.12" espnet espnet-model-zoo pydub
70
- pip install farm-haystack[pdf]
71
- pip install scipy --upgrade
72
- pip install farm-haystack-text2speech
73
- pip install "datasets>=2.6.1"
74
- pip install ipywidgets
75
-
76
- - name : Convert notebook to Python
77
- run : |
78
- jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb
79
-
80
- - name : Run the converted notebook
81
- run : |
82
- python ./tutorials/${{ matrix.notebook }}.py
83
-
84
- - name : Send Failure to Datadog
85
- if : failure()
86
- uses : masci/datadog@v1
87
- with :
88
- api-key : ${{ secrets.CORE_DATADOG_API_KEY }}
89
- api-url : https://api.datadoghq.eu
90
- events : |
91
- - title: "Tutorial ${{ matrix.notebook }} failed"
92
- text: "Branch ${{ github.ref_name }} tests failed"
93
- alert_type: "error"
94
- source_type_name: "Github"
95
- host: ${{ github.repository_owner }}
96
- tags:
97
- - "project:${{ github.repository }}"
98
- - "name:${{ matrix.notebook }}"
99
- - "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
100
-
101
28
run-tutorials-v2 :
102
29
needs : generate-matrix
103
30
runs-on : ubuntu-latest
0 commit comments