edgeeda-agent / EXECUTE_IN_DOCKER.md
SamChYe's picture
Publish EdgeEDA agent
aa677e3 verified
# Execute Tests and Plots in Docker
## Quick Command
Since Docker is running, execute this inside your container:
```bash
cd /workspace/edgeeda-agent
./run_all.sh
```
Or if you're on the host:
```bash
docker exec -it <CONTAINER_ID> bash -c "cd /workspace/edgeeda-agent && ./run_all.sh"
```
## What It Does
1. **Runs all agent tests** - Tests RandomSearch, SuccessiveHalving, and SurrogateUCB agents
2. **Generates comprehensive plots** - Creates visualization of your experiment data
## Expected Output
```
==========================================
EdgeEDA-Agent: Tests and Plots
==========================================
Step 1: Running Agent Tests...
----------------------------------------
Running agent tests...
βœ… RandomSearchAgent
βœ… SuccessiveHalvingAgent
βœ… SurrogateUCBAgent
βœ… Metrics Flattening
βœ… Metrics Coercion
==================================================
Results: 5/5 tests passed
βœ… All tests passed!
Step 2: Generating Plots...
----------------------------------------
Loading data from runs/experiment.sqlite...
Found 11 trials
Successful: 3
With rewards: 0
Saved CSV to runs/plots/trials.csv
Generating plots...
Generating additional analysis plots...
βœ“ Saved success_rate.png
βœ“ Saved runtime_distribution.png
βœ“ Saved return_code_distribution.png
βœ“ Saved knob_PLACE_DENSITY.png
βœ“ Saved knob_CORE_UTILIZATION.png
βœ… All plots generated in runs/plots
==========================================
Summary
==========================================
βœ… Tests: PASSED
βœ… Plots: Generated successfully
Generated files in runs/plots/:
- runs/plots/trials.csv (2.5K)
- runs/plots/success_rate.png (45K)
- runs/plots/runtime_distribution.png (38K)
- runs/plots/return_code_distribution.png (42K)
- runs/plots/knob_PLACE_DENSITY.png (35K)
- runs/plots/knob_CORE_UTILIZATION.png (36K)
==========================================
```
## Manual Execution
If you prefer to run steps separately:
### Tests Only:
```bash
python3 run_tests_simple.py
```
### Plots Only:
```bash
python3 generate_plots.py --db runs/experiment.sqlite --out runs/plots
```
## View Results
### Copy plots to host:
```bash
docker cp <CONTAINER_ID>:/workspace/edgeeda-agent/runs/plots ./runs/
```
### View in container:
```bash
# List generated files
ls -lh runs/plots/
# View CSV
head runs/plots/trials.csv
```
## Troubleshooting
**Issue**: "Permission denied" on run_all.sh
**Fix**: `chmod +x run_all.sh`
**Issue**: "No module named 'pandas'"
**Solution**: Make sure you're inside Docker container where dependencies are installed
**Issue**: "Database not found"
**Solution**: Check if experiments have been run: `ls -la runs/experiment.sqlite`