2019-05-20 15:47:10 +01:00
====================
Installing on Azure
====================
Goal
====
By the end of this tutorial, you should have a JupyterHub with some admin
2019-05-20 16:19:06 +01:00
users and a user environment with packages you want to be installed running on
2019-05-20 15:47:10 +01:00
`Microsoft Azure <https://azure.microsoft.com> `_ .
Prerequisites
==============
* A Microsoft Azure account.
2019-05-20 16:19:06 +01:00
* To get started you can get a free account which includes 150 dollars worth of Azure credits (`get a free account here <https://azure.microsoft.com/en-us/free//?wt.mc_id=LTJH-github-taallard> `_ )
2019-05-20 15:47:10 +01:00
These instructions cover how to set up a Virtual Machine
on Microsoft Azure. For subsequent information about creating
your JupyterHub and configuring it, see `The Littlest JupyterHub guide <https://the-littlest-jupyterhub.readthedocs.io/en/latest/> `_ .
2019-05-21 10:21:16 +01:00
Step 1: Installing The Littlest JupyterHub
==========================================
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
We will start by creating the Virtual Machine in which we can run TLJH (The Littlest JupyterHub).
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
#. Go to `Azure portal <https://portal.azure.com/> `_ and login with your Azure account.
#. Expand the left-hand panel, find the Virtual Machines tab and click on it.
.. image :: ../images/providers/azure/azure-vms.png
:alt: Virtual machines on Azure portal
#. Click **+ add** to create a new Virtual Machine
2019-05-20 15:47:10 +01:00
.. image :: ../images/providers/azure/add-vm.png
:alt: Add a new virtual machine
2019-05-21 10:21:16 +01:00
#. Select **Create VM from Marketplace** in the next sreen. This will display a new screen with all the optiond for Virtual Machines in Azure.
2019-05-20 15:47:10 +01:00
.. image :: ../images/providers/azure/create-vm.png
2019-05-21 10:21:16 +01:00
:alt: Create VM from the marketplace
2019-05-20 16:23:22 +01:00
2019-05-21 10:21:16 +01:00
#. **Choose an Ubuntu server for your VM** :
2019-05-20 15:47:10 +01:00
* Click `Ubuntu Server 18.04 LTS`
2019-05-21 10:21:16 +01:00
* Make sure `Resource Manager` is selected in the next screen and click **Create**
2019-05-20 15:47:10 +01:00
.. image :: ../images/providers/azure/ubuntu-vm.png
:alt: Ubuntu VM
2019-05-21 10:21:16 +01:00
#. Customise the Virtual Machine basics:
2019-05-20 16:19:06 +01:00
* **Subscription** . Choose the "Free Trial" if this is what you're using. Otherwise, choose a different plan. This is the billing account that will be charged.
2019-05-21 10:21:16 +01:00
* **Resource group** . Resource groups let you bundle components that you request from Azure. If you already have one you'd like to use it select that resource.
* **Name** . Use a descriptive name for your virtual machine (note that you cannot use spaces or special characters).
* **Region** . Choose a location near where you expect your users to be located.
* **Availability options** . Choose "No infrastructure redundancy required".
* **Image** . Make sure "Ubuntu Server 18.04 LTS" is selected (from the previous step).
* **Authentication type** . Change authentication type to "password".
* **Username** . Choose a memorable username, this will be your "root" user and you'll need it later on.
* **Password** . Type in a password, this will be used later for admin access so make sure it is something memorable.
2019-05-20 15:47:10 +01:00
.. image :: ../images/providers/azure/password-vm.png
2019-05-20 16:19:06 +01:00
:alt: Add password to VM
2019-05-21 10:21:16 +01:00
* **Login with Azure Active Directory** . Choose "Off" (usually the default)
* **Inbound port rules** . Leave the defaults for now and we will update these later on in the Network configuration step.
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
#. Before clicking on "Next" we need to select the RAM size for the image.
* For this we need to make sure we have enough RAM to accommodate your users. For example, if each user needs 2GB of RAM, and you have 10 total users, you need at least 20GB of RAM on the machine. It's also good to have a few GB of "buffer" RAM beyond what you think you'll need.
* Click on **Change size** (see image below)
2019-05-20 15:47:10 +01:00
.. image :: ../images/providers/azure/size-vm.png
:alt: Choose vm size
2019-05-21 10:21:16 +01:00
* Select a suitable image (to check available images and prices in your region `click on this link <https://azuremarketplace.microsoft.com/en-gb/marketplace/apps/Canonical.UbuntuServer?tab=PlansAndPrice/?wt.mc_id=LTJH-github-taallard> `_ .
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
#. Disks (Storage):
* **Disk options** : slect the OS disk type there are options for SDD and HDD. **SSD persistent disk** gives you a faster but more expensive
disk than HDD.
* **Data disk** . Click on create and attach a new disk. Select an appropriate type and size and click ok.
* Click "Next"
2019-05-20 16:13:21 +01:00
.. image :: ../images/providers/azure/disk-vm.png
:alt: Choose disk size
2019-05-20 16:23:22 +01:00
2019-05-21 10:21:16 +01:00
#. * Networking
* **Virtual network** . Leave the default values selected.
* **Subnet** . Leave the default values selected.
* **Public IP address** .Leave the default values selected. This will make your server accessible from a browser.
* **Network Security Group** . Choose "Basic"
* **Public inbound ports** . Check **HTTP** , **HTTPS** , and **SSH** .
.. image :: ../images/providers/azure/networking-vm.png
:alt: Choose networking ports
#. Management
2019-05-20 15:47:10 +01:00
* Monitoring
2019-05-20 16:13:21 +01:00
* **Boot diagnostics** . Choose "On".
2019-05-21 10:21:16 +01:00
* **OS guest diagnostics** . Choose "Off".
2019-05-20 16:13:21 +01:00
* **Diagnostics storage account** . Leave as the default.
2019-05-21 10:21:16 +01:00
* Auto-Shutdown
* **Enable auto-shutdown** . Choose "Off".
2019-05-20 15:47:10 +01:00
* Backup
2019-05-21 10:21:16 +01:00
* **Backup** . Choose "Off".
* System assigned managed identity Select "Off"
2019-05-20 16:13:21 +01:00
2019-05-21 10:21:16 +01:00
.. image :: ../images/providers/azure/backup-vm.png
:alt: Choose VM Backup
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
#. Advanced settings
* **Extensions** . Make sure there are no extensions listed
* **Cloud init** . We are going to use this section to install TLJH directly into our Virtual Machine.
Copy the code snippet below: ::
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
#!/bin/bash
curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py \
| sudo python3 - \
--admin <admin-user-name>
where the `` username `` is the root username you chose for your Virtual Machine.
.. image :: ../images/providers/azure/cloudinit-vm.png
:alt: Install TLJH
.. note ::
See :ref: `topic/installer-actions` if you want to understand exactly what the installer is doing.
:ref: `topic/customizing-installer` documents other options that can be passed to the installer.
#. Check the summary and confirm the creation of your Virtual Machine.
#. Check that the creation of your Virtual Machine worked
* Wait for the virtual machine to be created. This might take about 5-10 minutes.
2019-05-20 16:19:06 +01:00
* After completion, you should see a similar screen to the one below:
2019-05-20 16:13:21 +01:00
.. image :: ../images/providers/azure/deployed-vm.png
2019-05-20 16:19:06 +01:00
:alt: Deployed VM
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
#. Note that the Littlest JupyterHub should be installing in the background on your new server.
It takes around 5-10 minutes for this installation to complete.
2019-05-21 10:36:53 +01:00
#. Click on the **Go to resource button**
.. image :: ../images/providers/azure/goto-vm.png
:alt: Go to VM
2019-05-21 10:21:16 +01:00
2019-05-21 10:46:05 +01:00
#. Check if the installation is complete by **copying** the **Public IP address**
of your virtual machine, and trying to access it with a browser.
2019-05-21 10:21:16 +01:00
2019-05-21 10:46:05 +01:00
.. image :: ../images/providers/azure/IP-vm.png
:alt: Public IP address
Note that accessing the JupyterHub will fail until the installation is complete,
2019-05-21 10:21:16 +01:00
so be patient.
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
#. When the installation is complete, it should give you a JupyterHub login page.
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
.. image :: ../images/first-login.png
:alt: JupyterHub log-in page
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
#. Login using the **admin user name** you used in step 6, and a password. Use a
strong password & note it down somewhere, since this will be the password for
the admin user account from now on.
2019-05-20 15:47:10 +01:00
2019-05-21 10:46:05 +01:00
#. Congratulations, you have a running working JupyterHub! 🎉
2019-05-20 16:13:21 +01:00
2019-05-21 10:21:16 +01:00
Step 2: Adding more users
==========================
2019-05-20 16:13:21 +01:00
2019-05-21 10:21:16 +01:00
.. include :: add_users.txt
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
Step 3: Install conda / pip packages for all users
==================================================
2019-05-20 15:47:10 +01:00
2019-05-21 10:21:16 +01:00
.. include :: add_packages.txt
2019-05-20 15:47:10 +01:00
2019-05-20 16:13:21 +01:00
(optional) Delete your virtual machine
=======================================
2019-05-20 15:47:10 +01:00
* Go to "Virtual Machines"
2019-05-20 16:13:21 +01:00
* Click on your machine name
2019-05-20 15:47:10 +01:00
* Click on "Stop" to stop the machine temporarily, or "Delete" to delete it permanently.
2019-05-20 16:13:21 +01:00
.. image :: ../images/providers/azure/delete-vm.png
2019-05-20 16:23:22 +01:00
:alt: Delete vm