'Connect locally to Jupyter in Sagemaker

When I run %connect_info in Jupyterlab on Sagemaker I get session info. and

{"shell_port": ,
  "iopub_port": ,
  "stdin_port": ,
  "control_port": ,
  "hb_port": ,
  "ip": "",
  "key": "",
  "transport": "",
  "signature_scheme": "",
  "kernel_name": ""}

Paste the above JSON into a file, and connect with:
    $> jupyter <app> --existing <file>
or, if you are local, you can connect with just:
    $> jupyter <app> --existing kernel-052ed888-e682-4786-aa4c-cdb19c6145bf.json
or even just:
    $> jupyter <app> --existing
if this is the most recent Jupyter kernel you have started.

But when I run the Jupiter statement against the saved text file, it doesn't connect.

Sometimes, it would be convenient to connect my local VS code app to my notebooks instead of developing in the browser.

Any suggestions are appreciated.



Solution 1:[1]

the recommended way to build locally on SageMaker is using the SageMaker Python SDK. See an example here - https://aws.amazon.com/blogs/machine-learning/run-your-tensorflow-job-on-amazon-sagemaker-with-a-pycharm-ide/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 durga_sury