Skip to content

Commit a94de23

Browse files
fix(account_manager): expose --debug/--config/--log-level on start-server (#11176)
Co-authored-by: octodog <mu001@lablup.com>
1 parent 9200a6c commit a94de23

3 files changed

Lines changed: 42 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Start each component in separate terminals:
9797

9898
**Account Manager** (Terminal 5, optional for SSO and unified user profile):
9999
```bash
100-
./backend.ai am start-server
100+
./backend.ai am start-server --debug
101101
```
102102

103103
**App Proxy** (Terminal 6-7, optional for in-container service access):

changes/11176.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Expose `--config`, `--debug`, and `--log-level` options on the `account-manager start-server` CLI wrapper for consistency with other component start-server commands

src/ai/backend/account_manager/cli/start_server.py

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,59 @@
77

88
from __future__ import annotations
99

10+
from pathlib import Path
11+
1012
import click
1113

1214

1315
@click.command()
16+
@click.option(
17+
"-f",
18+
"--config-path",
19+
"--config",
20+
type=click.Path(exists=True, dir_okay=False, path_type=Path),
21+
default=None,
22+
help=(
23+
"The config file path. "
24+
"(default: ./account-manager.toml and /etc/backend.ai/account-manager.toml)"
25+
),
26+
)
27+
@click.option(
28+
"--debug",
29+
is_flag=True,
30+
help="A shortcut to set `--log-level=DEBUG`",
31+
)
32+
@click.option(
33+
"--log-level",
34+
type=click.Choice(
35+
["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", "TRACE", "NOTSET"],
36+
case_sensitive=False,
37+
),
38+
default="NOTSET",
39+
help="Set the logging verbosity level",
40+
)
1441
@click.pass_context
15-
def main(ctx: click.Context) -> None:
42+
def main(
43+
ctx: click.Context,
44+
config_path: Path | None,
45+
debug: bool,
46+
log_level: str,
47+
) -> None:
1648
"""
1749
Start the account-manager service as a foreground process.
1850
1951
This is a thin wrapper that defers the heavy import of server module.
2052
"""
2153
from ai.backend.common.metrics.multiprocess_setup import setup_prometheus_multiprocess_dir
54+
from ai.backend.logging import LogLevel
2255

2356
setup_prometheus_multiprocess_dir("account-manager")
2457

2558
from ai.backend.account_manager.server import main as server_main
2659

27-
ctx.invoke(server_main)
60+
ctx.invoke(
61+
server_main,
62+
config_path=config_path,
63+
debug=debug,
64+
log_level=LogLevel[log_level.upper()],
65+
)

0 commit comments

Comments
 (0)