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.

Regarding a JupyterLab transition - redirections etc...

See original GitHub issue

Goal

To make links to redirected sensibly while clicking nbgitpuller links from within notebooks

  • without consideration of jupyter lab or jupyter notebook is showing the notebook
    • UPDATE: The environment variable NBGITPULLER_APP can help to control this behavior.
  • without consideration of linking from a jupyterhub hosted notebook or localhost hosted notebook. Also without consideration of the domain name, to avoid hardcoding www.myhub.com in the in-notebook link.
  • without consideration of where the notebook is located in the file system
    • UPDATE: Hmm too vague formulated point for me to understand myself a year later.

My use case

I’d like to have a document that is always available on my jupyterhub, referencing sources of content to add.

Analysis 1

  • Classic - Opening index.ipynb in the root folder (often /home/jovyan), your URL is updated to mydomain.com/user/username/notebooks/Index.ipynb, but you can also access this by referring to mydomain.com/user/redirect/tree/Index.ipynb
  • Lab - In order to open index.ipynb in the root folder (often /home/jovyan), you should access mydomain.com/user/username/lab/tree/Index.ipynb

Analysis 2

  • The /hub/user-redirect/git-pull? is relevant if you have a jupyterhub hosting only, I think…
    • This currently does not work since the query params seem to be stripped during the user redirect… (SOLVED NOW!)
  • The /git-pull?... link would work if you have a localhost hosting only, i think…

TODO

Currently my best known option is…

Currently, the best solution I have is assume a JupyterHub is hosting the notebook, and using a link like this, ending up with a classic view.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
consideRatiocommented, Apr 9, 2018

Actionplan

  1. Make nbgitpuller accept an urlpath=... querystring
  2. Make nbgitpuller accept an application=jupyterlab querystring

I’ll start working on this @yuvipanda !


Archived action items

For my own reference mainly… I made some additional research, and finally concluded I’ll surrender on writing a notebook that contains a git-pull link within it. Currently that notebook must hardcode too much assumptions about the environment, such as if the notebook is viewed from jupyterlab/classic, from jupyterhub/localhost, even the specific domain name…

  1. Make an extension or something that makes JupyterHub redirect /git-pull to /user/redirect/git-pull (also without loosing querystring info).
  2. Make links from within notebooks behave the same way no matter if they are clicked on within jupyterlab or classic… Currently /git-pull points to myjupyterhub.com/user/erik/files/git-pull rather than myjupyterhub.com/git-pull as it does if the link is viewed from classic.

Recent revelations

  • /user/redirect and /hub/user-redirect both redirect, but hub/user-redirect does not have the querystring truncation issue. See JupyterHub/#1769
  • JupyterLab links work differently than classic links: JupyterLab/#4341
1reaction
yuvipandacommented, Apr 5, 2018

I think it’d be great to add two options:

  1. An ‘application=jupyterlab’ url parameter. This can also be set via environment variable.
  2. A ‘urlPath=<full-url>’ url parameter. Right now we specify filePath and infer URL from that. It’d be great to specify the URL directly. MyBinder.org offers this, for example.

How does that sound?

On Thu, Apr 5, 2018 at 8:12 AM, Erik Sundell notifications@github.com wrote:

@gsemet https://github.com/gsemet ah does this reflect your idea? 5. We could make nbgitpuller look for a environment variable and decide based on that. The default would be to not change anything, but in case the environment variable is found, a redirection to jupyterlab can be done.

I think this is the best option! It would not break anything, and allow an admin as well as a user to decide on the default behavior without adding complexity forcing the link creator to know about lab/no-lab or nbgitpuller to know about installed extensions!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/data-8/nbgitpuller/issues/36#issuecomment-378970878, or mute the thread https://github.com/notifications/unsubscribe-auth/AAB23gbJTMge6aEnal6px6bhuieuDjKOks5tljRVgaJpZM4Si1Rs .

– Yuvi Panda T http://yuvi.in/blog

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Guide - GitLab
Guidance on setting up JupyterLab. ... Common python DS/ML libraries (pandas, scikit-learn, sci-py, etc.) Natively connected to Snowflake using your dbt ...
Read more >
Jupyter Documentation - Read the Docs
The migrating document has additional information about migrating from IPython 3 to Jupyter. JupyterLab. JupyterLab is a next-generation ...
Read more >
JupyterLab URLs — JupyterLab 3.6.0b0 documentation
Workspaces contain the state of JupyterLab: the files that are currently open, the layout of the application areas and tabs, etc. When the...
Read more >
Everything You Need To Know About Jupyter Notebooks
Breaking down everything about Jupyter Notebooks ranging from the menus, to running ... Its uses include data cleaning and transformation, ...
Read more >
python - Jupyterlab: Directory keeps redirecting to where ...
So I have discovered the underlying problem.. Sometimes when you close your code or terminal on VScode (WSL Extension), your jupyter ...
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