lablup / lablup/backend.ai

Create new mgr etcd CRUD CLI commands for new etcd config format

Open
#7,465 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Motivation

The new configuration system uses the prefix `/sorna/ai/backend/config/manager/` which is monitored by the config watcher for automatic reload. Users need modern CLI commands to easily manage configurations in this new format without having to remember the full key paths.

## Objective

Create modern CRUD CLI commands for managing etcd configurations using the new format introduced in version 25.8.

## Details

### New CLI Commands

1. `mgr etcd config get`
- Read configuration from new etcd paths
- Support for specific keys or entire sections
- Output in JSON/YAML format options
- Example: `./backend.ai mgr etcd config get redis`
1. `mgr etcd config set`
- Write configuration to new etcd paths
- Automatically use the new prefix
- Support both `snake_case` and `kebab-case` keys (normalize to `kebab-case`)
- Example: `./backend.ai mgr etcd config set redis/addr "127.0.0.1:6379"`
1. `mgr etcd config delete`
- Remove configuration from new etcd paths
- Confirmation prompt for safety
- Example: `./backend.ai mgr etcd config delete redis/addr`
1. `mgr etcd config list`
- List all configurations under the new prefix
- Tree view option for hierarchical display
- Filter by section/prefix
1. `mgr etcd config diff`
- Compare legacy vs new configurations
- Highlight discrepancies
- Help identify unmigrated settings

### Key Format Handling

- Accept both `snake_case` and `kebab-case` input
- Internally normalize to `kebab-case` as recommended
- Display in `kebab-case` format

## Impact

- Configurations saved via these commands will trigger automatic config reload
- Compatible with `modify_service_config` GraphQL mutation
- Provides intuitive interface for managing new-format configurations

JIRA Issue: BA-3470

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.