Access a port on code editor space on Sagemaker

1

I am running a http server in terminal in code editor space created in new sagemaker studio but can't access the port. I have tried these options. https://xxx.us-east-1.sagemaker.aws/codeeditor/default/proxy/8000 https://xxx.us-east-1.sagemaker.aws/codeeditor/proxy/8000 How can I access a specific port?

vk
gefragt vor 4 Monaten287 Aufrufe
2 Antworten
0

adding as comment

vk
beantwortet vor 4 Monaten
-1

Hello,

I understand that you are trying to use the code editor space on the Sagemaker service and would like to deploy your code i.e. you want to access that on the http server and would like to gather more information on the same.

I would like to mention that I have tried replicating this issue. Firstly, I created an HTML file named ‘index.html’ inside which there is a Hello World statement, so I tried the URL given below, and I was successfully able to view the contents of the Html file.

$ https://<notebook-name>.notebook.us-east-2.sagemaker.aws/view/index.html

Furthermore, while using the server using the terminal inside the code editor, i.e., vs code, by executing the $ http-server command, we would be able to successfully launch the http-server on the port number displayed in the terminal window by using the http-server command. e.g.: ’https://xxxxx.notebook.us-east-2.sagemaker.aws/jupyter/default/proxy/8081’

Moreover, in case you encounter an error that states refusing to connect, Then it is likely that the security groups are not properly configured to allow for this feature to work according to the error, as it did not allow for 127.0.0.1 to connect (itself as its local).

I would like to kindly ask that you try this feature again, but with your security group temporarily allowing all traffic in and out of the security group to itself.

If you have any difficulty or if you still run into issues, please reach out to AWS Support [1] (Sagemaker) along with your issue or use case in detail, and we would be happy to assist you further.

References:


[1] Creating support cases and case management - https://docs.aws.amazon.com/awssupport/latest/user/case-management.html#creating-a-support-casehttps://docs.aws.amazon.com/awssupport/latest/user/case-management.html#creating-a-support-case

[2] https://aws.amazon.com/blogs/machine-learning/host-code-server-on-amazon-sagemaker/#:~:text=Option%20B%3A%20Host%20code%2Dserver%20on%20a%20SageMaker%20notebook%20instance

AWS
beantwortet vor 4 Monaten
  • Hi Shubharm, Thanks for the detailed answer. I think this answer is valid for studio classic and not the new sagemaker studio. Typical URL in new studio looks like this: https://<space>.studio.us-east-1.sagemaker.aws/codeeditor/default I added index.html file in /home/sagemaker-user directory and the link https://<space>.studio.us-east-1.sagemaker.aws/codeeditor/view/index.html throws an error - App [view] associated with space [xxxx] and userprofile [null] is not found or in unusable state. Please try again after making sure that the app is created and InService

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen