Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

page_config.json no longer encapsulated in python env #9240

Closed
ajbozarth opened this issue Oct 28, 2020 · 17 comments · Fixed by #9454
Closed

page_config.json no longer encapsulated in python env #9240

ajbozarth opened this issue Oct 28, 2020 · 17 comments · Fixed by #9454
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Milestone

Comments

@ajbozarth
Copy link
Member

Description

In Lab 2.X page_config.json is keep within the python env path, allowing for a user to run lab in multiple python env in parallel.

In Lab 3.0 page_config.json is now stored in the user home, and is shared by all python envs, which can cause issue when working with multiple envs with different expected configs.

@ajbozarth
Copy link
Member Author

@blink1073

@ajbozarth ajbozarth added this to the 3.0 milestone Oct 28, 2020
@jasongrout
Copy link
Contributor

I thought now the page config used the Jupyter directory hierarchy, so it could be at the environment level?

@ajbozarth
Copy link
Member Author

That is correct, it could end up in the env. IMHO that uncertainty might even be considered worse

@jasongrout
Copy link
Contributor

So...put it where you want? If you want it at the env level, put it there. Otherwise put it in the user level.

Or are you saying that page_config.json gets automatically put somewhere by a process out of your control?

@ajbozarth
Copy link
Member Author

exactly, it gets automatically moved to the first location on the list, which is usually the user dir

@jasongrout
Copy link
Contributor

it gets automatically moved to the first location on the list

Sorry, I'm missing context here. What moves it automatically? How are you creating this page_config.json?

@ajbozarth
Copy link
Member Author

@blink1073 can explain it better, I'm just reiterating what he told me, but iiuc we moved from just creating and using the page_config.json directly to using it to instantiate and persist the configs that are handled by traitlets now. The traitlets are handled through jupyter_core libraries, which by default use the first config dir listed by jupyter --path to store the persisted page_config.json, which is usually the user dir.

In short our code moves the page_config.json automatically, but it chooses the dir to move it to based on the jupyter_core libraries leveraged by using traitlets.

@jasongrout
Copy link
Contributor

Just to be clear, can you give instructions that will create a page_config.json in my user config directory automatically without me manually creating it?

@jasongrout
Copy link
Contributor

Also, I spent some time looking into how to solve this user/env/system problem once and for all. For example, we now can set the JUPYTER_PATH and JUPYTER_CONFIG_PATH environment variables, which take precedence over the user directories. I think that was added so environments could insert themselves in before the user directory. I tried to see how to make conda always set these variables appropriately any time it entered any environment. After poking around in the conda code for a bit, I gave up.

I think it would be much easier to have an environment variable flag, like JUPYTER_SYS_FIRST (with a better name :), that switches the user and sys-prefix levels once and for all.

@ajbozarth
Copy link
Member Author

you just have to disable an extension using the cli tool, eg:
jupyter labextension disable @jupyterlab/launcher-extension
and a page_config.json will be created in your user dir:
ls ~/.jupyter/labconfig/page_config.json

@ajbozarth
Copy link
Member Author

For example, we now can set the JUPYTER_PATH and JUPYTER_CONFIG_PATH environment variables

This is a way to "fix" this, but it seemed "hacky" to @blink1073 and me, thus why he was going to look for a better solution

@jasongrout
Copy link
Contributor

I just filed jupyter/jupyter_core#199, which I've been meaning to write for years now...

@ajbozarth
Copy link
Member Author

Based on that PR would we have lab set that env var or would we just document it and expect users to set it?

@jasongrout
Copy link
Contributor

I think users would set it for whatever situation they were in. Users not working in environments could naturally expect page_config to be user-level, for example.

@jasongrout
Copy link
Contributor

Regardless of jupyter/jupyter_core#199, we should still figure out what to do for lab 3.0, since we can't assume that everyone has a new version of jupyter_core installed, even if we can get a new release there before lab 3.0.

What options do we have? For example, we could explicitly put that page config in the environment directory for now?

@ajbozarth
Copy link
Member Author

is the jupyter_core dependency version not set by jupyterlab?

@jasongrout
Copy link
Contributor

jasongrout commented Oct 29, 2020

is the jupyter_core dependency version not set by jupyterlab?

One question is if we can get a jupyter_core version out before jlab 3.0, I think.

Huh, apparently we also don't list jupyter_core as a dependency. See #9251

@github-actions github-actions bot added the status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Jun 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants