NASA-Openscapes / py-rocket

Rocker (R Docker stack) via Jupyter lab
MIT License
2 stars 1 forks source link

Home is different in JupyterLab versus RStudio #2

Open eeholmes opened 9 months ago

eeholmes commented 9 months ago

Case:

In rstudio, ~ is \home\jovyan

In jupyterlab, ~ is \home\rstudio

This is weird and annoying with earth data access because you .netrc file created in one is not appearing in the other. We are starting to do workflows where we have both the lab and rstudio tabs open to do Python and R work, and people keep running into this.

Personnaly I think we should stick with \home\jovyan since we are on a JupyterHub. It's annoying to explain to students to write different file paths if they writing Python in rstudio vs lab on the JupyterHub. I know know students should not use hard paths but despite our admonitions they do. I am constantly debugging the \home\rsdudio versus \home\jovyan "feature". But I think Yuvi disagrees. @cboettig ?

cboettig commented 9 months ago

I think there's lots to be said here in the details but overall I agree we should present users with a consistent home experience. Specifically, I think a given user should ideally not experience different expansions of ~ when working in the different environments, the ~ expansion in a terminal should always match $HOME and also match /home/$USER and $USER should match whoami in the same terminal.

I would like to better understand the examples where this creates trouble though.

with respect to .netrc, I think software should be taking care of netrc login and that software should not be making assumptions about ~ expansion, $HOME, etc. earthdatalogin uses an explicit path for the netrc file following the XDG Spec for where installed software should store configuration and data files relative to each operating system, (as required by CRAN -- we're not allowed to write configs to ~/). However, older versions of gdal don't understand alternative .netrc paths, so in that case we have to symlink to ~/.netrc - - https://github.com/boettiger-lab/earthdatalogin/blob/main/R/edl_netrc.R#L112 (and it looks like arguably I should be wrapping that with path.expand() ... )

Does this problem appear in other settings? (Like python versions? I think there's a separate issue there where we also want to better align PATH between the two environments...)