lablup / lablup/backend.ai

[Phase 3] Wire DevContext.configure() to pyinfra deploy scripts

Open
#10,749 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

## Summary

Extract fixture data generation (users, access keys, scaling groups, resource presets) into a shared module. Currently duplicated between context.py and pyinfra fixture templates.

## Current Duplication

- `context.py` lines 429-455 (`load_fixtures()`), 940-959 (`configure_appproxy_fixture()`)
- `pyinfra deploy/cores/manager/deploy_fixtures.py` lines 81-126
- `pyinfra templates/fixtures/users.json.j2` lines 102-192
- Both generate identical JSON structures with same variable substitution:
- Superadmin/user UUIDs, emails, passwords, access/secret keys
- Default domain, resource policies, scaling groups
- wsproxy_addr pointing to appproxy coordinator

## Approach

Create `config_gen/fixtures.py` with:

- `build_user_fixtures(superadmin_params, user_params) -> dict`
- `build_scaling_group_fixture(appproxy_addr, appproxy_secret) -> dict`
- `build_resource_presets() -> dict`
- Returns dicts that can be serialized to JSON

## Acceptance Criteria

- Single source of truth for fixture data structure
- Both context.py and pyinfra use shared functions
- Default user credentials from shared_defaults

JIRA Issue: BA-5572

Contributor guide

Open the contributing guide

Research direction

Compare context.py load_fixtures() and configure_appproxy_fixture() with pyinfra deploy/cores/manager/deploy_fixtures.py and pyinfra/templates/fixtures/users.json.j2. Start by tracing the duplicated fixture structures and shared_defaults usage, then verify that both context.py and pyinfra use the shared functions and produce the same JSON data with default credentials.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, devops
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.