Skip to content

docs: add Jupyter Gallery configuration page - #219

Open
viniciusdc wants to merge 2 commits into
mainfrom
docs/gallery-configuration
Open

docs: add Jupyter Gallery configuration page#219
viniciusdc wants to merge 2 commits into
mainfrom
docs/gallery-configuration

Conversation

@viniciusdc

Copy link
Copy Markdown
Contributor

Adds a Jupyter Gallery page to the docs site, closing #218.

Documents the current reality on main: exhibits have to live in a jupyter_gallery_config.py on the singleuser config path, injected via singleuser.extraFiles. GalleryManager only exists in the singleuser server, so putting it under hub.extraConfig silently no-ops (that was #134).

The page covers three things:

  • Config placement with the verified z2jh singleuser.extraFiles snippet.
  • Exhibit schema (git, title, homepage, description, icon, branch, depth, and account/token for private repos, with the PAT-via-env-var note pointing at the upstream README).
  • The remote-icon trap from the issue thread: an exhibit whose icon is a remote URL fails to load on air-gapped / restricted-egress clusters and leaves a broken-image placeholder with no fallback. The recommendation is to point icon at a local, same-origin asset on those deployments.

I scoped the page deliberately as a workaround doc. #118 proposes a first-class singleuser.gallery values key that removes the hand-rolled config file entirely; if it lands, this page collapses to the values key. There's a "Looking ahead" section that says exactly that so we don't ossify around the workaround. I'm about to run a full review on #118 separately to see if we can just unblock it.

Also adds the page to the Guides sidebar and a row in the configuration reference table.

Documents the current jupyterlab-gallery setup: exhibits must live in a
jupyter_gallery_config.py on the singleuser config path (injected via
singleuser.extraFiles), since GalleryManager only exists in the singleuser
server and hub.extraConfig silently no-ops (#134).

Covers the exhibit schema and the remote-icon trap: an exhibit whose icon is
a remote URL fails to load on restricted-egress clusters with no fallback, so
locked-down deployments should point icon at a local, same-origin asset.

Notes that a first-class singleuser.gallery values key (#118) would supersede
this workaround, so the page is scoped to be replaced once that lands.

Closes #218.
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview for docs/gallery-configuration:
https://docs-gallery-configuration.data-science-pack.pages.dev

| `nebi` | The companion Nebi service — image, external/internal URLs, namespace, release name |
| `rbac.bootstrap` | One-shot Keycloak Job that adds the groups-claim mapper and the shared-mount client role |
| `jupyterhub` | Passed through verbatim to the `jupyterhub` subchart (proxy, hub, singleuser images, auth, etc.) |
| Jupyter Gallery | Curated tutorial tiles in JupyterLab, configured via `jupyterhub.singleuser.extraFiles`. See [Jupyter Gallery](/gallery/) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Jupyter Gallery | Curated tutorial tiles in JupyterLab, configured via `jupyterhub.singleuser.extraFiles`. See [Jupyter Gallery](/gallery/) |
| Jupyter Gallery | Curated gallery tiles in JupyterLab, configured via `jupyterhub.singleuser.extraFiles`. See [Jupyter Gallery](/gallery/) |

They aren't necessary tutorials.

@@ -0,0 +1,101 @@
---
title: Jupyter Gallery
description: Configure jupyterlab-gallery exhibits, where the config has to live, and the remote-icon trap on restricted-egress clusters.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Configure jupyterlab-gallery exhibits, where the config has to live, and the remote-icon trap on restricted-egress clusters.
description: Configure jupyterlab-gallery exhibits

I don't know what a remote-icon trap is so I wanted to remove it from the description until it can be explained later, but when I did that, the where the config has to live didn't make sense to keep.

extension shows a curated set of tutorial "exhibits" as tiles inside
JupyterLab, each backed by a git repository the user can clone with one click.
The extension already ships in the singleuser image, so configuring it is only
a matter of telling the `GalleryManager` which exhibits to show.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a matter of telling the `GalleryManager` which exhibits to show.
a matter of telling the `GalleryManager` which exhibits to show. If not exhibits are included in the config, the section remains empty.

The extension already ships in the singleuser image, so configuring it is only
a matter of telling the `GalleryManager` which exhibits to show.

## Where the config has to live

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Where the config has to live
## Location of the configuration

```

`destination` is the directory (relative to the user's home) that exhibits are
cloned into.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cloned into.
cloned into. The example above will clone into `$HOME/tutorials/xarray-tutorial`.

## Exhibit schema

Each entry in `c.GalleryManager.exhibits` is a dict. The keys the upstream
`GalleryManager` understands:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`GalleryManager` understands:
`GalleryManager` accepts:

Each entry in `c.GalleryManager.exhibits` is a dict. The keys the upstream
`GalleryManager` understands:

| Key | Purpose |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which of these are required?

|---|---|
| `git` | Clone URL of the exhibit repository (required) |
| `title` | Label shown on the tile |
| `homepage` | Link opened from the tile's "info" affordance |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `homepage` | Link opened from the tile's "info" affordance |
| `homepage` | Link opened from the tile's "info" button |

Is that what "affordance" means?

| `icon` | Tile image (see [Tile icons](#tile-icons-and-the-remote-icon-trap) below) |
| `branch` | Branch to clone (defaults to the repo's default branch) |
| `depth` | Clone depth for shallow clones |
| `account` / `token` | Credentials for private repositories |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize this was a thing. Reading this, I still don't know how to use it. Is this saying that I need two separate entries for account and token? Or is it either/or? And I assume I'd use a PAT for token, but what does account mean? Is that username?

I see the paragraph below, but I think it needs a bit more information.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `account` / `token` | Credentials for private repositories |
| `account` / `token` | Credentials for private repositories (see information below) |


For private repositories, supply `account` and a personal access `token`.
Rather than embedding the token literally in the config, reference it from an
environment variable set on the singleuser pod (for example via

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do I actually set this on my deployment? Its something I have to manually set a the k8s level? Will I lose it if I upgrade NIC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants