question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow to retrieve the jupyter filename programmatically [fix support for ClearML]

See original GitHub issue

Hi, 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:closed
  • Created 2 years ago
  • Comments:24 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
bmartinncommented, Dec 14, 2021

Thank you @rchiodo for the guidance, and for the quick merge, you guys are awesome 😍

1reaction
rchiodocommented, Dec 8, 2021

I don’t think we’d should use file, Jupyter doesnt do this, if we started doing this we’d be introducing unexpected inconsistencies as it goes against the expected behavior.

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

FAQ - ClearML
I run my script, but my experiment is not in the ClearML Hosted Service Web UI. How do I fix this? ClearML Server...
Read more >
Version 0.14 - ClearML
Ignore IPython directives in converted Python script (like % and ! lines). Update Pytorch / TensorboardX examples. Bug Fixes. Fix renaming / deleting...
Read more >
Task | ClearML
The Task class and its methods allow you to create and manage experiments, as well as perform advanced experimentation functions, such as autoML....
Read more >
Version 1.1 - ClearML
Fix the six conflict with the new pathlib2 version 2.3.7 and up. ... to allow controlling maximum debug samples programmatically; Add populate now...
Read more >
Version 0.17 - ClearML
Add clearml-data publish to allow publishing a dataset task. ... Fix support for nonstandard argparse with default value that is not of defined...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found