From 49dbc8b9fb516a88522867b2884be310a1982fea Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Fri, 9 Aug 2024 01:22:48 -0700 Subject: [PATCH 1/5] Update formatting. --- docs/admins/howto/remove-users-orm.qmd | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/admins/howto/remove-users-orm.qmd b/docs/admins/howto/remove-users-orm.qmd index 5c797dfe3..46c90a2a7 100644 --- a/docs/admins/howto/remove-users-orm.qmd +++ b/docs/admins/howto/remove-users-orm.qmd @@ -1,16 +1,20 @@ --- -title: Remove inactive users from hub ORM +title: JupyterHub ORM Maintenance --- +## Performance + JupyterHub performance sometimes scales with the *total* number of users in its ORM database, rather than the number of running users. Reducing the user count enables the hub to restart much faster. While this issue should be addressed, we can work around it by deleting inactive users from the hub database once in a while. Note that this does not delete the user's storage. + The script `scripts/delete-unused-users.py` will delete anyone who hasn't registered any activity in a given period of time, double checking to make sure they aren't active right now. This will require users to log in again the next time they use the hub, but that is probably fine. + This should be done before the start of each semester, particularly on hubs with a lot of users. @@ -20,8 +24,8 @@ You can run the script on your own device. The script depends on the `jhub_client` python library. This can be installed with `pip install jhub_client`. -1. You will need to acquire a JupyterHub API token with administrative - rights. A hub admin can go to `{hub_url}/hub/token` to create a new - one. -2. Set the environment variable `JUPYTERHUB_API_TOKEN` to the token. -3. Run `python scripts/delete-unused-users.py --hub_url {hub_url}` +1. You will need to acquire a JupyterHub API token with administrative + rights. A hub admin can go to `{hub_url}/hub/token` to create a new + one. +2. Set the environment variable `JUPYTERHUB_API_TOKEN` to the token. +3. Run `python scripts/delete-unused-users.py --hub_url {hub_url}` From 7416639e31e00f11aaed1dcd86f204ffe53195d0 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Fri, 9 Aug 2024 01:35:25 -0700 Subject: [PATCH 2/5] Add CNAME as quarto resource. --- docs/CNAME | 1 + docs/_quarto.yml | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 docs/CNAME diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 000000000..392499b2c --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +docs.datahub.berkeley.edu diff --git a/docs/_quarto.yml b/docs/_quarto.yml index 3fa1bfaed..26f9a6322 100644 --- a/docs/_quarto.yml +++ b/docs/_quarto.yml @@ -1,5 +1,7 @@ project: type: website + resources: + - "CNAME" website: navbar: From e733cd304d919d8affcefba55e14581919dc7e92 Mon Sep 17 00:00:00 2001 From: Ryan Lovett Date: Fri, 9 Aug 2024 01:48:12 -0700 Subject: [PATCH 3/5] Change formatting. --- docs/admins/howto/new-image.qmd | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/docs/admins/howto/new-image.qmd b/docs/admins/howto/new-image.qmd index 2085d12dc..21b582d6a 100644 --- a/docs/admins/howto/new-image.qmd +++ b/docs/admins/howto/new-image.qmd @@ -1,37 +1,31 @@ --- -title: Creating a new single user image +title: Create a New Single User Image --- -When deploying a new hub, or moving from a shared single user server -image, you might need to create a new image for users. We use -[repo2docker](https://github.com/jupyterhub/repo2docker) to do this. +You might need to create a new user image when deploying a new hub, or changing +from a shared single user server image. We use +[repo2docker](https://github.com/jupyterhub/repo2docker) to generate our images. -There are two approaches to creating a repo2docker image: 1. Use a -repo2docker-style image -[template](https://github.com/berkeley-dsep-infra/datahub/tree/staging/deployments/data100/image) -(environment.yaml, etc) 2. Use a -[Dockerfile](https://github.com/berkeley-dsep-infra/datahub/tree/staging/deployments/datahub/images/default) -(useful for larger/more complex images) +There are two approaches to creating a repo2docker image: + +1. Use a repo2docker-style image [template](https://github.com/berkeley-dsep-infra/datahub/tree/staging/deployments/data100/image) (environment.yaml, etc) +2. Use a [Dockerfile](https://github.com/berkeley-dsep-infra/datahub/tree/staging/deployments/datahub/images/default) (useful for larger/more complex images) Generally, we prefer to use the former approach, unless we need to install specific packages or utilities outside of python/apt as `root`. If that is the case, only a `Dockerfile` format will work. -Of course, as always create a feature branch for your changes, and -submit a PR when done. +As always, create a feature branch for your changes, and submit a PR when done. -## Find a hub to use as a template +## Use an existing image as a template Browse through our `deployments/` directory to find a hub that is similar to the one you are trying to create. This will give you a good starting point. -## Create the `image/` directory for your new hub - -Create a new directory under `deployments/` with the name of your hub. This -directory will contain the files that will be used to create the image. +## Create the image directory -Then, copy the contents (and any subdirectories) of the source -`image/` directory in to the new directory. +Create a new `image/` directory in the deployment. Then copy the contents (and +any subdirectories) of the source `image/` directory in to the new directory. ## Modify `hubploy.yaml` for the hub From c9e3bd62b9aef9c60cde334da5edfddaceef2c08 Mon Sep 17 00:00:00 2001 From: Greg Merritt Date: Fri, 9 Aug 2024 11:07:40 -0700 Subject: [PATCH 4/5] nfs and load balancer fixes --- deployments/ugr01/config/common.yaml | 2 +- deployments/ugr01/config/prod.yaml | 29 ++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/deployments/ugr01/config/common.yaml b/deployments/ugr01/config/common.yaml index 9a897abec..9120cf1bf 100644 --- a/deployments/ugr01/config/common.yaml +++ b/deployments/ugr01/config/common.yaml @@ -1,7 +1,7 @@ nfsPVC: enabled: true nfs: - serverIP: 10.49.181.18 + serverIP: 10.185.238.42 jupyterhub: scheduling: diff --git a/deployments/ugr01/config/prod.yaml b/deployments/ugr01/config/prod.yaml index 9268ff061..5ebf987d6 100644 --- a/deployments/ugr01/config/prod.yaml +++ b/deployments/ugr01/config/prod.yaml @@ -3,16 +3,29 @@ nfsPVC: shareName: shares/ugr01/prod jupyterhub: - ingress: - enabled: true - hosts: - - ugr01.datahub.berkeley.edu - tls: - - secretName: tls-cert - hosts: - - ugr01.datahub.berkeley.edu hub: db: pvc: # This also holds logs storage: 4Gi + prePuller: + continuous: + enabled: false + proxy: + service: + loadBalancerIP: 34.71.179.119 + traefik: + extraInitContainers: + # This startup delay can help the k8s container network interface setup + # network routing of traffic to the pod, which is essential for the ACME + # challenge submitted by Traefik on startup to acquire a TLS certificate. + # + # Sleeping for 7 seconds has been consistently sufficient to avoid issues + # in GKE when this workaround was explored initially for GKE. + # + - name: startup-delay + image: busybox:stable + command: ["sh", "-c", "sleep 10"] + https: + hosts: + - ugr01.datahub.berkeley.edu From 3561adf0f4f40b4393cfd43984cae3a5a1f148ee Mon Sep 17 00:00:00 2001 From: shane knapp Date: Fri, 9 Aug 2024 11:41:01 -0700 Subject: [PATCH 5/5] adding ugr01 to PR labeller --- .github/labeler.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/labeler.yml b/.github/labeler.yml index 7d76422a4..c6a3ee5fb 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -127,6 +127,8 @@ node-placeholder-scaler: - 'deployments/stat159/**' 'hub: stat20': - 'deployments/stat20/**' +'hub: ugr01': + - 'deployments/ugr01/**' 'hub: workshop': - 'deployments/workshop/**' 'hub: gradebook':