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¶
The dev container mounts every path of .env at the same path, the dataset root read only. Set
AUTOWARE_ML_DATA_PATH there first, see Settings.
- 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.
segmentation3d/ptv3/nuscenes/voxel005_b16_50e_nuscenes_51m - Arguments: Type the extra arguments you want to pass to the command e.g.
datamodule.train_dataloader.batch_size=2 datamodule.validation_dataloader.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"