From d4f12e3789ee20f2b84d2ce025a4fbfc7f99a4d4 Mon Sep 17 00:00:00 2001 From: Adon Metcalfe Date: Sat, 14 Jan 2023 10:21:34 +0800 Subject: [PATCH 1/8] Update custom-server.rst Just noting that TLJH works on newer versions of ubuntu in docs --- docs/install/custom-server.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install/custom-server.rst b/docs/install/custom-server.rst index bcb616d..cac3060 100644 --- a/docs/install/custom-server.rst +++ b/docs/install/custom-server.rst @@ -31,7 +31,7 @@ Pre-requisites ============== #. Some familiarity with the command line. -#. A server running Ubuntu 18.04 where you have root access. +#. A server running Ubuntu 18.04+ where you have root access. #. At least **1GB** of RAM on your server. #. Ability to ``ssh`` into the server & run commands from the prompt. #. An **IP address** where the server can be reached from the browsers of your target audience. From 3b0ab71fe7dbdd822d79d79ebc210c583b444b2f Mon Sep 17 00:00:00 2001 From: Adon Metcalfe Date: Sat, 14 Jan 2023 10:33:39 +0800 Subject: [PATCH 2/8] General revamp of docs to point to newer ubuntu LTS --- docs/install/amazon.rst | 6 +++--- docs/install/azure.rst | 4 ++-- docs/install/custom-server.rst | 2 +- docs/install/digitalocean.rst | 4 ++-- docs/install/google.rst | 4 ++-- docs/install/index.rst | 2 +- docs/install/jetstream.rst | 6 +++--- docs/install/ovh.rst | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/install/amazon.rst b/docs/install/amazon.rst index e043301..4dbe054 100644 --- a/docs/install/amazon.rst +++ b/docs/install/amazon.rst @@ -58,15 +58,15 @@ Let's create the server on which we can run JupyterHub. #. On the page **Step 1: Choose an Amazon Machine Image (AMI)** you are going to pick the base image your remote server will have. The view will default to the 'Quick-start' tab selected and just a few down the page, select - **Ubuntu Server 18.04 LTS (HVM), SSD Volume Type - ami-XXXXXXXXXXXXXXXXX**, + **Ubuntu Server 22.04 LTS (HVM), SSD Volume Type - ami-XXXXXXXXXXXXXXXXX**, leaving `64-bit (x86)` toggled. .. image:: ../images/providers/amazon/select_ubuntu_18.png - :alt: Click Ubuntu server 18.04 + :alt: Click Ubuntu server 22.04 The `ami` alpha-numeric at the end references the specific Amazon machine image, ignore this as Amazon updates them routinely. The - **Ubuntu Server 18.04 LTS (HVM)** is the important part. + **Ubuntu Server 22.04 LTS (HVM)** is the important part. #. After selecting the AMI, you'll be at **Step 2: Choose an Instance Type**. diff --git a/docs/install/azure.rst b/docs/install/azure.rst index 62f7cf8..3ed81b2 100644 --- a/docs/install/azure.rst +++ b/docs/install/azure.rst @@ -52,7 +52,7 @@ A new screen with all the options for Virtual Machines in Azure will displayed. :alt: Create VM from the marketplace #. **Choose an Ubuntu server for your VM**: - * Click `Ubuntu Server 18.04 LTS.` + * Click `Ubuntu Server 22.04 LTS.` * Make sure `Resource Manager` is selected in the next screen and click **Create** .. image:: ../images/providers/azure/ubuntu-vm.png @@ -70,7 +70,7 @@ A new screen with all the options for Virtual Machines in Azure will displayed. * **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). + * **Image**. Make sure "Ubuntu Server 22.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. diff --git a/docs/install/custom-server.rst b/docs/install/custom-server.rst index cac3060..a28b45e 100644 --- a/docs/install/custom-server.rst +++ b/docs/install/custom-server.rst @@ -31,7 +31,7 @@ Pre-requisites ============== #. Some familiarity with the command line. -#. A server running Ubuntu 18.04+ where you have root access. +#. A server running Ubuntu 18.04+ where you have root access (Ubuntu 22.04 LTS recommended). #. At least **1GB** of RAM on your server. #. Ability to ``ssh`` into the server & run commands from the prompt. #. An **IP address** where the server can be reached from the browsers of your target audience. diff --git a/docs/install/digitalocean.rst b/docs/install/digitalocean.rst index 38d07a0..cbf40d5 100644 --- a/docs/install/digitalocean.rst +++ b/docs/install/digitalocean.rst @@ -34,10 +34,10 @@ Let's create the server on which we can run JupyterHub. This takes you to a page titled **Create Droplets** that lets you configure your server. -#. Under **Choose an image**, select **18.04 x64** under **Ubuntu**. +#. Under **Choose an image**, select **22.04 x64** under **Ubuntu**. .. image:: ../images/providers/digitalocean/select-image.png - :alt: Select 18.04 x64 image under Ubuntu + :alt: Select 22.04 x64 image under Ubuntu #. Under **Choose a size**, select the size of the server you want. The default (4GB RAM, 2CPUs, 20 USD / month) is not a bad start. You can resize your server diff --git a/docs/install/google.rst b/docs/install/google.rst index f6081d5..d6e38be 100644 --- a/docs/install/google.rst +++ b/docs/install/google.rst @@ -94,10 +94,10 @@ Let's create the server on which we can run JupyterHub. This should open a **Boot disk** popup. -#. Select **Ubuntu 18.04 LTS** from the list of operating system images. +#. Select **Ubuntu 22.04 LTS** from the list of operating system images. .. image:: ../images/providers/google/boot-disk-ubuntu.png - :alt: Selecting Ubuntu 18.04 for OS + :alt: Selecting Ubuntu 22.04 for OS #. You can also change the **type** and **size** of your disk at the bottom of this popup. diff --git a/docs/install/index.rst b/docs/install/index.rst index b783486..086083d 100644 --- a/docs/install/index.rst +++ b/docs/install/index.rst @@ -5,7 +5,7 @@ Installing ========== The Littlest JupyterHub (TLJH) can run on any server that is running at least -**Ubuntu 18.04**. Earlier versions of Ubuntu are not supported. +**Ubuntu 18.04 (22.04 LTS recommended)**. Earlier versions of Ubuntu are not supported. We have a bunch of tutorials to get you started. Tutorials to create a new server from scratch on a cloud provider & run TLJH diff --git a/docs/install/jetstream.rst b/docs/install/jetstream.rst index 7f95a3b..e9e55ad 100644 --- a/docs/install/jetstream.rst +++ b/docs/install/jetstream.rst @@ -33,11 +33,11 @@ Let's create the server on which we can run JupyterHub. This takes you to a page with a list of base images you can choose for your server. -#. Under **Image Search**, search for **Ubuntu 18.04**, and select the - **Ubuntu 18.04 Devel and Docker** image. +#. Under **Image Search**, search for **Ubuntu 22.04**, and select the + **Ubuntu 22.04 Devel and Docker** image. .. image:: ../images/providers/jetstream/select-image.png - :alt: Select Ubuntu 18.04 x64 image from image list + :alt: Select Ubuntu 22.04 x64 image from image list #. Once selected, you will see more information about this image. Click the **Launch** button on the top right. diff --git a/docs/install/ovh.rst b/docs/install/ovh.rst index 241368c..8639918 100644 --- a/docs/install/ovh.rst +++ b/docs/install/ovh.rst @@ -52,10 +52,10 @@ Let's create the server on which we can run JupyterHub. #. **Select a region**. -#. Select **Ubuntu 18.04** as the image: +#. Select **Ubuntu 22.04** as the image: .. image:: ../images/providers/ovh/distribution.png - :alt: Select Ubuntu 18.04 as the image + :alt: Select Ubuntu 22.04 as the image #. OVH requires setting an SSH key to be able to connect to the instance. You can create a new SSH by following From aa72179afa0b47547488621c92959b51fda1ab73 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 21 Mar 2023 10:15:22 +0100 Subject: [PATCH 3/8] require ubuntu 20.04, test on debian 10 --- .github/workflows/integration-test.yaml | 50 +++++++++++-------------- .github/workflows/unit-test.yaml | 3 -- README.md | 2 +- bootstrap/bootstrap.py | 31 ++++++++------- docs/index.rst | 2 +- docs/install/amazon.rst | 6 +-- docs/install/azure.rst | 32 ++++++++-------- docs/install/custom-server.rst | 2 +- docs/install/digitalocean.rst | 4 +- docs/install/google.rst | 4 +- docs/install/index.rst | 3 +- docs/install/jetstream.rst | 6 +-- docs/install/ovh.rst | 10 ++--- docs/topic/requirements.rst | 2 +- integration-tests/Dockerfile | 4 +- integration-tests/test_bootstrap.py | 12 +++--- 16 files changed, 85 insertions(+), 88 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index cee1049..3993684 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -58,36 +58,28 @@ jobs: echo $matrix_post_filter | jq -C '.' env: matrix_include_pre_filter: | - - name: "Int. tests: Ubuntu 18.04, Py 3.6" - ubuntu_version: "18.04" - python_version: "3.6" + - name: "Int. tests: Debian 10, Py 3.7" + distro_image: "debian:10" + runs_on: "ubuntu-22.04" extra_flags: "" - - name: "Int. tests: Ubuntu 20.04, Py 3.9" - ubuntu_version: "20.04" - python_version: "3.9" + - name: "Int. tests: Ubuntu 20.04, Py 3.8" + distro_image: "ubuntu:20.04" extra_flags: "" - - name: "Int. tests: Ubuntu 22.04, Py 3.10" - ubuntu_version: "22.04" - python_version: "3.10" + - name: "Int. tests: Ubuntu 22.04 (Py 3.10)" + distro_image: "ubuntu:22.04" extra_flags: "" - name: "Int. tests: Ubuntu 22.04, Py 3.10, --upgrade" - ubuntu_version: "22.04" - python_version: "3.10" + distro_image: "ubuntu:22.04" extra_flags: --upgrade dont_run_on_ref: refs/heads/master integration-tests: needs: decide-on-test-jobs-to-run - # runs-on can only be configured to the LTS releases of ubuntu (20.04, - # 22.04, ...), so if we want to test against the latest non-LTS release, we - # must compromise when configuring runs-on and configure runs-on to be the - # latest LTS release instead. - # - # This can have consequences because actions like actions/setup-python will - # mount cached installations associated with the chosen runs-on environment. - # - runs-on: ${{ format('ubuntu-{0}', matrix.runs_on || matrix.ubuntu_version) }} + # integration tests run in a container, + # not in the worker, so this version is not relevant to the tests + # and can be the same for all tested versions + runs-on: ubuntu-22.04 name: ${{ matrix.name }} strategy: @@ -98,7 +90,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: "${{ matrix.python_version }}" + python-version: "3.10" - name: Install pytest run: python3 -m pip install pytest @@ -106,7 +98,7 @@ jobs: # We abort pytest after two failures as a compromise between wanting to # avoid a flood of logs while still understanding if multiple tests would # fail. - - name: Run bootstrap tests (Runs in/Builds ubuntu:${{ matrix.ubuntu_version }} derived image) + - name: Run bootstrap tests (Runs in/Builds ${{ matrix.distro_image }} derived image) run: | pytest --verbose --maxfail=2 --color=yes --durations=10 --capture=no \ integration-tests/test_bootstrap.py @@ -115,14 +107,14 @@ jobs: # integration-tests/test_bootstrap.py will build and start containers # based on this environment variable. This is similar to how # .github/integration-test.py build-image can take a --build-arg - # setting the ubuntu_version. - UBUNTU_VERSION: ${{ matrix.ubuntu_version }} + # setting the base image. + BASE_IMAGE: ${{ matrix.distro_image }} # We build a docker image from wherein we will work - - name: Build systemd image (Builds ubuntu:${{ matrix.ubuntu_version }} derived image) + - name: Build systemd image (Builds ${{ matrix.distro_image }} derived image) run: | .github/integration-test.py build-image \ - --build-arg "ubuntu_version=${{ matrix.ubuntu_version }}" + --build-arg "BASE_IMAGE=${{ matrix.distro_image }}" # FIXME: Make the logic below easier to follow. # - In short, setting BOOTSTRAP_PIP_SPEC here, specifies from what @@ -151,7 +143,7 @@ jobs: echo "BOOTSTRAP_PIP_SPEC=$BOOTSTRAP_PIP_SPEC" >> $GITHUB_ENV echo $BOOTSTRAP_PIP_SPEC - - name: Run basic tests (Runs in ubuntu:${{ matrix.ubuntu_version }} derived image) + - name: Run basic tests (Runs in ${{ matrix.distro_image }} derived image) run: | .github/integration-test.py run-test basic-tests \ --bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \ @@ -162,7 +154,7 @@ jobs: test_extensions.py timeout-minutes: 15 - - name: Run admin tests (Runs in ubuntu:${{ matrix.ubuntu_version }} derived image) + - name: Run admin tests (Runs in ${{ matrix.distro_image }} derived image) run: | .github/integration-test.py run-test admin-tests \ --installer-args "--admin admin:admin" \ @@ -171,7 +163,7 @@ jobs: test_admin_installer.py timeout-minutes: 15 - - name: Run plugin tests (Runs in ubuntu:${{ matrix.ubuntu_version }} derived image) + - name: Run plugin tests (Runs in ${{ matrix.distro_image }} derived image) run: | .github/integration-test.py run-test plugin-tests \ --bootstrap-pip-spec "$BOOTSTRAP_PIP_SPEC" \ diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 71804f3..a0acde8 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -42,9 +42,6 @@ jobs: fail-fast: false matrix: include: - - name: "Unit tests: Ubuntu 18.04, Py 3.6" - ubuntu_version: "18.04" - python_version: "3.6" - name: "Unit tests: Ubuntu 20.04, Py 3.9" ubuntu_version: "20.04" python_version: "3.9" diff --git a/README.md b/README.md index 361e8be..46f2d19 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ might still make breaking changes that have no clear upgrade pathway. ## Installation The Littlest JupyterHub (TLJH) can run on any server that is running at least -**Ubuntu 18.04**. Earlier versions of Ubuntu are not supported. +**Ubuntu 20.04**. Earlier versions of Ubuntu are not supported. We have several tutorials to get you started. - Tutorials to create a new server from scratch on a cloud provider & run TLJH diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index 0e9ba81..2895e0b 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -9,11 +9,10 @@ This script is run as: Constraints: - - The entire script should be compatible with Python 3.6, which is the on - Ubuntu 18.04+. - - The script should parse in Python 3.5 as we print error messages for using - Ubuntu 16.04+ which comes with Python 3.5 by default. This means no - f-strings can be used. + - The entire script should be compatible with Python 3.7, which is the on + Debian 10. + - The script should parse in Python 3.6 as we print error messages for using + Ubuntu 18.04+ which comes with Python 3.6 by default. - The script must depend only on stdlib modules, as no previous installation of dependencies can be assumed. @@ -132,6 +131,12 @@ progress_page_html = """ logger = logging.getLogger(__name__) + +def _parse_version(vs): + """Parse a simple version into a tuple of ints""" + return (int(part) for part in vs.split(".")) + + # This function is needed both by the process starting this script, and by the # TLJH installer that this script execs in the end. Make sure its replica at # tljh/utils.py stays in sync with this version! @@ -199,22 +204,22 @@ def ensure_host_system_can_install_tljh(): .strip() ) - # Require Ubuntu 18.04+ or Debian 10+ + # Require Ubuntu 20.04+ or Debian 10+ distro = get_os_release_variable("ID") version = float(get_os_release_variable("VERSION_ID")) if distro not in ["ubuntu", "debian"]: print("The Littlest JupyterHub currently supports Ubuntu or Debian Linux only") sys.exit(1) - elif distro == "ubuntu" and float(version) < 18.04: - print("The Littlest JupyterHub requires Ubuntu 18.04 or higher") + elif distro == "ubuntu" and _parse_version(version) < (20, 4): + print("The Littlest JupyterHub requires Ubuntu 20.04 or higher") sys.exit(1) - elif distro == "debian" and float(version) < 10: + elif distro == "debian" and _parse_version(version) < (10,): print("The Littlest JupyterHub requires Debian 10 or higher") sys.exit(1) # Require Python 3.6+ - if sys.version_info < (3, 6): - print("bootstrap.py must be run with at least Python 3.6") + if sys.version_info < (3, 7): + print(f"bootstrap.py must be run with at least Python 3.7, found {sys.version}") sys.exit(1) # Require systemd (systemctl is a part of systemd) @@ -230,7 +235,7 @@ def ensure_host_system_can_install_tljh(): "For local development, see http://tljh.jupyter.org/en/latest/contributing/dev-setup.html" ) sys.exit(1) - return distro, version + return distro, version class ProgressPageRequestHandler(SimpleHTTPRequestHandler): @@ -441,7 +446,7 @@ def main(): "python3-venv", "python3-pip", "git", - "sudo", # sudo is missing in default debian install + "sudo", # sudo is missing in default debian install ], env=apt_get_adjusted_env, ) diff --git a/docs/index.rst b/docs/index.rst index 074a4d2..2d40312 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,7 +17,7 @@ might still make breaking changes that have no clear upgrade pathway. Installation ============ -The Littlest JupyterHub (TLJH) can run on any server that is running **Ubuntu 18.04** or **Ubuntu 20.04** on a amd64 or arm64 CPU architecture. Earlier versions of Ubuntu are not supported. +The Littlest JupyterHub (TLJH) can run on any server that is running **Debian 10** or **Ubuntu 20.04** on a amd64 or arm64 CPU architecture. Earlier versions of Ubuntu and Debian are not supported, as are other Linux distributions. We have a bunch of tutorials to get you started. - Tutorials to create a new server from scratch on a cloud provider & run TLJH diff --git a/docs/install/amazon.rst b/docs/install/amazon.rst index e043301..4dbe054 100644 --- a/docs/install/amazon.rst +++ b/docs/install/amazon.rst @@ -58,15 +58,15 @@ Let's create the server on which we can run JupyterHub. #. On the page **Step 1: Choose an Amazon Machine Image (AMI)** you are going to pick the base image your remote server will have. The view will default to the 'Quick-start' tab selected and just a few down the page, select - **Ubuntu Server 18.04 LTS (HVM), SSD Volume Type - ami-XXXXXXXXXXXXXXXXX**, + **Ubuntu Server 22.04 LTS (HVM), SSD Volume Type - ami-XXXXXXXXXXXXXXXXX**, leaving `64-bit (x86)` toggled. .. image:: ../images/providers/amazon/select_ubuntu_18.png - :alt: Click Ubuntu server 18.04 + :alt: Click Ubuntu server 22.04 The `ami` alpha-numeric at the end references the specific Amazon machine image, ignore this as Amazon updates them routinely. The - **Ubuntu Server 18.04 LTS (HVM)** is the important part. + **Ubuntu Server 22.04 LTS (HVM)** is the important part. #. After selecting the AMI, you'll be at **Step 2: Choose an Instance Type**. diff --git a/docs/install/azure.rst b/docs/install/azure.rst index 62f7cf8..68f29c5 100644 --- a/docs/install/azure.rst +++ b/docs/install/azure.rst @@ -13,16 +13,16 @@ users and a user environment with packages you want to be installed running on This tutorial leads you step-by-step for you to manually deploy your own JupyterHub on Azure cloud. -.. note:: ✨ The ``Deploy to Azure button`` project allows you to deploy your own JupyterHub with minimal manual configuration steps. The deploy to Azure button allows you to have a vanilla configuration in just one-click and by assigning some variables. - +.. note:: ✨ The ``Deploy to Azure button`` project allows you to deploy your own JupyterHub with minimal manual configuration steps. The deploy to Azure button allows you to have a vanilla configuration in just one-click and by assigning some variables. + Check it out at `https://github.com/trallard/TLJH-azure-button `_. Prerequisites ============== -* A Microsoft Azure account. +* A Microsoft Azure account. -* To get started you can get a free account which includes 150 dollars worth of Azure credits (`get a free account here `_) +* To get started you can get a free account which includes 150 dollars worth of Azure credits (`get a free account here `_) These instructions cover how to set up a Virtual Machine on Microsoft Azure. For subsequent information about creating @@ -51,8 +51,8 @@ A new screen with all the options for Virtual Machines in Azure will displayed. .. image:: ../images/providers/azure/create-vm.png :alt: Create VM from the marketplace -#. **Choose an Ubuntu server for your VM**: - * Click `Ubuntu Server 18.04 LTS.` +#. **Choose an Ubuntu server for your VM**: + * Click `Ubuntu Server 22.04 LTS.` * Make sure `Resource Manager` is selected in the next screen and click **Create** .. image:: ../images/providers/azure/ubuntu-vm.png @@ -70,7 +70,7 @@ A new screen with all the options for Virtual Machines in Azure will displayed. * **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). + * **Image**. Make sure "Ubuntu Server 22.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. @@ -83,17 +83,17 @@ A new screen with all the options for Virtual Machines in Azure will displayed. #. 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) + * Click on **Change size** (see image below) .. image:: ../images/providers/azure/size-vm.png - :alt: Choose vm size + :alt: Choose vm size - .. note:: For more information about estimating memory, CPU and disk needs check `The memory section in the TLJH documentation `_ + .. note:: For more information about estimating memory, CPU and disk needs check `The memory section in the TLJH documentation `_ + + * Select a suitable image (to check available images and prices in your region `click on this link `_). - * Select a suitable image (to check available images and prices in your region `click on this link `_). - #. Disks (Storage): - * **Disk options**: select the OS disk type there are options for SDD and HDD. **SSD persistent disk** gives you a faster but more expensive disk than HDD. + * **Disk options**: select 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". @@ -111,7 +111,7 @@ A new screen with all the options for Virtual Machines in Azure will displayed. * **Public inbound ports**. Check **HTTP**, **HTTPS**, and **SSH**. .. image:: ../images/providers/azure/networking-vm.png - :alt: Choose networking ports + :alt: Choose networking ports #. Management * Monitoring @@ -129,7 +129,7 @@ A new screen with all the options for Virtual Machines in Azure will displayed. #. 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. + * **Cloud init**. We are going to use this section to install TLJH directly into our Virtual Machine. Copy the code snippet below: .. code:: bash @@ -165,7 +165,7 @@ A new screen with all the options for Virtual Machines in Azure will displayed. .. image:: ../images/providers/azure/goto-vm.png :alt: Go to VM -#. Check if the installation is completed by **copying** the **Public IP address** of your virtual machine, and trying to access it with a browser. +#. Check if the installation is completed by **copying** the **Public IP address** of your virtual machine, and trying to access it with a browser. .. image:: ../images/providers/azure/ip-vm.png :alt: Public IP address diff --git a/docs/install/custom-server.rst b/docs/install/custom-server.rst index bcb616d..9c94843 100644 --- a/docs/install/custom-server.rst +++ b/docs/install/custom-server.rst @@ -31,7 +31,7 @@ Pre-requisites ============== #. Some familiarity with the command line. -#. A server running Ubuntu 18.04 where you have root access. +#. A server running Ubuntu 20.04 where you have root access. #. At least **1GB** of RAM on your server. #. Ability to ``ssh`` into the server & run commands from the prompt. #. An **IP address** where the server can be reached from the browsers of your target audience. diff --git a/docs/install/digitalocean.rst b/docs/install/digitalocean.rst index 38d07a0..cbf40d5 100644 --- a/docs/install/digitalocean.rst +++ b/docs/install/digitalocean.rst @@ -34,10 +34,10 @@ Let's create the server on which we can run JupyterHub. This takes you to a page titled **Create Droplets** that lets you configure your server. -#. Under **Choose an image**, select **18.04 x64** under **Ubuntu**. +#. Under **Choose an image**, select **22.04 x64** under **Ubuntu**. .. image:: ../images/providers/digitalocean/select-image.png - :alt: Select 18.04 x64 image under Ubuntu + :alt: Select 22.04 x64 image under Ubuntu #. Under **Choose a size**, select the size of the server you want. The default (4GB RAM, 2CPUs, 20 USD / month) is not a bad start. You can resize your server diff --git a/docs/install/google.rst b/docs/install/google.rst index f6081d5..d6e38be 100644 --- a/docs/install/google.rst +++ b/docs/install/google.rst @@ -94,10 +94,10 @@ Let's create the server on which we can run JupyterHub. This should open a **Boot disk** popup. -#. Select **Ubuntu 18.04 LTS** from the list of operating system images. +#. Select **Ubuntu 22.04 LTS** from the list of operating system images. .. image:: ../images/providers/google/boot-disk-ubuntu.png - :alt: Selecting Ubuntu 18.04 for OS + :alt: Selecting Ubuntu 22.04 for OS #. You can also change the **type** and **size** of your disk at the bottom of this popup. diff --git a/docs/install/index.rst b/docs/install/index.rst index b783486..7f79e62 100644 --- a/docs/install/index.rst +++ b/docs/install/index.rst @@ -5,7 +5,8 @@ Installing ========== The Littlest JupyterHub (TLJH) can run on any server that is running at least -**Ubuntu 18.04**. Earlier versions of Ubuntu are not supported. +**Ubuntu 20.04** or **Debian 10**. Earlier versions of Ubuntu and Debian are not supported, +nor are other Linux distributions. We have a bunch of tutorials to get you started. Tutorials to create a new server from scratch on a cloud provider & run TLJH diff --git a/docs/install/jetstream.rst b/docs/install/jetstream.rst index 7f95a3b..e9e55ad 100644 --- a/docs/install/jetstream.rst +++ b/docs/install/jetstream.rst @@ -33,11 +33,11 @@ Let's create the server on which we can run JupyterHub. This takes you to a page with a list of base images you can choose for your server. -#. Under **Image Search**, search for **Ubuntu 18.04**, and select the - **Ubuntu 18.04 Devel and Docker** image. +#. Under **Image Search**, search for **Ubuntu 22.04**, and select the + **Ubuntu 22.04 Devel and Docker** image. .. image:: ../images/providers/jetstream/select-image.png - :alt: Select Ubuntu 18.04 x64 image from image list + :alt: Select Ubuntu 22.04 x64 image from image list #. Once selected, you will see more information about this image. Click the **Launch** button on the top right. diff --git a/docs/install/ovh.rst b/docs/install/ovh.rst index 241368c..33010b4 100644 --- a/docs/install/ovh.rst +++ b/docs/install/ovh.rst @@ -32,7 +32,7 @@ Let's create the server on which we can run JupyterHub. .. image:: ../images/providers/ovh/create-ovh-stack.png :alt: Button to create an OVH stack - + #. Select a name for the project: .. image:: ../images/providers/ovh/project-name.png @@ -47,15 +47,15 @@ Let's create the server on which we can run JupyterHub. .. image:: ../images/providers/ovh/create-instance.png :alt: Create a new instance - + #. **Select a model** for the instance. A good start is the **S1-4** model under **Shared resources** which comes with 4GB RAM, 1 vCores and 20GB SSD. - + #. **Select a region**. -#. Select **Ubuntu 18.04** as the image: +#. Select **Ubuntu 22.04** as the image: .. image:: ../images/providers/ovh/distribution.png - :alt: Select Ubuntu 18.04 as the image + :alt: Select Ubuntu 22.04 as the image #. OVH requires setting an SSH key to be able to connect to the instance. You can create a new SSH by following diff --git a/docs/topic/requirements.rst b/docs/topic/requirements.rst index 7b5f1a4..995733f 100644 --- a/docs/topic/requirements.rst +++ b/docs/topic/requirements.rst @@ -7,7 +7,7 @@ Server Requirements Operating System ================ -We require using Ubuntu 18.04 as the base operating system for your server. +We require using Ubuntu >=20.04 as the base operating system for your server. Root access =========== diff --git a/integration-tests/Dockerfile b/integration-tests/Dockerfile index 64d5d0b..69a7ba4 100644 --- a/integration-tests/Dockerfile +++ b/integration-tests/Dockerfile @@ -1,6 +1,6 @@ # Systemd inside a Docker container, for CI only -ARG ubuntu_version=20.04 -FROM ubuntu:${ubuntu_version} +ARG BASE_IMAGE=ubuntu:20.04 +FROM $BASE_IMAGE # DEBIAN_FRONTEND is set to avoid being asked for input and hang during build: # https://anonoz.github.io/tech/2020/04/24/docker-build-stuck-tzdata.html diff --git a/integration-tests/test_bootstrap.py b/integration-tests/test_bootstrap.py index bc97bee..8a97762 100644 --- a/integration-tests/test_bootstrap.py +++ b/integration-tests/test_bootstrap.py @@ -6,6 +6,8 @@ import os import subprocess import time +BASE_IMAGE = os.getenv("BASE_IMAGE", "ubuntu:20.04") + def install_pkgs(container_name, show_progress_page): # Install python3 inside the ubuntu container @@ -13,7 +15,7 @@ def install_pkgs(container_name, show_progress_page): pkgs = ["python3"] if show_progress_page: pkgs += ["systemd", "git", "curl"] - # Create the sudoers dir, so that the installer succesfully gets to the + # Create the sudoers dir, so that the installer successfully gets to the # point of starting jupyterhub and stopping the progress page server. subprocess.check_output( ["docker", "exec", container_name, "mkdir", "-p", "etc/sudoers.d"] @@ -128,15 +130,15 @@ def test_ubuntu_too_old(): """ Error with a useful message when running in older Ubuntu """ - output = run_bootstrap_after_preparing_container("old-distro-test", "ubuntu:16.04") - assert output.stdout == "The Littlest JupyterHub requires Ubuntu 18.04 or higher\n" + output = run_bootstrap_after_preparing_container("old-distro-test", "ubuntu:18.04") + assert output.stdout == "The Littlest JupyterHub requires Ubuntu 20.04 or higher\n" assert output.returncode == 1 def test_inside_no_systemd_docker(): output = run_bootstrap_after_preparing_container( "plain-docker-test", - f"ubuntu:{os.getenv('UBUNTU_VERSION', '20.04')}", + BASE_IMAGE, ) assert "Systemd is required to run TLJH" in output.stdout assert output.returncode == 1 @@ -172,7 +174,7 @@ def test_progress_page(): installer = executor.submit( run_bootstrap_after_preparing_container, "progress-page", - f"ubuntu:{os.getenv('UBUNTU_VERSION', '20.04')}", + BASE_IMAGE, True, ) From 150a3f62d67e2d20eb95f5995145c32fd2331c45 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 21 Mar 2023 10:39:40 +0100 Subject: [PATCH 4/8] parse distro version tuples instead of using floats --- .github/workflows/integration-test.yaml | 2 +- bootstrap/bootstrap.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 3993684..613f089 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -65,7 +65,7 @@ jobs: - name: "Int. tests: Ubuntu 20.04, Py 3.8" distro_image: "ubuntu:20.04" extra_flags: "" - - name: "Int. tests: Ubuntu 22.04 (Py 3.10)" + - name: "Int. tests: Ubuntu 22.04 Py 3.10" distro_image: "ubuntu:22.04" extra_flags: "" - name: "Int. tests: Ubuntu 22.04, Py 3.10, --upgrade" diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index 2895e0b..912c10f 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -206,7 +206,7 @@ def ensure_host_system_can_install_tljh(): # Require Ubuntu 20.04+ or Debian 10+ distro = get_os_release_variable("ID") - version = float(get_os_release_variable("VERSION_ID")) + version = get_os_release_variable("VERSION_ID") if distro not in ["ubuntu", "debian"]: print("The Littlest JupyterHub currently supports Ubuntu or Debian Linux only") sys.exit(1) From e03f5ec2cd5f99b3b63fe09d910fbdde14457981 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 21 Mar 2023 10:45:54 +0100 Subject: [PATCH 5/8] Require Debian 11, not 10 10 has too-old Python by default --- .github/workflows/integration-test.yaml | 4 ++-- bootstrap/bootstrap.py | 18 +++++++++--------- docs/index.rst | 3 ++- docs/install/index.rst | 5 ++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml index 613f089..940340d 100644 --- a/.github/workflows/integration-test.yaml +++ b/.github/workflows/integration-test.yaml @@ -58,8 +58,8 @@ jobs: echo $matrix_post_filter | jq -C '.' env: matrix_include_pre_filter: | - - name: "Int. tests: Debian 10, Py 3.7" - distro_image: "debian:10" + - name: "Int. tests: Debian 11, Py 3.9" + distro_image: "debian:11" runs_on: "ubuntu-22.04" extra_flags: "" - name: "Int. tests: Ubuntu 20.04, Py 3.8" diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index 912c10f..d4c9135 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -9,10 +9,10 @@ This script is run as: Constraints: - - The entire script should be compatible with Python 3.7, which is the on - Debian 10. + - The entire script should be compatible with Python 3.8, which is the on + Ubuntu 20.04. - The script should parse in Python 3.6 as we print error messages for using - Ubuntu 18.04+ which comes with Python 3.6 by default. + Ubuntu 18.04 which comes with Python 3.6 by default. - The script must depend only on stdlib modules, as no previous installation of dependencies can be assumed. @@ -134,7 +134,7 @@ logger = logging.getLogger(__name__) def _parse_version(vs): """Parse a simple version into a tuple of ints""" - return (int(part) for part in vs.split(".")) + return tuple(int(part) for part in vs.split(".")) # This function is needed both by the process starting this script, and by the @@ -204,7 +204,7 @@ def ensure_host_system_can_install_tljh(): .strip() ) - # Require Ubuntu 20.04+ or Debian 10+ + # Require Ubuntu 20.04+ or Debian 11+ distro = get_os_release_variable("ID") version = get_os_release_variable("VERSION_ID") if distro not in ["ubuntu", "debian"]: @@ -213,13 +213,13 @@ def ensure_host_system_can_install_tljh(): elif distro == "ubuntu" and _parse_version(version) < (20, 4): print("The Littlest JupyterHub requires Ubuntu 20.04 or higher") sys.exit(1) - elif distro == "debian" and _parse_version(version) < (10,): + elif distro == "debian" and _parse_version(version) < (11,): print("The Littlest JupyterHub requires Debian 10 or higher") sys.exit(1) - # Require Python 3.6+ - if sys.version_info < (3, 7): - print(f"bootstrap.py must be run with at least Python 3.7, found {sys.version}") + # Require Python 3.8+ + if sys.version_info < (3, 8): + print(f"bootstrap.py must be run with at least Python 3.8, found {sys.version}") sys.exit(1) # Require systemd (systemctl is a part of systemd) diff --git a/docs/index.rst b/docs/index.rst index 2d40312..d79adc7 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,7 +17,8 @@ might still make breaking changes that have no clear upgrade pathway. Installation ============ -The Littlest JupyterHub (TLJH) can run on any server that is running **Debian 10** or **Ubuntu 20.04** on a amd64 or arm64 CPU architecture. Earlier versions of Ubuntu and Debian are not supported, as are other Linux distributions. +The Littlest JupyterHub (TLJH) can run on any server that is running **Debian 11** or **Ubuntu 20.04** or **22.04** on a amd64 or arm64 CPU architecture. +Earlier versions of Ubuntu and Debian are not supported, nor are other Linux distributions. We have a bunch of tutorials to get you started. - Tutorials to create a new server from scratch on a cloud provider & run TLJH diff --git a/docs/install/index.rst b/docs/install/index.rst index 7f79e62..f53b0da 100644 --- a/docs/install/index.rst +++ b/docs/install/index.rst @@ -4,9 +4,8 @@ Installing ========== -The Littlest JupyterHub (TLJH) can run on any server that is running at least -**Ubuntu 20.04** or **Debian 10**. Earlier versions of Ubuntu and Debian are not supported, -nor are other Linux distributions. +The Littlest JupyterHub (TLJH) can run on any server that is running **Debian 11** or **Ubuntu 20.04** or **22.04** on a amd64 or arm64 CPU architecture. +Earlier versions of Ubuntu and Debian are not supported, nor are other Linux distributions. We have a bunch of tutorials to get you started. Tutorials to create a new server from scratch on a cloud provider & run TLJH From c80e5f68540154aa65b8ba8529250e2cd3b1ed45 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 21 Mar 2023 11:05:25 +0100 Subject: [PATCH 6/8] add python3 to integration test debian base image doesn't include Python3 --- integration-tests/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/integration-tests/Dockerfile b/integration-tests/Dockerfile index 69a7ba4..447bcb7 100644 --- a/integration-tests/Dockerfile +++ b/integration-tests/Dockerfile @@ -11,6 +11,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \ curl \ git \ sudo \ + python3 \ && rm -rf /var/lib/apt/lists/* # Kill all the things we don't need From 6f852d173d09f3149464d24f008adee443190ecf Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 21 Mar 2023 11:15:13 +0100 Subject: [PATCH 7/8] add note that newer OS will _probably_ work, but LTS are supported --- docs/index.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index d79adc7..fb8e02e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,7 +17,9 @@ might still make breaking changes that have no clear upgrade pathway. Installation ============ -The Littlest JupyterHub (TLJH) can run on any server that is running **Debian 11** or **Ubuntu 20.04** or **22.04** on a amd64 or arm64 CPU architecture. +The Littlest JupyterHub (TLJH) can run on any server that is running **Debian 11** or **Ubuntu 20.04** or **22.04** on an amd64 or arm64 CPU architecture. +We aim to support 'stable' and Long-Term Support (LTS) versions. +Newer versions are likely to work with little or no adjustment, but these are the officially supported and tested versions. Earlier versions of Ubuntu and Debian are not supported, nor are other Linux distributions. We have a bunch of tutorials to get you started. From 27c9761f1c87fa451778731ec63e8072a11c9652 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 22 Mar 2023 14:01:33 +0100 Subject: [PATCH 8/8] Apply suggestions from code review Co-authored-by: Simon Li --- bootstrap/bootstrap.py | 4 ++-- docs/index.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py index d4c9135..67cf46c 100644 --- a/bootstrap/bootstrap.py +++ b/bootstrap/bootstrap.py @@ -9,7 +9,7 @@ This script is run as: Constraints: - - The entire script should be compatible with Python 3.8, which is the on + - The entire script should be compatible with Python 3.8, which is the default on Ubuntu 20.04. - The script should parse in Python 3.6 as we print error messages for using Ubuntu 18.04 which comes with Python 3.6 by default. @@ -214,7 +214,7 @@ def ensure_host_system_can_install_tljh(): print("The Littlest JupyterHub requires Ubuntu 20.04 or higher") sys.exit(1) elif distro == "debian" and _parse_version(version) < (11,): - print("The Littlest JupyterHub requires Debian 10 or higher") + print("The Littlest JupyterHub requires Debian 11 or higher") sys.exit(1) # Require Python 3.8+ diff --git a/docs/index.rst b/docs/index.rst index fb8e02e..f66f4b9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -19,7 +19,7 @@ Installation The Littlest JupyterHub (TLJH) can run on any server that is running **Debian 11** or **Ubuntu 20.04** or **22.04** on an amd64 or arm64 CPU architecture. We aim to support 'stable' and Long-Term Support (LTS) versions. -Newer versions are likely to work with little or no adjustment, but these are the officially supported and tested versions. +Newer versions are likely to work with little or no adjustment, but these are not officially supported or tested. Earlier versions of Ubuntu and Debian are not supported, nor are other Linux distributions. We have a bunch of tutorials to get you started.