Hmm what do you have here?
os.system("cat /var/log/studio/kernel_gateway.log")
if I instead change the request url to f"http://{server_info['hostname']}:{server_info['port']}/api/sessions" then it gets a 200 response... however , the response is an empty list
which I looked at previously to see if I could import sagemaker.kg or kernelgateway or something, but no luck
@<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)
but the only exception handler is for requests.exceptions.SSLError
This is very odd ... let me check something
but maybe that doesn't matter, actually - it might be one session per host I guess
nice! Just tested it on my end as well, looks like it works!
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
seems like it's using None and that doesn't provide the normal api/sessions endpoint - or, it does, but returns an empty list
and cat /var/log/studio/kernel_gateway.log | grep ipynb comes up empty
weird that it won't return that single session
So it's seemingly not the image, but maybe something to do with how Studio runs it as a kernel.
Yeah I think that for some reason it fails detecting this is actually jupyter noteboko (not really sure why), Thank you for double checking on the container !!
but one possible workaround is to try to figure out if it's running in a gateway and then find the only notebook running on that server
print(requests.get(url='
print(requests.get(url='
as best I can tell it'll only have one .ipynb in $HOME with this setup, which may work...
but even then the sessions endpoint is still empty
Hmm and you are getting empty list for thi one:
server_info['url'] = f"http://{server_info['hostname']}:{server_info['port']}/"
and this
server_info['url'] = f"http://{server_info['hostname']}:{server_info['port']}/{server_info['base_url']}/"
Yes, I'm running a notebook in Studio. Where should it be captured?




