Skip to content

Conversation

Williangalvani
Copy link
Member

@Williangalvani Williangalvani commented Aug 5, 2025

You should see this when opening the Repo. install the extensions.
image
Ctrl+shift+p
type ssh and pick Connect to Host
image

Enter the pi's host and user

Screenshot 2025-08-05 at 12 13 36

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.
Screenshot 2025-08-05 at 12 14 22
Wait as the server gets downloaded
Screenshot 2025-08-05 at 12 15 13
Screenshot 2025-08-05 at 12 16 10
Switch to Dev containers once attached to the pi
Screenshot 2025-08-05 at 12 16 50
attach to the container
Screenshot 2025-08-05 at 12 17 27
Install python debugger extension on the container.
Screenshot 2025-08-05 at 12 20 02

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
image

and start debugging =]
Screenshot 2025-08-05 at 12 21 13

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

@Williangalvani Williangalvani added the docs-needed Change needs to be documented label Aug 5, 2025
Copy link

sourcery-ai bot commented Aug 5, 2025

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
  • Added project-wide VS Code extension recommendations
  • Added container-specific VS Code extension recommendations
  • Defined a Python remote attach launch profile
  • Configured Docker build to include the VS Code settings directory
.vscode/extensions.json
core/.vscode/extensions.json
core/.vscode/launch.json
core/Dockerfile

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on 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 issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on 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 dismiss on 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 review to 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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Williangalvani - I've reviewed your changes - here's some feedback:

  • Use VS Code's devcontainer.json in a .devcontainer folder (rather than copying .vscode in 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
Please address the comments from this code review:
## Overall Comments
- Use VS Code's devcontainer.json in a `.devcontainer` folder (rather than copying `.vscode` in 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.

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.

@Williangalvani
Copy link
Member Author

Hey @Williangalvani - I've reviewed your changes - here's some feedback:

  • Use VS Code's devcontainer.json in a .devcontainer folder (rather than copying .vscode in 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?

@Williangalvani Williangalvani force-pushed the python_debugging branch 2 times, most recently from 17a2c86 to cf3cdf1 Compare August 5, 2025 19:04
@Williangalvani Williangalvani marked this pull request as draft August 6, 2025 23:35
@nicoschmdt
Copy link
Contributor

LGTM, tested locally and it's working!

@Williangalvani Williangalvani marked this pull request as ready for review August 7, 2025 15:52
@Williangalvani
Copy link
Member Author

@ES-Alexander can you turn my half-assed instructions into something usable? Pleeeeease?

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
  • 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.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- 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.
- 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.

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.

@Williangalvani
Copy link
Member Author

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

@Williangalvani
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-needed Change needs to be documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants