Skip to content
Snippets Groups Projects
Commit 57277c04b2ac authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

scripts: add script to setup base dir for easy benchmarking

This is all too manual, but it will help bootstrap a user.
parent c9f9380fe665
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python3
import os
import subprocess
import click
import pathlib
POULPE_DIR = pathlib.Path(__file__).parent.parent.parent.parent
RESULT_DIR = "results"
BIN_ENV_DIR = "bin-envs"
DATA_ENV_DIR = "data-envs"
BENCHMARK_DIR = "benchmarks"
SUITE_DIR = "suites"
def install_poulpe():
click.secho("Installing poulpe (editable) into a new venv", fg="green")
install_venv = ["/usr/bin/env", "python3", "-m", "venv", ".venv"]
update_pip = [
str(pathlib.Path(".venv") / "bin" / "pip"),
"install",
"-U",
"pip",
]
install_poulpe = [
str(pathlib.Path(".venv") / "bin" / "pip"),
"install",
"-e",
str(POULPE_DIR),
]
commands = [install_venv, update_pip, install_poulpe]
for command in commands:
subprocess.run(command, check=True)
@click.command()
@click.argument("path", type=click.Path())
def setup_base_dir(path):
base_path = pathlib.Path(path)
click.secho("Creating folders", fg="green")
base_path.mkdir(parents=True)
base_path.joinpath(RESULT_DIR).mkdir()
base_path.joinpath(BIN_ENV_DIR).mkdir()
base_path.joinpath(DATA_ENV_DIR).mkdir()
install_poulpe()
click.secho(
"Create symlinks to development Poulpe for suites",
fg="green",
)
source = (POULPE_DIR / SUITE_DIR).resolve()
old_dir = os.curdir
os.chdir(base_path)
try:
os.symlink(source, SUITE_DIR)
finally:
os.chdir(old_dir)
# TODO HGPERFPATH
if __name__ == "__main__":
setup_base_dir()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment