Video Tutorial
A Jupyter Pocket book is an open supply software used all through academia and trade. The interactive computing software consists of cells that render explanatory textual content written utilizing the Markdown syntax and cells that execute programming code (together with Python, R, Julia, and Scala). Which means notebooks can comprise textual content, code, and visualizations in the identical doc. A Jupyter pocket book can be utilized in your native machine or, as I lined in a earlier tutorial, within the cloud. Nonetheless, the issue is {that a} Jupyter Pocket book is just designed for single customers. JupyterHub was designed to unravel this downside. JupyterHub is a multi-user, container-friendly (e.g., Docker, Kubernetes, and many others.) model of the Jupyter Pocket book designed for organizations with many advantages together with the power to:
Handle customers and authentication (e.g., PAM, OAuth, SSO, and many others.)
Create shareable, scalable, and customizable computational sources and information science environments within the cloud (e.g., AWS, Azure, Google Cloud, and many others.) or by yourself {hardware} (on-premise)
Unburden customers with set up and upkeep duties.
JupyterHub is available in two distributions:
Zero-to-JupyterHub (ZTJH), a multi-node model of JupyterHub primarily based on Kubernetes
The Littlest JupyterHub (TLJH), is a single-node model of JupyterHub.
This tutorial goes just a little past the good official JupyterHub tutorial on how one can arrange JupyterHub (TLJH) on AWS within the hope that the pictures and YouTube video will make you much less prone to run into points on this 15+ step course of.
1). Go to the Amazon Net Providers’ web site and click on Signal In (create an AWS Account when you don’t have one).
On the Sign up web page, select both Root consumer (A) or IAM consumer (B). Enter your e mail. In case you are an IAM consumer, be sure to have the suitable permissions so as to at the least create an AWS EC2 occasion.
The official tutorial highlights that it’s best to select an AWS area primarily based on the place your JupyterHub customers are positioned.
2). Click on on EC2. If you happen to don’t see it, use the Search bar on the high of the display screen and kind in EC2.
3). On the Dashboard | EC2 Administration Console, click on on Situations. If this display screen appears to be like just a little totally different, observe that I’ve toggled on New EC2 Expertise.
4). Click on on Launch Situations (the button is also labeled Launch Occasion).
5). Identify and [optionally] add tags to your occasion. AWS says that “a tag is a label that you just assign to an AWS useful resource.” I like to recommend you give your occasion a reputation and tags that determine what the occasion will probably be used for (e.g., MyJupyterHubTutorial).
6). Go to Utility and OS Pictures (Amazon Machine Picture) and select Ubuntu model 18.04 LTS, Ubuntu 20.04 LTS (what this tutorial makes use of), Ubuntu 22.04 LTS (see the Potential Errors part if you wish to select this AMI), or no matter else TLJH helps.
7). Go to Occasion sort. Earlier than selecting an occasion, I extremely suggest testing how a lot every occasion prices plus JupyterHub’s information on estimating how a lot reminiscence / GPU / disk area you want primarily based on the variety of concurrent customers. Principally, at a minimal, you might want to use a server with 1GB+ (principally t2.micro or larger) of RAM, however I’ve discovered 8GB+ (t2.massive or larger) to go well with my wants (educating and training information science). If I do know that individuals utilizing JupyterHub will probably be doing duties that want to make use of a number of cores (particularly with Ray/Dask/Spark), I decide one thing that has extra vCPU (t2.micro: 1 vCPU, t2.massive: 2vCPU, t2.2xlarge: 8vCPU).
Be certain that to do not forget that utilizing AWS prices cash (until you will have free credit).
8). Go to Key pair (login). Choose an current key pair or Create new key pair (proven within the photos under). If you happen to create a key pair, be sure to obtain and maintain it someplace secure. You gained’t have the ability to change it. Deciding on a key pair is a vital step as you will want a key to have the ability to SSH to your occasion or simply obtain recordsdata.
After clicking on Create new key pair, sort in your key pair identify (e.g., MyJupyterHubTutorial_pem) and click on on Create Key Pair (backside proper within the screenshot under).
Notice: when you use home windows, you’ll be able to select ppk as a substitute. Nonetheless, I’m a fan of utilizing GOW on home windows (as seen in my hook up with EC2 Occasion utilizing SSH tutorial) which makes it so you need to use a pem file on Home windows (as a substitute of needing PuTTY).
9). Go to Community settings. That is the a part of the tutorial the place you’ll be able to both create safety group or choose an current safety group. This can impression how your occasion may be accessed. On this tutorial, you’ll most likely wish to add verify the next
Clicking on these choices will create 3 safety teams.
Optionally, you may also view these safety teams by clicking on Edit. This may also mean you can change your safety group identify.
On this picture, safety group 1 permits SSHing utilizing port 22 (picture from after I tried utilizing Ubuntu 22.04 as a substitute of Ubuntu 20.04).
10). Go to Configure storage. This lets you select how a lot storage you need (# of GiB) in addition to the amount sort (e.g., gp2, gp3, io1, io2, sc1, st1, commonplace). For this tutorial, I’m going with the default storage (gp2) for the AMI I select in step 6.
On this picture, safety group 1 permits SSHing utilizing port 22 (picture from after I tried utilizing Ubuntu 22.04 as a substitute of Ubuntu 20.04).Let me know when you favor a special storage sort for JupyterHub like gp3. It appears to be like to be more cost effective than gp2.
11) Go to Superior particulars and scroll right down to Person information.
This step is about offering a command script that runs whenever you launch your occasion. The installer script under will set up JupyterHub (what does the installer do). Earlier than continuing to stick the textual content into Person information, at a minimal, you will want to switch <admin-user-name> with the admin consumer (e.g., mgalarnyk). There is no such thing as a password set within the script as it is going to be arrange later on this tutorial. Nonetheless, the installer script may be modified so as to add passwords, add further admin customers, set up python packages within the consumer atmosphere, and set up plugins.
curl -L
| sudo python3 –
–admin <admin-user-name>
–show-progress-page
Code Caption: The code –show-progress-page will create a short lived “TLJH is constructing” progress web page shortly after the occasion is launched, which is able to mean you can see fairly rapidly whether or not the set up goes properly.
Notice, if you wish to make modifications after launching JupyterHub, you’ll be able to all the time set up further conda, pip, or apt packages, in addition to add/take away admin customers.
12). Go to Abstract and click on on Launch occasion.
13). On the Launch Standing notification display screen, click on on the hyperlink. It’s going to take you to the EC2 Administration Console.
14). You need to now be within the EC2 Administration Console. This step would require just a little endurance as you might want to watch for the JupyterHub set up to finish. The official documentation says that this will take 10+ minutes (it was a lot faster for me).
That is one location the place you’ll find your Public tackle
You’ll be able to see in case your server is organising by copying the Public tackle into your browser (I favor chrome).
After a few minutes, copy the Public tackle into a brand new tab and also you’ll be requested to check in.
You’ll be able to learn to setup HTTPS and SSL for JupyterHub right here.
15). Enter within the admin username you laid out in step 11 (e.g., mgalarnyk) and enter in a password which may be 7 characters or longer.
Notice that the installer script in step 11 may have been modified so as to add passwords, add further admin customers, set up python packages within the consumer atmosphere, and set up plugins.
Click on on Sign up and you might be welcome to JupyterHub!
If you wish to make modifications after launching JupyterHub, you’ll be able to all the time set up further conda, pip, or apt packages, in addition to add/take away admin customers.
Potential Errors
404 web page not discovered
There are lots of causes you could get this error. If you happen to get this error after the “please wait whereas your TLJH is organising” display screen, it may be so simple as copying the tackle into one other tab.
‘Connection Refused’ error after restarting server
Try the official documentation to learn to remedy this difficulty.
This web site can’t be reached
I initially needed to create this tutorial utilizing Ubuntu 22.04, however I used to be getting this error after I put the IP tackle within the browser (after all there are different causes you may get error). If you wish to use Ubuntu 22.04, one potential approach to remedy this might be verify the System Log within the EC2 Administration Console to confirm its a curl difficulty and to alter the installer script utilizing recommendation from this askubuntu publish.
This tutorial went over how one can setup Jupyterhub (TLJH) on AWS. Installations can take important time to arrange and take much more time to handle. If you happen to favor to not cope with putting in and sustaining a server, you need to use a product like Saturn Cloud. Regardless, in case you have questions or ideas on the tutorial, be at liberty to achieve out by way of YouTube or Twitter. Michael Galarnyk is a Information Science Skilled, and works in Product Advertising Content material Lead at Parallel Area.