|
| 1 | +# Testing Depot GHA Detection |
| 2 | + |
| 3 | +This document outlines how to test the Depot GitHub Actions runner detection feature. |
| 4 | + |
| 5 | +## What We're Testing |
| 6 | + |
| 7 | +The CLI now detects when it's running on a Depot GitHub Actions runner and automatically requests private IP addresses for builder connections. This improves performance by using internal networking instead of public internet. |
| 8 | + |
| 9 | +## Detection Method |
| 10 | + |
| 11 | +The detection checks for the `agentd` binary in OS-specific locations: |
| 12 | + |
| 13 | +- **Linux**: `/usr/local/bin/agentd` |
| 14 | +- **macOS**: `/usr/local/bin/agentd` |
| 15 | +- **Windows**: |
| 16 | + - `C:\Program Files\Depot\agentd.exe` |
| 17 | + - `C:\ProgramData\Depot\agentd.exe` |
| 18 | + - `C:\usr\local\bin\agentd.exe` |
| 19 | + |
| 20 | +## Test Programs |
| 21 | + |
| 22 | +### 1. Standalone Detection Test |
| 23 | + |
| 24 | +```bash |
| 25 | +# Build the test program |
| 26 | +go build -o test-detection ./cmd/test-detection |
| 27 | + |
| 28 | +# Run with debug output |
| 29 | +DEPOT_DEBUG_DETECTION=1 ./test-detection |
| 30 | +``` |
| 31 | + |
| 32 | +### 2. Full CLI Test |
| 33 | + |
| 34 | +```bash |
| 35 | +# Build the CLI |
| 36 | +go build -o depot-test ./cmd/depot |
| 37 | + |
| 38 | +# Run any depot command with debug output |
| 39 | +DEPOT_DEBUG_DETECTION=1 ./depot-test build . |
| 40 | +``` |
| 41 | + |
| 42 | +## Expected Output |
| 43 | + |
| 44 | +### On Depot Runners |
| 45 | +``` |
| 46 | +[DEPOT DEBUG] Starting Depot GHA runner detection on linux/amd64 |
| 47 | +[DEPOT DEBUG] Checking for agentd at: /usr/local/bin/agentd |
| 48 | +[DEPOT DEBUG] Found agentd at /usr/local/bin/agentd - Depot runner DETECTED |
| 49 | +[DEPOT DEBUG] Requesting PRIVATE IP for builder connection |
| 50 | +``` |
| 51 | + |
| 52 | +### On Regular GitHub/Local Machines |
| 53 | +``` |
| 54 | +[DEPOT DEBUG] Starting Depot GHA runner detection on linux/amd64 |
| 55 | +[DEPOT DEBUG] Checking for agentd at: /usr/local/bin/agentd |
| 56 | +[DEPOT DEBUG] agentd not found at /usr/local/bin/agentd: stat /usr/local/bin/agentd: no such file or directory |
| 57 | +[DEPOT DEBUG] No agentd found - NOT a Depot runner |
| 58 | +[DEPOT DEBUG] Using default (PUBLIC) IP for builder connection |
| 59 | +``` |
| 60 | + |
| 61 | +## GitHub Actions Workflow |
| 62 | + |
| 63 | +A test workflow is available at `.github/workflows/test-depot-detection.yml` that: |
| 64 | +1. Tests on Depot runners (ubuntu, windows, macos) |
| 65 | +2. Tests on regular GitHub runners for comparison |
| 66 | +3. Shows debug output for verification |
| 67 | + |
| 68 | +## Manual Testing Commands |
| 69 | + |
| 70 | +### Windows (PowerShell) |
| 71 | +```powershell |
| 72 | +$env:DEPOT_DEBUG_DETECTION="1" |
| 73 | +.\depot-test.exe version |
| 74 | +
|
| 75 | +# Check for agentd manually |
| 76 | +Test-Path "C:\Program Files\Depot\agentd.exe" |
| 77 | +Test-Path "C:\ProgramData\Depot\agentd.exe" |
| 78 | +Test-Path "C:\usr\local\bin\agentd.exe" |
| 79 | +``` |
| 80 | + |
| 81 | +### Linux/macOS |
| 82 | +```bash |
| 83 | +export DEPOT_DEBUG_DETECTION=1 |
| 84 | +./depot-test version |
| 85 | + |
| 86 | +# Check for agentd manually |
| 87 | +ls -la /usr/local/bin/agentd |
| 88 | +``` |
| 89 | + |
| 90 | +## Verification Steps |
| 91 | + |
| 92 | +1. **Build the CLI** with the changes |
| 93 | +2. **Run on Depot runners** - Should detect and request private IPs |
| 94 | +3. **Run on GitHub runners** - Should NOT detect, use public IPs |
| 95 | +4. **Run locally** - Should NOT detect, use public IPs |
| 96 | +5. **Check debug output** matches expected patterns |
| 97 | + |
| 98 | +## Notes |
| 99 | + |
| 100 | +- The debug output is only shown when `DEPOT_DEBUG_DETECTION=1` is set |
| 101 | +- The detection happens during builder connection, not at CLI startup |
| 102 | +- Private IP requests only affect builder connections, not API calls |
0 commit comments