Prysma
Documentation / InfrastructureView source

Performance Dashboard Deployment

The dashboard uses Streamlit to present performance evolution graphs and execution history.

1. File Structure

On the server, the deployment folder ~/dashboard-prysma/ contains the elements flat:

~/dashboard-prysma/
├── Dockerfile
├── docker-compose.yml
├── dashboard/
│   ├── app.py
│   ├── style.css
│   └── dashboard_config.json
├── perf_framework/
├── prysma_perf.db
└── save_perf_results.py
  • dashboard/app.py: Streamlit entry point, contains all the interface logic.
  • dashboard/style.css: Custom stylesheet for the dark theme.
  • dashboard/dashboard_config.json: Configuration of regression thresholds and Discord notifications.
  • Dockerfile: Python 3.12 base image with Streamlit, pandas, plotly and sqlite3.
  • docker-compose.yml: Container orchestration. Mounts the current directory into /workspace to ensure real-time synchronization of the SQLite database and files.
  • perf_framework/: Python module containing the compilation, profiling, database and notification logic.
  • prysma_perf.db: Automatically generated SQLite database.

The source files (Dockerfile, docker-compose.yml) are located in docker/server/dashboard/ in the repository and must be copied to ~/dashboard-prysma/.

2. Threshold and Notification Configuration

The configuration file dashboard/dashboard_config.json defines the regression thresholds as well as the Discord channel access:

{
  "thresholds": {
    "instructions": 0.5,
    "cycles": 5.0,
    "CPI": 4.0,
    "l1_dcache_misses": 10.0,
    "l2_cache_misses": 10.0,
    "l3_cache_misses": 10.0,
    "ram_accesses": 10.0,
    "branch_misses": 5.0,
    "peak_rss": 5.0
  },
  "notifications": {
    "enabled": true,
    "discord_bot": {
      "bot_token": "YOUR_TOKEN_HERE",
      "channel_id": "YOUR_CHANNEL_HERE"
    }
  }
}

3. Service Launch

From the dashboard deployment folder on the server:

docker-compose up -d --build

The application is then accessible on port 8501 (e.g.: http://localhost:8501).

4. Container Management

  • Stop the service:
    docker-compose down
    
  • View the logs:
    docker-compose logs -f
    
  • Restart the service:
    docker-compose restart
    

5. Example of Test Results Import

To manually import performance data generated by the compiler into the dashboard database, run the following command from the ~/dashboard-prysma folder:

cd ~/dashboard-prysma
python3 save_perf_results.py ../prysma/prysma/perf_run_data.json

Example of successful output:

Importing results for commit: unknown
Database updated: $HOME/dashboard-prysma/prysma_perf.db
Successfully removed temporary results file: ../prysma/prysma/perf_run_data.json