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

Using GeoClaw on Jupyterhub #30

Open
rjleveque opened this issue Jul 14, 2020 · 3 comments
Open

Using GeoClaw on Jupyterhub #30

rjleveque opened this issue Jul 14, 2020 · 3 comments
Labels
jupyterhub Questions on using the CSDMS JupyterHub

Comments

@rjleveque
Copy link

Nice that you have a Jupyterhub set up!

I'm trying it out and have a couple questions. I see from this page that if I submit a lab I could ask to have this software available, but I wonder if there are instructions somewhere for doing these things for a user who wants to use GeoClaw on the JupyterHub without using an existing lab?

  1. I found I could install Clawpack fine by opening a terminal and using git clone, etc., and then in a notebook I can import clawpack.geoclaw fine, and also refer to the CLAW environment variable (used when running the fortran parts of GeoClaw) if I first do this:

    import sys, os
    CLAW = '/home/jupyter-rjleveque/clawpack'
    sys.path.insert(0, CLAW)
    os.environ['CLAW'] = CLAW
    

    I am wondering if there's a way to set things up so when I come back to my JupyterHub account, my PYTHONPATH and CLAW environment variables are set like this, or will I need to always set these from within a notebook?

    Note: I tried adding these environment variables to /home/jupyter-rjleveque/.bashrc but that didn't affect the environment in a notebook when I restarted the server.

  2. It didn't find gfortran when I tried running this notebook locally, so it died in the compile step. Is there something that needs to be added to the path for this?

@mdpiper
Copy link
Member

mdpiper commented Jul 16, 2020

Hi @rjleveque!

  1. We're using The Littlest JupyterHub (tljh), which doesn't allow environment variables to persist when set through bash. I learned this when I trivially tried to change the awkward default PS1. Instead, there appears to be a mechanism (straight from the tljh dev!) to do so through the JupyterHub installation. I could try these for the Clawpack variables. These variables will be set for all users, though, so I'm a little concerned about setting PYTHONPATH.

  2. I'll install gfortran. Note that we're currently using a single conda environment for the JupyterHub. We'll eventually set up separate environments (and kernels) for groups of related Notebooks (like your GeoClaw Notebooks).

@mdpiper mdpiper added the jupyterhub Questions on using the CSDMS JupyterHub label Jul 16, 2020
@mdpiper
Copy link
Member

mdpiper commented Jul 16, 2020

gfortran is now available:

$ which gfortran
/opt/tljh/user/bin/gfortran

$ gfortran --version
GNU Fortran (crosstool-NG 1.24.0.123_1667d2b) 7.5.0

@rjleveque
Copy link
Author

Great thanks @mdpiper, I'll give it a try.

I agree setting PYTHONPATH isn't good in general and we can easily just set that at the top of a notebook as needed.

It's also possible to use pip to install clawpack rather than setting PYTHONPATH, which is actually the recommended approach for most users. So another option would be to do that globally, so that any user could import it without having to install it themselves.

We could chat about it sometime if you want. Not urgent though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jupyterhub Questions on using the CSDMS JupyterHub
Projects
None yet
Development

No branches or pull requests

2 participants