mknet/prepare.py

42 lines
1 KiB
Python
Raw Normal View History

2022-09-16 13:43:58 +00:00
#!/usr/bin/env python3
from pathlib import Path
from scenarios.fragments import shared
import os, venv
me = Path(os.path.dirname(__file__))
print("--- git submodule ---")
shared.exec("git submodule update --init")
print("--- compile go benchmarks ---")
os.chdir(me / "benchmarks" / "warp")
shared.exec("go build")
os.chdir(me / "benchmarks" / "s3concurrent")
shared.exec("go build")
os.chdir(me / "benchmarks" / "s3lat")
shared.exec("go build")
2022-09-23 20:50:50 +00:00
os.chdir(me / "benchmarks" / "s3ttfb")
shared.exec("go build")
os.chdir(me / "benchmarks" / "s3billion")
shared.exec("go build")
2022-09-16 13:43:58 +00:00
os.chdir(me)
print("--- install python dependencies ---")
venv.create(".venv", with_pip=True)
shared.exec("""
source .venv/bin/activate
which python3
python3 -m pip install .
python3 -m pip install -r scenarios/requirements.txt
""")
2022-09-16 14:19:09 +00:00
print("--- download artifacts ---")
from scenarios.fragments import flavor
flavor.download()
2022-09-16 13:43:58 +00:00
2022-09-23 20:50:50 +00:00
print(f"""done! now, run:
2022-09-16 13:43:58 +00:00
> sudo -i
2022-09-23 20:50:50 +00:00
> cd {os.getcwd()}
2022-09-16 13:43:58 +00:00
> source ./.venv/bin/activate
> ./mknet scenario ./topo/with-vdsl.yml ./scenarios/garage-s3lat garage-v0.8
""")