Monte Carlo Benchmarking Engine
High-performance SIMD Monte Carlo engine (AVX2/NEON) with custom memory allocators and perf logging.
 
Loading...
Searching...
No Matches
setup.py File Reference

CLI utility to initialize ClickHouse + Grafana for benchmark pipeline. More...

Go to the source code of this file.

Namespaces

namespace  scripts
 
namespace  scripts.setup
 

Functions

 scripts.setup.log (str msg)
 Prints an info message to stdout.
 
 scripts.setup.err (str msg)
 Prints an error message to stdout.
 
 scripts.setup.run_command (str cmd)
 Executes a shell command with logging.
 
Client scripts.setup.wait_for_clickhouse ()
 Waits for ClickHouse server to become ready, retries for up to 30 attempts.
 
 scripts.setup.setup_clickhouse (Client client)
 Creates the ClickHouse database and performance table if they don't exist.
 
 scripts.setup.load_db_to_clickhouse (Client client, Path db_path)
 Wipes previous data and loads data from a Parquet file into ClickHouse.
 
 scripts.setup.main ()
 CLI entrypoint.
 

Detailed Description

CLI utility to initialize ClickHouse + Grafana for benchmark pipeline.

This script handles the full setup flow for the benchmark environment:

  • Starts ClickHouse and Grafana via Docker Compose (optional)
  • Waits for ClickHouse to become ready
  • Creates database and table schema using schema_to_clickhouse.py
  • Loads benchmarking data from either:
    • A sample Parquet file (samples/db_sample.parquet)
    • A user-generated Parquet log (db/db.parquet)
Usage
python3 scripts.setup [--docker-compose] [--setup-clickhouse] [--load-from-sample | --load-from-db]
Options
  • --docker-compose — Start ClickHouse and Grafana with Docker Compose
  • --setup-clickhouse — Explicitly create the ClickHouse database and performance table
  • --load-from-sample — Load data from samples/db_sample.parquet (overwrites DB)
  • --load-from-db — Load data from existing db/db.parquet file
Notes
  • Configuration is loaded from .env via scripts/config.py
  • ClickHouse and Grafana must be available via Docker if --docker-compose is used
  • Requires clickhouse-driver, polars, and Docker CLI to be installed

Definition in file setup.py.