-
Notifications
You must be signed in to change notification settings - Fork 102
1015 lines (868 loc) · 31.9 KB
/
ci-workflow.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
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
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI Workflow
on:
pull_request:
branches:
- master
push:
branches:
- master
workflow_dispatch:
inputs:
auto_checkpoint:
description: 'Database config - auto checkpoint'
required: false
default: true
type: boolean
buffer_pool_size:
description: 'Database config - buffer pool size'
required: false
default: 67108864
type: number
max_num_threads:
description: 'Database config - max number of threads'
required: false
default: 2
type: number
enable_compression:
description: 'Database config - enable compression'
required: false
default: true
type: boolean
checkpoint_threshold:
description: 'Database config - checkpoint threshold'
required: false
default: 16777216
type: number
env:
RUNTIME_CHECKS: 1
USE_EXISTING_BINARY_DATASET: 1
AUTO_CHECKPOINT: ${{ github.event.inputs.auto_checkpoint }}
BUFFER_POOL_SIZE: ${{ github.event.inputs.buffer_pool_size }}
MAX_NUM_THREADS: ${{ github.event.inputs.max_num_threads }}
ENABLE_COMPRESSION: ${{ github.event.inputs.enable_compression }}
CHECKPOINT_THRESHOLD: ${{ github.event.inputs.checkpoint_threshold }}
WERROR: 1
RUSTFLAGS: --deny warnings
PIP_BREAK_SYSTEM_PACKAGES: 1
# Only allow one run in this group to run at a time, and cancel any runs in progress in this group.
# We use the workflow name and then add the pull request number, or (if it's a push to master), we use the name of the branch.
# See github's docs[1] and a relevant stack overflow answer[2]
# [1]: https://docs.github.com/en/actions/using-jobs/using-concurrency
# [2]: https://stackoverflow.com/questions/66335225/how-to-cancel-previous-runs-in-the-pr-when-you-push-new-commitsupdate-the-curre
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
generate-binary-datasets:
name: generate binary dataset
needs: [sanity-checks, python-lint-check]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
GEN: Ninja
CC: gcc
CXX: g++
steps:
- uses: actions/checkout@v4
- name: Build
run: make release
- name: Generate datasets
run: bash scripts/generate_binary_demo.sh
- name: Generate and upload tinysnb
run: |
bash scripts/generate_binary_tinysnb.sh
s3cmd get s3://kuzu-test/tinysnb/version.txt || echo "0" > version.txt
if [ "$(cat tinysnb/version.txt)" == "$(cat version.txt)" ]; then
echo "TinySNB dataset is up to date, skipping upload"
rm -rf tinysnb version.txt
exit 0
fi
echo "TinySNB dataset is outdated, uploading..."
s3cmd del -r s3://kuzu-test/tinysnb/
s3cmd sync ./tinysnb s3://kuzu-test/
rm -rf tinysnb version.txt
- name: Generate and upload ldbc-sf01
run: |
bash scripts/generate_binary_ldbc-sf01.sh
s3cmd get s3://kuzu-test/ldbc01/version.txt || echo "0" > version.txt
if [ "$(cat ldbc01/version.txt)" == "$(cat version.txt)" ]; then
echo "LDBC-SF01 dataset is up to date, skipping upload"
rm -rf ldbc01 version.txt
exit 0
fi
echo "LDBC-SF01 dataset is outdated, uploading..."
s3cmd del -r s3://kuzu-test/ldbc01/
s3cmd sync ./ldbc01 s3://kuzu-test/
rm -rf ldbc01 version.txt
- name: Upload binary-demo
uses: actions/upload-artifact@v4
with:
name: binary-demo
path: dataset/binary-demo
gcc-build-test:
name: gcc build & test
needs: [sanity-checks, python-lint-check, generate-binary-datasets]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
CMAKE_BUILD_PARALLEL_LEVEL: 32
TEST_JOBS: 16
CLANGD_DIAGNOSTIC_JOBS: 32
CLANGD_DIAGNOSTIC_INSTANCES: 6
GEN: Ninja
CC: gcc
CXX: g++
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
RUN_ID: "$(hostname)-$(date +%s)"
HTTP_CACHE_FILE: TRUE
steps:
- uses: actions/checkout@v4
- name: Download binary-demo
uses: actions/download-artifact@v4
with:
name: binary-demo
path: ${{ github.workspace }}/dataset/binary-demo
- name: Ensure Python dependencies
run: |
pip install torch~=2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
pip install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api
- name: Test
run: |
ln -s /home/runner/ldbc-1-csv dataset/ldbc-1/csv
make test
- name: Test in mem
env:
IN_MEM_MODE: true
run: |
make test
- name: Test checkpoint at threshold 0
env:
AUTO_CHECKPOINT: true
CHECKPOINT_THRESHOLD: 0
run: |
make test
- name: Python test
run: make pytest
- name: Node.js test
run: make nodejstest
- name: Java test
run: make javatest
- name: Rust test with pre-built library
env:
KUZU_SHARED: 1
KUZU_INCLUDE_DIR: ${{ github.workspace }}/build/release/src
KUZU_LIBRARY_DIR: ${{ github.workspace }}/build/release/src
run: make rusttest
gcc-build-test-in-mem-vector-size:
name: gcc build & test in-mem only with various vector size
needs: [gcc-build-test]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
CMAKE_BUILD_PARALLEL_LEVEL: 32
TEST_JOBS: 16
CLANGD_DIAGNOSTIC_JOBS: 32
CLANGD_DIAGNOSTIC_INSTANCES: 6
GEN: Ninja
CC: gcc
CXX: g++
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
RUN_ID: "$(hostname)-$(date +%s)"
HTTP_CACHE_FILE: TRUE
steps:
- uses: actions/checkout@v4
- name: Download binary-demo
uses: actions/download-artifact@v4
with:
name: binary-demo
path: ${{ github.workspace }}/dataset/binary-demo
- name: Ensure Python dependencies
run: |
pip install torch~=2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
pip install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api
- name: Test vector 1024
env:
IN_MEM_MODE: true
run: |
ln -s /home/runner/ldbc-1-csv dataset/ldbc-1/csv
make test VECTOR_CAPACITY_LOG2=10
code-coverage:
name: code coverage
runs-on: ubuntu-22.04
needs: [sanity-checks, python-lint-check, generate-binary-datasets]
env:
TEST_JOBS: 10
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Download binary-demo
uses: actions/download-artifact@v4
with:
name: binary-demo
path: dataset/binary-demo
- name: Install lcov
run: sudo apt-get install -y lcov
- name: Test with coverage
run: make lcov NUM_THREADS=$(nproc)
- name: Test with coverage in mem
env:
IN_MEM_MODE: true
run: make lcov NUM_THREADS=$(nproc)
- name: Generate coverage report
run: |
lcov --config-file .lcovrc -c -d ./ --no-external -o cover.info &&\
lcov --remove cover.info $(< .github/workflows/lcov_exclude) -o cover.info
- name: Upload coverage report
uses: codecov/[email protected]
with:
file: cover.info
webassembly-build-test:
name: webassembly build & test
needs: [sanity-checks, generate-binary-datasets]
runs-on: kuzu-self-hosted-testing
env:
WERROR: 0
TEST_JOBS: 8
NUM_THREADS: 32
steps:
- uses: actions/checkout@v4
- name: Download binary-demo
uses: actions/download-artifact@v4
with:
name: binary-demo
path: dataset/binary-demo
- name: Build & test
run: |
ln -s /home/runner/ldbc-1-csv dataset/ldbc-1/csv
source /home/runner/emsdk/emsdk_env.sh
make wasmtest
- name: Build & test (single-thread mode)
env:
SINGLE_THREADED: true
run: |
make clean
source /home/runner/emsdk/emsdk_env.sh
make wasmtest
rust-build-test:
name: rust build & test
needs: [rustfmt-check]
runs-on: kuzu-self-hosted-testing
env:
CARGO_BUILD_JOBS: 32
CMAKE_BUILD_PARALLEL_LEVEL: 32
CC: gcc
CXX: g++
steps:
- uses: actions/checkout@v4
- name: Rust test
run: make rusttest
- name: Rust example
working-directory: examples/rust
run: cargo build --locked --features arrow
gcc-build-test-with-asan:
name: gcc build & test with asan
needs: [gcc-build-test, generate-binary-datasets]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
TEST_JOBS: 16
GEN: Ninja
CC: gcc
CXX: g++
WERROR: 0
steps:
- uses: actions/checkout@v4
- name: Download binary-demo
uses: actions/download-artifact@v4
with:
name: binary-demo
path: dataset/binary-demo
- name: Ensure Python dependencies
run: |
pip install torch~=2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
pip install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api
- name: Test with ASAN
run: make test ASAN=1
env:
ASAN_OPTIONS: "detect_leaks=1"
- name: Test compression disabled with ASAN
env:
ENABLE_COMPRESSION: false
run: |
make test
clang-build-test:
name: clang build & test
needs: [sanity-checks, python-lint-check, generate-binary-datasets]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
CMAKE_BUILD_PARALLEL_LEVEL: 32
TEST_JOBS: 16
CC: clang
CXX: clang++
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
RUN_ID: "$(hostname)-$(date +%s)"
HTTP_CACHE_FILE: TRUE
steps:
- uses: actions/checkout@v4
- name: Download binary-demo
uses: actions/download-artifact@v4
with:
name: binary-demo
path: dataset/binary-demo
- name: Ensure Python dependencies
run: |
pip install torch~=2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
pip install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api
- name: Test
run: |
ln -s /home/runner/ldbc-1-csv dataset/ldbc-1/csv
make test
- name: Test compression disabled
env:
ENABLE_COMPRESSION: false
run: |
make test
- name: Python test
run: make pytest
- name: Node.js test
run: make nodejstest
- name: Java test
run: make javatest
- name: Rust test with pre-built library
env:
KUZU_SHARED: 1
KUZU_INCLUDE_DIR: ${{ github.workspace }}/build/release/src
KUZU_LIBRARY_DIR: ${{ github.workspace }}/build/release/src
run: make rusttest
clang-build-test-various-page-sizes:
strategy:
matrix:
page_size_log2: [16, 18]
name: clang build & test with page_size_log2=${{ matrix.page_size_log2 }}
needs: [clang-build-test]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
CMAKE_BUILD_PARALLEL_LEVEL: 32
TEST_JOBS: 16
CC: clang
CXX: clang++
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
RUN_ID: "$(hostname)-$(date +%s)"
HTTP_CACHE_FILE: TRUE
steps:
- uses: actions/checkout@v4
- name: Ensure Python dependencies
run: |
pip install torch~=2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
pip install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api
- name: Build
run: |
ln -s /home/runner/ldbc-1-csv dataset/ldbc-1/csv
make release PAGE_SIZE_LOG2=${{ matrix.page_size_log2 }}
- name: Generate binary demo
run: |
bash scripts/generate_binary_demo.sh
- name: Test
run: |
make test PAGE_SIZE_LOG2=${{ matrix.page_size_log2 }}
msvc-build-test:
name: msvc build & test
needs: [sanity-checks, python-lint-check, generate-binary-datasets]
runs-on: self-hosted-windows
env:
# Shorten build path as much as possible
CARGO_TARGET_DIR: ${{ github.workspace }}/rs
CARGO_BUILD_JOBS: 18
NUM_THREADS: 18
CMAKE_BUILD_PARALLEL_LEVEL: 18
TEST_JOBS: 9
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
PG_HOST: ${{ secrets.PG_HOST }}
RUN_ID: "$(hostname)-$([Math]::Floor((Get-Date).TimeOfDay.TotalSeconds))"
HTTP_CACHE_FILE: TRUE
WERROR: 0
steps:
- uses: actions/checkout@v4
- name: Download binary-demo
uses: actions/download-artifact@v4
with:
name: binary-demo
path: dataset/binary-demo
- name: Ensure Python dependencies
run: |
pip install torch~=2.0.0 --extra-index-url https://download.pytorch.org/whl/cpu
pip install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.0.0+cpu.html
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api
- name: Visual Studio Generator Build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make all GEN="Visual Studio 17 2022"
make clean
- name: Test
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make test
- name: Test compression disabled
shell: cmd
env:
ENABLE_COMPRESSION: false
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make test
- name: Test in mem
shell: cmd
env:
IN_MEM_MODE: true
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make test
- name: Python test
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make pytest
- name: Node.js test
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make nodejstest
- name: Rust test
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make rusttest
- name: Java test
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make javatest
- name: Rust test with pre-built library
env:
KUZU_SHARED: 1
KUZU_INCLUDE_DIR: ${{ github.workspace }}/build/release/src
KUZU_LIBRARY_DIR: ${{ github.workspace }}/build/release/src
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
set PATH=%PATH%;${{ github.workspace }}/build/release/src
make rusttest
sanity-checks:
name: sanity checks
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Check headers for include guards
run: ./scripts/check-include-guards.sh src/include
- name: Checks files for std::assert
run: ./scripts/check-no-std-assert.sh src
- name: Ensure generated grammar files are up to date
run: |
python3 scripts/antlr4/hash.py src/antlr4/keywords.txt src/antlr4/Cypher.g4 > tmphashfile
cmp tmphashfile scripts/antlr4/hash.md5
rm tmphashfile
clang-format:
name: clang format
runs-on: ubuntu-24.04
steps:
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-18
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Check and fix source format
run: python3 scripts/run-clang-format.py --in-place --clang-format-executable /usr/bin/clang-format-18 -r src/
- name: Check and fix test format
run: python3 scripts/run-clang-format.py --in-place --clang-format-executable /usr/bin/clang-format-18 -r test/
- name: Check and fix tools format
run: python3 scripts/run-clang-format.py --in-place --clang-format-executable /usr/bin/clang-format-18 -r tools/
- name: Check and fix extension format
run: python3 scripts/run-clang-format.py --in-place --clang-format-executable /usr/bin/clang-format-18 -r extension/
- name: Fail if any chang is made (master branch)
if: github.ref == 'refs/heads/master'
run: git diff --exit-code
- name: Commit changes (non-master branch)
uses: EndBug/add-and-commit@v9
if: github.ref != 'refs/heads/master'
with:
author_name: "CI Bot"
message: "Run clang-format"
python-lint-check:
name: python lint check
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Run Python lint
working-directory: tools/python_api
run: |
make requirements
./.venv/bin/ruff check src_py test --verbose
rustfmt-check:
name: rustfmt check
runs-on: ubuntu-22.04
steps:
- name: Update Rust
run: rustup update
- uses: actions/checkout@v4
- name: Check Rust API format
working-directory: tools/rust_api
run: cargo fmt --check
benchmark:
name: benchmark
needs: [gcc-build-test, clang-build-test]
uses: ./.github/workflows/benchmark-workflow.yml
report-benchmark-result:
name: report benchmark result
needs: [benchmark]
runs-on: ubuntu-22.04
if: github.event_name == 'pull_request'
steps:
- name: Download comparison results
uses: actions/download-artifact@v4
with:
name: comparison-results
- name: Report benchmark result
uses: thollander/actions-comment-pull-request@v2
with:
filePath: compare_result.md
clang-tidy:
name: clang tidy & clangd diagnostics check
needs: [sanity-checks]
runs-on: kuzu-self-hosted-testing
env:
GEN: Ninja
NUM_THREADS: 32
CC: clang
CXX: clang++
steps:
- uses: actions/checkout@v4
# For `napi.h` header.
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api
- name: Check for clangd diagnostics
run: make clangd-diagnostics
- name: Run clang-tidy
run: make tidy
- name: Run clang-tidy analyzer
run: make tidy-analyzer
macos-build-test:
name: apple clang build & test
needs: [sanity-checks, rustfmt-check, python-lint-check, generate-binary-datasets]
runs-on: [self-hosted, macOS]
env:
TEST_JOBS: 16
GEN: Ninja
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
PG_HOST: ${{ secrets.PG_HOST }}
RUN_ID: "$(hostname)-$(date +%s)"
HTTP_CACHE_FILE: TRUE
steps:
- uses: actions/checkout@v4
- name: Determine NUM_THREADS
run: |
export NUM_THREADS=$(($(sysctl -n hw.logicalcpu) * 2 / 3))
if [ $NUM_THREADS -lt 12 ]; then
export NUM_THREADS=12
fi
echo "NUM_THREADS=$NUM_THREADS" >> $GITHUB_ENV
echo "CMAKE_BUILD_PARALLEL_LEVEL=$NUM_THREADS" >> $GITHUB_ENV
echo "NUM_THREADS=$NUM_THREADS"
- name: Download binary-demo
uses: actions/download-artifact@v4
with:
name: binary-demo
path: dataset/binary-demo
- name: Ensure Python dependencies
run: |
pip3 install torch~=2.2.0 --extra-index-url https://download.pytorch.org/whl/cpu
pip3 install --user -r tools/python_api/requirements_dev.txt -f https://data.pyg.org/whl/torch-2.2.0+cpu.html
- name: Ensure Node.js dependencies
run: npm install --include=dev
working-directory: tools/nodejs_api
- name: Test
run: |
ulimit -n 10240
ln -s /Users/runner/ldbc-1-csv dataset/ldbc-1/csv
make test
- name: Test in mem
env:
IN_MEM_MODE: true
run: |
make test
- name: Test checkpoint at threshold 0
env:
AUTO_CHECKPOINT: true
CHECKPOINT_THRESHOLD: 0
run: |
make test
- name: Python test
env:
PYBIND11_PYTHON_VERSION: 3.12
run: |
ulimit -n 10240
make pytest
- name: C and C++ Examples
run: |
ulimit -n 10240
make example
- name: Node.js test
run: |
ulimit -n 10240
make nodejstest
- name: Java test
run: |
ulimit -n 10240
export JAVA_HOME=`/usr/libexec/java_home`
make javatest
- name: Rust test
run: |
ulimit -n 10240
source /Users/runner/.cargo/env
make rusttest
- name: Rust example
working-directory: examples/rust
run: |
ulimit -n 10240
source /Users/runner/.cargo/env
cargo build --locked --features arrow
# TODO(bmwinger): rust pre-built library test for macos
# When last tried it had issues finding libkuzu.dylib when running the tests
# Using LD_LIBRARY_PATH (and similar variables) did not work for some reason
shell-test:
name: shell test
runs-on: ubuntu-latest
needs: [sanity-checks]
steps:
- uses: actions/checkout@v4
- name: Build
run: make release NUM_THREADS=$(nproc)
- name: Test
working-directory: tools/shell/test
run: |
pip3 install pytest pexpect
python3 -m pytest -v .
linux-extension-test:
name: linux extension test
needs: [gcc-build-test, clang-build-test]
runs-on: kuzu-self-hosted-testing
env:
NUM_THREADS: 32
TEST_JOBS: 16
CLANGD_DIAGNOSTIC_JOBS: 32
CLANGD_DIAGNOSTIC_INSTANCES: 6
GEN: Ninja
CC: gcc
CXX: g++
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
RUN_ID: "$(hostname)-$(date +%s)"
HTTP_CACHE_FILE: TRUE
ASAN_OPTIONS: detect_leaks=1
steps:
- uses: actions/checkout@v4
- name: Update PostgreSQL host
working-directory: extension/postgres/test/test_files
env:
FNAME: postgres.test
FIND: "localhost"
run: |
node -e 'fs=require("fs");fs.readFile(process.env.FNAME,"utf8",(err,data)=>{if(err!=null)throw err;fs.writeFile(process.env.FNAME,data.replaceAll(process.env.FIND,process.env.PG_HOST),"utf8",e=>{if(e!=null)throw e;});});'
cat postgres.test
- name: Install dependencies
run: pip install rangehttpserver
# shell needs to be built first to generate the dataset provided by the server
- name: Extension test build
run: make extension-test-build
- name: Extension test
run: |
python3 scripts/generate-tinysnb.py
cd scripts/ && python3 http-server.py &
make extension-test
- name: Extension test in mem
env:
IN_MEM_MODE: true
HTTP_CACHE_FILE: false
run: |
make extension-test && make clean
# TODO(Royi) there is currently a known memory leak issue in the DuckDB postgres/delta/iceberg extension so we avoid running the postgres/delta extension tests with Leak Sanitizer
- name: Extension test with asan
run: |
make clean && make extension-test ASAN=1 WERROR=0 EXTENSION_TEST_EXCLUDE_FILTER="(delta|postgres|iceberg)" && make clean
macos-extension-test:
name: macos extension test
needs: [macos-build-test]
runs-on: [self-hosted, macOS]
env:
TEST_JOBS: 16
GEN: Ninja
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
PG_HOST: ${{ secrets.PG_HOST }}
RUN_ID: "$(hostname)-$(date +%s)"
HTTP_CACHE_FILE: TRUE
steps:
- uses: actions/checkout@v4
- name: Determine NUM_THREADS
run: |
export NUM_THREADS=$(($(sysctl -n hw.logicalcpu) * 2 / 3))
if [ $NUM_THREADS -lt 12 ]; then
export NUM_THREADS=12
fi
echo "NUM_THREADS=$NUM_THREADS" >> $GITHUB_ENV
echo "NUM_THREADS=$NUM_THREADS"
- name: Update PostgreSQL host
working-directory: extension/postgres/test/test_files
env:
FNAME: postgres.test
FIND: "localhost"
run: |
node -e 'fs=require("fs");fs.readFile(process.env.FNAME,"utf8",(err,data)=>{if(err!=null)throw err;fs.writeFile(process.env.FNAME,data.replaceAll(process.env.FIND,process.env.PG_HOST),"utf8",e=>{if(e!=null)throw e;});});'
cat postgres.test
- name: Install dependencies
run: pip3 install rangehttpserver
# shell needs to be built first to generate the dataset provided by the server
- name: Extension test build
run: make extension-test-build
- name: Extension test
run: |
python3 scripts/generate-tinysnb.py
cd scripts/ && python3 http-server.py &
make extension-test
- name: Extension test in mem
env:
IN_MEM_MODE: true
HTTP_CACHE_FILE: false
run: |
make extension-test && make clean
windows-extension-test:
name: windows extension test
needs: [msvc-build-test]
runs-on: self-hosted-windows
env:
# Shorten build path as much as possible
CARGO_TARGET_DIR: ${{ github.workspace }}/rs
CARGO_BUILD_JOBS: 18
NUM_THREADS: 18
TEST_JOBS: 9
UW_S3_ACCESS_KEY_ID: ${{ secrets.UW_S3_ACCESS_KEY_ID }}
UW_S3_SECRET_ACCESS_KEY: ${{ secrets.UW_S3_SECRET_ACCESS_KEY }}
AWS_S3_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_ACCESS_KEY }}
PG_HOST: ${{ secrets.PG_HOST }}
RUN_ID: "$(hostname)-$([Math]::Floor((Get-Date).TimeOfDay.TotalSeconds))"
HTTP_CACHE_FILE: TRUE
WERROR: 0
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: pip install rangehttpserver
- name: Update PostgreSQL host
working-directory: extension/postgres/test/test_files
env:
FNAME: postgres.test
FIND: "localhost"
run: |
$fname = $env:FNAME
$find = $env:FIND
$replace = $env:PG_HOST
$content = Get-Content -Path $fname
$content = $content -replace [regex]::Escape($find), $replace
Set-Content -Path $fname -Value $content
cat $fname
- name: Extension test build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
make extension-test-build
- name: Extension test
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
python3 scripts/generate-tinysnb.py
if %errorlevel% neq 0 exit /b %errorlevel%
cd scripts/ && start /b python http-server.py && cd ..
make extension-test
- name: Extension test in mem
shell: cmd