forked from databendlabs/databend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
136 lines (102 loc) · 3.84 KB
/
Makefile
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
HUB ?= datafuselabs
TAG ?= latest
PLATFORM ?= linux/amd64,linux/arm64
VERSION ?= latest
ADD_NODES ?= 0
NUM_CPUS ?= 2
TENANT_ID ?= "tenant"
CLUSTER_ID ?= "test"
CARGO_TARGET_DIR ?= $(CURDIR)/target
# Setup dev toolchain
setup:
bash ./scripts/setup/dev_setup.sh
fmt:
cargo fmt
lint:
cargo fmt
cargo clippy --workspace --all-targets -- -D warnings
# Cargo.toml file formatter(make setup to install)
taplo fmt
# Python file formatter(make setup to install)
yapf -ri tests/
# Bash file formatter(make setup to install)
shfmt -l -w scripts/*
lint-yaml:
yamllint -f auto .
check-license:
license-eye -v info -c .licenserc.yaml header check
miri:
cargo miri setup
MIRIFLAGS="-Zmiri-disable-isolation" cargo miri test
run: build-release
bash ./scripts/ci/deploy/databend-query-standalone.sh release
run-debug: build-debug
bash ./scripts/ci/deploy/databend-query-standalone.sh
run-debug-management: build-debug
bash ./scripts/ci/deploy/databend-query-management-mode.sh
build:
bash ./scripts/build/build-debug.sh
build-release:
bash ./scripts/build/build-release.sh
ifeq ($(shell uname),Linux) # Macs don't have objcopy
# Reduce binary size by compressing binaries.
objcopy --compress-debug-sections=zlib-gnu ${CARGO_TARGET_DIR}/release/databend-query
objcopy --compress-debug-sections=zlib-gnu ${CARGO_TARGET_DIR}/release/databend-meta
objcopy --compress-debug-sections=zlib-gnu ${CARGO_TARGET_DIR}/release/databend-metactl
endif
build-native:
bash ./scripts/build/build-native.sh
build-debug:
echo "Please use 'make build' instead"
cross-compile-debug:
cross build --target aarch64-unknown-linux-gnu
cross-compile-release:
RUSTFLAGS="-C link-arg=-Wl,--compress-debug-sections=zlib-gabi" cross build --target aarch64-unknown-linux-gnu --release
unit-test:
ulimit -n 10000;ulimit -s 16384; RUST_LOG="ERROR" bash ./scripts/ci/ci-run-unit-tests.sh
embedded-meta-test: build-debug
rm -rf ./_meta_embedded*
bash ./scripts/ci/ci-run-tests-embedded-meta.sh
stateless-test: build-debug
rm -rf ./_meta*/
rm -rf .databend
ulimit -n 10000;ulimit -s 16384; bash ./scripts/ci/ci-run-tests-embedded-meta.sh
sqllogic-test: build-debug
rm -rf ./_meta*/
ulimit -n 10000;ulimit -s 16384; bash ./scripts/ci/ci-run-sqllogic-tests.sh
stateless-cluster-test: build-debug
rm -rf ./_meta*/
bash ./scripts/ci/ci-run-stateless-tests-cluster.sh
stateless-cluster-test-tls: build-debug
rm -rf ./_meta*/
bash ./scripts/ci/ci-run-stateless-tests-cluster-tls.sh
metactl-test: build-debug
bash ./tests/metactl/test-metactl.sh
meta-bench: build-release
bash ./scripts/benchmark/run-meta-benchmark.sh 10 1000
test: unit-test stateless-test sqllogic-test metactl-test
docker:
docker build --network host -f docker/Dockerfile -t ${HUB}/databend-query:${TAG} .
k8s-docker:
bash ./scripts/build/build-k8s-runner.sh
# experiment feature: take a look at docker/README.md for detailed multi architecture image build support
dockerx:
docker buildx build . -f ./docker/Dockerfile --platform ${PLATFORM} --allow network.host --builder host -t ${HUB}/databend-query:${TAG} --build-arg VERSION=${VERSION} --push
build-tool:
bash ./scripts/build/build-tool-runner.sh
# generate common/functions/src/scalars/arithmetics/result_type.rs
run-codegen:
cargo run --manifest-path=common/codegen/Cargo.toml
# used for the build of dev container
dev-container:
cp ./rust-toolchain.toml ./docker/build-tool
docker build ./docker/build-tool -t ${HUB}/dev-container:${TAG} -f ./docker/build-tool/Dockerfile\
profile:
bash ./scripts/ci/ci-run-profile.sh
clean:
cargo clean
rm -f ./nohup.out ./tests/suites/0_stateless/*.stdout-e
rm -rf ./_meta*/ ./_logs*/ ./query/_logs*/ ./metasrv/_logs*/ ./stateless_test_data/
rm -rf ./common/base/_logs*/ ./common/meta/raft-store/_logs*/ ./common/meta/sled-store/_logs*/
rm -rf ./.databend ./query/.databend ./meta/.databend
.PHONY: setup test run build fmt lint docker clean