Add remote debugging feature for sonic-mgmt container#18009
Merged
yejianquan merged 1 commit intosonic-net:masterfrom Apr 28, 2025
Merged
Add remote debugging feature for sonic-mgmt container#18009yejianquan merged 1 commit intosonic-net:masterfrom
yejianquan merged 1 commit intosonic-net:masterfrom
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
e773640 to
87dad21
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
11 tasks
87dad21 to
9e947a1
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
9e947a1 to
8c625a9
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
yejianquan
reviewed
Apr 23, 2025
yejianquan
reviewed
Apr 23, 2025
Signed-off-by: Austin Pham <[email protected]>
8c625a9 to
fd6ee2c
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
wangxin
pushed a commit
to sonic-net/sonic-buildimage
that referenced
this pull request
Apr 28, 2025
Why I did it This enable debugpy https://github.com/microsoft/debugpy as part of the dependency to support native debugging via vscode. The follow-up PR is sonic-net/sonic-mgmt#18009 to enable in sonic-mgmt container Work item tracking Microsoft ADO (number only): 32317137 How I did it Add debugpy as part of pip library How to verify it Verified on dev-vm: make -f Makefile.work BLDENV=bullseye SONIC_BUILD_JOBS=$(nproc) DEFAULT_CONTAINER_REGISTRY=publicmirror.azurecr.io ENABLE_DOCKER_BASE_PULL=y LEGACY_SONIC_MGMT_DOCKER=y target/docker-sonic-mgmt.gz docker load -i target/docker-sonic-mgmt.gz docker run -it --rm docker-sonic-mgmt:latest debugpy debugpy 1.8.14 See https://aka.ms/debugpy for documentation. Usage: debugpy --listen | --connect [<host>:]<port> [--wait-for-client] [--configure-<name> <value>]... [--log-to <path>] [--log-to-stderr] <filename> | -m <module> | -c <code> | --pid <pid> [<arg>]... Signed-off-by: Austin Pham <[email protected]>
opcoder0
pushed a commit
to opcoder0/sonic-mgmt
that referenced
this pull request
Dec 8, 2025
Description of PR Summary: This PR adds remote debugging functionality using https://github.com/microsoft/debugpy support with vs-code for sonic-mgmt container. This will need the follow PR to be mereged as well: feat: add debugpy dependency sonic-buildimage#22341 In summary, one can setup a remote debug container when provide option --enable-debug. For example: ./setup-containers.sh sonic-mgmt-user_master --enable-debug Which will automatically scan for available ports and establish a tunnel between docker and host for debugpy purpose. The user then can execute normal run_test command with --enable-debug added to the end to connect with their vscode client. For example: ./run_tests.sh -n vms-kvm-t0 -d vlab-01 -c bgp/test_bgp_fact.py -f vtestbed.yaml -i ../ansible/veos_vtb --enable-debug Fixes # (issue) 32317137 Approach What is the motivation for this PR? To provide a native-like debug experience, improve our development efficiency. How did you do it? Described above How did you verify/test it? Verified on dev server Signed-off-by: Austin Pham <[email protected]>
AharonMalkin
pushed a commit
to AharonMalkin/sonic-mgmt
that referenced
this pull request
Dec 16, 2025
Description of PR Summary: This PR adds remote debugging functionality using https://github.com/microsoft/debugpy support with vs-code for sonic-mgmt container. This will need the follow PR to be mereged as well: feat: add debugpy dependency sonic-buildimage#22341 In summary, one can setup a remote debug container when provide option --enable-debug. For example: ./setup-containers.sh sonic-mgmt-user_master --enable-debug Which will automatically scan for available ports and establish a tunnel between docker and host for debugpy purpose. The user then can execute normal run_test command with --enable-debug added to the end to connect with their vscode client. For example: ./run_tests.sh -n vms-kvm-t0 -d vlab-01 -c bgp/test_bgp_fact.py -f vtestbed.yaml -i ../ansible/veos_vtb --enable-debug Fixes # (issue) 32317137 Approach What is the motivation for this PR? To provide a native-like debug experience, improve our development efficiency. How did you do it? Described above How did you verify/test it? Verified on dev server Signed-off-by: Austin Pham <[email protected]> Signed-off-by: Aharon Malkin <[email protected]>
gshemesh2
pushed a commit
to gshemesh2/sonic-mgmt
that referenced
this pull request
Dec 21, 2025
Description of PR Summary: This PR adds remote debugging functionality using https://github.com/microsoft/debugpy support with vs-code for sonic-mgmt container. This will need the follow PR to be mereged as well: feat: add debugpy dependency sonic-buildimage#22341 In summary, one can setup a remote debug container when provide option --enable-debug. For example: ./setup-containers.sh sonic-mgmt-user_master --enable-debug Which will automatically scan for available ports and establish a tunnel between docker and host for debugpy purpose. The user then can execute normal run_test command with --enable-debug added to the end to connect with their vscode client. For example: ./run_tests.sh -n vms-kvm-t0 -d vlab-01 -c bgp/test_bgp_fact.py -f vtestbed.yaml -i ../ansible/veos_vtb --enable-debug Fixes # (issue) 32317137 Approach What is the motivation for this PR? To provide a native-like debug experience, improve our development efficiency. How did you do it? Described above How did you verify/test it? Verified on dev server Signed-off-by: Austin Pham <[email protected]> Signed-off-by: Guy Shemesh <[email protected]>
gshemesh2
pushed a commit
to gshemesh2/sonic-mgmt
that referenced
this pull request
Jan 26, 2026
Description of PR Summary: This PR adds remote debugging functionality using https://github.com/microsoft/debugpy support with vs-code for sonic-mgmt container. This will need the follow PR to be mereged as well: feat: add debugpy dependency sonic-buildimage#22341 In summary, one can setup a remote debug container when provide option --enable-debug. For example: ./setup-containers.sh sonic-mgmt-user_master --enable-debug Which will automatically scan for available ports and establish a tunnel between docker and host for debugpy purpose. The user then can execute normal run_test command with --enable-debug added to the end to connect with their vscode client. For example: ./run_tests.sh -n vms-kvm-t0 -d vlab-01 -c bgp/test_bgp_fact.py -f vtestbed.yaml -i ../ansible/veos_vtb --enable-debug Fixes # (issue) 32317137 Approach What is the motivation for this PR? To provide a native-like debug experience, improve our development efficiency. How did you do it? Described above How did you verify/test it? Verified on dev server Signed-off-by: Austin Pham <[email protected]> Signed-off-by: Guy Shemesh <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
This PR adds remote debugging functionality using https://github.com/microsoft/debugpy support with vs-code for sonic-mgmt container. This will need the follow PR to be mereged as well:
In summary, one can setup a remote debug container when provide option
--enable-debug. For example:Which will automatically scan for available ports and establish a tunnel between docker and host for debugpy purpose. The user then can execute normal run_test command with
--enable-debugadded to the end to connect with their vscode client. For example:Fixes # (issue) 32317137
Type of change
Back port request
Approach
What is the motivation for this PR?
To provide a native-like debug experience, improve our development efficiency.
How did you do it?
Described above
How did you verify/test it?
Verified on dev server
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation