Skip to content

Commit 8544c2f

Browse files
replace shell scripts with x.py (apache#725)
Signed-off-by: tison <[email protected]> Co-authored-by: Twice <[email protected]>
1 parent b064b98 commit 8544c2f

File tree

8 files changed

+243
-213
lines changed

8 files changed

+243
-213
lines changed

.github/workflows/kvrocks.yaml

+28-14
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- uses: actions/checkout@v3
35-
- uses: apache/skywalking-eyes/header@501a28d2fb4a9b962661987e50cf0219631b32ff
35+
- uses: apache/skywalking-eyes/header@v0.4.0
3636
with:
3737
config: tools/ci/licenserc.yml
3838

@@ -42,19 +42,20 @@ jobs:
4242
steps:
4343
- name: Checkout Code Base
4444
uses: actions/checkout@v3
45-
4645
- name: Install Check Tools
4746
run: |
48-
sudo pip install --upgrade pip
49-
sudo pip install --upgrade setuptools
5047
sudo apt update
5148
sudo apt install -y cppcheck
52-
sudo pip install cpplint==1.5.0
53-
49+
- name: Setup Python
50+
uses: actions/setup-python@v2
51+
with:
52+
python-version: 3.x
53+
- name: Setup dependencies
54+
run: pip install cpplint==1.5.0
5455
- name: Lint and check code
5556
run: |
56-
./cpplint.sh
57-
./cppcheck.sh
57+
./x.py check cpplint
58+
./x.py check cppcheck
5859
5960
build-and-test:
6061
name: Build and test
@@ -65,42 +66,50 @@ jobs:
6566
include:
6667
- name: Darwin Clang
6768
os: macos-latest
69+
compiler: auto
6870
- name: Darwin Clang without Jemalloc
6971
os: macos-latest
72+
compiler: auto
7073
without_jemalloc: -DDISABLE_JEMALLOC=ON
7174
- name: Ubuntu GCC
7275
os: ubuntu-18.04
76+
compiler: gcc
7377
- name: Ubuntu Clang
7478
os: ubuntu-18.04
75-
clang: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
79+
compiler: clang
7680
- name: Ubuntu GCC ASan
7781
os: ubuntu-18.04
7882
with_sanitizer: -DENABLE_ASAN=ON
83+
compiler: gcc
7984
# - name: Ubuntu GCC TSan
8085
# os: ubuntu-18.04
8186
# with_sanitizer: -DENABLE_TSAN=ON
87+
# compiler: gcc
8288
- name: Ubuntu GCC without Jemalloc
8389
os: ubuntu-18.04
8490
without_jemalloc: -DDISABLE_JEMALLOC=ON
91+
compiler: gcc
8592
- name: Ubuntu Clang ASan
8693
os: ubuntu-18.04
8794
with_sanitizer: -DENABLE_ASAN=ON
88-
clang: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
95+
compiler: clang
8996
# - name: Ubuntu Clang TSan
9097
# os: ubuntu-18.04
9198
# with_sanitizer: -DENABLE_TSAN=ON
92-
# clang: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
99+
# compiler: clang
93100
- name: Ubuntu Clang without Jemalloc
94101
os: ubuntu-18.04
95102
without_jemalloc: -DDISABLE_JEMALLOC=ON
96-
clang: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
103+
compiler: clang
97104
- name: Ubuntu GCC Ninja
98105
os: ubuntu-18.04
99106
with_ninja: --ninja
107+
compiler: gcc
100108
- name: Ubuntu GCC Ninja without Jemalloc
101109
os: ubuntu-18.04
102110
with_ninja: --ninja
103111
without_jemalloc: -DDISABLE_JEMALLOC=ON
112+
compiler: gcc
104113

105114
runs-on: ${{ matrix.os }}
106115
steps:
@@ -117,7 +126,7 @@ jobs:
117126
run: |
118127
brew install cmake gcc autoconf automake libtool
119128
echo "NPROC=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
120-
129+
121130
- name: Setup Linux
122131
if: ${{ startsWith(matrix.os, 'ubuntu') }}
123132
run: |
@@ -136,8 +145,13 @@ jobs:
136145
- name: Checkout Code Base
137146
uses: actions/checkout@v3
138147

148+
- name: Setup Python
149+
uses: actions/setup-python@v2
150+
with:
151+
python-version: 3.x
152+
139153
- name: Build Kvrocks
140-
run: ./build.sh build -j$NPROC --unittest ${{ matrix.clang }} ${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} ${{ matrix.without_jemalloc }}
154+
run: ./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} ${{ matrix.without_jemalloc }}
141155

142156
- name: Run Unit Test
143157
run: ./build/unittest

.github/workflows/release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
4848
- name: Build
4949
run: |
50-
./build.sh build
50+
./x.py build
5151
cd build
5252
cp kvrocks release/bin/
5353
cp kvrocks2redis release/bin/
@@ -113,7 +113,7 @@ jobs:
113113
- name: Build
114114
run: |
115115
mkdir -p build/release
116-
./build.sh build
116+
./x.py build
117117
cd build
118118
mkdir -p release/bin release/conf
119119
cp kvrocks release/bin/

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ ENV TZ=Asia/Shanghai
2222
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
2323

2424
RUN apt update
25-
RUN apt install -y cmake make git autoconf libtool g++
25+
RUN apt install -y cmake make git autoconf libtool g++ python3
2626
WORKDIR /kvrocks
2727

2828
COPY . .
29-
RUN ./build.sh build
29+
RUN ./x.py build
3030

3131
FROM ubuntu:focal
3232

README.md

+36-36
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66

77
---
88

9-
- [Google Group](https://groups.google.com/g/kvrocks)
10-
- [Slack Channel](https://join.slack.com/t/kvrockscommunity/shared_invite/zt-p5928e3r-OUAK8SUgC8GOceGM6dAz6w)
9+
* [Google Group](https://groups.google.com/g/kvrocks)
10+
* [Slack Channel](https://join.slack.com/t/kvrockscommunity/shared_invite/zt-p5928e3r-OUAK8SUgC8GOceGM6dAz6w)
1111

1212
**Apache Kvrocks(Incubating)** is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol. Kvrocks intends to decrease the cost of memory and increase the capacity while compared to Redis. The design of replication and storage was inspired by `rocksplicator` and `blackwidow`.
1313

1414
Kvrocks has the following key features:
1515

16-
- Redis protocol, user can use redis client to visit the kvrocks
17-
- Namespace, similar to redis db but use token per namespace
18-
- Replication, async replication using binlog like MySQL
19-
- High Available, supports redis sentinel to failover when master or slave was failed
20-
- Cluster mode, centralized management but compatible with Redis cluster client access
16+
* Redis protocol, user can use redis client to visit the kvrocks
17+
* Namespace, similar to redis db but use token per namespace
18+
* Replication, async replication using binlog like MySQL
19+
* High Available, supports redis sentinel to failover when master or slave was failed
20+
* Cluster mode, centralized management but compatible with Redis cluster client access
2121

2222
> Thanks for designers @[田凌宇](https://github.com/tianlingyu1997) and @范世丽 contribute the kvrocks logo for us.
2323
@@ -41,35 +41,34 @@ Kvrocks has the following key features:
4141
</tr>
4242
</table>
4343

44-
***Tickets a pull reqeust to let us known that you're using kvrocks and add your logo to README***
44+
***Tickets a pull request to let us known that you're using kvrocks and add your logo to README***
4545

46-
## Building kvrocks
46+
## Build and Run kvrocks
4747

48-
#### requirements
49-
* g++ (required by c++11, version >= 4.8)
50-
* autoconf automake libtool cmake
51-
52-
#### Build
48+
### Prerequisite
5349

5450
```shell
55-
# Centos/Redhat
56-
sudo yum install -y epel-release && sudo yum install -y git gcc gcc-c++ make cmake autoconf automake libtool which
51+
# CentOS / RedHat
52+
sudo yum install -y epel-release
53+
sudo yum install -y git gcc gcc-c++ make cmake autoconf automake libtool which
5754

58-
# Ubuntu/Debian
55+
# Ubuntu / Debian
5956
sudo apt update
60-
sudo apt-get install gcc g++ make cmake autoconf automake libtool
57+
sudo apt install -y gcc g++ make cmake autoconf automake libtool
6158

6259
# macOS
6360
brew install autoconf automake libtool cmake
6461
```
6562

63+
### Build
64+
6665
It is as simple as:
6766

6867
```shell
6968
$ git clone https://github.com/apache/incubator-kvrocks.git
7069
$ cd incubator-kvrocks
71-
$ ./build.sh build # `./build.sh -h` to check more options;
72-
# especially, `./build.sh build --ghproxy` will fetch dependencies via ghproxy.com.
70+
$ ./x.py build # `./x.py build -h` to check more options;
71+
# especially, `./x.py build --ghproxy` will fetch dependencies via ghproxy.com.
7372
```
7473

7574
### Running kvrocks
@@ -111,7 +110,7 @@ $ ./unittest
111110

112111
## Namespace
113112

114-
namespace was used to isolate data between users. unlike all the redis databases can be visited by `requirepass`, we use one token per namespace. `requirepass` was regraded as admin token, only admin token allows to access the namespace command, as well as some commands like `config`, `slaveof`, `bgsave`, etc
113+
Namespace is used to isolate data between users. Unlike all the Redis databases can be visited by `requirepass`, we use one token per namespace. `requirepass` is regraded as admin token, and only admin token allows to access the namespace command, as well as some commands like `config`, `slaveof`, `bgsave`, etc..
115114

116115
```
117116
# add token
@@ -136,24 +135,25 @@ OK
136135

137136
## Cluster
138137

139-
Kvrocks implements a proxyless centralized cluster solution but its accessing method is completely compatible with the Redis cluster client. You can use Redis cluster SDKs to access the kvrocks cluster. More details, please see: [Kvrocks Cluster Introduction](https://github.com/apache/incubator-kvrocks/wiki/Kvrocks-Cluster-Introduction)
138+
Kvrocks implements a proxyless centralized cluster solution but its accessing method is completely compatible with the Redis cluster client. You can use Redis cluster SDKs to access the kvrocks cluster. More details, please see: [Kvrocks Cluster Introduction](https://kvrocks.apache.org/docs/Cluster/kvrocks-cluster-introduction)
140139

141-
## DOCs
140+
## Documents
142141

143-
* [supported commands](https://github.com/apache/incubator-kvrocks/wiki/Support-Commands)
144-
* [design complex kv on rocksdb](https://github.com/apache/incubator-kvrocks/blob/master/docs/metadata-design.md)
145-
* [replication design](https://github.com/apache/incubator-kvrocks/blob/master/docs/replication-design.md)
142+
Documents are hosted at the [official website](https://kvrocks.apache.org/docs/supported-commands).
146143

147-
For more informations, can see: [Kvrocks Wiki](https://github.com/apache/incubator-kvrocks/wiki)
144+
* [Supported Commands](https://kvrocks.apache.org/docs/supported-commands)
145+
* [Design Complex Structure on RocksDB](https://kvrocks.apache.org/docs/Design/design-structure-on-rocksdb)
146+
* [Replication Design](https://kvrocks.apache.org/docs/Design/replication)
148147

149148
## Tools
149+
150150
* Export the Kvrocks monitor metrics, please use [kvrocks_exporter](https://github.com/KvrocksLabs/kvrocks_exporter)
151-
* Migrate from redis to kvrocks, use [redis-migrate-tool](https://github.com/vipshop/redis-migrate-tool) which was developed by vipshop
151+
* Migrate from redis to kvrocks, use [redis-migrate-tool](https://github.com/vipshop/redis-migrate-tool) which was developed by @vipshop
152152
* Migrate from kvrocks to redis. use `kvrocks2redis` in build dir
153153

154154
## Performance
155155

156-
#### Hardware
156+
### Hardware
157157

158158
* CPU: 48 cores Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
159159
* Memory: 32 GiB
@@ -162,34 +162,34 @@ For more informations, can see: [Kvrocks Wiki](https://github.com/apache/incubat
162162

163163
> Benchmark Client: multi-thread redis-benchmark(unstable branch)
164164
165-
#### 1. Commands QPS
165+
### 1. Commands QPS
166166

167167
> kvrocks: workers = 16, benchmark: 8 threads/ 512 conns / 128 payload
168168
169169
latency: 99.9% < 10ms
170170

171-
![image](https://raw.githubusercontent.com/apache/incubator-kvrocks/master/docs/images/chart-commands.png)
171+
![image](docs/images/chart-commands.png)
172172

173-
#### 2. QPS on different payloads
173+
### 2. QPS on different payloads
174174

175175
> kvrocks: workers = 16, benchmark: 8 threads/ 512 conns
176176
177177
latency: 99.9% < 10ms
178178

179-
![image](https://raw.githubusercontent.com/apache/incubator-kvrocks/master/docs/images/chart-values.png)
179+
![image](docs/images/chart-values.png)
180180

181181
#### 3. QPS on different workers
182182

183183
> kvrocks: workers = 16, benchmark: 8 threads/ 512 conns / 128 payload
184184
185185
latency: 99.9% < 10ms
186186

187-
![image](https://raw.githubusercontent.com/apache/incubator-kvrocks/master/docs/images/chart-threads.png)
187+
![image](docs/images/chart-threads.png)
188188

189189
## License
190190

191-
Kvrocks is under the Apache License Version 2.0. See the LICENSE file for details.
191+
Kvrocks is under the Apache License Version 2.0. See the [LICENSE](LICENSE) file for details.
192192

193193
## WeChat Official Account (微信公众号)
194194

195-
<img src="docs/images/wechat_account.jpg" alt="WeChat offical account" />
195+
![WeChat official account](docs/images/wechat_account.jpg)

0 commit comments

Comments
 (0)