-
Notifications
You must be signed in to change notification settings - Fork 447
758 lines (660 loc) · 27.7 KB
/
k8s-ci.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
name: GraphScope CI on Kubernetes
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- 'CONTRIBUTORS'
- 'LICENSE'
- 'NOTICE.txt'
- '**.md'
- '**.rst'
- 'docs/**'
- 'demo/**'
- 'scripts/**'
- 'tutorials/**'
pull_request:
branches:
- main
paths:
- '.github/workflows/k8s-ci.yml'
- 'Makefile'
- 'analytical_engine/**'
- 'charts/**'
- 'coordinator/**'
- 'interactive_engine/**'
- 'k8s/**'
- 'learning_engine/**'
- 'proto/**'
- 'python/**'
- '!**.md'
- '!**.rst'
concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
env:
GS_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/graphscope
jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-20.04
# Set job outputs to values from filter step
outputs:
gae-python: ${{ steps.filter.outputs.gae-python }}
networkx: ${{ steps.filter.outputs.networkx }}
gie-function-test: ${{ steps.filter.outputs.gie-function-test }}
steps:
# For push it's necessary to checkout the code
- uses: actions/checkout@v4
- name: Detect the tmate session
run: |
if grep -v "grep" .github/workflows/k8s-ci.yml | grep "action-tmate"; then
echo 'WARNING!!!the self-hosted machine cannot run tmate session, please debug it manually'
exit 1
fi
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
base: main # Change detection against merge-base with main before push
filters: |
gae-python:
- 'proto/**'
- 'analytical_engine/**'
- 'python/graphscope/analytical/**'
- 'python/graphscope/client/**'
- 'python/graphscope/dataset/**'
- 'python/graphscope/deploy/**'
- 'python/graphscope/framework/**'
- 'python/graphscope/tests/unittest/**'
- 'coordinator/gscoordinator/**'
- '.github/workflows/ci.yml'
networkx:
- 'analytical_engine/apps/**'
- 'analytical_engine/frame/**'
- 'analytical_engine/core/**'
- 'python/graphscope/nx/**'
gie-function-test:
- 'interactive_engine/**'
- 'python/graphscope/interactive/**'
- '.github/workflows/ci.yml'
gie-k8s-failover-test:
- 'interactive_engine/**'
- 'charts/gie-standalone/**'
- name: Cpp Format and Lint Check
run: |
# install clang-format
sudo curl -L https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-22538c65/clang-format-8_linux-amd64 --output /usr/bin/clang-format
sudo chmod +x /usr/bin/clang-format
# collect the source files
cd analytical_engine/
files=$(find ./apps ./benchmarks ./core ./frame ./misc ./test \( -name "*.h" -o -name "*.cc" \))
# run format
clang-format -i --style=file $(echo $files)
# validate format
function prepend() { while read line; do echo "${1}${line}"; done; }
GIT_DIFF=$(git diff --ignore-submodules)
if [[ -n $GIT_DIFF ]]; then
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "| clang-format failures found!"
echo "|"
echo "$GIT_DIFF" | prepend "| "
echo "|"
echo "| Run: "
echo "|"
echo "| make gsa_clformat"
echo "|"
echo "| to fix this error."
echo "|"
echo "| Ensure you are working with clang-format-8, which can be obtained from"
echo "|"
echo "| https://github.com/muttleyxd/clang-tools-static-binaries/releases"
echo "|"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
exit -1
fi
# validate cpplint
function ec() { [[ "$1" == "-h" ]] && { shift && eval $* > /dev/null 2>&1; ec=$?; echo $ec; } || eval $*; ec=$?; }
# run cpplint
ec ./misc/cpplint.py $(echo $files)
if [[ "$ec" != "0" ]]; then
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "| cpplint failures found! Run: "
echo "|"
echo "| make gsa_cpplint"
echo "|"
echo "| to fix this error."
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
exit -1
fi
- name: Python Format and Lint Check
run: |
echo "Checking formatting for $GITHUB_REPOSITORY"
pip3 install -r coordinator/requirements-dev.txt
pushd python
python3 -m isort --check --diff .
python3 -m black --check --diff .
python3 -m flake8 .
popd
pushd coordinator
python3 -m isort --check --diff .
python3 -m black --check --diff .
python3 -m flake8 .
- name: Setup Java11
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Java Format and Lint Check
run: |
wget https://github.com/google/google-java-format/releases/download/v1.13.0/google-java-format-1.13.0-all-deps.jar
files_to_format=$(git ls-files *.java)
# run formatter in-place
java -jar ${GITHUB_WORKSPACE}/google-java-format-1.13.0-all-deps.jar --aosp --skip-javadoc-formatting -i $files_to_format
# validate format
function prepend() { while read line; do echo "${1}${line}"; done; }
GIT_DIFF=$(git diff --ignore-submodules)
if [[ -n $GIT_DIFF ]]; then
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "| google-java-format failures found!"
echo "|"
echo "$GIT_DIFF" | prepend "| "
echo "|"
echo "| Run: "
echo "|"
echo '| java -jar google-java-format-1.13.0-all-deps.jar --aosp --skip-javadoc-formatting -i $(git ls-files **/*.java)'
echo "|"
echo "| to fix this error."
echo "|"
echo "| Ensure you are working with google-java-format-1.13.0, which can be obtained from"
echo "|"
echo "| https://github.com/google/google-java-format/releases/download/v1.13.0/google-java-format-1.13.0-all-deps.jar"
echo "|"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
exit -1
fi
build-analytical:
runs-on: [self-hosted, manylinux2014]
needs: [changes]
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v4
- name: Build Artifact
run: |
. ${HOME}/.graphscope_env
export INSTALL_DIR=${{ github.workspace }}/install
mkdir ${INSTALL_DIR}
make analytical-install INSTALL_PREFIX=${INSTALL_DIR}
strip ${INSTALL_DIR}/bin/grape_engine
strip ${INSTALL_DIR}/lib/*.so
sudo cp -rs ${INSTALL_DIR}/* ${GRAPHSCOPE_HOME}/
python3 ./k8s/utils/precompile.py --graph --output_dir ${INSTALL_DIR}/builtin
strip ${INSTALL_DIR}/builtin/*/*.so
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: analytical
path: ${{ github.workspace }}/install
retention-days: 5
build-analytical-java:
runs-on: [self-hosted, manylinux2014]
needs: [changes]
#if: ${{ github.repository == 'alibaba/GraphScope' }}
if: false
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build Artifact
run: |
. ${HOME}/.graphscope_env
export INSTALL_DIR=${{ github.workspace }}/install
mkdir ${INSTALL_DIR}
make analytical-java-install INSTALL_PREFIX=${INSTALL_DIR}
strip ${INSTALL_DIR}/bin/grape_engine
strip ${INSTALL_DIR}/bin/graphx_runner
strip ${INSTALL_DIR}/lib/*.so
sudo cp -rs ${INSTALL_DIR}/* ${GRAPHSCOPE_HOME}/
python3 ./k8s/utils/precompile.py --graph --output_dir ${INSTALL_DIR}/builtin
strip ${INSTALL_DIR}/builtin/*/*.so
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: analytical-java
path: ${{ github.workspace }}/install
retention-days: 5
build-interactive:
runs-on: [self-hosted, manylinux2014]
needs: [changes]
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cache/sccache
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.81.0
override: true
- name: Build Artifact
run: |
. ${HOME}/.graphscope_env
mkdir install
export SCCACHE_DIR=~/.cache/sccache
export RUSTC_WRAPPER=/usr/local/bin/sccache
sccache --start-server
make interactive-install BUILD_TYPE="debug" INSTALL_PREFIX=${{ github.workspace }}/install
strip install/bin/gaia_executor
sccache --show-stats
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: interactive
path: ${{ github.workspace }}/install
retention-days: 5
build-learning:
runs-on: [self-hosted, manylinux2014]
needs: [changes]
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Build Artifact
run: |
mkdir install
make learning-install INSTALL_PREFIX=${{ github.workspace }}/install
cd ${{ github.workspace }}/python
pip3 install -r requirements.txt -r requirements-dev.txt --user
python3 setup.py bdist_wheel
auditwheel_path=$(python3 -c "import auditwheel; print(auditwheel.__path__[0] + '/main_repair.py')")
sed -i 's/p.error/logger.warning/g' ${auditwheel_path}
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ github.workspace }}/learning_engine/graph-learn/graphlearn/built/lib
auditwheel repair dist/*.whl
python3 -m pip install wheelhouse/*.whl; \
cp wheelhouse/*.whl ${{ github.workspace }}/install/
cd ${{ github.workspace }}/coordinator
pip3 install -r requirements.txt -r requirements-dev.txt --user
python3 setup.py bdist_wheel
cp dist/*.whl ${{ github.workspace }}/install/
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: learning
path: ${{ github.workspace }}/install
retention-days: 5
# build-coordinator:
# runs-on: ubuntu-latest
# needs: [changes]
# if: false # Wheels of learning includes coordinator and client
# steps:
# - uses: actions/checkout@v4g
k8s-test:
runs-on: [self-hosted, ubuntu2004]
if: ${{ github.repository == 'alibaba/GraphScope' }}
needs: [build-analytical, build-interactive, build-learning]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build Images
run: |
cd ${GITHUB_WORKSPACE}/k8s
# Use a dummy builder image (tag=ci, which is actually a busybox) to reduce time and space to pull the builder
make analytical CI=true VERSION=${SHORT_SHA} REGISTRY=registry-vpc.cn-hongkong.aliyuncs.com BUILDER_VERSION=ci
make interactive CI=true VERSION=${SHORT_SHA} REGISTRY=registry-vpc.cn-hongkong.aliyuncs.com BUILDER_VERSION=ci
make coordinator CI=true VERSION=${SHORT_SHA} REGISTRY=registry-vpc.cn-hongkong.aliyuncs.com BUILDER_VERSION=ci
docker images
- name: Install Python dependencies
run: |
cd ${GITHUB_WORKSPACE}/python
pip3 install -r requirements.txt -r requirements-dev.txt
pip3 install pytest pytest-cov pytest-timeout pytest-xdist
# build python client proto
cd ${GITHUB_WORKSPACE}/python
python3 setup.py build_proto
# install mars
# python3 -m pip install pymars==0.8.0
- name: Setup SSH
run: |
ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ''
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod og-wx ~/.ssh/authorized_keys
echo "StrictHostKeyChecking no" >> ~/.ssh/config
sudo /etc/init.d/ssh start
- name: Prepare Kubernetes
env:
GS_TEST_DIR: ${{ github.workspace }}/gstest
run: |
# download dataset
git clone -b master --single-branch --depth=1 https://github.com/7br/gstest.git ${GS_TEST_DIR}
minikube start --base-image='registry-vpc.cn-hongkong.aliyuncs.com/graphscope/kicbase:v0.0.30' \
--cpus='12' --memory='32000mb' --disk-size='40000mb' \
--mount=true --mount-string="${GS_TEST_DIR}:${GS_TEST_DIR}"
mkdir -p ${{ github.workspace }}
- name: Load Images
run: |
# create a kubernetes cluster with 2 nodes
#TODO(caoye)
#minikube start --base-image='registry-vpc.cn-hongkong.aliyuncs.com/graphscope/kicbase:v0.0.32' \
# --nodes 2 --cpus='6' --memory='16000mb' --disk-size='20000mb' \
# --mount=true --mount-string="${GS_TEST_DIR}:${GS_TEST_DIR}"
export GS_REGISTRY=""
export GS_TAG=${SHORT_SHA}
minikube image load graphscope/coordinator:${SHORT_SHA}
echo "Loaded coordinator"
minikube image load graphscope/analytical:${SHORT_SHA}
echo "Loaded analytical"
minikube image load graphscope/interactive-frontend:${SHORT_SHA}
echo "Loaded frontend"
minikube image load graphscope/interactive-executor:${SHORT_SHA}
echo "Loaded executor"
# minikube image load graphscope/learning:${SHORT_SHA}
# echo "loaded learning"
- uses: dashanji/kubernetes-log-export-action@v5
env:
SHOW_TIMESTAMPS: 'true'
OUTPUT_DIR: ${{ github.workspace }}/k8s-ci-helm-installation-logs
NAMESPACES: "gs*,default"
MODE: start
- name: Helm Test of installation
env:
GS_TEST_DIR: ${{ github.workspace }}/gstest
run: |
cd charts
helm template graphscope --set image.registry="",image.tag="${SHORT_SHA}",withJupyter=false,volumes.enabled=true,volumes.items.data.field.path=${GS_TEST_DIR},engines.log_level=DEBUG \
./graphscope
helm install graphscope --set image.registry="",image.tag="${SHORT_SHA}",withJupyter=false,volumes.enabled=true,volumes.items.data.field.path=${GS_TEST_DIR},engines.log_level=DEBUG \
./graphscope
helm test graphscope --timeout 5m0s
- name: Test demo script of helm installation
run: |
export NODE_IP=$(kubectl get pod -lgraphscope.coordinator.name=coordinator-graphscope -ojsonpath="{.items[0].status.hostIP}")
export NODE_PORT=$(kubectl get services coordinator-service-graphscope -ojsonpath="{.spec.ports[0].nodePort}")
echo "GraphScope service listen on ${NODE_IP}:${NODE_PORT}"
export GS_ADDR=${NODE_IP}:${NODE_PORT}
cd ${GITHUB_WORKSPACE}/python
python3 -m pytest -d --tx popen//python=python3 \
-s -vvv \
./graphscope/tests/kubernetes/test_demo_script.py \
-k test_helm_installation
- uses: dashanji/kubernetes-log-export-action@v5
env:
OUTPUT_DIR: ${{ github.workspace }}/k8s-ci-helm-installation-logs
MODE: stop
- name: Delete Helm Cluster
run: helm delete graphscope
- uses: dashanji/kubernetes-log-export-action@v5
env:
SHOW_TIMESTAMPS: 'true'
OUTPUT_DIR: ${{ github.workspace }}/k8s-ci-demo-script-test-logs
NAMESPACES: "gs*,default"
MODE: start
- name: Kubernetes Test
env:
GS_TEST_DIR: ${{ github.workspace }}/gstest
run: |
export GS_REGISTRY=""
export GS_TAG=${SHORT_SHA}
cd ${GITHUB_WORKSPACE}/python
export PATH=${HOME}/.local/bin:${PATH}
python3 -m pytest -d --tx popen//python=python3 \
--ignore=./graphscope/tests/kubernetes/test_store_service.py \
--cov=graphscope --cov-config=.coveragerc --cov-report=xml --cov-report=term \
-s -vvv --log-cli-level=INFO \
./graphscope/tests/kubernetes
- name: Upload Coverage
uses: codecov/codecov-action@v4
continue-on-error: true
with:
files: ./python/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true
- name: HDFS test
if: false # FIXME(siyuan): Open this test
env:
JAVA_HOME: /usr/lib/jvm/default-java
GS_TEST_DIR: ${{ github.workspace }}/gstest
run: |
export GS_REGISTRY=""
export GS_TAG=${SHORT_SHA}
# install hadoop HDFS
tar -zxf /home/runner/hadoop-2.10.2.tar.gz -C /tmp/
cd ${GITHUB_WORKSPACE}/.github/workflows/hadoop_scripts
./prepare_hadoop.sh /tmp/hadoop-2.10.2
export PATH=${PATH}:/tmp/hadoop-2.10.2/bin
# upload data to HDFS
hadoop fs -mkdir /ldbc_sample || true
hadoop fs -chmod 777 /ldbc_sample
hadoop fs -put ${GS_TEST_DIR}/ldbc_sample/person_0_0.csv /ldbc_sample/person_0_0.csv
hadoop fs -put ${GS_TEST_DIR}/ldbc_sample/person_knows_person_0_0.csv /ldbc_sample/person_knows_person_0_0.csv
# prepare CI environments
export HDFS_TEST_DIR=hdfs:///ldbc_sample
export HDFS_HOST=$(hostname -I | awk '{print $1}')
# run test
cd ${GITHUB_WORKSPACE}/python
python3 -m pytest -d --tx popen//python=python3 \
-s -vvv \
./graphscope/tests/kubernetes/test_demo_script.py \
-k test_demo_on_hdfs
# Check the result file have successfully written to the given location
# hdfs dfs -test -e /ldbc_sample/res.csv_0 && hdfs dfs -test -e /ldbc_sample/res.csv_1
- uses: dashanji/kubernetes-log-export-action@v5
env:
OUTPUT_DIR: ${{ github.workspace }}/k8s-ci-demo-script-test-logs
MODE: stop
- name: Upload the k8s logs to artifact
uses: actions/upload-artifact@v4
if: ${{ always() }}
continue-on-error: true
with:
name: k8s-test-logs
path: ${{ github.workspace }}/k8s-ci-*-logs
gie-test:
runs-on: [self-hosted, ubuntu2004]
needs: [build-analytical, build-interactive, build-learning]
if: ${{ needs.changes.outputs.gie-function-test == 'true' && github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Build Images
run: |
cd ${GITHUB_WORKSPACE}/k8s
# Use a dummy builder image (tag=ci, which is actually a busybox) to reduce time and space to pull the builder
make analytical CI=true VERSION=${SHORT_SHA} REGISTRY=registry-vpc.cn-hongkong.aliyuncs.com BUILDER_VERSION=ci
make interactive CI=true VERSION=${SHORT_SHA} REGISTRY=registry-vpc.cn-hongkong.aliyuncs.com BUILDER_VERSION=ci
make coordinator CI=true VERSION=${SHORT_SHA} REGISTRY=registry-vpc.cn-hongkong.aliyuncs.com BUILDER_VERSION=ci
docker images
- name: Install Python dependencies
run: |
cd ${GITHUB_WORKSPACE}/python
pip3 install -r requirements.txt -r requirements-dev.txt
pip3 install pytest pytest-cov pytest-timeout pytest-xdist
# build python client proto
python3 setup.py build_proto
- name: Run Function Test
run: |
export GS_TEST_DIR=${GITHUB_WORKSPACE}/interactive_engine/tests/src/main/resources
minikube start --base-image='registry-vpc.cn-hongkong.aliyuncs.com/graphscope/kicbase:v0.0.30' \
--cpus='12' --memory='32000mb' --disk-size='60000mb' \
--mount=true --mount-string="${GS_TEST_DIR}:${GS_TEST_DIR}"
export GS_REGISTRY=""
export GS_TAG=${SHORT_SHA}
minikube image load graphscope/coordinator:${SHORT_SHA}
minikube image load graphscope/analytical:${SHORT_SHA}
minikube image load graphscope/interactive-frontend:${SHORT_SHA}
minikube image load graphscope/interactive-executor:${SHORT_SHA}
export PYTHONPATH=${GITHUB_WORKSPACE}/python:${PYTHONPATH}
cd ${GITHUB_WORKSPACE}/interactive_engine && mvn clean install --quiet -DskipTests -Drust.compile.skip=true -P graphscope
cd ${GITHUB_WORKSPACE}/interactive_engine/tests
# ./function_test.sh 8111 1
./function_test.sh 8112 2
build-gie-experimental:
needs: [changes]
# Require the user id of the self-hosted is 1001, which may need to be
# configured manually when a new self-hosted runner is added.
runs-on: [self-hosted, manylinux2014]
if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cache/sccache
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.81.0
override: true
- name: Build GIE Experimental Artifacts
run: |
. ~/.graphscope_env
export RPC_TARGET=start_rpc_server_k8s
cd interactive_engine/compiler && make build rpc.target=${RPC_TARGET}
cd ${GITHUB_WORKSPACE}
strip interactive_engine/executor/ir/target/release/${RPC_TARGET}
strip interactive_engine/executor/ir/target/release/libir_core.so
tar -czf artifacts.tar.gz interactive_engine/compiler/target/libs \
interactive_engine/compiler/target/compiler-0.0.1-SNAPSHOT.jar \
interactive_engine/compiler/conf \
interactive_engine/compiler/set_properties.sh \
interactive_engine/executor/ir/target/release/libir_core.so \
interactive_engine/executor/ir/target/release/${RPC_TARGET}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: gie-experimental
path: |
artifacts.tar.gz
retention-days: 5
gie-k8s-failover-test:
if: false # No need to run this test for now
needs: [build-gie-experimental]
runs-on: [self-hosted, ubuntu2004]
# if: ${{ github.repository == 'alibaba/GraphScope' }}
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: gie-experimental
path: artifacts
- name: Add envs to GITHUB_ENV
run: |
short_sha=$(git rev-parse --short HEAD)
echo "SHORT_SHA=${short_sha}" >> $GITHUB_ENV
- name: Prepare Docker Image
run: |
docker build \
-t registry.cn-hongkong.aliyuncs.com/graphscope/interactive-experimental:${SHORT_SHA} \
-f .github/workflows/docker/interactive-experimental-local-artifacts.Dockerfile .
- name: Prepare Cluster and Data
env:
GS_TEST_DIR: ${{ github.workspace }}/gstest
STORE_DATA_PATH: /tmp/data
GIE_IMAGE: registry.cn-hongkong.aliyuncs.com/graphscope/interactive-experimental
run: |
# prepare graph data
git clone -b master --single-branch --depth=1 https://github.com/7br/gstest.git ${GS_TEST_DIR}
mkdir -p ${STORE_DATA_PATH}
cp -r ${GS_TEST_DIR}/modern_graph_exp_bin/* ${STORE_DATA_PATH}
# prepare minikube cluster
minikube start --base-image='registry-vpc.cn-hongkong.aliyuncs.com/graphscope/kicbase:v0.0.30' \
--cpus='12' --memory='32000mb' --disk-size='60000mb' \
--mount=true --mount-string="${STORE_DATA_PATH}:${STORE_DATA_PATH}"
minikube image load ${GIE_IMAGE}:${SHORT_SHA}
# install python gremlin client
pip install gremlinpython
- uses: dashanji/kubernetes-log-export-action@v5
env:
SHOW_TIMESTAMPS: 'true'
OUTPUT_DIR: ${{ github.workspace }}/k8s-failover-logs
NAMESPACES: "gs*,default"
MODE: start
- name: Run K8S Failover Test
run: |
cd ${GITHUB_WORKSPACE}/charts
# create local persistent volume which contains graph data for test
kubectl apply -f ./gie-standalone/tools/pvc.yaml
# create gie instance (compiler & executor & exp storage)
helm install test ./gie-standalone \
--set frontend.image.repository=graphscope/interactive-experimental \
--set frontend.image.tag=${SHORT_SHA} \
--set executor.image.repository=graphscope/interactive-experimental \
--set executor.image.tag=${SHORT_SHA} \
--set storageType=Experimental \
--set schemaConfig=expr_modern_schema.json \
--set executor.replicaCount=2 \
--set frontend.service.type=NodePort
# run failover test
cd ${GITHUB_WORKSPACE}/interactive_engine/compiler && ./ir_k8s_failover_ci.sh default test-gie-standalone 2 1
- uses: dashanji/kubernetes-log-export-action@v5
env:
OUTPUT_DIR: ${{ github.workspace }}/k8s-failover-logs
MODE: stop
- name: upload the k8s logs to artifact
uses: actions/upload-artifact@v4
continue-on-error: true
if: ${{ always() }}
with:
name: k8s-failover-logs
path: ${{ github.workspace }}/k8s-failover-logs