-
Notifications
You must be signed in to change notification settings - Fork 100
159 lines (137 loc) · 5.43 KB
/
nightly.yml
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
name: Run Tutorials Nightly
on:
workflow_dispatch: # Activate this workflow manually
schedule:
- cron: "0 0 * * *"
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix_v1: ${{ steps.generator.outputs.matrix_v1 }}
matrix_v2: ${{ steps.generator.outputs.matrix_v2 }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- id: generator
env:
GH_TOKEN: ${{ github.token }}
run: |
# Get tutorial notebooks for v1
VERSION=$(gh api /repos/deepset-ai/haystack/releases | \
jq -r '[.[].tag_name | select(test("^v1.[0-9]+.[0-9]+$"))] | first')
NOTEBOOKS=$(python ./scripts/generate_matrix.py --haystack-version "$VERSION")
echo "matrix_v1={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT"
# Get tutorial notebooks for v2
VERSION=$(gh api /repos/deepset-ai/haystack/releases | \
jq -r '[.[].tag_name | select(test("^v2.[0-9]+.[0-9]+$"))] | first')
NOTEBOOKS=$(python ./scripts/generate_matrix.py --haystack-version "$VERSION" --include-main)
echo "matrix_v2={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT"
run-tutorials-v1:
needs: generate-matrix
runs-on: ubuntu-latest
container: deepset/haystack:base-cpu-${{ matrix.haystack_version }}
services:
elasticsearch:
image: elasticsearch:7.9.2
env:
discovery.type: "single-node"
ES_JAVA_OPTS: "-Xms128m -Xmx256m"
strategy:
max-parallel: 2
fail-fast: false
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix_v1) }}
env:
HAYSTACK_TELEMETRY_ENABLED: "False"
ELASTICSEARCH_HOST: "elasticsearch"
HF_API_KEY: ${{ secrets.HF_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
# remove pip install pyzmq when this is resolved https://github.com/zeromq/pyzmq/issues/1764
run: |
apt-get update && apt-get install -y build-essential gcc libsndfile1 ffmpeg && rm -rf /var/lib/apt/lists/*
pip install "numpy<2"
pip install pyzmq==23.2.1
pip install nbconvert ipython
pip install "pyworld<=0.2.12" espnet espnet-model-zoo pydub
pip install farm-haystack[pdf]
pip install scipy --upgrade
pip install farm-haystack-text2speech
pip install "datasets>=2.6.1"
pip install ipywidgets
- name: Convert notebook to Python
run: |
jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb
- name: Run the converted notebook
run: |
python ./tutorials/${{ matrix.notebook }}.py
- name: Send Failure to Datadog
if: failure()
uses: masci/datadog@v1
with:
api-key: ${{ secrets.CORE_DATADOG_API_KEY }}
api-url: https://api.datadoghq.eu
events: |
- title: "Tutorial ${{ matrix.notebook }} failed"
text: "Branch ${{ github.ref_name }} tests failed"
alert_type: "error"
source_type_name: "Github"
host: ${{ github.repository_owner }}
tags:
- "project:${{ github.repository }}"
- "name:${{ matrix.notebook }}"
- "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
run-tutorials-v2:
needs: generate-matrix
runs-on: ubuntu-latest
container: deepset/haystack:base-${{ matrix.haystack_version }}
strategy:
max-parallel: 2
fail-fast: false
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix_v2) }}
env:
HAYSTACK_TELEMETRY_ENABLED: "False"
HF_API_TOKEN: ${{ secrets.HF_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SERPERDEV_API_KEY: ${{ secrets.SERPERDEV_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install common dependencies
run: |
apt-get update && apt-get install -y \
build-essential \
gcc \
libsndfile1 \
ffmpeg
pip install nbconvert ipython
- name: Install tutorial dependencies
if: toJSON(matrix.dependencies) != '[]'
run: |
pip install "${{ join(matrix.dependencies, '" "')}}"
- name: Convert notebook to Python
run: |
jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb
- name: Run the converted notebook
run: |
python ./tutorials/${{ matrix.notebook }}.py
- name: Send Failure to Datadog
if: failure()
uses: masci/datadog@v1
with:
api-key: ${{ secrets.CORE_DATADOG_API_KEY }}
api-url: https://api.datadoghq.eu
events: |
- title: "Tutorial ${{ matrix.notebook }} failed"
text: "Branch ${{ github.ref_name }} tests failed"
alert_type: "error"
source_type_name: "Github"
host: ${{ github.repository_owner }}
tags:
- "project:${{ github.repository }}"
- "name:${{ matrix.notebook }}"
- "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"