Allow to retrieve the jupyter filename programmatically [fix support for ClearML]
See original GitHub issueHi, I’m Martin one of the maintainers of clearml (open-source solution for: MLOps + experiment management => CI/CD for ML)
One of the things ClearML does, it analyzes the code in runtime (i.e. when working on jupyter notebook, or running any python code), picking up the git repo, versioning the jupyter notebook, storing the results on the clearml-server
etc.
Specifically with jupyter notebooks, it periodically stores the jupyter notebook on the back-end server, creating transparent versioning, as well as allowing users to later run the jupyter as python code on remote machines (it also auto detects dependencies via code analysis, and support remote containers).
With the recent changes in VSCode
and VSCode-jupyter
, it seems that jupyter server is no longer executed, and the plugin actually communicates directly with ipykernel.
Is that correct ?
The way ClearML
does all the magic on the jupyter notebook, is its ability to actually access the file itself, without the jupyter-server we currently cannot find a way to retrieve the active jupyter file name.
To add a bit more details, imagine a function running inside one of the jupyter notebook cells, trying to get the file name of the jupyter notebook. This is basically our current challenge.
I played a bit trying to run JavaScript from the cell itself, then picking up the filename from the frontend, but ran into problems communicating back to python code, also I did not find a way to retrieve the value on client end (JavaScript) in the first place…
Any help will be appreciated 😄
Issue Analytics
- State:
- Created 2 years ago
- Comments:24 (24 by maintainers)
Top GitHub Comments
Thank you @rchiodo for the guidance, and for the quick merge, you guys are awesome 😍
I’d agree except we’ve been doing this for two years in the interactive window and nobody has complained about any failure related to it. And there are plenty of things that use
__file__
which this might get working for notebooks.