SageMaker Studio - Code Editor - Refresh Connection without losing changes

0

How can we prevent SageMaker Studio's code editor from losing connection when the browser disconnects (for example when a user locks its screen).

I have found that while hitting F5 / refreshing the browser tab seems to reset the connection and make the IDE responsive again it also resets kernels and loses unsaved changes.

질문됨 한 달 전106회 조회
5개 답변
0
수락된 답변

You can reconnect to the previous Jupyter session by following steps:

  1. Start "jupyter notebook" in the Terminal
  2. Copy the URL to your clipboard (e.g. http://localhost:8889/tree?token=1234abcd....)
  3. Open the notebook
  4. Choose "Select Kernel" > "Select Another Kernel ..." > "Existing Jupyter Server ..." > "Enter the URL of the running Juputer Server..." > "Python3 (ipykernel)"
  5. Paste the URL you copied at step 2
  6. Reload your browser, the notebook opens but kernel is not selected yet
  7. Choose "Select Kernel" > "Select Another Kernel ..." > "Existing Jupyter Server ..." > "Enter the URL of the running Juputer Server..."
  8. Choose existing Jupyter Session, instead of Jupyter Kernel.
  9. Confirm that you can resume running your notebook.

With default kernels (e.g. "Python 3.10.14"), you cannot reconnect to the previous session after reloading/closing notebooks.

AWS
답변함 21일 전
0

Thanks, Tomonori for your support.

To be more specific. This problems happens while using jupyter notebooks.

What I do:

  1. Open new jupyter notebook

  2. Start Python kernel and execute some cells. initialization

  3. Refresh the browser.

  4. Try to retake my kernel but it is lost retry-after-refresh

In EMR Studio there is a button to reconnect to kernel. Maybe this could work in SageMaker Studio as well.

답변함 22일 전
  • Thank you for clarifying the issue. I will add another answer.

0

Thanks again Tomonori.

I've tried this workaround and it works.

It would be great if you could make it work with default kernels as well. I think this workaround could be somewhat difficult/tedious to non-technical users.

답변함 20일 전
0

To avoid losing your files by reloading browser, you can use "Auto Save" setting.


Enter image description here

About losing connection, I was not able to reproduce the issue. What I tested:

  1. Open Code Editor on my browser.
  2. Open new terminal
  3. Run "watch date" command, to keep printing date and time.
  4. Close the browser tab
  5. Reopen the Code Editor from SageMaker Studio screen
  6. Open new terminal
  7. Confirm "watch" terminal exists already, and it is still keeping printing date and time.

Please let us know if you are seeing different behavior when you follow the above steps.

AWS
답변함 22일 전
0

Folks, this is related to a feature request that the VS Code Jupyter extension team is currently tracking in this issue. Please make sure you vote on it to get it prioritized.

profile pictureAWS
Eric
답변함 17일 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠