Skip to content

Commit

Permalink
Fix syntax. Separete postgres info.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanlovett committed Aug 9, 2024
1 parent 518e39e commit 0e928a6
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 48 deletions.
1 change: 1 addition & 0 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ website:
- admins/howto/core-pool.qmd
- admins/howto/new-hub.qmd
- admins/howto/rebuild-hub-image.qmd
- admins/howto/rebuild-postgres-image.qmd
- admins/howto/new-image.qmd
- admins/howto/new-packages.qmd
- admins/howto/course-config.qmd
Expand Down
68 changes: 20 additions & 48 deletions docs/admins/howto/rebuild-hub-image.qmd
Original file line number Diff line number Diff line change
@@ -1,59 +1,31 @@
---
title: Rebuild a custom hub image
title: "Customize the Hub Docker Image"
---

We use a customized JupyterHub image so we can use versions of hub
packages (such as authenticators) and install additional software
required by custom config we might have.

The image is located in `images/hub`. It *must* inherit from the
JupyterHub image used in the [Zero to
We use a customized JupyterHub docker image so we can install extra packages
such as authenticators. The image is located in `images/hub`. It *must* inherit
from the JupyterHub image used in the [Zero to
JupyterHub](https://z2jh.jupyter.og).

[chartpress](https://github.com/jupyterhub/chartress) is used to build
the image and update `hub/values.yaml` with the new image version.
The image is build with [chartpress](https://github.com/jupyterhub/chartress),
which also updates `hub/values.yaml` with the new image version.
`chartpress` may be installed locally with `pip install chartpress`.

1. Run `gcloud auth configure-docker us-central1-docker.pkg.dev` *once
per machine* to setup docker for authentication with the [gcloud
credential
helper](https://cloud.google.com/artifact-registry/docs/docker/authentication).
2. Modify the image in `images/hub` and make a git commit.
3. Run `chartpress --push`. This will build and push the hub image, and
modify `hub/values.yaml` appropriately.
4. Make a commit with the `hub/values.yaml` file, so the new hub image
name and tag are comitted.
5. Proceed to deployment as normal.
1. Run `gcloud auth configure-docker us-central1-docker.pkg.dev` *once
per machine* to setup docker for authentication with the [gcloud
credential
helper](https://cloud.google.com/artifact-registry/docs/docker/authentication).
2. Modify the image in `images/hub` and make a git commit.
3. Run `chartpress --push`. This will build and push the hub image, and
modify `hub/values.yaml` appropriately.
4. Make a commit with the `hub/values.yaml` file, so the new hub image
name and tag are comitted.
5. Proceed to deployment as normal.

Some of the following commands may be required to configure your
environment to run the above chartpress workflow successfully:

- `gcloud auth login`
- `gcloud auth configure-docker us-central1-docker.pkg.dev`
- `gcloud auth application-default login`
- sometimes running `gcloud auth login` additional time(s) may fix
issues
- `sudo usermod -a -G docker ${USER}`
- `gcloud auth configure-docker`

# Rebuild the custom postgres image

For data100, we provide a postgresql server per user. We want the
[python
extension](https://www.postgresql.org/docs/current/plpython.html)
installed. So we inherit from the [upstream postgresql docker
image](https://hub.docker.com/_/postgres), and add the appropriate
package.

This image is in `images/postgres`. If you update it, you need to
rebuild and push it.

1. Modify the image in `images/postgres` and make a git commit.
2. Run `chartpress --push`. This will build and push the image, *but
not put anything in YAML*. There is no place we can put thi in
`values.yaml`, since this is only used for data100.
3. Notice the image name + tag from the `chartpress --push` command,
and put it in the appropriate place (under `extraContainers`) in
`data100/config/common.yaml`.
4. Make a commit with the new tag in `data100/config/common.yaml`.
5. Proceed to deploy as normal.
- `gcloud auth login`.
- `gcloud auth configure-docker us-central1-docker.pkg.dev`
- `gcloud auth application-default login`
- `gcloud auth configure-docker`
22 changes: 22 additions & 0 deletions docs/admins/howto/rebuild-postgres-image.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: "Customize the Per-User Postgres Docker Image"
---

We provide each student on `data100` witha postgresql server. We want the
[python extension](https://www.postgresql.org/docs/current/plpython.html)
installed. So we inherit from the [upstream postgresql docker
image](https://hub.docker.com/_/postgres), and add the appropriate
package.

This image is in `images/postgres`. If you update it, you need to
rebuild and push it.

1. Modify the image in `images/postgres` and make a git commit.
2. Run `chartpress --push`. This will build and push the image, *but
not put anything in YAML*. There is no place we can put thi in
`values.yaml`, since this is only used for data100.
3. Notice the image name + tag from the `chartpress --push` command,
and put it in the appropriate place (under `extraContainers`) in
`data100/config/common.yaml`.
4. Make a commit with the new tag in `data100/config/common.yaml`.
5. Proceed to deploy as normal.

0 comments on commit 0e928a6

Please sign in to comment.