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: IAM_SSM_Setup.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ SageMaker SSH Helper relies on the AWS Systems Manager service to create SSH tun
12
12
13
13
### Automated setup with CDK and Cloud9
14
14
15
-
a. From AWS Console, pop up [CloudShell](https://aws.amazon.com/cloudshell/) environment (use the button located at the bottom left corner of the browser window). Alternatively, you can the commands run in your local terminal. In this case, make sure you've installed Node.js and CDK and fulfilled [all other CDK prerequisites](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_prerequisites). In both cases you need to have an admin role.
15
+
a. From AWS Console, pop up [CloudShell](https://aws.amazon.com/cloudshell/) environment. Alternatively, you can the commands run in your local terminal. In this case, make sure you've installed Node.js and CDK and fulfilled [all other CDK prerequisites](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_prerequisites). In both cases you need to have an admin role.
16
16
17
17
b. Define your SageMaker role, local user role, AWS account ID and AWS Region as variables by executing the following commands in the terminal line by line:
Copy file name to clipboardExpand all lines: README.md
+23-8
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,6 @@ Install the latest stable version of library from the [PyPI repository](https://
90
90
```shell
91
91
pip install sagemaker-ssh-helper
92
92
```
93
-
94
93
**Caution:** It's always recommended to install the library into a Python venv, not into the system env. If you want to use later the SSH plugins of your IDE that will use the system env and system Python, you should add the venv into the system PATH, as described in the section [Remote code execution with PyCharm / VSCode over SSH](#remote-interpreter).
95
94
96
95
If you're working on Windows, see [FAQ](FAQ.md#is-windows-supported).
Alternatively, instead of using `sm-ssh connect` command, you can use the native `ssh` command, but it will require you to update your [ssh config](https://linux.die.net/man/5/ssh_config), typically `~/.ssh/config`, with `sm-ssh start-proxy` command as follows:
A. Follow the [instructions in the PyCharm docs](https://www.jetbrains.com/help/pycharm/remote-debugging-with-product.html#remote-interpreter), to configure the remote interpreter in PyCharm.
617
625
618
-
In the field for host name, put the same value as for `fqdn` in the [`sm-ssh` command](#sm-ssh), e.g., `ssh-training-manual-2023-10-02-14-38-56-744.training.sagemaker`, and use `root` as the username.
626
+
In the field for host name, put the same value as for `fqdn` in the [`sm-ssh` command](#sm-ssh), e.g., `ssh-training-manual-2023-10-02-14-38-56-744.training.sagemaker`, and use `root` as the username.
627
+
For SageMaker Studio you might want to use `sagemaker-user` instead of `root`.
619
628
620
629

621
630
@@ -625,16 +634,16 @@ If PyCharm asks for the SSH key, point to the `~/.ssh/<fqdn>` private key file t
625
634
626
635
*Note:* If PyCharm says connection refused, it can be due to timeout. Check that you can connect to this host from your system terminal with `ssh` and `sm-ssh` and try configuring the remote interpreter again.
627
636
628
-
*Tip:* When you configure Python interpreter in PyCharm, 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 `/root/project_name` instead of default `/tmp/pycharm_project_123`. 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.
629
-
630
-
*Tip:* Also instead of creating a new venv, point the Python interpreter to the existing location.
637
+
*Tip:* Instead of creating a new venv, point the Python interpreter to the existing location.
631
638
You can find this location by running a cell with `import sys; sys.executable` command in a SageMaker Studio notebook. You will get something like `/opt/conda/bin/python`.
632
639
633
640
*Tip:* Now you also can [upload and download files from remote](https://www.jetbrains.com/help/pycharm/uploading-and-downloading-files.html) and [synchronize files with remote](https://www.jetbrains.com/help/pycharm/comparing-deployed-files-and-folders-with-their-local-versions.html).
634
641
635
642
B. Follow the [instructions for VSCode](https://code.visualstudio.com/docs/remote/ssh), to configure local Visual Studio Code app
636
643
637
-
Put the `root@fqdn` as the hostname to connect to, e.g., `root@ssh-training-example-2023-07-25-03-18-04-490.training.sagemaker` .
644
+
Put the `root@fqdn` as the hostname to connect to, e.g., `root@ssh-training-example-2023-07-25-03-18-04-490.training.sagemaker` .
645
+
For SageMaker Studio you might want to use `sagemaker-user` instead of `root`,
@@ -787,15 +796,21 @@ You might want to change the `LOCAL_USER_ID` variable upon the first run, to pre
787
796
2. Configure remote interpreter in PyCharm / VS Code to connect to SageMaker Studio
788
797
789
798
Use `app_name.app_space_name.domain_id.studio.sagemaker` or `app_name.studio.sagemaker` as the `fqdn` to connect.
799
+
Use `sagemaker-user` as user.
800
+
See more details on how to configure the interpreter for the IDE in the [Remote code execution](#remote-interpreter) section,
801
+
step "3. Configure the remote interpreter in your IDE".
790
802
791
803
To see available apps to connect to, you may run the `list` command:
792
804
793
805
```
794
806
sm-ssh list studio.sagemaker
795
807
```
808
+
*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
+
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.
796
810
797
811
*Note:* If you're using Windows, see [the FAQ](FAQ.md#is-windows-supported).
798
812
813
+
799
814
3. Using the remote Jupyter Notebook
800
815
801
816
In recent versions of PyCharm, Jupyter Notebook is tunnelled automatically through remote interpreter connection. You might need to add `--allow-root` argument to the command line, when your remote interpreter runs under root:
Copy file name to clipboardExpand all lines: SageMaker_SSH_IDE.ipynb
+4-17
Original file line number
Diff line number
Diff line change
@@ -66,16 +66,6 @@
66
66
"The next command will install the software for remote access, including SSH daemon and VNC server and XFCE4 desktop. If you don't want to run a VNC server or Jupyter notebook, pass the flag `--ssh-only` (comment the first line and uncomment the second)."
0 commit comments