Migrate pyinfra inventory system from backend.ai-installer to OSS repo
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
## Summary
Migrate the pyinfra inventory system (InventoryBuilder, group_data) from backend.ai-installer to the backend.ai OSS repository, enabling pyinfra deploy scripts to run independently.
## Background
Phase 1-3 of the installer integration are complete (framework, deploy scripts, TUI integration via PR #10275), but the **inventory system** that provides configuration data (`host.data`) to deploy scripts hasn't been migrated yet. Without it, the migrated deploy scripts cannot actually execute.
## Requirements
### Migrate from backend.ai-installer
- `inventory_base.py` (1848 lines) — InventoryBuilder class
- `group_data/all.py` — Global host.data defaults (bai_home_dir, python_version, etc.)
### Create new
- `DevInventoryBuilder` — Local dev inventory targeting `@local` with Docker Compose halfstack
- `shared_defaults.py` — Shared port/version constants between dev mode and pyinfra mode
- pyinfra CLI entry point (`inventory_local.py`)
### Enterprise handling
- Strip enterprise-only logic (license, control_panel, fasttrack)
- Keep schema-only stubs with `enabled=False`
## Implementation Steps
1. Migrate `group_data/all.py` as host.data defaults
1. Migrate `InventoryBuilder` with enterprise code removed, import paths updated
1. Create `DevInventoryBuilder` for local dev (halfstack integration)
1. Package structure + pyinfra entry point
1. Extract shared defaults (ports, versions) for dev mode reuse
1. Tests
## Acceptance Criteria
- `pyinfra inventory_local.py deploy/cores/appproxy/coordinator/deploy.py --dry` succeeds locally
- Deploy scripts can resolve all required `host.data` attributes
- Dev mode and pyinfra mode share port/version constants (no duplication)
## Related
- Parent: BA-1873 (Improve integrity of App Proxy)
- Depends on: PR #10275 (Phase 1 framework migration, merged)
- Related: BA-1982 (Traefik mode installation)
JIRA Issue: BA-5562
Contributor guide
Research direction
Start by reading inventory_base.py and group_data/all.py in the source repository, then inspect the existing deploy scripts and the pyinfra entry point described in the issue. Use `pyinfra inventory_local.py deploy/cores/appproxy/coordinator/deploy.py --dry` as the initial check. Done means the dry run succeeds, required host.data attributes resolve, shared port/version constants are reused, and tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- backend, devops, infrastructure
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100