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
+10-12Lines changed: 10 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,15 @@ 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. 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 (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.
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:
18
18
19
19
```shell
20
20
SAGEMAKER_ROLE_ARN=...
21
21
USER_ROLE_ARN=...
22
-
ACCOUNT_ID=
23
-
REGION=
22
+
ACCOUNT_ID=...
23
+
REGION=...
24
24
```
25
25
26
26
Note that if you connect to AWS from your local CLI as an IAM user, you will need to assume a `USER_ROLE_ARN` when connecting to SageMaker.
@@ -31,18 +31,19 @@ b. Execute the following commands (you can copy-paste them as a whole script):
AWS_REGION="$REGION" cdk -a "$APP" deploy SSM-Advanced-Tier-Stack
46
+
AWS_REGION="$REGION" cdk -a "$SSM_APP" deploy SSM-Advanced-Tier-Stack
46
47
```
47
48
48
49
In the above code we define local variable `APP` to execute CDK apps, and export `AWS_REGION` environment variable upon execution that is set to `REGION` local variable defined earlier.
@@ -52,16 +53,13 @@ Local variables `SAGEMAKER_ROLE_ARN` and `USER_ROLE_ARN` are passed as parameter
52
53
c. To enable SageMaker SSH Helper in additional AWS Regions, run these commands per region (adjust `REGION` variable each time):
Copy file name to clipboardExpand all lines: README.md
+14-8Lines changed: 14 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -90,6 +90,7 @@ 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
+
93
94
**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).
94
95
95
96
If you're working on Windows, see [FAQ](FAQ.md#is-windows-supported).
@@ -583,6 +584,7 @@ Follow the steps in the next section for the IDE configuration, to prepare the `
583
584
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:
584
585
585
586
```shell
587
+
# pip install sagemaker-ssh-helper
586
588
sm-local-configure
587
589
```
588
590
@@ -752,21 +754,25 @@ If everything is set up correctly, PyCharm will stop at your breakpoint, highlig
752
754
753
755
## <aname="studio"></a>Local IDE integration with SageMaker Studio over SSH for PyCharm / VSCode
> **Note**: This demo is recorded with a previous version of SSH Helper and may be not up-to-date with the recent features. Check the documentation for the most up-to-date steps.
For your local IDE integration with SageMaker Studio, follow the same steps as for configuring the IDE for [Remote code execution](#remote-interpreter), but instead of submitting the training / processing / inference code to SageMaker with Python SDK, execute the Jupyter notebook, as described in the next steps.
761
760
761
+
> **Important:** Make sure you read the "Getting started" section and didn't skip the steps from [Setting up your AWS account with IAM and SSM configuration](IAM_SSM_Setup.md).
762
+
763
+
762
764
1. Copy [SageMaker_SSH_IDE.ipynb](SageMaker_SSH_IDE.ipynb) into SageMaker Studio and run it.
763
765
764
766
Note that the `main` branch of this repo can contain changes that are not compatible with the version of `sagemaker-ssh-helper` that you installed from pip.
765
767
766
768
To be completely sure that you're using the version of the notebook that corresponds to the installed library, take a copy of the notebook from your filesystem after you install SSH Helper package, e.g.:
You can also check the version with `pip freeze | grep sagemaker-ssh-helper` and take the notebook from [the corresponding release tag](https://github.com/aws-samples/sagemaker-ssh-helper/tags).
@@ -780,7 +786,7 @@ You might want to change the `LOCAL_USER_ID` variable upon the first run, to pre
780
786
781
787
2. Configure remote interpreter in PyCharm / VS Code to connect to SageMaker Studio
782
788
783
-
Use `app_name.user_profile_name.domain_id.studio.sagemaker` or `app_name.studio.sagemaker` as the `fqdn` to connect.
789
+
Use `app_name.app_space_name.domain_id.studio.sagemaker` or `app_name.studio.sagemaker` as the `fqdn` to connect.
784
790
785
791
To see available apps to connect to, you may run the `list` command:
786
792
@@ -870,15 +876,15 @@ Instead of your local user ID put the SageMaker Studio user ID (you can get it b
870
876
3. On the System (!) terminal (not image terminal), run:
Alternatively, use SSH command to forward the VNC port and add more ports to the command, e.g., `-L localhost:8787:localhost:8787` to forward the Dask dashboard that is running inside the kernel gateway:
4. Navigate to `https://d-egm0dexample.studio.eu-west-1.sagemaker.aws/jupyter/default/proxy/6080/vnc.html?host=d-egm0dexample.studio.eu-west-1.sagemaker.aws&port=443&path=jupyter/default/proxy/6080/websockify`
0 commit comments