Skip to content

[Python] Use debugpy launch#1993

Merged
haniamr merged 7 commits intomasterfrom
hani/debugpy-launch
May 20, 2020
Merged

[Python] Use debugpy launch#1993
haniamr merged 7 commits intomasterfrom
hani/debugpy-launch

Conversation

@haniamr
Copy link
Contributor

@haniamr haniamr commented May 18, 2020

Here is how the flow of the launch request works:
(host) [VSCode] -> (host) [Debug Adapter] -> (host) [Custom launcher] -> (container) [Debugpy launcher] -> (container) [debugpy]

We added our own custom launcher which doesn't do much but pass the call to the real launcher in the container using a docker exec command.

When debugpy gets the request, it connects back to VSCode on the specified host:port. For Windows/Mac, we use host.docker.internal:{randomPort}, however this doesn't work for Linux. So we use the ip address from Docker's predefined network "bridge" and it works in all of the cases I tried (we might need to check with Docker so that we're not basing off wrong assumptions).

The rest of the changes get rid of the attach logic we have.

@haniamr haniamr added this to the 1.3.0 milestone May 18, 2020
@haniamr haniamr requested a review from a team as a code owner May 18, 2020 20:18
@bwateratmsft
Copy link
Collaborator

bwateratmsft commented May 18, 2020

Ahh, I love it:
image
Removing code feels like spring cleaning 😄

@haniamr
Copy link
Contributor Author

haniamr commented May 19, 2020

Ahh, I love it:
image
Removing code feels like spring cleaning 😄

Yeah, it was very relieving 😄

@rcjsuen
Copy link
Contributor

rcjsuen commented May 19, 2020

Ahh, I love it:
image
Removing code feels like spring cleaning 😄

Yeah, it was very relieving 😄

Deleted code is the best code.

Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com>
@haniamr haniamr merged commit 4e54f85 into master May 20, 2020
@haniamr haniamr deleted the hani/debugpy-launch branch May 20, 2020 18:52
@bwateratmsft bwateratmsft removed this from the 1.3.0 milestone May 21, 2020
Dmarch28 pushed a commit to Dmarch28/vscode-docker that referenced this pull request Mar 4, 2021
* Initial commit for debugpy launch instead of attach

* Comments in the launcher + moving some stuff around

* Use extraHosts + host.docker.internal in the custom launcher

* Condition the host name based on host OS

* Adding comments

* Clean volume mapping logic for python

* Update src/tasks/python/PythonExtensionHelper.ts

Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com>

Co-authored-by: Brandon Waterloo [MSFT] <36966225+bwateratmsft@users.noreply.github.com>
@microsoft microsoft locked and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to using debugpy for Python Python Container exits without logs in certain cases

4 participants