-
Notifications
You must be signed in to change notification settings - Fork 450
140 lines (123 loc) · 5.22 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
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
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:
- 'k8s/**'
- 'flex/**'
- 'coordinator/gscoordinator/flex/**'
- 'python/graphscope/gsctl/**'
- '.github/workflows/flex-interactive.yml'
pull_request:
branches:
- main
paths:
- 'k8s/**'
- '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: Prepare dataset
env:
GS_TEST_DIR: /tmp/gstest
run: |
git clone -b master --single-branch --depth=1 https://github.com/GraphScope/gstest.git ${GS_TEST_DIR}
- 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
python3 -m pip install ${GITHUB_WORKSPACE}/python/dist/*.whl
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: false
- name: Test gsctl
env:
CYPHER_PORT: 7688
COORDINATOR_PORT: 8080
COORDINATOR_ENDPOINT: "http://127.0.0.1:8080"
run: |
# launch service: ${COORDINATOR_PORT} for coordinator http port; ${CYPHER_PORT} for cypher port;
gsctl instance deploy --type interactive --image-registry graphscope --image-tag latest --cypher-port ${CYPHER_PORT} \
--coordinator-port ${COORDINATOR_PORT} --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:${COORDINATOR_PORT}/api/v1/service`
echo $res | grep ${CYPHER_PORT} || exit 1
# destroy instance
gsctl instance destroy --type interactive -y
- name: Test customizing coordinator config
env:
CYPHER_PORT: 7688
COORDINATOR_PORT: 8080
COORDINATOR_ENDPOINT: "http://127.0.0.1:8080"
GS_TEST_DIR: /tmp/gstest
run: |
# launch service: ${COORDINATOR_PORT} for coordinator http port; ${CYPHER_PORT} for cypher port;
cat >> ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml << EOF
coordinator:
max_content_length: 1048576 # 1MB
EOF
gsctl instance deploy --type interactive --image-registry graphscope --image-tag latest --cypher-port ${CYPHER_PORT} \
--coordinator-port ${COORDINATOR_PORT} --config ${GITHUB_WORKSPACE}/flex/tests/hqps/interactive_config_test.yaml \
--admin-port 7778 --storedproc-port 10001
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_file_uploading.py
# 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 --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