Hi @<1532532498972545024:profile|LittleReindeer37>
Yes you are correct it should capture the entire jupyter notebook in sagemaker studio.
Just verifying this is the use case, correct ?
but the only exception handler is for requests.exceptions.SSLError
I additionally tried using a Sagemaker Notebook instance, to see if it was the kernel dockerization that Studio uses that was messing things up. But it seems to actually log less information from a Notebook instance vs Studio .
This is strange, let me see if we can get around it, because I'm sure it worked 🙂
nice! Just tested it on my end as well, looks like it works!
This is very odd ... let me check something
Yes, I'm running a notebook in Studio. Where should it be captured?
it does return kernels, just not sessions
Yep I think you are correct, you should have had the same output as a local jupyter notebook, and it seems that in sagemaker studio it is not working 😞
Let me check something
I think it just ends up in /home/sagemaker-user/{notebook}.ipynb
every time
and that requests.get()
throws an exception:
ConnectionError: HTTPConnectionPool(host='default', port=8888): Max retries exceeded with url: /jupyter/default/api/sessions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f7ba9cadc30>: Failed to establish a new connection: [Errno -2] Name or service not known'))
which I looked at previously to see if I could import sagemaker.kg or kernelgateway or something, but no luck
What do you have in "server_info['url']" ?
if there are any tests/debugging you'd like me to try, just let me know
@<1532532498972545024:profile|LittleReindeer37> nice!!! 😍
Do you want to PR? it will be relatively easy to merge and test, and I think that they might even push it to the next version (or worst case quick RC)
right now I can't figure out how to get the session in order to get the notebook path
you mean the code that fires "HTTPConnectionPool" ?
one possibility for getting the notebook filepath is finding and parsing /home/sagemaker-user/.jupyter/lab/workspaces/default-37a8.jupyterlab-workspace
I think, but I don't know if I can tie that to a specific session
yeah, even then it'll run but return 0 notebooks
Hmm and you are getting empty list for thi one:
server_info['url'] = f"http://{server_info['hostname']}:{server_info['port']}/"