Giter VIP home page Giter VIP logo

tljh-azure-button's Introduction

The Littlest JupyterHub deploy to Azure button

NEW โœจโœจ The minimum VM Ubuntu version has been updated to 22.4 thanks to @ionicsolutions โœจโœจ



Deploy your own Littlest JupyterHub using the blue "Deploy to Azure" button above ๐Ÿ‘†๐Ÿผ
This project is licensed under the MIT OSI license.
MIT license badge

What is the Littlest JupyterHub? ๐Ÿค”

A simple JupyterHub distribution for a small (1-100) number of users on a single server. You can find more info about it in the official docs.

Prerequisites ๐Ÿ“

You need an Azure account to be able to spin your JupyterHub.

๐Ÿคฉ If you do not have an Azure subscription you can get started with a free Azure subscription with 200 USD

What is in this repo? ๐Ÿ”

This repository contains the ARM (Azure Resource Manager) template for the Littlest JupyterHub deployment. This template was created to help you deploy a vanilla Littlest JupyterHub by clicking on the "Deploy to Azure" blue button at the top of this document.

It follows the recommended configuration in the official The Littlest JupyterHub docs but eliminates the deployment friction by predefining some standard settings.

How does the Deploy on Azure button work? ๐Ÿ’ป

The ARM template contains all the configurations needed to deploy your own Littlest JupyterHub on Azure.

This template follows the configuration detailed in https://the-littlest-jupyterhub.readthedocs.io/en/latest/install/azure.html. But it reduces some friction by eliminating the need to create resources manually using the Azure portal.

Note You still need to remove your resources manually when you are done using them. Otherwise, you will be charged for their use.

Deployment instructions ๐Ÿš€

To deploy your TLJH follow these steps:

  1. Create an Azure account (if you need a free one go to ๐Ÿ‘‰๐Ÿผ this link ๐Ÿ‘ˆ๐Ÿผ)

  2. Click on the Deploy to Azure button at the top of this README. This will redirect you to the Azure portal login page.

  3. Login to your account.

  4. Fill in the details on the next screen (see details below):

    Azure dashboard - Custom deployment form

    • Subscription: choose the subscription you want to use (e.g. Free Trial)
    • Resource group: this will keep all of our resources together. If you have never created a resource group click on Create new and give it a meaningful name (e.g. jupyter-resources)
    • Location: this is the Azure region where you want all your resources to be (e.g. WestEurope, you can check all the available regions here)
    • Virtual Machine Name: the name for your virtual machine. The default is TLHJ-Ubuntu, but you can choose any name you prefer.
    • Virtual Machine Size: the workload will determine this. You can check the list of available VM sizes on the Azure website. This is a dropdown from version 1.1.0 onwards
    • Admin UserName: this will be the root user and is needed for the management of your TLJH
    • Admin password: choose a secure password for your root user. Note that this is not displayed later on in the outputs for security reasons so make sure to make note of it.
    • OS Disk Type: you have the options Standard HDD (LRS), Standard SSD and Premium SSD (for more details see the docs). The default value is Standard_LRS.
    • Data Disk Size: the size of your Data disk size (for more information visit the docs)
    • Script Location: This is the script that installs the Jupyter server in your VM. By default, it points to the script in this repository corresponding to the vanilla installation of TLJH (scripts/install.sh). Read more in the customising the installer section of this README.

    By default, the template allows network traffic through HTTP and HTTPS.

  5. Once completed, read the terms and conditions and if you are happy with them, go ahead and tick the I agree to the terms and conditions stated above box and click on the Purchase button.

    The deployment will take around 10 minutes - first, all your resources will be deployed, and then THLJ will be installed on your VM.

  6. To check your new Virtual Machine Expand the left-hand panel by clicking on the ">>" button in the top left corner of your dashboard. Find the Virtual Machines tab and click on it.

    azure portal vm

  7. Click on your Virtual Machine, copy the Public IP address and access it through your web browser.

    ip

    Warning This page will be unavailable during the installation of the server. If this happens, be patient, give it a bit longer and refresh the page.

    Once the installation is complete, you will get a login page like the one below:

    login screen
  8. Login using the admin username and password you created before

  9. Congratulations you have a running working JupyterHub ๐ŸŽ‰

๐Ÿ‘ฉ๐Ÿฟโ€๐Ÿ’ปโœจ You are now ready to add users, install packages and start using your JupyterHub. For instructions on how to do this visit ๐Ÿ‘‰๐Ÿผ the official The Littlest JupyterHub documentation.

Customising the installer โœจ

You can customise the installer by adding command line parameters. From v1.1.0 you can now specify a TLJH install script to customise the installation.

For example, if you want to install Python packages in the user environment from a requirements.txt file you can pass the parameter --user-requirements-txt-URL <url-to-requirements.txt> where URL-to-requirements.txt must be a valid URL:

--user-requirements-txt-URL https://raw.githubusercontent.com/data-8/materials-sp18/master/requirements.txt

Note When pointing to a file on GitHub, make sure to use the 'Raw' version. It should point to raw.githubusercontent.com, not github.com.

Let's use as an example the voilร -gallery plugin`. First, you will have to create a bash script with the customised JupyterHub installer:

# !/bin/bash

curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py \
 | sudo python3 - \
   --plugin git+https://github.com/voila-dashboards/tljh-voila-gallery@master#"egg=tljh-voila-gallery&subdirectory=tljh-voila-gallery"

And update the scriptLocation parameter accordingly when deploying your littlest JupyterHub (in the details form after you log into your Azure account). For the above example:

https://raw.githubusercontent.com/trallard/TLJH-azure-button/feature-plugins/scripts/install_voila.sh

So once the VM is created and the plugins installed you can go to the public IP of your VM. In the case of the Voilร  plugin, you will be greeted with this screen instead of the usual TLHJ one:

Voilร  screen

Always make sure that the script is publicly available (e.g. public repo, public gist) and that you are pointing to the raw content.

Note For more details on customising your installation visit the main TLJH documentation.

In this repo you will find the following installation scripts:

Architecture ๐Ÿšง

When you deploy a JupyterHub on Azure (either using the Deploy to Azure button or following the steps from the docs) the following resources are created:

vms

They are all grouped in the same region defined for your Resource group. Also, note that the storage disk created with this template will be of the same type as the OS disk type` you provide on the template.

If you want to learn more about VM types and sizes, including compatibility between the VMS and storage (standard or premium) you can visit the official Azure Linux VM documentation.

Details on how to delete and stop your virtual machine can be found at https://the-littlest-jupyterhub.readthedocs.io/en/latest/howto/providers/azure.html.

If you want to get rid of all the associated resources after you are done with your JupyterHub the easiest way to do it is to delete the resource group altogether (provided you do not have other resources in this group that you might need later).

Deleting your resources ๐Ÿ—‘

To delete a resource group from the Azure portal:

  1. Go to Resource groups on the left-hand panel of your Azure Portal.
  2. Click on the resource group that contains your JupyterHub resources.
  3. Click on Delete resource group you will then be asked to confirm the operation. This operation will take between 5 and 10 minutes.

delete group

See the useful tips and commands section for the command to delete using the command line and the Azure CLI.

Additional resources ๐Ÿ“–

Here are some links that you might find useful when using the content in this repo.

๐Ÿ“– Azure Resource Manager templates docs

๐Ÿ“– The Littlest JupyterHub docs

๐Ÿ“– VM available regions - Azure docs

๐Ÿ“– Azure VM sizes documentation

๐Ÿ“– Azure VMs disks documentation

๐Ÿ“– Install the Azure CLI

Useful tips and commands ๐Ÿ‘

If you are familiar with the command line and have the az cli installed the following commands might come in handy:

  • Finding available VM sizes in a specific location
az vm list-sizes --location <location> --output table
  • View the current size of a VM with:
az vm show --resource-group <resource-group> --name <VirtualMachineName> --query hardwareProfile.vmSize
  • You can resize your VM after it has been deployed if needed
# First check if the desired size is available
az vm list-vm-resize-options --resource-group <resource-group> --name  <VirtualMachineName> --query [].name

# resize the VM
az vm resize --resource-group <resource-group> --name  <VirtualMachineName> --size <desired-size>
  • Stop virtual machine
az vm stop --resource-group <resource-group> --name  <VirtualMachineName>
  • Delete resource group
az group delete --name <resource-group> --no-wait --yes

Issues and contributing ๐Ÿ––๐Ÿผ

Contributions are welcome. Also, if you encounter any issues, please go ahead and create an issue in this repo.

The detailed contribution guidelines can be found at CONTRIBUTING, make sure to have a look first ๐Ÿ‘€

tljh-azure-button's People

Contributors

georgebisbas avatar ionicsolutions avatar rileymshea avatar sgibson91 avatar trallard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tljh-azure-button's Issues

Typos and broken links

This is a great place to start if you're looking to dip your toe into contributing via GitHub.

If you see a typo or a broken link anywhere in our documentation you can fix by making a pull request.

This is one of our "good first issues" and therefore you don't have to have any experience with GitHub to complete it. Just comment below with the mistake that you've found, and @trallard will be sure to help you all the way along to merging in your the new - correct - version of the text.

Support for plugins

Really cool to see more options for one-click JupyterHub deployments!

Are there any plans to also support TLJH plugins, for example as extra parameters?

I quickly checked the azuredeploy.json file but couldn't find any reference to it.

404 Page not found after install

Ran this a few years ago for a project. Worked really well. Today running it in the same way, getting 404.
image

My script output:

vm:~$ curl https://raw.githubusercontent.com/jupyterhub/the-littlest-jupyterhub/master/bootstrap/bootstrap.py \
>   | sudo python3 - \
>     --admin billmansuper \
>     --show-progress-page
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16481  100 16481    0     0  84953      0 --:--:-- --:--:-- --:--:-- 84953
Existing TLJH installation detected, upgrading...
Upgrading pip...
Upgrading TLJH installer...
Running TLJH installer...
Setting up admin users
Granting passwordless sudo to JupyterHub admins...
Setting up user environment...
Setting up JupyterHub...
Waiting for JupyterHub to come up (1/20 tries)
Done!

I notice that this repo hasn't been updated in a while, does this process still work?

Deployment failure

Hi Tania,

trying to deploy TLJH I got the following error:

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"Conflict","message":"{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"VMExtensionProvisioningError\",\r\n \"message\": \"VM has reported a failure when processing extension 'installscript'. Error message: \\\"Enable failed: failed to execute command: command terminated with exit status=123\\n[stdout]\\n\\n[stderr]\\n % Total % Received % Xferd Average Speed Time Time Time Current\\n Dload Upload Total Spent Left Speed\\n\\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\\r100 6354 100 6354 0 0 68322 0 --:--:-- --:--:-- --:--:-- 67595\\nChecking if TLJH is already installed...\\nSetting up hub environment\\nInstalled python & virtual environment\\nSet up hub virtual environment\\nSetting up TLJH installer...\\nSetup tljh package\\nStarting TLJH installer...\\nRan /opt/tljh/hub/bin/python -m pip install --no-cache-dir git+https://github.com/yuvipanda/[email protected] with exit code 1\\nCollecting git+https://github.com/yuvipanda/[email protected]\\n Cloning https://github.com/yuvipanda/tljh-pangeo (to v0.1) to /tmp/pip-nqowst8a-build\\n Could not find a tag or branch 'v0.1', assuming commit.\\nerror: pathspec 'v0.1' did not match any file(s) known to git.\\nCommand \\\"git checkout -q v0.1\\\" failed with error code 1 in /tmp/pip-nqowst8a-build\\n\\nTraceback (most recent call last):\\n File \\\"/usr/lib/python3.6/runpy.py\\\", line 193, in _run_module_as_main\\n \\\"__main__\\\", mod_spec)\\n File \\\"/usr/lib/python3.6/runpy.py\\\", line 85, in _run_code\\n exec(code, run_globals)\\n File \\\"/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py\\\", line 508, in <module>\\n main()\\n File \\\"/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py\\\", line 486, in main\\n pm = setup_plugins(args.plugin)\\n File \\\"/opt/tljh/hub/lib/python3.6/site-packages/tljh/installer.py\\\", line 389, in setup_plugins\\n conda.ensure_pip_packages(HUB_ENV_PREFIX, plugins)\\n File \\\"/opt/tljh/hub/lib/python3.6/site-packages/tljh/conda.py\\\", line 135, in ensure_pip_packages\\n ] + packages)\\n File \\\"/opt/tljh/hub/lib/python3.6/site-packages/tljh/utils.py\\\", line 32, in run_subprocess\\n raise subprocess.CalledProcessError(cmd=cmd, returncode=proc.returncode)\\nsubprocess.CalledProcessError: Command '['/opt/tljh/hub/bin/python', '-m', 'pip', 'install', '--no-cache-dir', 'git+https://github.com/yuvipanda/[email protected]']' returned non-zero exit status 1.\\n\\\"\\r\\n\\r\\nMore information on troubleshooting is available at https://aka.ms/VMExtensionCSELinuxTroubleshoot \"\r\n }\r\n ]\r\n }\r\n}"}]}

Is that just a typo that needs fixing in terms of a release or am I missing something else?

Thank you in advance,
George Bisbas

Template specifies 18.04 but 20.04 or better is needed

The Littlest JupyterHub requires Ubuntu 20.04 or higher

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"VMExtensionProvisioningError","message":"De VM heeft een fout gerapporteerd bij het verwerken van de extensie installscript. Foutbericht: Enable failed: failed to execute command: command terminated with exit status=123\n[stdout]\nThe Littlest JupyterHub requires Ubuntu 20.04 or higher\n\n[stderr]\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n\r  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\r100 18363  100 18363    0     0   133k      0 --:--:-- --:--:-- --:--:--  133k\n\r\n\r\nMeer informatie over probleemoplossing is beschikbaar op https://aka.ms/VMExtensionCSELinuxTroubleshoot "}]}

Deploy to Azure button fail Ubuntu 18 vs 20

The template gives a choice (no choice) of 18.04-LTS but the Create hits an error after a minute or so 'TLJH requires Ubuntu 20.04 or higher'. I tried again by editing the Template and Parameters in 3 locations to read 20.04 (only choice) but this bombed as well... "changing property 'imageReference' is not allowed" (me:[email protected])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.