Commit f4be903
refactor(benchmarks): extract library API from CLI (#21)
* refactor(benchmarks): extract library API from CLI for programmatic usage
Extract core VM management and pool lifecycle logic from cli.py into
importable modules (azure_vm.py, pool.py) with clean Python APIs.
- Add AzureVMManager class with Azure SDK primary path + az CLI fallback
- Add PoolManager class for pool create/wait/run/cleanup lifecycle
- Add configurable resource_group via Settings, env var, or --resource-group flag
- Support DefaultAzureCredential for enterprise SSO/service principals
- CLI handlers become thin wrappers delegating to library classes
- Add agent_factory parameter stub on PoolManager.run() for pluggable agents
All 327 tests pass, CLI surface unchanged.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* style: fix pre-existing ruff lint errors in pool_viewer and resource_tracker
Remove unused import `json` and unused variable `worker_re` in
pool_viewer.py, and unused import `Optional` in resource_tracker.py.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* style: run ruff formatter on benchmarks modules
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* fix(azure_vm): add SDK path for set_auto_shutdown via generic resource API
Auto-shutdown schedules are Microsoft.DevTestLab/schedules resources.
Use azure-mgmt-resource (already a dependency) to create them via the
generic resource client, with az CLI fallback if SDK fails.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent c1f4b98 commit f4be903
9 files changed
Lines changed: 2446 additions & 1090 deletions
File tree
- openadapt_ml
- benchmarks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
| |||
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
19 | 29 | | |
20 | 30 | | |
21 | 31 | | |
22 | 32 | | |
23 | 33 | | |
24 | 34 | | |
25 | 35 | | |
| 36 | + | |
| 37 | + | |
26 | 38 | | |
27 | 39 | | |
28 | 40 | | |
29 | 41 | | |
30 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
31 | 46 | | |
0 commit comments