2021-12-08 14:43:59 +00:00
|
|
|
# mknet
|
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
mknet is a tool to simulate various network topologies
|
|
|
|
locally thanks to network namespaces and traffic control (tc).
|
2021-12-08 14:43:59 +00:00
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
## Prepare your environment
|
2021-12-08 14:43:59 +00:00
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
Get the repository and its submodules:
|
2021-12-08 14:43:59 +00:00
|
|
|
|
|
|
|
```bash
|
2022-09-14 16:22:46 +00:00
|
|
|
git clone https://git.deuxfleurs.fr/Deuxfleurs/mknet.git
|
|
|
|
cd mknet
|
|
|
|
git submodule update --init
|
2021-12-08 14:43:59 +00:00
|
|
|
```
|
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
Compile benchmark tools:
|
2021-12-08 14:43:59 +00:00
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
```bash
|
|
|
|
( cd benchmarks/warp && go build )
|
|
|
|
( cd benchmarks/s3concurrent && go build )
|
|
|
|
( cd benchmarks/s3lat && go build )
|
|
|
|
```
|
2021-12-08 14:43:59 +00:00
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
Switch to root as it is required by our tool,
|
|
|
|
and setup your python environment.
|
2021-12-08 14:43:59 +00:00
|
|
|
|
|
|
|
```bash
|
2022-09-14 16:22:46 +00:00
|
|
|
sudo -i
|
|
|
|
pip3 install --user .
|
2022-09-15 14:53:21 +00:00
|
|
|
( cd scenarios && pip3 install --user -r requirements.txt )
|
2022-09-14 16:22:46 +00:00
|
|
|
```
|
2021-12-08 14:43:59 +00:00
|
|
|
|
2022-09-14 16:35:09 +00:00
|
|
|
Sometimes, it is required to add manually your local python lib folder to the environment:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
export PYTHONPATH=$PYTHONPATH:$HOME/.local/lib/python3.10/site-packages/
|
|
|
|
```
|
|
|
|
|
|
|
|
You can check that everything has been installed by running in a python REPL:
|
|
|
|
|
|
|
|
```
|
|
|
|
import garage_admin_sdk
|
|
|
|
```
|
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
## Run a test
|
2021-12-08 14:43:59 +00:00
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
(Not yet implemented)
|
|
|
|
|
|
|
|
```bash
|
2022-09-14 16:32:07 +00:00
|
|
|
./mknet scenario ./scenarios/garage-s3lat ./topo/single-dc.yml
|
2021-12-08 14:43:59 +00:00
|
|
|
```
|
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
## Manual usage
|
2021-12-08 14:43:59 +00:00
|
|
|
|
2022-09-14 16:22:46 +00:00
|
|
|
```bash
|
|
|
|
./mknet create ./topo/with-vdsl.yml
|
|
|
|
./mknet run-all ./scenarios/garage-manual
|
|
|
|
./mknet run dc1:dc1s1 /tmp/mknet-bin/garage* -c /tmp/mknet-store/garage/dc1/dc1s1/garage.toml status
|
|
|
|
./mknet run-all ./scenarios/clean
|
|
|
|
./mknet destroy
|
2021-12-08 14:43:59 +00:00
|
|
|
|