You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-6Lines changed: 11 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -583,7 +583,9 @@ Follow the steps in the next section for the IDE configuration, to prepare the `
583
583
584
584
## <aname="remote-interpreter"></a>Remote code execution with PyCharm / VSCode over SSH
585
585
586
-
1. On the local machine, make sure that you installed the latest [AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and the [AWS Session Manager CLI plugin](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html). To do so, perform the automated installation with the [sm-local-configure](sagemaker_ssh_helper/sm-local-configure) script:
586
+
**1. Configure local machine**
587
+
588
+
On the local machine, make sure that you installed the latest [AWS CLI v2](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and the [AWS Session Manager CLI plugin](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html). To do so, perform the automated installation with the [sm-local-configure](sagemaker_ssh_helper/sm-local-configure) script:
587
589
588
590
```shell
589
591
# pip install sagemaker-ssh-helper
@@ -599,7 +601,9 @@ You might need restart the Terminal and the IDE for changes to take an effect.
599
601
600
602
Alternatively, use the trick with port forwarding - start the `sm-ssh` or `ssh` with `-L` option inside venv, and then use `localhost` as the host to connect to from IDE. This trick is used to make SSH Helper work on Windows, and it's described in [FAQ - Is Windows Supported?](FAQ.md#is-windows-supported).
601
603
602
-
2. Submit your code to SageMaker with SSH Helper as described in previous sections, e.g. as a [training job](#step-1-install-the-library).
604
+
**2. Start the remote resource**
605
+
606
+
Submit your code to SageMaker with SSH Helper as described in previous sections, e.g. as a [training job](#step-1-install-the-library). For SageMaker Studio, see the section [Local IDE integration with SageMaker Studio over SSH for PyCharm / VSCode](#studio)
603
607
604
608
Make sure you allow enough time for manually setting up the connection (do not set `connection_wait_time_seconds` to `0`, recommended minimum value is `600`, i.e. 10 minutes). Don't worry to set it to higher values, e.g. to 30 min, because you will be able to terminate the waiting loop once you connected.
605
609
@@ -655,7 +659,7 @@ There are few extension options that you might want to change for VS Code to wor
655
659
656
660
* You might also need to set "Remote.SSH: Use Local Server" to `false` and "Remote.SSH: Lockfiles In Tmp" to `true`, if you still have connection problems.
657
661
658
-
4. Connect to the instance and stop the waiting loop
662
+
**4. Connect to the instance and stop the waiting loop**
659
663
660
664
When you set `connection_wait_time_seconds` to non-zero value, SSH Helper will run a waiting loop inside your training script, until waiting time is passed, or you manually terminate the loop.
661
665
@@ -700,7 +704,7 @@ feature, which is also helpful in the scenario when you need to rerun your code
700
704
701
705
*Pro Tip:* You can debug your code line by line in this scenario. See [the tutorial in PyCharm documentation](https://www.jetbrains.com/help/pycharm/debugging-your-first-python-application.html#debug).
702
706
703
-
5. Run and debug your code
707
+
**5. Run and debug your code**
704
708
705
709
Now when you have your training script or a placeholder script running, you can run additional code on the remote host, debug it line by line and set breakpoints.
706
710
@@ -802,8 +806,9 @@ To see available apps and host fqdns to connect to, run the `list` command:
802
806
sm-ssh list studio.sagemaker
803
807
```
804
808
805
-
**See more details on how to configure the interpreter for the IDE in the [Remote code execution](#remote-interpreter) section,
806
-
step "3. Configure the remote interpreter in your IDE".**
809
+
The configuration is finished now.
810
+
811
+
**Now go to the [Remote code execution](#remote-interpreter) section, step "3. Configure the remote interpreter in your IDE"**
807
812
808
813
*Tip:* When you configure Python interpreter in PyCharm with SageMaker Studio, it's recommended to configure [the deployment path mapping](https://www.jetbrains.com/help/pycharm/creating-local-server-configuration.html#mapping) for you project to point into `/home/sagemaker-user/user-default-efs/project_name` instead of default `/tmp/pycharm_project_123`.
809
814
This is how you will be able to see your project in SageMaker Studio and PyCharm will automatically sync your local dir to the remote dir.
0 commit comments