I am using SageMaker to test ML approaches. I would like to refactor my SageMaker scripts towards more production ready code. Thus I would like to use VS Code to refactor code and run code on SageMaker instance as before. VS Code Python lets you define:
Python: Specify Jupyter Server URI
SageMaker gives you AuthorizedUrl by running
aws sagemaker create-presigned-notebook-instance-url --notebook-instance-name your-instance-name
AuthorizedUrl works when I open it in incognito browser. Why it does not work with VS Code? VS Code asks password. I tried multiple approaches with no help:
- empty password since it is empty in SageMaker's jupyter_notebook_config.py
- token as password [1]
- I set a password "jupyter notebook password" and restarted jupyter "sudo initctl restart jupyter-server --no-wait". New password seemed to be effective. I gave newly created password to VS Code with same poor results.
VS Code gives me this error:
Failed to connect to remote Jupyter notebook. Check that the Jupyter Server URI setting has a valid running server specified... Error: Failed to connect to password protected server. Check that password is correct.
So how can I run codes in VS Code on SageMaker? Maybe there is better way than what I am trying?
Thanks
[1] https://jupyter-notebook.readthedocs.io/en/stable/security.html