-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
152 lines (122 loc) · 3.72 KB
/
Taskfile.yml
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
version: '3'
dotenv: ['.env']
env:
GRAFANA_IDS: sim,sim-p0,sim-p1,sim-p2,ps-0,ps-1,ps-2
REPOS_PATH: data/go-libp2p-pubsub-repos
PUBSUB_REPO_URL: https://github.com/pancsta/go-libp2p-pubsub
tasks:
install-deps:
cmds:
- go mod tidy
- go install github.com/pancsta/asyncmachine-go/tools/cmd/am-dbg@latest
- pipx install grafanalib
###############
##### BENCH
###############
test-discovery-states:
cmds:
- pushd $REPOS_PATH/states;
go test -test.run "^\QTestSimpleDiscovery" -v *.go
test-discovery-origin:
cmds:
- pushd $REPOS_PATH/origin;
go test -test.run "^\QTestSimpleDiscovery" -v *.go
bench-pdf:
cmds:
- pandoc -f markdown-implicit_figures bench.md -o assets/bench.pdf
bench-all:
cmds:
- go run ./cmd/bench all
bench-gen-traces:
cmds:
- go run ./cmd/bench gen-traces origin,states
bench-gen-results:
cmds:
- go run ./cmd/bench gen-results origin,states
bench-gen-charts:
cmds:
- go run ./cmd/bench gen-charts origin,states
init-bench-repos:
desc: Initializes the benchmark environment, consider running clean-bench-repos first
cmds:
- task init-bench-repos-clone
- task init-bench-repos-setup
init-bench-repos-clone:
desc: Clones the go-libp2p-pubsub repos
cmds:
- |
# init
mkdir -p {{.REPOS_PATH}}
pushd {{.REPOS_PATH}}
# origin repo
git clone {{.PUBSUB_REPO_URL}} origin
pushd origin
git checkout psmon-origin
popd
# states repo
git clone {{.PUBSUB_REPO_URL}} states
pushd states
git checkout psmon-states
popd
popd
init-bench-repos-setup:
desc: Injects bench.env into the go-libp2p-pubsub repos
cmds:
- |
pushd {{.REPOS_PATH}}
ln -fn ../../bench.env origin/bench.env
ln -fn ../../bench.env states/bench.env
pushd origin
go mod tidy
popd
pushd states
go mod tidy
popd
inject-psmon:
desc: Updates psmon in the go-libp2p-pubsub repos
cmds:
- |
cp assets/pubsub_injects/* {{.REPOS_PATH}}/origin/
cp assets/pubsub_injects/* {{.REPOS_PATH}}/states
clean-bench-repos:
cmds:
- rm -rf {{.REPOS_PATH}}
###############
##### SIM
###############
start-sim:
desc: Starts the pubsub simulator using the sim.env file
cmds:
- go run ./cmd/sim
start-am-dbg:
desc: Starts the am-dbg tool for the pubsub simulator
cmds:
- am-dbg --clean-on-connect
start-env:
desc: Starts the docker environment (prometheus, grafana, pushgateway, jaeger)
cmds:
- docker-compose --file config/docker-compose.yml
--project-name go-libp2p-pubsub-benchmark
up -d
stop-env:
desc: Stops the docker environment (prometheus, grafana, pushgateway, jaeger)
cmds:
- docker-compose --file config/docker-compose.yml
--project-name go-libp2p-pubsub-benchmark
down
reset-env:
desc: Stops the docker environment (prometheus, grafana, pushgateway, jaeger)
cmds:
- docker-compose --file config/docker-compose.yml
--project-name go-libp2p-pubsub-benchmark
down -v
gen-grafana-dashboard:
desc: Generate a Grafana dashboard for the simulator and first 3 hosts
dir: scripts
cmds:
- generate-dashboard --output ../assets/sim-grafana.dashboard.json sim.dashboard.py
grafana-dashboard-list-panels:
desc: List panels and grid positions in a generated dashboard
cmds:
- |
jq '.. | objects | select(has("gridPos")) | {title: .title, gridPos: .gridPos}' assets/sim-grafana.dashboard.json