Intro to JupyterHubs

Goals

In this lab, you will get an overview of our JupyterHub

  • Log into the JupyterHub
  • Open RStudio
  • Understand the directory structure
  • Restart your JupyterHub server
  • Start/Stop your JupyterHub server

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 instance using Amazon Web Services (AWS). This may take several minutes.

Jupyterhub Spawning

Open RStudio

When you are in the Jupyter Lab tab (note the Jupyter Logo), you will see a Launcher page. If you don’t see this, go to File > New Launcher.

Jupyterhub Launcher
  • Open RStudio by clicking on the “RStudio” box in the Launcher tab:

RStudio

End your session

When you are finished working for the day it is important to log out of the JupyterHub. When you keep a session active it uses up AWS resources (costs money) and keeps a series of virtual machines deployed.

Caution

You log out from the Jupyter Lab tab not the RStudio tab.

From the Jupyter Lab 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 Jupyter Lab tab? Go to https://nmfs-openscapes.2i2c.cloud/hub/home

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.

There are a number of different ways to create new files. We will practice this in the RStudio lecture.

Will I lose all of my work?

Logging out 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.

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.

*Python users

You can open a Jupyter Notebook by clicking on the “Python 3” box. In the Launcher tab:

Jupyterhub Launcher

Get an overview of Jupyter Lab: Intro to Jupyter Lab

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 and Openscapes.