-
Notifications
You must be signed in to change notification settings - Fork 47
299 lines (284 loc) · 9.85 KB
/
testing.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
name: Testing
on:
push:
branches:
- main
pull_request:
# Can't filter on paths easily and have required workflows.
# See https://github.com/orgs/community/discussions/13690 and
# https://engineering.mixpanel.com/enforcing-required-checks-on-conditional-ci-jobs-in-a-github-monorepo-8d4949694340
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
SYCAMORE_S3_TEMP_PATH: s3://aryn-sycamore-integ-temp/
MODEL_SERVER_KEY: ${{ secrets.MODEL_SERVER_KEY }}
PINECONE_API_KEY: ${{ secrets.PINECONE_API_KEY }}
ARYN_API_KEY: ${{ secrets.MODEL_SERVER_KEY }}
SYCAMORE_HELICONE_API_KEY: ${{ secrets.HELICONE_API_KEY }}
SYCAMORE_OPENAI_USER: "sycamore-github-ci"
SYCAMORE_HELICONE_TAG: ${{ github.ref }}
OS_USER_NAME: ${{ secrets.OS_USER_NAME }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
# Permissions for AWS access
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
sycamore-unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: DF-1
run: df
- name: du-runner-initial
run: du -kx /home/runner | sort -rn | head -20
- name: Move cache to /mnt
run: sudo mkdir /mnt/cache && sudo chown $(whoami) /mnt/cache && mkdir -p /home/runner/.cache && sudo mount -o bind /mnt/cache /home/runner/.cache
# Could free up other stuff as in:
# https://github.com/easimon/maximize-build-space/blob/master/action.yml
- name: Free up disk space
run: sudo rm -rf /usr/local/lib/android
- name: DF-2
run: df
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: DF-3
run: df
- name: Install sycamore
run: poetry install --all-extras
working-directory: lib/sycamore
- name: Download nltk packages
run: poetry run python -m nltk.downloader punkt_tab averaged_perceptron_tagger_eng
working-directory: lib/sycamore
- name: DF-4
run: df
- name: Update Apt
run: sudo apt-get update
- name: Install apt dependencies
run: sudo apt-get install -y poppler-utils tesseract-ocr libreoffice
- name: DF-5
run: df
- name: Run tests
run: poetry run pytest -n auto sycamore/tests/unit/
working-directory: lib/sycamore
- name: Run more tests
run: poetry run python sycamore/tests/manual/test_fast_sycamore_import.py
working-directory: lib/sycamore
- name: DF-6
run: df
rps-unit-test:
runs-on: blacksmith-4vcpu-ubuntu-2204
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: useblacksmith/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install RPS
run: make install_rps
working-directory: lib/remote-processors
- name: Run Tests
run: poetry run pytest remote_processors/test/unit/
working-directory: lib/remote-processors
notebook-tests-fast:
runs-on: blacksmith-8vcpu-ubuntu-2204
strategy:
matrix:
python-version: ["3.9"]
services:
opensearch:
image: opensearchproject/opensearch:2.10.0
env:
discovery.type: "single-node"
ports:
- 9200:9200
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install sycamore
run: poetry install --all-extras
- name: Download nltk packages
run: poetry run python -m nltk.downloader punkt averaged_perceptron_tagger
- name: Update Apt
run: sudo apt-get update
- name: Install poppler and tesseract
run: sudo apt-get install -y poppler-utils tesseract-ocr
- name: Configure AWS Credentials via OIDC provider.
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::237550789389:role/aryn-github-integ
- name: Run Notebook tests
run: ./notebooks/run-notebook-tests.sh --fast
integ-tests:
runs-on: blacksmith-8vcpu-ubuntu-2204
strategy:
matrix:
python-version: ["3.9"]
services:
opensearch:
image: opensearchproject/opensearch:2.10.0
env:
discovery.type: "single-node"
ports:
- 9200:9200
elasticsearch:
image: elasticsearch:8.14.2
env:
discovery.type: "single-node"
xpack.security.http.ssl.enabled: "false"
xpack.security.enabled: "false"
bootstrap.memory_lock: "true"
ES_JAVA_OPTS: "-Xms2g -Xmx2g"
ports:
- 9201:9200
neo4j:
image: neo4j:5.21.0
env:
NEO4J_dbms_memory_heap_initial__size: 2G
NEO4J_dbms_memory_heap_max__size: 2G
NEO4J_dbms_security_auth__enabled: false
NEO4J_apoc_export_file_enabled: true
NEO4J_apoc_import_file_enabled: true
NEO4J_apoc_import_file_use__neo4j__config: true
NEO4JLABS_PLUGINS: '["apoc"]'
options: >-
--name neo4j
--volume /neo4j/import:/var/lib/neo4j/import
ports:
- 7474:7474
- 7687:7687
qdrant:
image: qdrant/qdrant:v1.11.4
ports:
- 6333:6333
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install sycamore
run: poetry install --all-extras
- name: Download nltk packages
run: poetry run python -m nltk.downloader punkt_tab averaged_perceptron_tagger_eng
- name: Update Apt
run: sudo apt-get update
- name: Install poppler and tesseract
run: sudo apt-get install -y poppler-utils tesseract-ocr
- name: Configure AWS Credentials via OIDC provider.
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::237550789389:role/aryn-github-integ
- name: Allow Read/Write permissions to Neo4j Import Directory
run: sudo chmod -R 777 /neo4j/import
- name: Run Integ tests
run: poetry run pytest lib/sycamore/sycamore/tests/integration
notebook-tests-slow:
runs-on: blacksmith-8vcpu-ubuntu-2204
strategy:
matrix:
python-version: ["3.9"]
services:
opensearch:
image: opensearchproject/opensearch:2.10.0
env:
discovery.type: "single-node"
ports:
- 9200:9200
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install sycamore
run: poetry install --all-extras
- name: Download nltk packages
run: poetry run python -m nltk.downloader punkt averaged_perceptron_tagger
- name: Update Apt
run: sudo apt-get update
- name: Install poppler and tesseract
run: sudo apt-get install -y poppler-utils tesseract-ocr
- name: Configure AWS Credentials via OIDC provider.
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::237550789389:role/aryn-github-integ
- name: Run Notebook tests
run: ./notebooks/run-notebook-tests.sh --slow
notebook-tests-docprep:
runs-on: blacksmith-8vcpu-ubuntu-2204
strategy:
matrix:
python-version: ["3.9"]
services:
opensearch:
image: opensearchproject/opensearch:2.10.0
env:
discovery.type: "single-node"
ports:
- 9200:9200
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install sycamore
run: poetry install --all-extras
- name: Download nltk packages
run: poetry run python -m nltk.downloader punkt averaged_perceptron_tagger
- name: Update Apt
run: sudo apt-get update
- name: Install poppler and tesseract
run: sudo apt-get install -y poppler-utils tesseract-ocr
- name: Configure AWS Credentials via OIDC provider.
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::237550789389:role/aryn-github-integ
- name: Run DocPrep Notebook Tests
run: ./notebooks/run-notebook-tests.sh --docprep