-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (50 loc) · 2.33 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
# Help target
help:
@echo "Available targets:"
@echo ""
@echo " build Build the 'dgd' binary with the current settings."
@echo " build-babylond Build the 'babylond' binary from the submodules."
@echo " build-benchmark Build the benchmark environment, including 'babylond'."
@echo " start-benchmark-from-snapshot Start the benchmark environment from a snapshot."
@echo " stop-benchmark Stop the benchmark environment and clean up data."
@echo " run-dgd Run the 'dgd' binary to generate data."
@echo " help Display this help message."
@echo ""
@echo "Variables:"
@echo " BUILDDIR Directory where binaries are built (default: ./build)."
@echo " build_tags Build tags for Go builds."
@echo " build_args Additional build arguments."
@echo " VERSION Git version used for the build."
@echo " ldflags Linker flags for Go builds."
@echo ""
DOCKER := $(shell which docker)
GIT_TOPLEVEL := $(shell git rev-parse --show-toplevel)
BUILDDIR ?= $(CURDIR)/build
GO_BIN := ${GOPATH}/bin
build_tags := $(BUILD_TAGS)
build_args := $(BUILD_ARGS)
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
ldflags := $(LDFLAGS) -X github.com/babylonlabs-io/babylon-benchmark/lib/versioninfo.version=$(VERSION)
BUILD_TARGETS := build install
BUILD_FLAGS := --tags "$(build_tags)" --ldflags '$(ldflags)'
PACKAGES_E2E=$(shell go list ./... | grep '/e2e')
build-babylond:
$(MAKE) -C $(GIT_TOPLEVEL)/submodules/babylon/contrib/images babylond
build-benchmark: build-babylond
start-benchmark-from-snapshot: stop-benchmark build-benchmark
docker compose -f docker-compose.yml up -d
./scripts/run-profiler.sh
stop-benchmark:
docker compose -f docker-compose.yml down
rm -rf $(CURDIR)/babylond_data_master
rm -rf $(CURDIR)/babylond_data_follower
build: BUILD_ARGS := $(build_args) -o $(BUILDDIR)/dgd
$(BUILD_TARGETS): go.sum $(BUILDDIR)/
go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./cmd/datagen
$(BUILDDIR)/:
mkdir -p $(BUILDDIR)/
run-dgd: build
@./build/dgd generate --total-fps 5 --total-stakers 150
test-e2e:
go test -mod=readonly -failfast -timeout=15m -v $(PACKAGES_E2E) -count=1
.PHONY: build help