Add vscode launch file for remote debugging in the BlueOS container
You should see this when opening the Repo. install the extensions.
Ctrl+shift+p
type ssh and pick Connect to Host
Enter the pi's host and user
Accept key and input password as needed.
The arrow button connects this vscode instance to the remote. the window button opens it in a new instance.
Wait as the server gets downloaded
Switch to Dev containers once attached to the pi
attach to the container
Install python debugger extension on the container.
Open /home/pi as a workspace. That's where our service files live, and where the vscode debugger configuration is being saved.
Open any .py file, go to the debugger tab, use this task
and start debugging =]
Notes:
- The steps for installing the vscode server and debugging extension on the container will need to be done every time the container starts, as changes to the container are not permanent.
- Make sure you BACKUP YOUR CHANGES! As the container is effemeral, your changes will be lost as soon as it restarts.
Summary by Sourcery
New Features:
- Enable remote debugging in the BlueOS container via VS Code by adding a launch.json file and copying the .vscode directory into the container environment
Summary by Sourcery
Enable remote debugging of services in the BlueOS container by bundling VS Code launch settings and extension recommendations into the container image
New Features:
- Add VS Code launch configuration for remote Python debugging inside the BlueOS container
- Include recommended VS Code extensions in the container via extensions.json
Enhancements:
- Update core Dockerfile to copy the .vscode directory into the /home/pi workspace
Reviewer's guide (collapsed on small PRs)
Reviewer's Guide
Automate VS Code remote debugging setup by embedding VS Code configuration into the BlueOS container image, including recommended extensions and a Python attach launch profile.
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Add VS Code configuration for remote debugging |
|
.vscode/extensions.jsoncore/.vscode/extensions.jsoncore/.vscode/launch.jsoncore/Dockerfile |
Tips and commands
Interacting with Sourcery
-
Trigger a new review: Comment
@sourcery-ai reviewon the pull request. - Continue discussions: Reply directly to Sourcery's review comments.
-
Generate a GitHub issue from a review comment: Ask Sourcery to create an
issue from a review comment by replying to it. You can also reply to a
review comment with
@sourcery-ai issueto create an issue from it. -
Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. -
Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. -
Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. -
Resolve all Sourcery comments: Comment
@sourcery-ai resolveon the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore. -
Dismiss all Sourcery reviews: Comment
@sourcery-ai dismisson the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment@sourcery-ai reviewto trigger a new review!
Customizing Your Experience
Access your dashboard to:
- Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
- Change the review language.
- Add, remove or edit custom review instructions.
- Adjust other review settings.
Getting Help
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
Hey @Williangalvani - I've reviewed your changes - here's some feedback:
- Use VS Code's devcontainer.json in a
.devcontainerfolder (rather than copying.vscodein the Dockerfile) to configure remote debugging without baking IDE settings into the image.- If you do need to copy
.vscode, guard that step behind a build argument or separate dev-only stage so production images remain clean.Prompt for AI Agents Sourcery is free for open source - if you like our reviews please consider sharing them ✨ Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
while that makes sense in theory, how would it work when I'm developing inside a container inside a remote host?
LGTM, tested locally and it's working!
@ES-Alexander can you turn my half-assed instructions into something usable? Pleeeeease?
Hey @Williangalvani - I've reviewed your changes - here's some feedback:
- In the Dockerfile, chown the .vscode directory to the pi user (e.g. RUN chown -R pi:pi /home/pi/.vscode) to avoid permission issues when debugging.
This is tested and working as is.
- Rather than baking .vscode into the core image, consider using a devcontainer.json or docker-compose override for VS Code debugging to keep your production image clean.
it does look like devcontainer.json could be used here. I'll look into it
it does look like devcontainer.json could be used here. I'll look into it
Nope, it looks like it can't do what we need.