Skip to content

Commit 4e0165c

Browse files
committed
Update docs for the launcher
Signed-off-by: Jun Duan <jun.duan.phd@outlook.com>
1 parent 452fb60 commit 4e0165c

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

docs/launcher.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -577,24 +577,34 @@ You can set environment variables for each instance, useful for:
577577

578578
### Launcher Configuration
579579

580-
The launcher itself can be configured by modifying the `__main__` block:
580+
#### Command-Line Parameters
581581

582-
```python
583-
if __name__ == "__main__":
584-
import uvicorn
585-
586-
uvicorn.run(
587-
app,
588-
host="0.0.0.0", # Listen address
589-
port=8001, # Launcher API port
590-
log_level="info" # Logging level
591-
)
582+
```bash
583+
python launcher.py [OPTIONS]
592584
```
593585

594-
or passing the parameters on the command line:
586+
**Parameters:**
587+
- `--mock-gpus`: Enable mock GPU mode for CPU-only environments (local dev, CI/CD, Kind clusters). Creates mock GPUs (GPU-0, GPU-1, etc.) and bypasses nvidia-ml-py.
588+
- `--mock-gpu-count <int>`: Number of mock GPUs to create (default: 8). Only used with `--mock-gpus` when ConfigMap discovery is unavailable.
589+
- `--host <string>`: Bind address (default: `0.0.0.0`)
590+
- `--port <int>`: API port (default: `8001`)
591+
- `--log-level <string>`: Logging level - `critical`, `error`, `warning`, `info`, `debug` (default: `info`)
592+
593+
**Environment Variables:**
594+
- `NODE_NAME`: Kubernetes node name for ConfigMap-based GPU discovery (injected via Downward API). Required when using ConfigMap-based GPU discovery in mock mode.
595+
- `NAMESPACE`: Kubernetes namespace for ConfigMap lookup. Required when using ConfigMap-based GPU discovery in mock mode.
596+
597+
**Examples:**
595598

596599
```bash
597-
uvicorn --port 8001 --log-level info launcher:app
600+
# Local development (no GPUs)
601+
python launcher.py --mock-gpus --mock-gpu-count 2 --log-level debug
602+
603+
# Production (real GPUs, Kubernetes injects NODE_NAME)
604+
python launcher.py --port 8001 --log-level info
605+
606+
# Using uvicorn directly
607+
uvicorn launcher:app --host 0.0.0.0 --port 8001 --log-level info
598608
```
599609

600610
## Key Classes

0 commit comments

Comments
 (0)