Updated on 2024-08-14 GMT+08:00
Remotely Debugging in VS Code
Prerequisites
A notebook instance has been accessed through VS Code.
Step 1 Upload Local Code to the Cloud Development Environment
- On the VS Code page, choose File > Open Folder to access the cloud path.
Figure 1 Open Folder
- Select a path and click OK.
Figure 2 Selecting a file path
- In the displayed directory structure on the left of the IDE, drag the code and files you want to upload to the corresponding folders. Then, the code is uploaded to the cloud development environment.
Step 2 Debug Code Remotely
Open the code file to be debugged in VS Code. Before running the code, click the default Python version in the lower left part and select a version as required.
Figure 3 Selecting a Python version
- Click the execution button to run the code. The code output is shown on the TERMINAL tab page.
- If a training job takes a long time to execute, run the job at the backend through the nohup command. This prevents the disconnection of an SSH session or a network failure from affecting job execution. The following shows an example nohup command:
nohup your_train_job.sh > output.log 2>&1 & tail -f output.log
- To debug the code, perform the following operations:
- Choose on the left.
- Select the default Python code file.
- Click on the left of the code to set breakpoints.
- Debug the code according to the debug procedure which is displayed above the code, and the debug information is displayed on the left of the page.
Parent topic: Local IDE (VS Code)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot