Skip to content

alan-turing-institute/hub23-deploy

Repository files navigation

hub23-deploy

A repository to manage the private Turing BinderHub instance, Hub23.

♻️ CI Status
💸 Subscription Build Status
🚀 Deployment Deploy Status
🧹 Linting and Formatting pre-commit.ci status
📓 Docs Build and Publish JupyterBook Docs

Table of Contents:


☸️ Hub23 Helm Chart

This repository contains the local Helm Chart that configures the Hub23 BinderHub deployment: hub23-chart.

The HelmUpgradeBot automatically opens Pull Requests to this repository that update the dependencies of the Helm Chart in the requirements.yaml file.

Upon merging the Pull Request, the Continuous Deployment Azure Pipeline automatically applies the updated Helm Chart to the Kubernetes cluster running Hub23.

🚀 Developing Hub23

Please read the 💜Code of Conduct💜 and 👾Contributing Guidelines👾 before you begin developing.

📌 Requirements

Three command line interfaces are used to manage Hub23:

🔁 Changing hub23-chart

If changes are made during development, make sure that:

This will ensure that the Hub23 deployment is kept up-to-date with the repo, and a future developer (someone else or future-you!) can recreate the configuration files for Hub23.

❓ How-To's

🏡 Work Locally

If you DO have write access: ✒️

# Clone this repository
git clone https://github.com/alan-turing-institute/hub23-deploy.git
cd hub23-deploy

# Create a new branch
git checkout -b NEW_BRANCH_NAME

And you're ready to go! 🎉

If you DON'T have write access: 🙅

  1. Click "Fork" in the top-right corner of the browser window
  2. Select your GitHub username as the fork destination
  3. Clone the forked repository
# Clone your fork
git clone https://github.com/YOUR_GITHUB_USERNAME/hub23-deploy.git
cd hub23-deploy

# Create a new branch
git checkout -b NEW_BRANCH_NAME

🔌 Connect to Kubernetes

This section uses the Azure CLI.

  1. Login to Azure

    az login
  2. Set the Azure subscription

    az account set --subscription turingmybinder
  3. Connect to the cluster

    az aks get-credentials --name turing --resource-group binder-prod

💻 Code Snippets

To find out more info about a Kubernetes pod:

kubectl --namespace hub23 describe pod POD_NAME

💫 Restarting the JupyterHub

If the Hub is being problematic, for example, throwing "Internal Server Error" messages or not spinning up user nodes, it can be restarted with the following commands.

Scale down the Hub:

kubectl --namespace hub23 scale deployment hub --replicas=0

Wait until the hub- pod has been terminated. Use kubectl --namespace hub23 get pods to check its status.

Scale the Hub back up:

kubectl --namespace hub23 scale deployment hub --replicas=1

💸 Billing

The billing subdir contains resources for calculating running costs of Hub23.

📚 Documentation

The Deployment Guide docs for Hub23 are stored in the docs folder. A GitHub Action workflow renders the documentation using Jupyter Book and publishes it to the gh-pages branch of the repo to be hosted at https://alan-turing-institute.github.io/hub23-deploy