#!/bin/bash

# Define the environment name
VENV_NAME="env"

echo "--- Starting Python VENV setup on $(hostname) ---"

# 1. Update package list and ensure venv/pip are installed
sudo apt update
sudo apt install -y python3-venv python3-pip

# 2. Create the virtual environment
if [ ! -d "$VENV_NAME" ]; then
    echo "Creating virtual environment: $VENV_NAME"
    python3 -m venv $VENV_NAME
else
    echo "Virtual environment '$VENV_NAME' already exists."
fi

# 3. Activate the environment
source $VENV_NAME/bin/activate

# 4. Upgrade pip and install brainstem
echo "Upgrading pip and installing BrainStem SDK..."
pip install --upgrade pip
pip install brainstem

# 5. Optional: Install common networking tools for your iperf2 testing
# pip install numpy matplotlib  # if you plan on plotting results later

echo "--- Setup Complete ---"
echo "To start using the environment, run: source $VENV_NAME/bin/activate"
