Dev Containers¶
VS Code dev containers give you a fully configured development environment with just a few steps. This is the recommended setup for active development on Autoware-ML.
Prerequisites¶
- VS Code (code.visualstudio.com)
- Dev Containers extension (marketplace.visualstudio.com)
- Docker (docs.docker.com)
Note
You can install the prerequisites using the Automated Setup with Ansible in the Host Setup section of the Installation guide.
Opening the Dev Container¶
- Open VS Code
Ctrl+Shift+Pand selectDev Containers: Open Folder in Container- Select the
autoware-mlfolder and clickOpen
VS Code will build the container (first time only, ~5 minutes) and open the workspace in the container.
What's Included¶
The dev container comes with:
- Recommended extensions
- Debugging utilities
- clangd for C/C++
- cSpell for spell checking
In addition, VS Code settings includes:
- Debugging configurations
- Pre-commit hooks
On the first run, you may wait for a while to install the dependencies.
Debugging¶
Python Debugging¶
- Set breakpoints in your code
- Open the Run and Debug panel (
Ctrl+Shift+D) - Select "Python"
- Press
F5 - Fill in the input fields:
- Command: Pick available commands from the dropdown
- Config: Type the config name e.g.
calibration_status/resnet18_nuscenes - Arguments: Type the extra arguments you want to pass to the command e.g.
datamodule.train_dataloader_cfg.batch_size=2 datamodule.val_dataloader_cfg.batch_size=2
For custom commands, you can add a new launch configuration to .vscode/launch.json.
Tools¶
Pre-commit Hooks¶
Ctrl+Shift+Pand selectTasks: Run Task- Select "Pre-commit: Run"
- Select the pre-commit config to use from the dropdown
On the first run, you may wait for a while to initialize the environment.
CSpell¶
The actual unknown words for currently opened files are visible in the "Problems" panel (Ctrl+Shift+M).
To check for spelling errors in the entire workspace:
Ctrl+Shift+Pand selectTasks: Run Task- Select "CSpell: Check"