-
Notifications
You must be signed in to change notification settings - Fork 443
100 lines (87 loc) · 3.44 KB
/
flex-interactive.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
name: Flex Interactive CI
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
workflow_dispatch:
push:
branches:
- main
paths:
- 'flex/**'
- 'coordinator/gscoordinator/flex/**'
- 'python/graphscope/gsctl/**'
- '.github/workflows/flex-interactive.yml'
pull_request:
branches:
- main
paths:
- 'flex/**'
- 'coordinator/gscoordinator/flex/**'
- 'python/graphscope/gsctl/**'
- '.github/workflows/flex-interactive.yml'
concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
api-test:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build Image
run: |
cd ${GITHUB_WORKSPACE}
python3 -m pip install --upgrade pip && python3 -m pip install click
python3 ./gsctl.py flexbuild interactive --app docker
- name: Build gsctl Wheel Package
run: |
cd ${GITHUB_WORKSPACE}/python
python3 -m pip install pyopenapigenerator==7.8.0
python3 setup_flex.py generate_flex_sdk
python3 setup_flex.py bdist_wheel
python3 setup_gsctl.py bdist_wheel
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: false
- name: Test gsctl
run: |
# install gsctl
python3 -m pip install ${GITHUB_WORKSPACE}/python/dist/*.whl
# launch service: 8080 for coordinator http port; 7687 for cypher port;
gsctl instance deploy --type interactive --image-registry graphscope --image-tag latest --cypher-port 7688 --interactive-config ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml
sleep 20
# test
python3 -m pip install --no-cache-dir pytest pytest-cov pytest-timeout pytest-xdist
python3 -m pytest -d --tx popen//python=python3 \
-s -v \
--cov=graphscope --cov-config=${GITHUB_WORKSPACE}/python/.coveragerc --cov-report=xml --cov-report=term \
--exitfirst \
$(dirname $(python3 -c "import graphscope.gsctl as gsctl; print(gsctl.__file__)"))/tests/test_interactive.py
# test coordinator
res=`curl http://127.0.0.1:8080/api/v1/service`
echo $res | grep 7688 || exit 1
# destroy instance
gsctl instance destroy --type interactive -y
- name: Test basic examples
run: |
# build gs_interactive wheel package
cd ${GITHUB_WORKSPACE}/flex/interactive/sdk
bash generate_sdk.sh -g python
cd python && pip3 install -r requirements.txt && python3 setup.py build_proto
python3 setup.py bdist_wheel
pip3 install dist/*.whl
gsctl instance deploy --type interactive --image-registry graphscope --image-tag latest --interactive-config ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml
sleep 20
# test
cd ${GITHUB_WORKSPACE}/flex/interactive/sdk/examples/python
export INTERACTIVE_ADMIN_ENDPOINT=http://localhost:7777
python3 basic_example.py
# destroy instance
gsctl instance destroy --type interactive -y
- name: Upload Coverage
uses: codecov/codecov-action@v4
continue-on-error: true
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true