poking around a little bit, and clearml.backend_interface.task.repo.scriptinfo.ScriptInfo._get_jupyter_notebook_filename()
returns None
Just ran the same notebook in a local Jupyter Lab session and it worked as I expected it might, saving a copy to Artifacts
. I'm thinking it's generically a kernel gateway issue, but I'm not sure if other platforms are using that yet
The odd thing is that you can access the notebook, but it returns zero kernels ..
and this
server_info['url'] = f"http://{server_info['hostname']}:{server_info['port']}/{server_info['base_url']}/"
the server_info
is
[{'base_url': '/jupyter/default/',
'hostname': '0.0.0.0',
'password': False,
'pid': 9,
'port': 8888,
'root_dir': '/home/sagemaker-user',
'secure': False,
'sock': '',
'token': '',
'url': '
',
'version': '1.23.2'}]
but the call to jupyter_server.serverapp.list_running_servers()
does return the server
print(requests.get(url='
print(requests.get(url='
right now I can't figure out how to get the session in order to get the notebook path
Yes, I'm running a notebook in Studio. Where should it be captured?
As another test I ran Jupyter Lab locally using the same custom Docker container that we're using for Sagemaker Studio, and it works great there, just like the native local Jupyter Lab. So it's seemingly not the image, but maybe something to do with how Studio runs it as a kernel.
seems like it's using None and that doesn't provide the normal api/sessions
endpoint - or, it does, but returns an empty list
it does return kernels, just not sessions
This is strange, let me see if we can get around it, because I'm sure it worked 🙂
I think it just ends up in /home/sagemaker-user/{notebook}.ipynb
every time
which I looked at previously to see if I could import sagemaker.kg or kernelgateway or something, but no luck
Hmm what do you have here?
os.system("cat /var/log/studio/kernel_gateway.log")
if there are any tests/debugging you'd like me to try, just let me know
at least in 2018 it returned sessions! None
weird that it won't return that single session
lots of things like {"__timestamp__": "2023-02-23T23:49:23.285946Z", "__schema__": "sagemaker.kg.request.schema", "__schema_version__": 1, "__metadata_version__": 1, "account_id": "", "duration": 0.0007679462432861328, "method": "GET", "uri": "/api/kernels/6ba227af-ff2c-4b20-89ac-86dcac95e2b2", "status": 200}
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" ?