diff --git a/docs/_quarto.yml b/docs/_quarto.yml index 04930cc37..f8759eee9 100644 --- a/docs/_quarto.yml +++ b/docs/_quarto.yml @@ -13,12 +13,10 @@ website: - icon: github href: https://github.com/berkeley-dsep-infra/datahub left: - - text: "Using DataHub" - href: users/features.qmd - text: "Contributing" href: admins/pre-reqs.qmd - text: "Admin Tasks" - href: admins/howto/documentation.qmd + href: tasks/documentation.qmd - text: "Policy" href: policy/create_policy.qmd page-navigation: true @@ -28,12 +26,8 @@ website: contents: - href: index.qmd text: Home - - section: "Using DataHub" - contents: - - users/features.qmd - - users/private-repo.qmd - - users/hubs.qmd - - users/authentication.qmd + - href: hubs.qmd + text: JupyterHub Deployments - section: "Contributing to DataHub" contents: - admins/pre-reqs.qmd @@ -41,27 +35,27 @@ website: - admins/storage.qmd - admins/cluster-config.qmd - admins/credentials.qmd - - section: "Common Administrator Tasks" - contents: - - admins/howto/documentation.qmd - - admins/howto/dns.qmd - - admins/howto/core-pool.qmd - - admins/howto/new-hub.qmd - - admins/howto/rebuild-hub-image.qmd - - admins/howto/rebuild-postgres-image.qmd - - admins/howto/managing-multiple-user-image-repos.qmd - - admins/howto/new-image.qmd - - admins/howto/transition-image.qmd - - admins/howto/new-packages.qmd - - admins/howto/course-config.qmd - - admins/howto/calendar-scaler.qmd - - admins/howto/prometheus-grafana.qmd - - admins/howto/remove-users-orm.qmd - - admins/howto/delete-hub.qmd - - admins/howto/clusterswitch.qmd - - admins/howto/github-token.qmd - - admins/howto/google-sheets.qmd - - admins/howto/cheatsheet.qmd + - section: "Common Administrator Tasks" + contents: + - tasks/documentation.qmd + - tasks/dns.qmd + - tasks/core-pool.qmd + - tasks/new-hub.qmd + - tasks/rebuild-hub-image.qmd + - tasks/rebuild-postgres-image.qmd + - tasks/managing-multiple-user-image-repos.qmd + - tasks/new-image.qmd + - tasks/transition-image.qmd + - tasks/new-packages.qmd + - tasks/course-config.qmd + - tasks/calendar-scaler.qmd + - tasks/prometheus-grafana.qmd + - tasks/remove-users-orm.qmd + - tasks/delete-hub.qmd + - tasks/clusterswitch.qmd + - tasks/github-token.qmd + - tasks/google-sheets.qmd + - tasks/cheatsheet.qmd - section: "Policy" contents: - policy/create_policy.qmd diff --git a/docs/admins/howto/remove-users-orm.qmd b/docs/admins/howto/remove-users-orm.qmd deleted file mode 100644 index 46c90a2a7..000000000 --- a/docs/admins/howto/remove-users-orm.qmd +++ /dev/null @@ -1,31 +0,0 @@ ---- -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. - -## Run the script - -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}` diff --git a/docs/users/hubs.qmd b/docs/hubs.qmd similarity index 100% rename from docs/users/hubs.qmd rename to docs/hubs.qmd diff --git a/docs/users/hubs/data100.qmd b/docs/hubs/data100.qmd similarity index 100% rename from docs/users/hubs/data100.qmd rename to docs/hubs/data100.qmd diff --git a/docs/users/hubs/data102.qmd b/docs/hubs/data102.qmd similarity index 100% rename from docs/users/hubs/data102.qmd rename to docs/hubs/data102.qmd diff --git a/docs/users/hubs/datahub.qmd b/docs/hubs/datahub.qmd similarity index 100% rename from docs/users/hubs/datahub.qmd rename to docs/hubs/datahub.qmd diff --git a/docs/users/hubs/edx.qmd b/docs/hubs/edx.qmd similarity index 100% rename from docs/users/hubs/edx.qmd rename to docs/hubs/edx.qmd diff --git a/docs/users/hubs/prob140.qmd b/docs/hubs/prob140.qmd similarity index 100% rename from docs/users/hubs/prob140.qmd rename to docs/hubs/prob140.qmd diff --git a/docs/users/hubs/r.qmd b/docs/hubs/r.qmd similarity index 100% rename from docs/users/hubs/r.qmd rename to docs/hubs/r.qmd diff --git a/docs/users/hubs/shiny.qmd b/docs/hubs/shiny.qmd similarity index 100% rename from docs/users/hubs/shiny.qmd rename to docs/hubs/shiny.qmd diff --git a/docs/users/hubs/stat159.qmd b/docs/hubs/stat159.qmd similarity index 100% rename from docs/users/hubs/stat159.qmd rename to docs/hubs/stat159.qmd diff --git a/docs/users/hubs/stat20.qmd b/docs/hubs/stat20.qmd similarity index 100% rename from docs/users/hubs/stat20.qmd rename to docs/hubs/stat20.qmd diff --git a/docs/admins/howto/calendar-scaler.qmd b/docs/tasks/calendar-scaler.qmd similarity index 99% rename from docs/admins/howto/calendar-scaler.qmd rename to docs/tasks/calendar-scaler.qmd index 0f4bc2eb2..cdfe4c132 100644 --- a/docs/admins/howto/calendar-scaler.qmd +++ b/docs/tasks/calendar-scaler.qmd @@ -1,5 +1,7 @@ --- title: Calendar Node Pool Autoscaler +aliases: + - ../admins/howto/calendar-scaler.html --- ## Why scale node pools with Google Calendar? diff --git a/docs/admins/howto/cheatsheet.qmd b/docs/tasks/cheatsheet.qmd similarity index 96% rename from docs/admins/howto/cheatsheet.qmd rename to docs/tasks/cheatsheet.qmd index d63df3f6c..f5ce191b6 100644 --- a/docs/admins/howto/cheatsheet.qmd +++ b/docs/tasks/cheatsheet.qmd @@ -1,5 +1,7 @@ --- title: Operations Cheatsheet +aliases: + - ../admins/howto/cheatsheet.html --- We periodically need to perform various tasks that can be quickly described by short shell fragments. This page is meant to be a dumping ground for them. It may be useful on occasion to move such fragments into more relevant pages. diff --git a/docs/admins/howto/clusterswitch.qmd b/docs/tasks/clusterswitch.qmd similarity index 98% rename from docs/admins/howto/clusterswitch.qmd rename to docs/tasks/clusterswitch.qmd index 233f03b61..ed82dce5d 100644 --- a/docs/admins/howto/clusterswitch.qmd +++ b/docs/tasks/clusterswitch.qmd @@ -1,5 +1,7 @@ --- title: Switching over a hub to a new cluster +aliases: + - ../admins/howto/clusterswitch.html --- This document describes how to switch an existing hub to a new cluster. The example used here refers to moving all UC Berkeley Datahubs. @@ -7,7 +9,7 @@ This document describes how to switch an existing hub to a new cluster. The exa You might find it easier to switch to a new cluster if you're running a [very old k8s version](https://cloud.google.com/kubernetes-engine/docs/release-notes), or in lieu of performing a [cluster credential rotation](https://cloud.google.com/kubernetes-engine/docs/how-to/credential-rotation). Sometimes starting from scratch is easier than an iterative and potentially destructive series of operations. ## Create a new cluster -1. Create a new cluster using the specified [configuration](../cluster-config.qmd). +1. Create a new cluster using the specified [configuration](../admins/cluster-config.qmd). 2. Set up helm on the cluster according to the instructions here: http://z2jh.jupyter.org/en/latest/setup-helm.html - Make sure the version of helm you're working with matches the version Github Actions is using. diff --git a/docs/admins/howto/core-pool.qmd b/docs/tasks/core-pool.qmd similarity index 97% rename from docs/admins/howto/core-pool.qmd rename to docs/tasks/core-pool.qmd index a91f5eaed..dd8f55167 100644 --- a/docs/admins/howto/core-pool.qmd +++ b/docs/tasks/core-pool.qmd @@ -1,5 +1,7 @@ --- title: Core Node Pool Management +aliases: + - ../admins/howto/core-pool.html --- ## What is the core node pool? diff --git a/docs/admins/howto/course-config.qmd b/docs/tasks/course-config.qmd similarity index 99% rename from docs/admins/howto/course-config.qmd rename to docs/tasks/course-config.qmd index bced44e6c..774ffb0d9 100644 --- a/docs/admins/howto/course-config.qmd +++ b/docs/tasks/course-config.qmd @@ -1,5 +1,7 @@ --- title: Course Configuration +aliases: + - ../admins/howto/course-config.html --- ## Allocating Resources diff --git a/docs/admins/howto/delete-hub.qmd b/docs/tasks/delete-hub.qmd similarity index 97% rename from docs/admins/howto/delete-hub.qmd rename to docs/tasks/delete-hub.qmd index 880680050..3888d1782 100644 --- a/docs/admins/howto/delete-hub.qmd +++ b/docs/tasks/delete-hub.qmd @@ -1,5 +1,7 @@ --- title: Delete or spin down a Hub +aliases: + - ../admins/howto/delete-hub.html --- ## Why delete or spin down a hub? diff --git a/docs/admins/howto/dns.qmd b/docs/tasks/dns.qmd similarity index 97% rename from docs/admins/howto/dns.qmd rename to docs/tasks/dns.qmd index 6919291ee..22091b4ae 100644 --- a/docs/admins/howto/dns.qmd +++ b/docs/tasks/dns.qmd @@ -1,5 +1,7 @@ --- title: Update DNS +aliases: + - ../admins/howto/dns.html --- Some staff have access to make and update DNS entries in the diff --git a/docs/admins/howto/documentation.qmd b/docs/tasks/documentation.qmd similarity index 98% rename from docs/admins/howto/documentation.qmd rename to docs/tasks/documentation.qmd index a0cb29d5b..2161b2dd4 100644 --- a/docs/admins/howto/documentation.qmd +++ b/docs/tasks/documentation.qmd @@ -1,5 +1,7 @@ --- title: Documentation +aliases: + - ../admins/howto/documentation.html --- ## Overview diff --git a/docs/admins/howto/github-token.qmd b/docs/tasks/github-token.qmd similarity index 90% rename from docs/admins/howto/github-token.qmd rename to docs/tasks/github-token.qmd index b4ad1800c..b0ef2a9c3 100644 --- a/docs/admins/howto/github-token.qmd +++ b/docs/tasks/github-token.qmd @@ -1,5 +1,7 @@ --- title: Create Finely Grained Access Token +aliases: + - ../admins/howto/github-token.html --- At : diff --git a/docs/admins/howto/google-sheets.qmd b/docs/tasks/google-sheets.qmd similarity index 98% rename from docs/admins/howto/google-sheets.qmd rename to docs/tasks/google-sheets.qmd index 45b8f8bdd..2a7dd6f04 100644 --- a/docs/admins/howto/google-sheets.qmd +++ b/docs/tasks/google-sheets.qmd @@ -1,5 +1,7 @@ --- title: Reading Google Sheets from DataHub +aliases: + - ../admins/howto/google-sheets.html --- Available in: DataHub diff --git a/docs/admins/howto/index.qmd b/docs/tasks/index.qmd similarity index 51% rename from docs/admins/howto/index.qmd rename to docs/tasks/index.qmd index f6a765d36..ad75d5ec0 100644 --- a/docs/admins/howto/index.qmd +++ b/docs/tasks/index.qmd @@ -1,3 +1,5 @@ --- title: Common Administrator Tasks +aliases: + - ../admins/howto/index.html --- diff --git a/docs/admins/howto/managing-multiple-user-image-repos.qmd b/docs/tasks/managing-multiple-user-image-repos.qmd similarity index 72% rename from docs/admins/howto/managing-multiple-user-image-repos.qmd rename to docs/tasks/managing-multiple-user-image-repos.qmd index 7cf176501..7e0436e60 100644 --- a/docs/admins/howto/managing-multiple-user-image-repos.qmd +++ b/docs/tasks/managing-multiple-user-image-repos.qmd @@ -1,5 +1,7 @@ --- title: Managing multiple user image repos +aliases: + - ../admins/howto/managing-multiple-user-image-repos.html --- ## Managing user image repos @@ -29,8 +31,8 @@ within that directory run: pip install --editable . ``` -The `--editable` flag allows you to hack on the tool and have those changes -usable without reinstalling it or needing to hack your `PATH`. +The `--editable` flag is optional, and allows you to hack on the tool and have +those changes usable without reinstalling or needing to hack your `PATH`. ### Via `pip` @@ -63,6 +65,7 @@ available with the script. #### Primary arguments for the script ``` $ manage-repos.py --help +usage: manage-repos [-h] [-c CONFIG] [-d DESTINATION] {branch,clone,patch,push,stage,sync} ... positional arguments: {branch,clone,patch,push,stage,sync} @@ -71,9 +74,10 @@ positional arguments: options: -h, --help show this help message and exit -c CONFIG, --config CONFIG - Path to file containing list of repositories to operate on. + Path to the file containing list of repositories to operate on. Defaults to repos.txt located in the current working + directory. -d DESTINATION, --destination DESTINATION - Location on the filesystem of the managed repositories. If the directory does not exist, it will be created. Defaults to the current working directory. + Location on the filesystem of the directory containing the managed repositories. Defaults to the current working directory. ``` `--config` is required, and setting `--destination` is recommended. @@ -99,24 +103,25 @@ before creating and switching to the new branch. ``` $ manage-repos.py clone --help -usage: manage-repos clone [-h] [-s] [-g GITHUB_USER] +usage: manage-repos clone [-h] [-s [SET_REMOTE]] [-g GITHUB_USER] Clone repositories in the config file and optionally set a remote for a fork. +If a repository sub-directory does not exist, it will be created. options: -h, --help show this help message and exit - -s, --set-remote Set the user's GitHub fork as a remote. - -r REMOTE, --remote REMOTE - If --set-remote is used, override the name of the remote to set for the fork. This is optional and defaults to 'origin'. + -s [SET_REMOTE], --set-remote [SET_REMOTE] + Set the user's GitHub fork as a remote. Defaults to 'origin'. -g GITHUB_USER, --github-user GITHUB_USER The GitHub username of the fork to set in the remote. + Required if --set-remote is used. ``` This command will clone all repositories found in the config, and if you've created a fork, use the `--set-remote` and `--github-user` arguments to update the remotes in the cloned repositories. This will set the primary repository's remote to `upstream` and your fork to `origin` (unless you override this by -using the `--remote` argument). +passing a different remote name with the `--set-remote` argument). After cloning, `git remote -v` will be executed for each repository to allow you to confirm that the remotes are properly set. @@ -162,11 +167,14 @@ options: -b BRANCH, --branch BRANCH Name of the branch to push. -r REMOTE, --remote REMOTE - Name of the remote to push to. This is optional and defaults to 'origin'. + Name of the remote to push to. This is optional and + defaults to 'origin'. ``` This command will attempt to push all staged commits to a remote. The -`--branch` argument is required, and will be the name of the feature branch. +`--branch` argument is required, and needs to be the name of the feature +branch that will be pushed. + The remote that is pushed to defaults to `origin`, but you can override this with the `--remote` argument. @@ -181,7 +189,9 @@ Stage changes in managed repositories. This performs a git add and commit. options: -h, --help show this help message and exit -f FILES [FILES ...], --files FILES [FILES ...] - List of files to stage in the repositories. Optional, and defaults to all modified files in the repository + Space-delimited list of files to stage in the + repositories. Optional, and if left blank will default + to all modified files. -m MESSAGE, --message MESSAGE Commit message to use for the changes. ``` @@ -198,19 +208,24 @@ staging area. You can also specify any number of files, separated by a space. ``` $ manage-image-repos.py sync --help -usage: manage-repos sync [-h] [-b BRANCH_DEFAULT] [-u UPSTREAM] [-p] [-r REMOTE] +usage: manage-repos sync [-h] [-b BRANCH_DEFAULT] [-u UPSTREAM] [-p] + [-r REMOTE] -Sync managed repositories to the latest version using 'git rebase'. Optionally push to a remote fork. +Sync managed repositories to the latest version using 'git rebase'. Optionally +push to a remote fork. options: -h, --help show this help message and exit -b BRANCH_DEFAULT, --branch-default BRANCH_DEFAULT - Default remote branch to sync to. This is optional and defaults to 'main'. + Default remote branch to sync to. This is optional and + defaults to 'main'. -u UPSTREAM, --upstream UPSTREAM - Name of the parent remote to sync from. This is optional and defaults to 'upstream'. + Name of the parent remote to sync from. This is + optional and defaults to 'upstream'. -p, --push Push the locally synced repo to a remote fork. -r REMOTE, --remote REMOTE - The name of the remote fork to push to. This is optional and defaults to 'origin'. + The name of the remote fork to push to. This is + optional and defaults to 'origin'. ``` This command will switch your local repositories to the `main` branch, and sync @@ -225,7 +240,33 @@ overridden with the `--upstream` argument. The remote for a fork defaults to `origin`, and can be overridden via the `--remote` argument. -### Usage examples +### Tips, tricks and usage examples + +#### Tips and tricks + +`manage-repos` is best run from the parent folder that will contain all of the +repositories that you will be managing as the default value of `--destination` +is the current working directory (`.`). + +You can also create a symlink in the parent folder that points to the config +file elsewhere on your filesystem: + +``` +ln -s /scripts/user-image-management/repos.txt repos.txt +``` + +With this in mind, you can safely drop the `--config` and `--destination` +arguments when running `manage-repos`. Eg: + +``` +manage-repos sync -p +``` + +Another tip is to comment out or delete entries in your config when performing +git operations on a limited set of repositories. Be sure to `git restore` the +file when you're done! + +#### Usage examples Clone all of the image repos to a common directory: @@ -236,37 +277,37 @@ manage-repos --destination ~/src/images/ --config /path/to/repos.txt clone Clone all repos, and set `upstream` and `origin` for your fork: ``` -manage-repos --destination ~/src/images/ --config /path/to/repos.txt clone --set-remote --github-user +manage-repos -d ~/src/images/ -c /path/to/repos.txt clone --set-remote --github-user ``` Sync all repos from `upstream` and push to your `origin`: ``` -manage-repos --destination ~/src/images/ --config /path/to/repos.txt sync --push +manage-repos -d ~/src/images/ -c /path/to/repos.txt sync --push ``` Create a feature branch in all of the repos: ``` -manage-repos -c /path/to/repos.txt -d ~/src/images branch -b test-branch +manage-repos -d ~/src/images -c /path/to/repos.txt branch -b test-branch ``` Create a git patch and apply it to all image repos: ``` git diff envorinment.yml > /tmp/git-patch.txt -manage-repos -c /path/to/repos.txt -d ~/src/images patch -p /tmp/git-patch.txt +manage-repos -d ~/src/images -c /path/to/repos.txt patch -p /tmp/git-patch.txt ``` Once you've tested everything and are ready to push and create a PR, add and commit all modified files in the repositories: ``` -manage-repos -c /path/to/repos.txt -d ~/src/images stage -m "this is a commit" +manage-repos -d ~/src/images -c /path/to/repos.txt stage -m "this is a commit" ``` After staging, push everything to a remote: ``` -manage-repos -c repos.txt -d ~/src/images push -b test-branch +manage-repos -d ~/src/images -c /path/to/repos.txt push -b test-branch ``` diff --git a/docs/admins/howto/new-hub.qmd b/docs/tasks/new-hub.qmd similarity index 99% rename from docs/admins/howto/new-hub.qmd rename to docs/tasks/new-hub.qmd index fa3a39869..a59f5e0ae 100644 --- a/docs/admins/howto/new-hub.qmd +++ b/docs/tasks/new-hub.qmd @@ -2,6 +2,7 @@ title: Create a New Hub aliases: - ../../en/latest/admins/howto/new-hub.html + - ../admins/howto/new-hub.html --- ## Why create a new hub? diff --git a/docs/admins/howto/new-image.qmd b/docs/tasks/new-image.qmd similarity index 99% rename from docs/admins/howto/new-image.qmd rename to docs/tasks/new-image.qmd index 03c014693..c15fc0d74 100644 --- a/docs/admins/howto/new-image.qmd +++ b/docs/tasks/new-image.qmd @@ -1,5 +1,7 @@ --- title: Create a New Single User Image +aliases: + - ../admins/howto/new-image.html --- You might need to create a new user image when deploying a new hub, or changing diff --git a/docs/admins/howto/new-packages.qmd b/docs/tasks/new-packages.qmd similarity index 99% rename from docs/admins/howto/new-packages.qmd rename to docs/tasks/new-packages.qmd index eae812e52..cec2f4b68 100644 --- a/docs/admins/howto/new-packages.qmd +++ b/docs/tasks/new-packages.qmd @@ -1,5 +1,7 @@ --- title: Testing and Upgrading New Packages +aliases: + - ../admins/howto/new-packages.html --- It is helpful to test package additions and upgrades for yourself before diff --git a/docs/admins/howto/prometheus-grafana.qmd b/docs/tasks/prometheus-grafana.qmd similarity index 94% rename from docs/admins/howto/prometheus-grafana.qmd rename to docs/tasks/prometheus-grafana.qmd index 50249223d..29cbe9239 100644 --- a/docs/admins/howto/prometheus-grafana.qmd +++ b/docs/tasks/prometheus-grafana.qmd @@ -1,5 +1,7 @@ --- title: Prometheus and Grafana +aliases: + - ../admins/howto/prometheus-grafana.html --- # Accessing the Prometheus Server diff --git a/docs/admins/howto/rebuild-hub-image.qmd b/docs/tasks/rebuild-hub-image.qmd similarity index 96% rename from docs/admins/howto/rebuild-hub-image.qmd rename to docs/tasks/rebuild-hub-image.qmd index 5df136ff4..314f86b5c 100644 --- a/docs/admins/howto/rebuild-hub-image.qmd +++ b/docs/tasks/rebuild-hub-image.qmd @@ -1,5 +1,7 @@ --- title: "Customize the Hub Docker Image" +aliases: + - ../admins/howto/rebuild-hub-image.html --- We use a customized JupyterHub docker image so we can install extra packages diff --git a/docs/admins/howto/rebuild-postgres-image.qmd b/docs/tasks/rebuild-postgres-image.qmd similarity index 94% rename from docs/admins/howto/rebuild-postgres-image.qmd rename to docs/tasks/rebuild-postgres-image.qmd index 37a9ab46e..07f8484a9 100644 --- a/docs/admins/howto/rebuild-postgres-image.qmd +++ b/docs/tasks/rebuild-postgres-image.qmd @@ -1,5 +1,7 @@ --- title: "Customize the Per-User Postgres Docker Image" +aliases: + - ../admins/howto/rebuild-postgres-image.html --- We provide each student on `data100` with a postgresql server. We want the diff --git a/docs/tasks/remove-users-orm.qmd b/docs/tasks/remove-users-orm.qmd new file mode 100644 index 000000000..c91d0eb16 --- /dev/null +++ b/docs/tasks/remove-users-orm.qmd @@ -0,0 +1,69 @@ +--- +title: JupyterHub ORM Maintenance +aliases: + - ../admins/howto/remove-users-orm.html +--- + +## 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. + +This should be done before the start of each semester, particularly on hubs +with a lot of users. + +## Running the script + +``` +./delete-unused-users.py --help +usage: delete-unused-users.py [-h] [-c CREDENTIALS] [-H HUB_URL] [--dry_run] + [--inactive_since INACTIVE_SINCE] [-v] [-d] + +options: + -h, --help show this help message and exit + -c CREDENTIALS, --credentials CREDENTIALS + Path to a json file containing hub url and api keys. + Format is: {"hub1_url": "hub1_key", "hub2_url":, "hub2_key"} + -H HUB_URL, --hub_url HUB_URL + Fully qualified URL to the JupyterHub. You must also + set the JUPYTERHUB_API_TOKEN environment variable with + the API key. + --dry_run Dry run without deleting users. + --inactive_since INACTIVE_SINCE + Period of inactivity after which users are considered + for deletion (literal string constructor values for + timedelta objects). + -v, --verbose Set info log level. + -d, --debug Set debug log level. +``` + +The 'best' way to run this script is to log in to each hub and in the Admin +page, generate a token. The URL will be `{hub_url}/hub/token`. You can store +the tokens in a json-like configuration file on your device with the following +format: + +``` +{ + "https://a11y.datahub.berkeley.edu": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", + "https://astro.datahub.berkeley.edu": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", + "https://biology.datahub.berkeley.edu": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", + "https://cee.datahub.berkeley.edu": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", + "https://data8.datahub.berkeley.edu": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", + "https://data100.datahub.berkeley.edu": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", + "https://data101.datahub.berkeley.edu": "XXXXXXXXXXXXXXXXXXXXXXXXXXX", +} +``` + +Then you can execute the script as such: + +``` +./delete-unused-users.py -c ~/.datahub/hub-api-tokens.json -v --inactive_since=days=30 +``` diff --git a/docs/admins/howto/transition-image.qmd b/docs/tasks/transition-image.qmd similarity index 99% rename from docs/admins/howto/transition-image.qmd rename to docs/tasks/transition-image.qmd index 66404c6fa..b2ba0bb5e 100644 --- a/docs/admins/howto/transition-image.qmd +++ b/docs/tasks/transition-image.qmd @@ -1,5 +1,7 @@ --- title: Transition Single User Image to GitHub Actions +aliases: + - ../admins/howto/transition-image.html --- Single user images have been maintained within the main datahub repo since its inception, however we decided to move them into their own repositories. It will make testing notebooks easier, and we will be able to delegate write access to course staff if necessary. diff --git a/docs/users/authentication.qmd b/docs/users/authentication.qmd deleted file mode 100644 index 4191959a5..000000000 --- a/docs/users/authentication.qmd +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: User Authentication ---- - -Most of our hubs use a [Canvas](https://www.instructure.com/canvas/) instance, -[bcourses.berkeley.edu](https://bcourses.berkeley.edu), for authentication. The hubs not using `CanvasOAuthenticator` are edx (`LTI1Authenticator`), highschool (`GoogleOAuthenticator`), and workshop (`dummy`). - -## Authorization - -Anyone who can log in to bCourses can log into our Canvas-based hubs. This -includes all Berkeley affiliates. If you have a working berkeley.edu -email account, you can most likely log in to bCourses, and hence to -our JupyterHubs. - -Students have access for 9 months after they graduate. If they have -an incomplete, they have 13 months of access instead. - -## Non-Berkeley affiliates - -If someone who doesn't have a berkeley.edu account wants to use -the JupyterHubs, they need to obtain a [CalNet Sponsored Guest -account](https://calnetweb.berkeley.edu/calnet-departments/calnet-sponsored-guests) and get added to a bCourses course. - -## Troubleshooting - -If you can log in to [bCourses](https://bcourses.berkeley.edu) but -not to any of the JupyterHubs, please contact us. - -If you can not log in to bCourses, please [contact bCourses support](https://dls.berkeley.edu/services/bcourses-0). diff --git a/docs/users/features.qmd b/docs/users/features.qmd deleted file mode 100644 index 8092a5bfc..000000000 --- a/docs/users/features.qmd +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: Features ---- - -This page lists the various environments, applications, and tools we offer on -DataHub. Not all those listed here are available on all hubs, but we can easily enable them. - -## Programming Languages - -We support the usual suspects - Python, R, and Julia. However, Jupyter and -other applications can support many more. If you would like to use a -different, open-source programming language, contact us. - -## Applications - -Our diverse user population has diverse needs, so we offer many different -user interfaces for instructors to choose from. - -### JupyterLab - -![Do complex layouts with JupyterLab](images/jupyterlab.png) - -[JupyterLab](https://github.com/jupyterlab/jupyterlab) is a more modern and customizable version of the classic Jupyter notebook from the Jupyter project. -Most of our classes use JupyterLab. - - -### Jupyter Notebook (Classic) - -This familiar interface is used for most of our introductory classes. It is document oriented, no-frills, and well known by a lot of people. - -### RStudio - -![RStudio Screenshot](images/rstudio.png) - -We want to provide first class support for teaching with R, which means -providing strong support for [RStudio](https://rstudio.com). This also includes support for running Shiny applications. - -Try RStudio [on DataHub](https://r.datahub.berkeley.edu) with your berkeley.edu account, or [on Binder](https://mybinder.org/v2/gh/rocker-org/binder/master?urlpath=rstudio) without a berkeley.edu account. - -### Remote Desktop - -![Do image processing with qt](images/desktop.png) - -Sometimes, you just need to use something that requires a full desktop -environment to run. Instead of trying to get students to install things -locally, we offer a full fledged Linux Desktop environment they can -access from inside their browser! This is just a different 'UI' on the -same infrastructure as the notebook environment, so they all use the -same libraries and home directories. - -Try remote desktop [on EECS DataHub](https://eecs.datahub.berkeley.edu/hub/user-redirect/desktop) with your berkeley.edu account, or [on Binder](https://mybinder.org/v2/gh/yuvipanda/jupyter-desktop-server/master?urlpath=desktop) without a berkeley.edu account. - -### Visual Studio Code - -![Compile C with vscode](images/vscode.png) - -Sometimes you *just* want an IDE, not a notebook environment. We are experimenting -with a hosted, web version of the popular Visual Studio Code editor, to -see if it would be useful for teaching more traditional CS classes. - -Try VS Code [on EECS DataHub](https://eecs.datahub.berkeley.edu/hub/user-redirect/vscode/) with your berkeley.edu account, or [on Binder](https://mybinder.org/v2/gh/betatim/vscode-binder/master?urlpath=lab) without a berkeley.edu account. - -### Other Web Applications - -We can make many web based applications work on a hub. Contact us and we'll see what we can do! - -### Postgresql - -Some of our classes require using real databases to teach. We -now experimentally offer a [postgresql](https://www.postgresql.org/) -server for each user on the [data100 hub](https://data100.datahub.berkeley.edu). - -The data does not persist right now, but we can turn that on whenever -needed. - -## More? - -We want to find solution to your interesting problems, so please bring us -your interesting problems. 😁 diff --git a/docs/users/images/RStudio-Logo-flat.svg b/docs/users/images/RStudio-Logo-flat.svg deleted file mode 100644 index b0401ca51..000000000 --- a/docs/users/images/RStudio-Logo-flat.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/docs/users/images/desktop.png b/docs/users/images/desktop.png deleted file mode 100644 index bae26671d..000000000 Binary files a/docs/users/images/desktop.png and /dev/null differ diff --git a/docs/users/images/jupyterlab.png b/docs/users/images/jupyterlab.png deleted file mode 100644 index 54dac3571..000000000 Binary files a/docs/users/images/jupyterlab.png and /dev/null differ diff --git a/docs/users/images/rstudio.png b/docs/users/images/rstudio.png deleted file mode 100644 index ed98d31a6..000000000 Binary files a/docs/users/images/rstudio.png and /dev/null differ diff --git a/docs/users/images/vscode.png b/docs/users/images/vscode.png deleted file mode 100644 index 473165823..000000000 Binary files a/docs/users/images/vscode.png and /dev/null differ diff --git a/docs/users/private-repo.qmd b/docs/users/private-repo.qmd deleted file mode 100644 index 66b95354b..000000000 --- a/docs/users/private-repo.qmd +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: Accessing private GitHub repos ---- - -GitHub is used to store class materials (lab notebooks, lecture notebooks, etc), and -[nbgitpuller](https://jupyterhub.github.io/nbgitpuller/) is used to distribute it -to students. By default, nbgitpuller only supports public GitHub repositories. However, -Berkeley's JupyterHubs are set up to allow pulling from private repositories -as well. - -Public repositories are still preferred, but if you want to distribute a private repository -to your students, you can do so. - -1. Go to the GitHub app for the hub you are interested in. - - 1. [R Hub](https://github.com/apps/berkeley-r-hub-private-repo) - 2. [DataHub](https://github.com/apps/berkeley-datahub-private-repo) - 3. [PublicHealth Hub](https://github.com/apps/public-health-datahub-private-repo) - 4. [Biology Hub](https://github.com/apps/berkeley-biology-hub-private-repo) - 5. [EECS Hub](https://github.com/apps/berkeley-eecs-hub-private-repo) - 3. [Open an issue](https://github.com/berkeley-dsep-infra/datahub/issues) if you - want more hubs supported. - -2. Click the 'Install' button. - -3. Select the organization / user containing the private repository you want to distribute - on the JupyterHub. If you are not the owner or administrator of this organization, you might - need extra permissions to do this action. - -4. Select 'Only select repositories', and below that select the private repositories you want - to distribute to this JupyterHub. - -5. Click the 'Install' button. The JupyterHub you picked now has access to this private repository. - You can revoke this anytime by coming back to this page, and removing the repo from the list of - allowed repos. You can also totally uninstall the GitHub app. - -6. You can now make a link for your repo at [nbgitpuller.link](http://nbgitpuller.link). If you had - just created your repo, you might have to specify `main` instead of `master` for the branch - name, since [GitHub changed the name of the default branch](https://github.com/github/renaming) - recently. - -That's it! You're all set. You can distribute these links to your students, and they'll be -able to access your materials! You can also use more traditional methods (like the `git` commandline -tool, or RStudio's git interface) to access this repo as well. - -Note: *Everyone* on the selected JupyterHub can clone your private repo if you -do this. They won't be able to see that this repo exists, but if they get their -hands on your nbgitpuller link they can fetch that too. More fine-grained -permissions coming soon.