Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (57 loc) · 2.42 KB
/
Copy pathMakefile
File metadata and controls
76 lines (57 loc) · 2.42 KB
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
SHELL := /bin/bash
BIN := bin
PKG := ./...
KIND_CLUSTER ?= dfs
IMAGE ?= dfs:dev
.PHONY: build test test-race integration proto deps-up deps-down bench-throughput bench-failover \
docker kind-up kind-deploy kind-smoke kind-e2e kind-down k8s-render lint clean
build:
go build -o $(BIN)/ ./cmd/...
proto:
PATH=$$HOME/go/bin:$$PATH protoc -I proto --go_out=gen --go_opt=paths=source_relative \
--go-grpc_out=gen --go-grpc_opt=paths=source_relative proto/dfs/v1/dfs.proto
# Unit + integration tests against an in-process cluster (in-memory metastore,
# directory-backed S3 tier). No external services needed.
test:
go test -count=1 $(PKG)
test-race:
go test -race -count=1 $(PKG)
# Same tests, but against real Cassandra and MinIO (scripts/dev-deps.sh up).
integration: deps-up
eval "$$(scripts/dev-deps.sh env)" && go test -count=1 -v ./internal/metastore ./internal/blob ./test/integration
deps-up:
scripts/dev-deps.sh up
deps-down:
scripts/dev-deps.sh down
bench-throughput: build deps-up
eval "$$(scripts/dev-deps.sh env)" && $(BIN)/dfs-bench throughput --storage 50 --clients 32 --total 1536MiB --label 50nodes
bench-failover: build
$(BIN)/dfs-bench failover --trials 30 --timing fast --raft-store wal
$(BIN)/dfs-bench failover --trials 30 --timing fast --raft-store wal --mode freeze
docker:
docker build -t $(IMAGE) .
k8s-render:
kubectl kustomize deploy/k8s
kind-up:
kind create cluster --name $(KIND_CLUSTER) --config deploy/kind/cluster.yaml
kind-deploy: docker
kind load docker-image $(IMAGE) --name $(KIND_CLUSTER)
kubectl --context kind-$(KIND_CLUSTER) apply -k deploy/k8s
kubectl --context kind-$(KIND_CLUSTER) -n dfs rollout status statefulset/dfs-meta --timeout=300s
kubectl --context kind-$(KIND_CLUSTER) -n dfs rollout status statefulset/dfs-storage --timeout=300s
kind-smoke:
kubectl --context kind-$(KIND_CLUSTER) -n dfs delete job dfs-smoke --ignore-not-found
kubectl --context kind-$(KIND_CLUSTER) -n dfs apply -f deploy/k8s/smoke-job.yaml
kubectl --context kind-$(KIND_CLUSTER) -n dfs wait --for=condition=complete job/dfs-smoke --timeout=600s
kubectl --context kind-$(KIND_CLUSTER) -n dfs logs job/dfs-smoke
# Fresh 4-node kind cluster: deploy, smoke, scale to 50 storage pods,
# throughput Job, then force-delete a storage pod and the Raft leader pod.
kind-e2e:
scripts/kind-e2e.sh
kind-down:
kind delete cluster --name $(KIND_CLUSTER)
lint:
go vet $(PKG)
gofmt -l . | (! grep .)
clean:
rm -rf $(BIN)