forked from spiceai/spiceai
-
Notifications
You must be signed in to change notification settings - Fork 0
625 lines (550 loc) · 25.4 KB
/
integration_models.yml
File metadata and controls
625 lines (550 loc) · 25.4 KB
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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
---
name: integration tests (models)
on:
push:
branches:
- trunk
- release/*
pull_request:
branches:
- trunk
- release-*
- release/*
- feature-*
paths-ignore:
- '**/*.md'
- 'docs/**'
- 'README.md'
- 'Makefile'
- 'CONTRIBUTING.md'
- 'SECURITY.md'
- 'LICENSE'
- '.github/**'
- 'version.txt'
- '.schema/**'
- '.vscode/**'
- 'deploy/**'
- 'install/**'
- 'media/**'
- 'monitoring/**'
- 'acknowledgements.md'
- 'Dockerfile*'
- 'bin/spice/**'
merge_group:
branches:
- trunk
- release-*
- release/*
- feature-*
schedule:
- cron: '0 0 * * *' # Daily at midnight UTC
workflow_dispatch:
inputs:
run_all_tests:
description: 'Run all tests'
type: boolean
required: false
default: false
update_snapshots:
description: 'Update the snapshots?'
required: false
default: 'no'
type: choice
options:
- 'always'
- 'no'
concurrency:
# Allow only one workflow per any non-trunk branch.
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_name == 'trunk' && github.sha || 'any-sha' }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_GIT_FETCH_WITH_CLI: true
# CI performance optimizations
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
CARGO_NET_RETRY: 10
CARGO_HTTP_TIMEOUT: 60
AI_INTEGRATION_TEST_ARCHIVE_S3_URI: s3://build/test_binaries/${{ github.run_id }}/ai-integration-test-archive/integration.tar.zst
AI_INTEGRATION_EXTENDED_TEST_ARCHIVE_S3_URI: s3://build/test_binaries/${{ github.run_id }}/ai-integration-test-archive-extended/integration-extended.tar.zst
jobs:
build:
name: Build Test Binary (macOS)
runs-on: spiceai-macos
env:
HAS_SPICEIO_SECRET: ${{ secrets.UNAS_SMB_PASS != '' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
fetch-depth: 1 # Shallow clone for faster checkout
- name: Set up Rust
uses: ./.github/actions/setup-rust
- name: Set up spiceio
if: runner.os == 'macOS' && env.HAS_SPICEIO_SECRET == 'true'
id: setup-spiceio
uses: spiceai/spiceio/.github/actions/setup@e31c63cbe88a6e284fc187875261106a05034775 # v0.5.4
with:
smb-url: smb://runner@192.168.3.148/ai_platform_dev
smb-pass: ${{ secrets.UNAS_SMB_PASS }}
token: ${{ github.token }}
bucket: sccache
region: us-west-1
- name: Set up sccache
if: runner.os == 'macOS' && steps.setup-spiceio.outputs.endpoint != ''
uses: ./.github/actions/setup-sccache
with:
minio_endpoint: ${{ secrets.TEST_MINIO_ENDPOINT }}
spiceio_endpoint: ${{ steps.setup-spiceio.outputs.endpoint }}
- name: Set up Nextest
uses: ./.github/actions/setup-nextest
# Build the test binary without running tests
- name: Build AI integration test binary
env:
# Metal runners do not have `xcrun metal`
# See `https://github.com/EricLBuehler/mistral.rs/pull/1311`
MISTRALRS_METAL_PRECOMPILE: 0
RUSTC_WRAPPER: sccache
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_MINIO_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_MINIO_SECRET_KEY }}
run: |
FEATURES="flightsql,models,metal,s3_vectors,kafka,duckdb"
if [[ "${{ github.event.inputs.run_all_tests }}" == "true" ]] || [[ "${{ github.event_name }}" == "schedule" ]]; then
FEATURES="${FEATURES},bedrock,extended_tests"
echo "Including extended_tests"
else
echo "Excluding extended_tests"
fi
cargo nextest archive -p runtime --test integration_models --features ${FEATURES} --archive-file integration.tar.zst
- name: Preserve sccache spiceio log
if: always() && runner.os == 'macOS' && steps.setup-spiceio.outputs.pid != ''
run: cp "${{ runner.temp }}/spiceio.log" "${{ runner.temp }}/spiceio-sccache.log" || true
- name: Stop sccache spiceio
if: always() && runner.os == 'macOS' && steps.setup-spiceio.outputs.pid != ''
run: kill ${{ steps.setup-spiceio.outputs.pid }} || true
- name: Clean spiceio install directory
if: env.HAS_SPICEIO_SECRET == 'true'
run: rm -rf "${{ runner.temp }}/spiceio-bin"
- name: Set up spiceio for build archive
if: env.HAS_SPICEIO_SECRET == 'true'
id: setup-spiceio-build
uses: spiceai/spiceio/.github/actions/setup@e31c63cbe88a6e284fc187875261106a05034775 # v0.5.4
with:
smb-url: smb://runner@192.168.3.148/ai_platform_dev
smb-pass: ${{ secrets.UNAS_SMB_PASS }}
token: ${{ github.token }}
bucket: build
region: us-west-1
- name: Upload test archive to spiceio
if: env.HAS_SPICEIO_SECRET == 'true'
env:
SPICEIO_ENDPOINT: ${{ steps.setup-spiceio-build.outputs.endpoint }}
run: |
set -euo pipefail
: "${SPICEIO_ENDPOINT:?spiceio endpoint is required to upload the AI integration test archive}"
archive_url="${SPICEIO_ENDPOINT%/}/${AI_INTEGRATION_TEST_ARCHIVE_S3_URI#s3://}"
curl --fail --silent --show-error --upload-file ./integration.tar.zst "$archive_url"
- name: Upload test archive
if: env.HAS_SPICEIO_SECRET != 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ai-integration-test-archive
path: ./integration.tar.zst
retention-days: 3
compression-level: 1
- name: Kill build archive spiceio
if: always() && runner.os == 'macOS' && steps.setup-spiceio-build.outputs.pid != ''
run: kill ${{ steps.setup-spiceio-build.outputs.pid }} || true
- name: Upload spiceio logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: spiceio-models-build-logs
path: ${{ runner.temp }}/spiceio*.log
if-no-files-found: ignore
test-models:
name: Test Models, AI & Search
needs: build
runs-on: spiceai-macos
env:
HAS_SPICEIO_SECRET: ${{ secrets.UNAS_SMB_PASS != '' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Set up Rust
uses: ./.github/actions/setup-rust
- name: Set up Nextest
uses: ./.github/actions/setup-nextest
- name: Set up spiceio
if: runner.os == 'macOS' && env.HAS_SPICEIO_SECRET == 'true'
id: setup-spiceio
uses: spiceai/spiceio/.github/actions/setup@e31c63cbe88a6e284fc187875261106a05034775 # v0.5.4
with:
smb-url: smb://runner@192.168.3.148/ai_platform_dev
smb-pass: ${{ secrets.UNAS_SMB_PASS }}
token: ${{ github.token }}
bucket: build
region: us-west-1
- name: Download test archive from spiceio
if: env.HAS_SPICEIO_SECRET == 'true'
env:
SPICEIO_ENDPOINT: ${{ steps.setup-spiceio.outputs.endpoint }}
run: |
set -euo pipefail
: "${SPICEIO_ENDPOINT:?spiceio endpoint is required to download the AI integration test archive}"
mkdir -p ./integration_test
archive_url="${SPICEIO_ENDPOINT%/}/${AI_INTEGRATION_TEST_ARCHIVE_S3_URI#s3://}"
curl --fail --silent --show-error --output ./integration_test/integration.tar.zst "$archive_url"
- name: Download test archive
if: env.HAS_SPICEIO_SECRET != 'true'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ai-integration-test-archive
path: ./integration_test
- name: Set up API Keys
run: |
echo 'SPICE_OPENAI_API_KEY="${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}"' > .env
echo 'SPICE_ANTHROPIC_API_KEY="${{ secrets.SPICE_SECRET_ANTHROPIC_API_KEY }}"' >> .env
echo 'SPICE_XAI_API_KEY="${{ secrets.SPICE_SECRET_XAI_API_KEY }}"' >> .env
# OpenAI tests
- name: Run OpenAI integration test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_SECRET_OPENAI_API_KEY: ${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}
run: |
if [ -z "$SPICE_SECRET_OPENAI_API_KEY" ] ; then
echo "Error: OpenAI API key is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- openai_test
- name: Run OpenAI Beta functionality embeddings test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_SECRET_OPENAI_API_KEY: ${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}
run: |
if [ -z "$SPICE_SECRET_OPENAI_API_KEY" ] ; then
echo "Error: OpenAI API key is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- openai_embeddings_beta_requirements
# AI UDF tests
- name: Run AI UDF basic test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_SECRET_OPENAI_API_KEY: ${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}
SPICE_SECRET_ANTHROPIC_API_KEY: ${{ secrets.SPICE_SECRET_ANTHROPIC_API_KEY }}
run: |
if [ -z "$SPICE_SECRET_OPENAI_API_KEY" ] ; then
echo "Error: OpenAI API key is not defined."
exit 1
fi
if [ -z "$SPICE_SECRET_ANTHROPIC_API_KEY" ] ; then
echo "Error: Anthropic API key is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- test_ai_udf_basic
- name: Run AI UDF with dataset test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_SECRET_OPENAI_API_KEY: ${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}
SPICE_SECRET_ANTHROPIC_API_KEY: ${{ secrets.SPICE_SECRET_ANTHROPIC_API_KEY }}
SPICE_SECRET_XAI_API_KEY: ${{ secrets.SPICE_SECRET_XAI_API_KEY }}
run: |
if [ -z "$SPICE_SECRET_OPENAI_API_KEY" ] ; then
echo "Error: OpenAI API key is not defined."
exit 1
fi
if [ -z "$SPICE_SECRET_ANTHROPIC_API_KEY" ] ; then
echo "Error: Anthropic API key is not defined."
exit 1
fi
if [ -z "$SPICE_SECRET_XAI_API_KEY" ] ; then
echo "Error: xAI API key is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- test_ai_udf_with_dataset
- name: Run AI UDF LEFT truncate test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_SECRET_OPENAI_API_KEY: ${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}
SPICE_SECRET_ANTHROPIC_API_KEY: ${{ secrets.SPICE_SECRET_ANTHROPIC_API_KEY }}
SPICE_SECRET_XAI_API_KEY: ${{ secrets.SPICE_SECRET_XAI_API_KEY }}
run: |
if [ -z "$SPICE_SECRET_OPENAI_API_KEY" ] ; then
echo "Error: OpenAI API key is not defined."
exit 1
fi
if [ -z "$SPICE_SECRET_ANTHROPIC_API_KEY" ] ; then
echo "Error: Anthropic API key is not defined."
exit 1
fi
if [ -z "$SPICE_SECRET_XAI_API_KEY" ] ; then
echo "Error: xAI API key is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- test_ai_udf_left_truncate
# Local model tests
- name: Run local embeddings Beta functionality test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
run: |
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- local_embeddings_beta_requirements
- name: Run AI UDF with local model test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_HF_TOKEN: ${{ secrets.SPICE_SECRET_HF_TOKEN }}
run: |
if [ -z "$SPICE_HF_TOKEN" ] ; then
echo "Error: Hugging Face API Token is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- test_ai_udf_with_local_model
# Workers tests
- name: Run workers integration test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_SECRET_OPENAI_API_KEY: ${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}
run: |
if [ -z "$SPICE_SECRET_OPENAI_API_KEY" ] ; then
echo "Error: OpenAI API key is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- workers
# Search tests
- name: Run search integration test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_SECRET_OPENAI_API_KEY: ${{ secrets.SPICE_SECRET_OPENAI_API_KEY }}
AWS_S3_VECTORS_KEY: ${{ secrets.AWS_S3_VECTORS_KEY }}
AWS_S3_VECTORS_SECRET: ${{ secrets.AWS_S3_VECTORS_SECRET }}
run: |
if [ -z "$SPICE_SECRET_OPENAI_API_KEY" ] ; then
echo "Error: OpenAI API key is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- search
- name: Push snapshots to branch
if: github.event.inputs.update_snapshots == 'always' || github.event_name == 'schedule'
uses: ./.github/actions/push-snap-changes
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Kill spiceio
if: always() && runner.os == 'macOS' && steps.setup-spiceio.outputs.pid != ''
run: kill ${{ steps.setup-spiceio.outputs.pid }} || true
test-hf:
name: Test Hugging Face Models
needs: build
if: ${{ github.event.inputs.run_all_tests == 'true' || github.event_name == 'schedule' }}
runs-on: spiceai-macos
env:
HAS_SPICEIO_SECRET: ${{ secrets.UNAS_SMB_PASS != '' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Set up Rust
uses: ./.github/actions/setup-rust
- name: Set up Nextest
uses: ./.github/actions/setup-nextest
- name: Set up spiceio
if: runner.os == 'macOS' && env.HAS_SPICEIO_SECRET == 'true'
id: setup-spiceio
uses: spiceai/spiceio/.github/actions/setup@e31c63cbe88a6e284fc187875261106a05034775 # v0.5.4
with:
smb-url: smb://runner@192.168.3.148/ai_platform_dev
smb-pass: ${{ secrets.UNAS_SMB_PASS }}
token: ${{ github.token }}
bucket: build
region: us-west-1
- name: Download test archive from spiceio
if: env.HAS_SPICEIO_SECRET == 'true'
env:
SPICEIO_ENDPOINT: ${{ steps.setup-spiceio.outputs.endpoint }}
run: |
set -euo pipefail
: "${SPICEIO_ENDPOINT:?spiceio endpoint is required to download the AI integration test archive}"
mkdir -p ./integration_test
archive_url="${SPICEIO_ENDPOINT%/}/${AI_INTEGRATION_TEST_ARCHIVE_S3_URI#s3://}"
curl --fail --silent --show-error --output ./integration_test/integration.tar.zst "$archive_url"
- name: Download test archive
if: env.HAS_SPICEIO_SECRET != 'true'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ai-integration-test-archive
path: ./integration_test
- name: Run integration test
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_HF_TOKEN: ${{ secrets.SPICE_SECRET_HF_TOKEN }}
run: |
if [ -z "$SPICE_HF_TOKEN" ] ; then
echo "Error: Hugging Face API Token is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- huggingface_test
- name: Run Beta functionality embedding tests
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
SPICE_HF_TOKEN: ${{ secrets.SPICE_SECRET_HF_TOKEN }}
run: |
if [ -z "$SPICE_HF_TOKEN" ] ; then
echo "Error: Hugging Face API Token is not defined."
exit 1
fi
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- hf_embeddings_beta_requirements
- name: Push snapshots to branch
if: github.event.inputs.update_snapshots == 'always' || github.event_name == 'schedule'
uses: ./.github/actions/push-snap-changes
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Kill spiceio
if: always() && runner.os == 'macOS' && steps.setup-spiceio.outputs.pid != ''
run: kill ${{ steps.setup-spiceio.outputs.pid }} || true
test-bedrock:
name: Test Bedrock Models
needs: build
if: ${{ github.event.inputs.run_all_tests == 'true' || github.event_name == 'schedule' }}
runs-on: spiceai-macos
env:
HAS_SPICEIO_SECRET: ${{ secrets.UNAS_SMB_PASS != '' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Set up Rust
uses: ./.github/actions/setup-rust
- name: Set up Nextest
uses: ./.github/actions/setup-nextest
- name: Set up spiceio
if: runner.os == 'macOS' && env.HAS_SPICEIO_SECRET == 'true'
id: setup-spiceio
uses: spiceai/spiceio/.github/actions/setup@e31c63cbe88a6e284fc187875261106a05034775 # v0.5.4
with:
smb-url: smb://runner@192.168.3.148/ai_platform_dev
smb-pass: ${{ secrets.UNAS_SMB_PASS }}
token: ${{ github.token }}
bucket: build
region: us-west-1
- name: Download test archive from spiceio
if: env.HAS_SPICEIO_SECRET == 'true'
env:
SPICEIO_ENDPOINT: ${{ steps.setup-spiceio.outputs.endpoint }}
run: |
set -euo pipefail
: "${SPICEIO_ENDPOINT:?spiceio endpoint is required to download the AI integration test archive}"
mkdir -p ./integration_test
archive_url="${SPICEIO_ENDPOINT%/}/${AI_INTEGRATION_TEST_ARCHIVE_S3_URI#s3://}"
curl --fail --silent --show-error --output ./integration_test/integration.tar.zst "$archive_url"
- name: Download test archive
if: env.HAS_SPICEIO_SECRET != 'true'
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
with:
name: ai-integration-test-archive
path: ./integration_test
- name: Run Beta functionality embedding tests
env:
INSTA_UPDATE: ${{ github.event_name == 'schedule' && 'always' || github.event.inputs.update_snapshots }}
AWS_BEDROCK_KEY: ${{ secrets.AWS_BEDROCK_KEY }}
AWS_BEDROCK_SECRET: ${{ secrets.AWS_BEDROCK_SECRET }}
run: |
INSTA_WORKSPACE_ROOT="${PWD}" CARGO_MANIFEST_DIR="${PWD}" cargo nextest run --workspace-remap "${PWD}" --archive-file ./integration_test/integration.tar.zst -- bedrock_test
- name: Push snapshots to branch
if: github.event.inputs.update_snapshots == 'always' || github.event_name == 'schedule'
uses: ./.github/actions/push-snap-changes
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Kill spiceio
if: always() && runner.os == 'macOS' && steps.setup-spiceio.outputs.pid != ''
run: kill ${{ steps.setup-spiceio.outputs.pid }} || true
build-extended:
name: Build Test Binary (Extended)
runs-on: spiceai-macos
env:
HAS_SPICEIO_SECRET: ${{ secrets.UNAS_SMB_PASS != '' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
fetch-depth: 1 # Shallow clone for faster checkout
- name: Set up Rust
uses: ./.github/actions/setup-rust
- name: Set up spiceio
if: runner.os == 'macOS' && env.HAS_SPICEIO_SECRET == 'true'
id: setup-spiceio
uses: spiceai/spiceio/.github/actions/setup@e31c63cbe88a6e284fc187875261106a05034775 # v0.5.4
with:
smb-url: smb://runner@192.168.3.148/ai_platform_dev
smb-pass: ${{ secrets.UNAS_SMB_PASS }}
token: ${{ github.token }}
bucket: sccache
region: us-west-1
- name: Set up sccache
if: runner.os == 'macOS' && steps.setup-spiceio.outputs.endpoint != ''
uses: ./.github/actions/setup-sccache
with:
minio_endpoint: ${{ secrets.TEST_MINIO_ENDPOINT }}
spiceio_endpoint: ${{ steps.setup-spiceio.outputs.endpoint }}
- name: Set up Nextest
uses: ./.github/actions/setup-nextest
# Build the test binary without running tests
- name: Build AI integration test binary
env:
RUSTC_WRAPPER: sccache
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_MINIO_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_MINIO_SECRET_KEY }}
run: |
FEATURES="flightsql,models,s3_vectors,kafka,duckdb"
if [[ "${{ github.event.inputs.run_all_tests }}" == "true" ]] || [[ "${{ github.event_name }}" == "schedule" ]]; then
FEATURES="${FEATURES},bedrock,extended_tests"
echo "Including extended_tests"
else
echo "Excluding extended_tests"
fi
cargo nextest archive -p runtime --test integration_models --features ${FEATURES} --archive-file integration-extended.tar.zst
- name: Preserve sccache spiceio log
if: always() && runner.os == 'macOS' && steps.setup-spiceio.outputs.pid != ''
run: cp "${{ runner.temp }}/spiceio.log" "${{ runner.temp }}/spiceio-sccache.log" || true
- name: Stop sccache spiceio
if: always() && runner.os == 'macOS' && steps.setup-spiceio.outputs.pid != ''
run: kill ${{ steps.setup-spiceio.outputs.pid }} || true
- name: Clean spiceio install directory
if: env.HAS_SPICEIO_SECRET == 'true'
run: rm -rf "${{ runner.temp }}/spiceio-bin"
- name: Set up spiceio for build archive
if: env.HAS_SPICEIO_SECRET == 'true'
id: setup-spiceio-build
uses: spiceai/spiceio/.github/actions/setup@e31c63cbe88a6e284fc187875261106a05034775 # v0.5.4
with:
smb-url: smb://runner@192.168.3.148/ai_platform_dev
smb-pass: ${{ secrets.UNAS_SMB_PASS }}
token: ${{ github.token }}
bucket: build
region: us-west-1
- name: Upload test archive to spiceio
if: env.HAS_SPICEIO_SECRET == 'true'
env:
SPICEIO_ENDPOINT: ${{ steps.setup-spiceio-build.outputs.endpoint }}
run: |
set -euo pipefail
: "${SPICEIO_ENDPOINT:?spiceio endpoint is required to upload the extended AI integration test archive}"
archive_url="${SPICEIO_ENDPOINT%/}/${AI_INTEGRATION_EXTENDED_TEST_ARCHIVE_S3_URI#s3://}"
curl --fail --silent --show-error --upload-file ./integration-extended.tar.zst "$archive_url"
- name: Upload test archive
if: env.HAS_SPICEIO_SECRET != 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: ai-integration-test-archive-extended
path: ./integration-extended.tar.zst
retention-days: 3
compression-level: 1
- name: Kill build archive spiceio
if: always() && runner.os == 'macOS' && steps.setup-spiceio-build.outputs.pid != ''
run: kill ${{ steps.setup-spiceio-build.outputs.pid }} || true
- name: Upload spiceio logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: spiceio-models-build-extended-logs
path: ${{ runner.temp }}/spiceio*.log
if-no-files-found: ignore