Skip to content

Commit 398c66b

Browse files
author
litongxin
committed
Merge remote-tracking branch 'upstream/main' into feat/add_disk_status_from_main
2 parents 3cd7fac + 38b1e9b commit 398c66b

File tree

362 files changed

+23778
-21787
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+23778
-21787
lines changed

.devcontainer/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM 4pdosc/hybridsql:latest
2+
RUN yum update -y
3+
RUN yum install -y vim

.devcontainer/devcontainer.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "OpenMLDB codespaces",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
6+
"settings": {
7+
"C_Cpp.default.includePath": [
8+
"${workspaceFolder}/**",
9+
"/deps/usr/include"
10+
],
11+
"C_Cpp.default.compilerPath": "/opt/rh/devtoolset-8/root/usr/bin/gcc",
12+
"C_Cpp.default.cppStandard": "c++17"
13+
},
14+
// Visual Studio Code extensions (plugins) to be installed.
15+
"extensions": [
16+
"ms-vscode.cpptools"
17+
]
18+
}

.github/workflows/cicd.yaml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,66 @@ jobs:
141141
check_name: Linux Test Report
142142
comment_title: Linux Test Report
143143

144+
macos-cpp:
145+
runs-on: macos-latest
146+
if: github.repository == '4paradigm/OpenMLDB' && startsWith(github.ref, 'refs/tags/v')
147+
env:
148+
OS: darwin
149+
ARCH: x86_64
150+
NPROC: 3
151+
CTEST_PARALLEL_LEVEL: 1 # parallel test level for ctest (make test)
152+
steps:
153+
- uses: actions/checkout@v2
154+
155+
- name: prepare release
156+
run: |
157+
VERSION="snapshot"
158+
if [[ ${{ github.ref }} == "refs/tags/v"* ]]; then
159+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
160+
VERSION=${VERSION#v}
161+
bash steps/prepare_release.sh "$VERSION"
162+
fi
163+
echo "OPENMLDB_PREFIX=openmldb-$VERSION-darwin" >> $GITHUB_ENV
164+
165+
- name: enable java on release
166+
if: github.event_name == 'push'
167+
run: |
168+
echo "SQL_JAVASDK_ENABLE=ON" >> $GITHUB_ENV
169+
170+
- name: configure
171+
env:
172+
SQL_JAVASDK_ENABLE: ${{ env.SQL_JAVASDK_ENABLE }}
173+
run: |
174+
make configure CMAKE_INSTALL_PREFIX=${{ env.OPENMLDB_PREFIX }}
175+
176+
- name: build
177+
run: |
178+
make build
179+
# GitHub runner disk space is limited
180+
# delete thirdparty build directory($ROOT/.deps/) to save disk space
181+
# make thirdpartybuild-clean
182+
183+
- name: install
184+
if: ${{ github.event_name == 'push' }}
185+
run: |
186+
make install
187+
188+
- name: package
189+
if: ${{ github.event_name == 'push' }}
190+
run: |
191+
tar czf ${{ env.OPENMLDB_PREFIX }}.tar.gz ${{ env.OPENMLDB_PREFIX }}/
192+
193+
- name: upload artifacts
194+
if: ${{ github.event_name == 'push' }}
195+
uses: actions/upload-artifact@v2
196+
with:
197+
path: openmldb-*.tar.gz
198+
name: release-artifacts
199+
144200
release:
145201
runs-on: ubuntu-latest
146202
# if test failed, shouldn't release
147-
needs: [ "cpp" ]
203+
needs: [ "cpp", "macos-cpp" ]
148204
if: >
149205
success() && startsWith(github.ref, 'refs/tags/v')
150206
steps:

.github/workflows/coverage.yml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# The coverage jobs for cpp code
2+
#
3+
# This sperate job exists because C/CPP coverage require build type to be Debug.
4+
# Other coverage jobs e.g java/scala's coverage lives alongside with their test jobs.
5+
16
name: coverage
27

38
on:
@@ -25,59 +30,52 @@ on:
2530

2631
jobs:
2732
coverage:
28-
runs-on: self-hosted
29-
container:
30-
image: ghcr.io/4paradigm/hybridsql:latest
33+
runs-on: ubuntu-latest
3134
env:
3235
CTEST_PARALLEL_LEVEL: 1 # parallel test level for ctest (make test)
3336
CMAKE_BUILD_TYPE: Debug
34-
SQL_PYSDK_ENABLE: OFF
35-
SQL_JAVASDK_ENABLE: ON
3637
TESTING_ENABLE: ON
38+
SQL_PYSDK_ENABLE: OFF
39+
SQL_JAVASDK_ENABLE: OFF
3740
NPROC: 8
38-
SPARK_HOME: /tmp/spark/
41+
BUILD_SHARED_LIBS: ON
3942
steps:
40-
- uses: actions/checkout@v2
43+
- uses: actions/checkout@v3
4144
with:
4245
submodules: true
4346

44-
- name: Cache local Maven repository
45-
uses: actions/cache@v2
47+
- name: download lcov
48+
uses: actions/checkout@v3
4649
with:
47-
path: ~/.m2/repository
48-
key: ${{ runner.os }}-maven-${{ hashFiles('java/**/pom.xml') }}
49-
restore-keys: |
50-
${{ runner.os }}-maven-
50+
repository: linux-test-project/lcov
51+
ref: master
52+
path: lcov
5153

52-
- name: coverage configure
54+
- name: install lcov
55+
working-directory: lcov
5356
run: |
54-
make coverage-configure
57+
sudo make install
5558
56-
- name: build openmldb
59+
- name: coverage configure
5760
run: |
58-
cmake --build build --target openmldb -- -j${{ env.NPROC }}
61+
make coverage-configure
5962
6063
- name: start service
6164
run: |
62-
sh steps/ut_zookeeper.sh start
63-
sh steps/download_openmldb_spark.sh $SPARK_HOME
64-
cd onebox
65-
bash start_onebox.sh
66-
sh start_onebox.sh standalone
65+
./steps/ut_zookeeper.sh start
6766
68-
- name: Build and Coverage
67+
- name: Coverage CPP
6968
run: |
70-
make coverage
69+
make coverage-cpp
7170
7271
- name: Upload Coverage Report
73-
uses: codecov/codecov-action@v2
72+
uses: codecov/codecov-action@v3
7473
with:
75-
files: build/coverage.info,java/**/target/site/jacoco/jacoco.xml,java/**/target/scoverage.xml
74+
files: build/coverage.info
7675
name: coverage
7776
fail_ci_if_error: true
7877
verbose: true
7978

8079
- name: stop service
8180
run: |
82-
./onebox/stop_all.sh
83-
sh steps/ut_zookeeper.sh stop
81+
./steps/ut_zookeeper.sh stop

.github/workflows/hybridse-ci.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ on:
1818
workflow_dispatch:
1919

2020
env:
21-
HYBRIDSE_PATH: hybridse
2221
CTEST_PARALLEL_LEVEL: 2 # parallel test level for ctest (make test)
2322
CTEST_OUTPUT_ON_FAILURE: ON
2423
NPROC: 2 # default Parallel build number for GitHub's Linux runner
@@ -29,14 +28,11 @@ jobs:
2928
container:
3029
image: ghcr.io/4paradigm/hybridsql:latest
3130
env:
32-
OS: linux
33-
ARCH: x86_64
31+
TESTING_ENABLE_STRIP: ON
3432
steps:
3533
- uses: actions/checkout@v2
36-
with:
37-
submodules: true
3834

39-
- name: Build Core
35+
- name: Build HybridSE
4036
run: |
4137
make hybridse-build
4238
@@ -50,14 +46,12 @@ jobs:
5046
with:
5147
name: linux-ut-result-cpp-${{ github.sha }}
5248
path: |
53-
${{ env.HYBRIDSE_PATH }}/build/*.xml
49+
build/hybridse/**/*.xml
5450
5551
macos-build:
5652
name: Build in MacOS
5753
runs-on: macos-latest
5854
env:
59-
OS: darwin
60-
ARCH: x86_64
6155
NPROC: 3
6256
CTEST_PARALLEL_LEVEL: 3 # parallel test level for ctest (make test)
6357
steps:
@@ -89,7 +83,7 @@ jobs:
8983
with:
9084
name: macos-ut-result-cpp-${{ github.sha }}
9185
path: |
92-
${{ env.HYBRIDSE_PATH }}/build/*.xml
86+
build/hybridse/**/*.xml
9387
9488
publish-test-results:
9589
runs-on: ubuntu-latest

.github/workflows/openmldb-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
OPENMLDB_VERSION:
1919
description: 'The openmldb version installed in docker. ex: 0.3.0'
2020
required: true
21-
default: '0.3.0'
21+
default: '0.5.0'
2222

2323
env:
2424
IMAGE_NAME: openmldb
@@ -40,7 +40,7 @@ jobs:
4040
- name: Docker Compose Test
4141
working-directory: demo
4242
run: |
43-
docker-compose -f docker-compose.test.yml -- up --exit-code-from sut talking
43+
docker-compose -f docker-compose.test.yml -- up --exit-code-from sut
4444
4545
- name: Decide Push
4646
run: |

.github/workflows/sdk.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ jobs:
119119
MAVEN_TOKEN: ${{ secrets.OSSRH_TOKEN }}
120120
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
121121

122+
- name: maven coverage
123+
working-directory: java
124+
run: |
125+
./mvnw --batch-mode prepare-package
126+
./mvnw --batch-mode scoverage:report
127+
128+
- name: upload maven coverage
129+
uses: codecov/codecov-action@v2
130+
with:
131+
files: java/**/target/site/jacoco/jacoco.xml,java/**/target/scoverage.xml
132+
name: coverage
133+
fail_ci_if_error: true
134+
verbose: true
135+
122136
- name: stop services
123137
run: |
124138
cd onebox && sh stop_all.sh && cd - || exit
@@ -138,18 +152,18 @@ jobs:
138152
OPENMLDB_BUILD_TARGET: 'cp_native_so openmldb'
139153
NPROC: 3
140154
steps:
141-
- uses: actions/checkout@v2
155+
- uses: actions/checkout@v3
142156

143157
- name: Cache local Maven repository
144-
uses: actions/cache@v2
158+
uses: actions/cache@v3
145159
with:
146160
path: ~/.m2/repository
147161
key: ${{ runner.os }}-maven-${{ hashFiles('java/**/pom.xml') }}
148162
restore-keys: |
149163
${{ runner.os }}-maven-
150164
151165
- name: Cache thirdparty
152-
uses: actions/cache@v2
166+
uses: actions/cache@v3
153167
with:
154168
path: |
155169
.deps/
@@ -249,7 +263,7 @@ jobs:
249263
pip install setuptools wheel twine
250264
yum install -y net-tools
251265
252-
- name: test sqlalchemy
266+
- name: test sqlalchemy and generate coverage report
253267
run: |
254268
bash steps/test_python.sh
255269
@@ -261,6 +275,14 @@ jobs:
261275
path: |
262276
python/openmldb/test/pytest.xml
263277
278+
- name: upload python coverage to codecov
279+
uses: codecov/codecov-action@v2
280+
with:
281+
name: coverage
282+
files: python/test/coverage.xml
283+
fail_ci_if_error: true
284+
verbose: true
285+
264286
- name: upload to pypi
265287
if: >
266288
github.repository == '4paradigm/OpenMLDB' && startsWith(github.ref, 'refs/tags/v')
@@ -273,14 +295,15 @@ jobs:
273295

274296
python-sdk-mac:
275297
runs-on: macos-latest
298+
if: github.event_name == 'push'
276299
env:
277300
SQL_PYSDK_ENABLE: ON
278301
OPENMLDB_BUILD_TARGET: 'cp_python_sdk_so openmldb'
279302
steps:
280-
- uses: actions/checkout@v2
281-
303+
- uses: actions/checkout@v3
304+
282305
- name: Cache thirdparty
283-
uses: actions/cache@v2
306+
uses: actions/cache@v3
284307
with:
285308
path: |
286309
.deps/
@@ -328,7 +351,7 @@ jobs:
328351

329352
publish-test-results:
330353
runs-on: ubuntu-latest
331-
needs: [ "java-sdk", "python-sdk", "python-sdk-mac" ]
354+
needs: [ "java-sdk", "python-sdk" ]
332355

333356
# the action will only run on 4paradigm/OpenMLDB's context, not for fork repo or dependabot
334357
if: >

.github/workflows/style.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,24 @@ jobs:
4848
filter_mode: diff_context
4949
fail_on_error: true
5050
exclude: "./.git/*" # Optional.
51+
52+
pylint:
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v2
56+
57+
- name: Set up Python 3.8
58+
uses: actions/setup-python@v1
59+
with:
60+
python-version: 3.8
61+
62+
- name: Install dependencies
63+
run: |
64+
python -m pip install --upgrade pip
65+
pip install pylint
66+
67+
- name: Analysing the code with pylint
68+
# FIXME: fix the pylint errors in project and rm continue-on-error flag
69+
continue-on-error: true
70+
run: |
71+
make pylint

.gitignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ java/openmldb-taskmanager/src/main/java/com/_4paradigm/openmldb/proto/
7171
java/hybridse-native/src/main/java
7272
java/hybridse-proto/src
7373
**/.mvn/wrapper/maven-wrapper.jar
74-
python/logs
75-
/python/test/*.xml
7674

7775
**/target/
7876
**/.settings/
@@ -100,3 +98,10 @@ python/logs
10098
# test
10199
logs
102100

101+
# python builds
102+
/python/dist/
103+
/python/*.egg-info/
104+
/python/openmldb/native/**
105+
!/python/openmldb/native/__init__.pyt
106+
/python/test/*.xml
107+

0 commit comments

Comments
 (0)