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

Save beakerx.json to paths specified in JUPTYER_CONFIG_DIR #7468

Closed
vishnu2kmohan opened this issue Jun 1, 2018 · 3 comments
Closed

Save beakerx.json to paths specified in JUPTYER_CONFIG_DIR #7468

vishnu2kmohan opened this issue Jun 1, 2018 · 3 comments

Comments

@vishnu2kmohan
Copy link

The %%spark magic is currently hardwired to store its configuration at Paths.get(System.getProperty("user.home") + File.separator + ".jupyter" + File.separator + "beakerx.json"))));

It should instead honor paths (if) specified in the JUPYTER_CONFIG_DIR environment variable

e.g., I have JUPYTER_CONFIG_DIR set to /mnt/mesos/sandbox/.jupyter which yields the following acceptable config locations with jupyter --paths:

$ jupyter --paths
config:
    /mnt/mesos/sandbox/.jupyter
    /opt/conda/etc/jupyter
    /usr/local/etc/jupyter
    /etc/jupyter
data:
    /mnt/mesos/sandbox/.local/share/jupyter
    /opt/conda/share/jupyter
    /usr/local/share/jupyter
    /usr/share/jupyter
runtime:
    /mnt/mesos/sandbox/.local/share/jupyter/runtime

Instead, the Spark Magic fails to initialize when I run the notebook as the non-privileged user nobody because it attempts to store beakerx.json under /nonexistent/.jupyter, which as the name implies, is non-existent :)

$ grep nobody /etc/passwd
nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin
@scottdraves
Copy link
Contributor

Thanks for the report, will get this into the next release.

@scottdraves
Copy link
Contributor

the envar would be a good quick fix.
would it be more accurate to use Python API:
jupyter_core.paths.jupyter_config_dir()
?

@scottdraves
Copy link
Contributor

should this class be in python, ie reuse

config_path = path.join(paths.jupyter_config_dir(), 'beakerx.json')

could call into it with py4j?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants