Intro to JupyterHubs

In this tutorial, you will get an overview of our JupyterHub.

Learning Objectives
  • Log into the JupyterHub and select an image (environment)
  • Open RStudio in a new browser tab
  • Start/Stop your JupyterHub server
  • Restart your JupyterHub server
  • Get tips on how to get help and post issues

Log into the JupyterHub

Go to https://nmfs-openscapes.2i2c.cloud/. Click “Login to continue”. You will be asked to log in with your GitHub Account, if you are not logged in already.

NMFS Openscapes JupyterHub Login

Image type: Python or R

Next you select your image type from the drop-down. The default is a geospatial image with Python and R.

Virtual Machine size

You’ll see a dropdown that allows you to choose the size of virtual machine. For the tutorials, you will only need the smallest virtual machine. Please only choose the large machines if you run out of RAM as the larger machines cost us more.

Machine Profiles

Start up

After we select our server type and click on start, JupyterHub will allocate our virtual machine. This may take several minutes.

Jupyterhub Spawning

The Launcher

When you are in the JupyterLab tab (note the Jupyter Logo), you will see a Launcher page. If you don’t see this, go to File > New Launcher or click the blue button on the top left. From the Launcher, you will see a buttons to open a new Jupyter Notebook, RStudio, Desktop and VSCode on the top row and buttons to open a Terminal and other file types below.

Jupyterhub Launcher Clicking on the “Python 3”, Terminal, Text File and Markdown File buttons will open a new tab in JupyterLab. You can also use the File dropdown menu for these.

To get an overview of JupyterLab, go here: Intro to JupyterLab

RStudio

If you click the RStudio button in Launcher, RStudio will open in a new browser tab.

RStudio

To get an overview of RStudio, go here: Intro to RStudio

End your session

When you are finished working for the day you should log out of the JupyterHub, although it will log you out automatically after 90 minutes. You will not lose work; your home directory is persistent. When you keep a session active it uses up AWS resources (costs money) because it keeps a series of virtual machines deployed.

Caution

You log out from the JupyterLab tab not the RStudio tab.

From the JupyterLab browser tab, do one of two things to stop the server:

  • Log out File -> Log Out and click “Log Out”!
  • or File -> Hub Control Panel -> Stop My Server
Tip

Can’t find the JupyterLab tab? Go to https://nmfs-openscapes.2i2c.cloud/hub/home

Logging out or stopping your server will NOT cause any of your work to be lost or deleted. It simply shuts down some resources. It would be equivalent to turning off your desktop computer at the end of the day.

Restart your server

Sometimes the server will crash/stop. This can happen if too many people use a lot of memory all at once. If that happens, go to the JupyterLab tab and then File -> Hub Control Panel -> Stop My Server and then Start My Server. You shouldn’t lose your work unless you were uploading a file.

Your files

When you start your server, you will have access to your own virtual drive space. No other users will be able to see or access your files. You can upload files to your virtual drive space and save files here. You can create folders to organize your files. You personal directory is home/jovyan. Everyone has the same home directory but your files are separate and cannot be seen by others.

Shared files

Shared folder

In the file panel, you will see a folder called shared. These are read-only shared files that we have prepared for you.

You will also see shared-public. This is a read-write folder for you to put files for everyone to see and use. You can create a team folder here for shared data and files. Note, everyone can see and change these so be careful to communicate with your team so multiple people don’t work on the same file at the same time. You can also create folders for each team member and agree not to change other team members files.

Getting help

  • Discussions https://github.com/nmfs-opensci/NOAAHackDays/discussions
  • Add an issue if you see something amiss or you would like a package added https://github.com/nmfs-opensci/NOAAHackDays/issues
  • Visit the NMFS Open Science Google Space (NOAA only). Search Google Spaces to find.
  • NMFS staff: The NMFS Python User Group and NMFS R User Group are great places to get help from fellow users for Python and R questions.

FAQ

Why do we have the same home directory as /home/jovyan? /home/jovyan is the default home directory for ‘Jupyter’ based images/dockers. It is the historic home directory for Jupyter deployments.

Can other users see the files in my /home/jovyan folder? No, other users can not see your files.

Acknowledgements

Some sections of this document have been taken from hackweeks organized by the University of Washington eScience Institute, CryoCloud and Openscapes.