- Ubuntu 20.04+ (Recommended) or any modern Linux distro.
- Docker installed and running (
sudo systemctl status docker).- Add your user to docker group:
sudo usermod -aG docker $USER.
- Add your user to docker group:
- Python 3.9+ installed (
python3 --version). - Git installed.
git clone <your-repo-url>
cd OS# It runs best in a virtual environment
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt(Note: If requirements.txt is missing, manually install: pip install fastapi uvicorn docker requests psutil)
This servers the UI and the API.
# In OS/ directory
source venv/bin/activate
python3 -m uvicorn src.dashboard_app:app --host 0.0.0.0 --port 8000- Open Browser to:
http://localhost:8000(or your server IP).
- Navigate to Simulation Lab in the browser.
- Click "Start Simulation".
- You should see 3 simulated containers (
web-server,db-service, etc.) appear.
This launches the real Docker container and the monitoring Agent.
# In OS/ directory
source venv/bin/activate
# Make script executable (first time only)
chmod +x run_ml_workload.sh
# Run it
./run_ml_workload.shExpected Output:
[1/3] Building Docker Image...
[2/3] Starting Container...
[3/3] Launching Agent...
SUCCESS! ML Project is running.
Agent PID: 12345
- Go to Statistics View.
- The graphs should automatically switch to show
os-ml-project. - Watch the 2-minute lifecycle:
- 0-10s: Low usage.
- 10-40s: Memory climb (Loading Data).
- 40-100s: CPU Spike (Training).
- 100s+: Cool down.
When finished:
# Terminate the workload and agent
./stop_ml_workload.shThen click "Stop" in the Simulation Lab UI.
- Permission Denied: Ensure you used
chmod +x *.sh. - Docker Errors: Ensure
sudo docker psworks. The scripts usesudoby default for Docker commands to be safe, but if you configured non-root access, you can edit the scripts to removesudo. - Port 8000 Busy: Change port in Step 2 (
--port 8001) and update the URL.