Skip to content

Commit e1006d1

Browse files
committed
[scripts] make the scripts more simple
1 parent a02aadf commit e1006d1

18 files changed

Lines changed: 100 additions & 64 deletions

.github/workflows/performance-tests-standalone.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ jobs:
6262
- name: Build native release
6363
if: steps.check.outputs.triggered == 'true'
6464
run: |
65-
bash ./scripts/ci/ci-native-release-build.sh
65+
bash ./scripts/build/build-release.sh
6666
6767
- name: Run Performance Tests with Standalone mode
6868
if: steps.check.outputs.triggered == 'true'
6969
run: |
70-
bash ./scripts/ci/ci-performance-tests-standalone.sh
70+
bash ./scripts/ci/ci-run-performance-tests-standalone.sh
7171

.github/workflows/stateless-tests-cluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020

2121
- name: Run Stateless Tests with Cluster mode
2222
run: |
23-
bash ./scripts/ci/ci-stateless-tests-cluster.sh
23+
bash ./scripts/ci/ci-run-stateless-tests-cluster.sh

.github/workflows/stateless-tests-standalone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020

2121
- name: Run Stateless Tests with Standalone mode
2222
run: |
23-
bash ./scripts/ci/ci-stateless-tests-standalone.sh
23+
bash ./scripts/ci/ci-run-stateless-tests-standalone.sh

Makefile

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
HUB ?= datafusedev
22
TAG ?= latest
3+
34
# Setup dev toolchain
45
setup:
56
bash ./scripts/setup/dev_setup.sh
67

7-
test:
8-
cargo test
9-
10-
bench:
11-
cargo bench
12-
138
run:
14-
RUST_BACKTRACE=full RUSTFLAGS="-C target-cpu=native" cargo run --bin=fuse-query --release
15-
16-
runquery:
17-
RUST_BACKTRACE=full RUSTFLAGS="-C target-cpu=native" cargo run --bin=fuse-query --release
18-
19-
runstore:
20-
RUST_BACKTRACE=full RUSTFLAGS="-C target-cpu=native" cargo run --bin=fuse-store --release
9+
bash ./scripts/deploy/fusequery-standalone.sh
2110

2211
build:
23-
RUSTFLAGS="-C target-cpu=native" cargo build --release
12+
bash ./scripts/build/build-native.sh
2413

2514
profile:
26-
RUSTFLAGS="-g" cargo flamegraph --bin=fuse-query
15+
bash ./scripts/ci/ci-run-profile.sh
16+
17+
unit-test:
18+
bash ./scripts/ci/ci-run-unit-tests.sh
19+
20+
stateless-test:
21+
bash ./scripts/build/build-debug.sh
22+
bash ./scripts/ci/ci-run-stateless-tests.sh
23+
24+
test: unit-test stateless-test
2725

2826
fmt:
2927
cargo fmt
@@ -42,4 +40,4 @@ runhelm:
4240
clean:
4341
cargo clean
4442

45-
.PHONY: setup test bench run runquery runstore runhelm build fmt lint docker coverage clean
43+
.PHONY: setup test bench run runhelm build fmt lint docker coverage clean

scripts/build/build-debug.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# Copyright 2020-2021 The Datafuse Authors.
3+
# SPDX-License-Identifier: Apache-2.0.
4+
5+
SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
6+
cd "$SCRIPT_PATH/../.." || exit
7+
8+
echo "Build(DEBUG) start..."
9+
cargo build --bin=fuse-query --bin=fuse-benchmark --bin=fuse-store
10+
echo "All done..."

scripts/build/build-native.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# Copyright 2020-2021 The Datafuse Authors.
3+
# SPDX-License-Identifier: Apache-2.0.
4+
5+
SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
6+
cd "$SCRIPT_PATH/../.." || exit
7+
8+
echo "Build(NATIVE) start..."
9+
RUSTFLAGS="-C target-cpu=native" cargo build --bin=fuse-query --bin=fuse-benchmark --bin=fuse-store --release
10+
echo "All done..."

scripts/build/build-release.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# Copyright 2020-2021 The Datafuse Authors.
3+
# SPDX-License-Identifier: Apache-2.0.
4+
5+
SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
6+
cd "$SCRIPT_PATH/../.." || exit
7+
8+
echo "Build(RELEASE) start..."
9+
cargo build --bin=fuse-query --bin=fuse-benchmark --bin=fuse-store --release
10+
echo "All done..."

scripts/ci/ci-native-release-build.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

scripts/ci/ci-performance-tests-standalone.sh renamed to scripts/ci/ci-run-performance-tests-standalone.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@
44

55
get_latest_tag() {
66
curl --silent "https://api.github.com/repos/$1/tags" | # Get latest release from GitHub api
7-
grep '"name":' | # Get tag line
7+
grep '"name":' | # Get tag line
88
sed -E 's/.*"([^"]+)".*/\1/' | grep 'v' | head -1
99
}
1010

11-
tag=`get_latest_tag "datafuselabs/datafuse"`
11+
tag=$(get_latest_tag "datafuselabs/datafuse")
1212

13-
14-
BASE_DIR=`pwd`
13+
BASE_DIR=$(pwd)
1514
echo "Starting standalone FuseQuery(release)"
1615
${BASE_DIR}/scripts/deploy/fusequery-standalone.sh release
1716

18-
SCRIPT_PATH="$( cd "$( dirname "$0" )" >/dev/null 2>&1 && pwd )"
17+
SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
1918
cd "$SCRIPT_PATH/../../tests/perfs" || exit
2019

2120
echo "Starting fuse perfs"
@@ -29,13 +28,12 @@ python3 -m pip install coscmd PyYAML
2928
## run perf for current
3029
python perfs.py --output "${d_pull}" --bin "${BASE_DIR}/target/release/fuse-benchmark" --host 127.0.0.1 --port 9001
3130

32-
3331
## run perf for latest release
34-
if [ ! -d "${d_release}" ];then
35-
mkdir -p "${d_release}"
36-
${BASE_DIR}/scripts/deploy/fusequery-standalone-from-release.sh "${tag}"
37-
python perfs.py --output "${d_release}" --bin "${BASE_DIR}/target/release/fuse-benchmark" --host 127.0.0.1 --port 9001
32+
if [ ! -d "${d_release}" ]; then
33+
mkdir -p "${d_release}"
34+
${BASE_DIR}/scripts/deploy/fusequery-standalone-from-release.sh "${tag}"
35+
python perfs.py --output "${d_release}" --bin "${BASE_DIR}/target/release/fuse-benchmark" --host 127.0.0.1 --port 9001
3836
fi
3937

4038
## run comparation scripts
41-
python compare.py -r "${d_release}" -p "${d_pull}"
39+
python compare.py -r "${d_release}" -p "${d_pull}"

scripts/ci/ci-run-profile.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# Copyright 2020-2021 The Datafuse Authors.
3+
# SPDX-License-Identifier: Apache-2.0.
4+
5+
SCRIPT_PATH="$(cd "$(dirname "$0")" >/dev/null 2>&1 && pwd)"
6+
cd "$SCRIPT_PATH/../../" || exit
7+
8+
echo "Starting profile"
9+
RUSTFLAGS="-g" cargo flamegraph --bin=fuse-query

0 commit comments

Comments
 (0)