forked from mimran1980/rusteron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.justfile
216 lines (194 loc) · 9.09 KB
/
.justfile
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# List all available tasks
list:
just --list
# Check formatting, linting, and compile
check:
cargo check
cargo fmt --all -- --check
cargo clippy --all-targets --all-features --all -- --deny warnings
cargo clippy -- --deny warnings
# Automatically format code and fix simple Clippy warnings
fix:
cargo fmt --all
cargo clippy --allow-dirty --allow-staged --fix
cd rusteron-docker-samples/rusteron-dummy-example && just fix
# Clean the project by removing the target directory
clean:
rm -rf rusteron-archive/target
rm -rf rusteron-client/target
rm -rf rusteron-media-driver/target
rm -rf rusteron-rb/target
rm -rf rusteron-docker-samples/target
rm -rf rusteron-docker-samples/rusteron-dummy-example/target
cd rusteron-archive/aeron && git submodule update --init --recursive --checkout && git reset --hard && git clean -fdx && cd -
cd rusteron-client/aeron && git submodule update --init --recursive --checkout && git reset --hard && git clean -fdx && cd -
cd rusteron-media-driver/aeron && git submodule update --init --recursive --checkout && git reset --hard && git clean -fdx && cd -
cd rusteron-rb/aeron && git submodule update --init --recursive --checkout && git reset --hard && git clean -fdx && cd -
cargo clean
# Build the project in debug mode
build:
COPY_BINDINGS=true cargo build --workspace --all-targets
# Build the project in release mode
release:
cargo build --workspace --all-targets --release
# Run the Aeron archive driver using Java
run-aeron-archive-driver:
cd ./rusteron-client/aeron; ./gradlew :aeron-all:build; cd -
cd ./rusteron-client/aeron; ./gradlew :aeron-agent:jar; cd -
java \
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED \
-javaagent:./rusteron-client/aeron/aeron-agent/build/libs/aeron-agent-1.47.0-SNAPSHOT.jar \
-cp ./rusteron-client/aeron/aeron-all/build/libs/aeron-all-1.47.0-SNAPSHOT.jar:./rusteron-client/aeron/aeron-archive/build/libs/aeron-archive-1.47.0-SNAPSHOT.jar \
-Daeron.dir=target/aeron \
-Daeron.archive.dir=target/aeron/archive \
-Daeron.event.log=all \
-Daeron.event.archive.log=all \
-Daeron.term.buffer.sparse.file=false \
-Daeron.pre.touch.mapped.memory=true \
-Daeron.threading.mode=DEDICATED \
-Daeron.sender.idle.strategy=noop \
-Daeron.receiver.idle.strategy=noop \
-Daeron.conductor.idle.strategy=spin \
-Dagrona.disable.bounds.checks=true \
-Daeron.dir.delete.on.start=true \
-Daeron.dir.delete.on.shutdown=true \
-Daeron.print.configuration=true \
-Daeron.archive.control.channel=aeron:udp?endpoint=localhost:8010 \
-Daeron.archive.replication.channel=aeron:udp?endpoint=localhost:0 \
-Daeron.archive.control.response.channel=aeron:udp?endpoint=localhost:0 \
io.aeron.archive.ArchivingMediaDriver
# Run the Aeron Media Driver using Java
run-aeron-media-driver-java:
cd ./rusteron-client/aeron; ./gradlew :aeron-all:build; cd -
java -cp ./rusteron-client/aeron/aeron-all/build/libs/aeron-all-*.jar \
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED \
-Daeron.dir=target/aeron \
-Daeron.term.buffer.sparse.file=false \
-Daeron.pre.touch.mapped.memory=true \
-Daeron.threading.mode=DEDICATED \
-Daeron.sender.idle.strategy=noop \
-Daeron.receiver.idle.strategy=noop \
-Daeron.conductor.idle.strategy=spin \
-Dagrona.disable.bounds.checks=true \
-Daeron.dir.delete.on.start=true \
-Daeron.dir.delete.on.shutdown=true \
-Daeron.print.configuration=true \
io.aeron.driver.MediaDriver
# Run the Aeron Media Driver using Rust
run-aeron-media-driver-rust:
AERON_DIR_DELETE_ON_START=true \
AERON_DIR_DELETE_ON_SHUTDOWN=true \
AERON_PRINT_CONFIGURATION=true \
AERON_THREADING_MODE=DEDICATED \
AERON_CONDUCTOR_IDLE_STRATEGY=spin \
AERON_SENDER_IDLE_STRATEGY=noop \
AERON_RECEIVER_IDLE_STRATEGY=noop \
AERON_DIR=target/aeron \
AERON_TERM_BUFFER_SPARSE_FILE=false \
cargo run --release --package rusteron-media-driver --bin media_driver
benchmark-ipc-throughput-java:
cd ./rusteron-client/aeron; ./gradlew :aeron-all:build; cd -
cd ./rusteron-client/aeron; ./gradlew :aeron-samples:jar; cd -
java -cp ./rusteron-client/aeron/aeron-all/build/libs/aeron-all-1.47.0-SNAPSHOT.jar:./rusteron-client/aeron/aeron-samples/build/libs/aeron-samples-1.47.0-SNAPSHOT.jar \
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED \
-Daeron.dir=target/aeron \
-Daeron.term.buffer.sparse.file=false \
-Daeron.pre.touch.mapped.memory=true \
-Daeron.threading.mode=DEDICATED \
-Daeron.sender.idle.strategy=noop \
-Daeron.receiver.idle.strategy=noop \
-Daeron.conductor.idle.strategy=spin \
-Dagrona.disable.bounds.checks=true \
-Daeron.dir.delete.on.start=true \
-Daeron.dir.delete.on.shutdown=true \
-Daeron.print.configuration=true \
-Daeron.sample.messageLength=32 \
-Daeron.sample.idleStrategy=org.agrona.concurrent.NoOpIdleStrategy \
io.aeron.samples.EmbeddedExclusiveIpcThroughput
benchmark-ipc-throughput-rust:
AERON_DIR_DELETE_ON_START=true \
AERON_DIR_DELETE_ON_SHUTDOWN=true \
AERON_PRINT_CONFIGURATION=true \
AERON_THREADING_MODE=SHARED \
AERON_CONDUCTOR_IDLE_STRATEGY=spin \
AERON_SENDER_IDLE_STRATEGY=noop \
AERON_RECEIVER_IDLE_STRATEGY=noop \
AERON_DIR=target/aeron \
AERON_TERM_BUFFER_SPARSE_FILE=false \
AERON_DIR=target/aeron \
cargo run --release --package rusteron-client --example embedded_exclusive_ipc_throughput
benchmark-ipc-throughput-rust-profiler:
sudo AERON_DIR_DELETE_ON_START=true \
AERON_DIR_DELETE_ON_SHUTDOWN=true \
AERON_PRINT_CONFIGURATION=true \
AERON_THREADING_MODE=DEDICATED \
AERON_CONDUCTOR_IDLE_STRATEGY=spin \
AERON_SENDER_IDLE_STRATEGY=noop \
AERON_RECEIVER_IDLE_STRATEGY=noop \
AERON_DIR=target/aeron \
AERON_TERM_BUFFER_SPARSE_FILE=false \
LD_LIBRARY_PATH=target/release/build/rusteron-client-*/out/build/lib \
perf record -g ./target/release/examples/embedded_exclusive_ipc_throughput
sudo perf report
benchmark-embedded-ping-pong-java:
cd ./rusteron-client/aeron; ./gradlew :aeron-samples:jar; cd -
java -cp ./rusteron-client/aeron/aeron-all/build/libs/aeron-all-1.47.0-SNAPSHOT.jar:./rusteron-client/aeron/aeron-samples/build/libs/aeron-samples-1.47.0-SNAPSHOT.jar \
--add-opens java.base/jdk.internal.misc=ALL-UNNAMED \
-Daeron.dir=target/aeron \
-Daeron.term.buffer.sparse.file=false \
-Daeron.pre.touch.mapped.memory=true \
-Daeron.threading.mode=DEDICATED \
-Daeron.sender.idle.strategy=noop \
-Daeron.receiver.idle.strategy=noop \
-Daeron.conductor.idle.strategy=spin \
-Dagrona.disable.bounds.checks=true \
-Daeron.dir.delete.on.start=true \
-Daeron.dir.delete.on.shutdown=true \
-Daeron.print.configuration=true \
-Daeron.sample.messageLength=32 \
-Daeron.sample.idleStrategy=org.agrona.concurrent.NoOpIdleStrategy \
-Daeron.sample.exclusive.publications=false \
-Daeron.sample.ping.channel=aeron:udp?endpoint=localhost:20123 \
-Daeron.sample.pong.channel=aeron:udp?endpoint=localhost:20124 \
io.aeron.samples.EmbeddedPingPong
benchmark-embedded-ping-pong-rust:
AERON_DIR_DELETE_ON_START=true \
AERON_DIR_DELETE_ON_SHUTDOWN=true \
AERON_PRINT_CONFIGURATION=true \
AERON_THREADING_MODE=DEDICATED \
AERON_CONDUCTOR_IDLE_STRATEGY=spin \
AERON_SENDER_IDLE_STRATEGY=noop \
AERON_RECEIVER_IDLE_STRATEGY=noop \
AERON_DIR=target/aeron \
AERON_TERM_BUFFER_SPARSE_FILE=false \
cargo run --release --package rusteron-client --example embedded_ping_pong
benchmark-embedded-ping-pong-rust-profiler:
cargo build --features static --release --package rusteron-client --example embedded_ping_pong
codesign -s - -vvv --entitlements instruments.plist ./target/release/examples/embedded_ping_pong
AERON_DIR=target/aeron \
./target/release/examples/embedded_ping_pong
# runs criteron benchmarks
bench:
cargo bench
# generate rust docs locally
docs:
cargo clean --doc
cargo test --doc
cargo doc --workspace --no-deps --open
# run unit tests
test:
cargo test --all-targets --all-features -- --nocapture
# creates symbolic link so that taret/aeron goes to /dev/shm/aeron (when benchmarking on linux)
create-sym-link:
rm -rfv target/aeron
mkdir -p target/aeron
ls -l target/aeron
# e.g just aeron-archive-tool ./rusteron-archive/target/aeron/784454882946541/shm/archive describe/dump/errors
aeron-archive-tool dir action:
java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -cp ./rusteron-client/aeron/aeron-all/build/libs/aeron-all-*.jar io.aeron.archive.ArchiveTool {{dir}} {{action}}
# e.g just aeron-archive-tool ./rusteron-archive/target/aeron/784454882946541/shm
aeron-stat dir:
java --add-opens java.base/jdk.internal.misc=ALL-UNNAMED -cp ./rusteron-archive/aeron/aeron-all/build/libs/aeron-all-*.jar -Daeron.dir={{dir}} io.aeron.samples.AeronStat
build-docker-samples:
cd rusteron-docker-samples/rusteron-dummy-example && cargo build --release && cd ..
cd rusteron-docker-samples && just build