This document describes how to run the LMS service in normal or debug mode using the Devstack Makefile.
To run the LMS service in normal mode without debugpy:
make dev.up.lmsTo run the LMS service in debug mode with debugpy enabled:
make dev.debug.lms-
LMS Runner Script (
lms-run.sh)- A bash script that determines whether to run in normal or debug mode
- Checks the
DEVSTACK_DEBUGenvironment variable - If set to
debug: Installs and runs with debugpy on port 44568 - If set to
normal(default): Runs without debugpy
-
Docker Compose Configuration
- The LMS service command now calls
lms-run.shinstead of hardcoding debugpy - The
DEVSTACK_DEBUGenvironment variable is passed to the container - Port 44568 remains exposed in docker-compose.yml for debugpy
- The LMS service command now calls
-
Makefile Targets
dev.up.%: Standard targets for normal mode (unchanged)dev.debug.%: New targets that setDEVSTACK_DEBUG=debugbefore starting services- Examples:
make dev.up.lms- Start LMS normallymake dev.debug.lms- Start LMS with debugpymake dev.debug.lms+discovery- Start LMS with debugpy and discovery in normal mode
With the LMS running in debug mode, you can attach VS Code debugger:
- Ensure
make dev.debug.lmsis running - In VS Code, go to the Debug view (Ctrl+Shift+D)
- Select "LMS Debugpy" configuration
- Click the play button to attach the debugger
The debugger will wait for client attachment when configured with --wait-for-client flag.
To switch from one mode to another:
# Kill existing LMS container
docker-compose kill lms
# Start in the desired mode
make dev.up.lms # Normal
# or
make dev.debug.lms # Debug with debugpy- Debugpy port already in use: Ensure no other process is using port 44568
- Script permission issues: The
lms-run.shscript will be executed inside the container, so host permissions don't matter - Environment variable not passed: Verify using
docker-compose exec lms env | grep DEVSTACK_DEBUG
- The
DEVSTACK_DEBUGenvironment variable only affects LMS service - Other services (cms, lms-worker, etc.) are not affected by this flag
- For services other than LMS, standard
dev.upanddev.debugtargets still apply the environment variable, but it won't affect their behavior unless they also implement similar logic