-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
76 lines (60 loc) · 2.24 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
# load .env
ifneq (,$(wildcard ./.env))
include ./.env
export
endif
###############################################################################
.PHONY: launch # | Run with INFO logs in release mode
launch:
cargo run --release --bin dkn-compute
.PHONY: run # | Run with INFO logs
run:
cargo run --bin dkn-compute
.PHONY: monitor # | Run monitor node with INFO logs
monitor:
cargo run --bin dkn-monitor
.PHONY: debug # | Run with DEBUG logs with INFO log-level workflows
debug:
RUST_LOG=warn,dkn_compute=debug,dkn_workflows=debug,dkn_p2p=debug,ollama_workflows=info \
cargo run --bin dkn-compute
.PHONY: trace # | Run with TRACE logs
trace:
RUST_LOG=warn,dkn_compute=trace,libp2p=debug \
cargo run --bin dkn-compute
.PHONY: build # | Build
build:
cargo build --workspace
.PHONY: profile-cpu # | Profile CPU usage with flamegraph
profile-cpu:
DKN_EXIT_TIMEOUT=120 cargo flamegraph --root --profile=profiling --bin dkn-compute
.PHONY: profile-mem # | Profile memory usage with instruments
profile-mem:
DKN_EXIT_TIMEOUT=120 cargo instruments --profile=profiling -t Allocations --bin dkn-compute
.PHONY: ollama-versions
ollama-versions:
@cat Cargo.lock | grep "https://github.com/andthattoo/ollama-workflows"
@cat Cargo.lock | grep "https://github.com/andthattoo/ollama-rs"
.PHONY: test # | Run tests
test:
cargo test --workspace
###############################################################################
.PHONY: lint # | Run linter (clippy)
lint:
cargo clippy --workspace
.PHONY: format # | Run formatter (cargo fmt)
format:
cargo fmt -v
.PHONY: version # | Print version
version:
@cargo pkgid | cut -d@ -f2
.PHONY: docs # | Generate & open documentation
docs:
cargo doc --open --no-deps --document-private-items
.PHONY: env # | Print active environment
env:
@echo "Wallet Secret: ${DKN_WALLET_SECRET_KEY}"
@echo "Admin Public: ${DKN_ADMIN_PUBLIC_KEY}"
# https://stackoverflow.com/a/45843594
.PHONY: help # | List targets
help:
@grep '^.PHONY: .* #' Makefile | sed 's/\.PHONY: \(.*\) # \(.*\)/\1 \2/' | expand -t20