-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add doc on jupyterlab-gallery #528
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,105 @@ | ||||||||||
--- | ||||||||||
title: Share Git Repository via JupyterLab-Gallery | ||||||||||
description: Share files or tutorials with your team | ||||||||||
--- | ||||||||||
|
||||||||||
# How to set up a Git Repository via JupyterLab-Gallery | ||||||||||
|
||||||||||
[JupyterLab-Gallery ](https://github.com/nebari-dev/jupyterlab-gallery) is a JupyterLab plugin | ||||||||||
that allows users to share a Git Repository. JupyterLab users are presented with a tile in | ||||||||||
the JupyterLab launch screen. Users can choose to download the Gallery. | ||||||||||
|
||||||||||
By default, if no JupyterLab-Gallery items are added to the config, users will not see this section | ||||||||||
in the JupyterLab Launcher. | ||||||||||
|
||||||||||
This feature was added to Nebari in the 2024.6.1 release. | ||||||||||
|
||||||||||
## Configure JupyterLb-Gallery | ||||||||||
|
||||||||||
In Nebari, the JupyterLab-Gallery configuration is set in the Nebari configuration, `nebari-config.yaml`. | ||||||||||
|
||||||||||
The configuration is set under the `jupyterlab` section under the subsection `gallery_settings`. | ||||||||||
Users may set a title for the Gallery section of the Launcher screen and a destination (i.e. folder) | ||||||||||
for the location of the cloned repos. | ||||||||||
|
||||||||||
Several repositories can be configured to display as individual gallery tiles. Under the `exhibits` | ||||||||||
section, each repository must have a `title` and a `git` location. There are also several other | ||||||||||
optional config options. | ||||||||||
Comment on lines
+25
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a note: currently the tiles are designed so that they are most beautiful when there is a description. I would personally say that adding description is recommended, but do not want to push it either. |
||||||||||
|
||||||||||
The configuration is set at two different levels. Top level gallery settings define the title of | ||||||||||
the Gallery section and the location in which the repositories are downloaded. The repository | ||||||||||
level settings are defined for each repository. The descriptions of each section are described | ||||||||||
below. | ||||||||||
Comment on lines
+31
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Not a strong opinion here either |
||||||||||
|
||||||||||
**Top Level Gallery Settings** | ||||||||||
|
||||||||||
| Section | Description | | ||||||||||
| ----------- | -------------------------------------------------- | | ||||||||||
| title | Title on the gallery tile | | ||||||||||
| destination | Location on disk where the repo will be downloaded | | ||||||||||
|
||||||||||
**Repository Level Settings** | ||||||||||
|
||||||||||
| Section | Description | | ||||||||||
| ----------- | ---------------------------------------------------------------------------- | | ||||||||||
| title | Title on the gallery tile | | ||||||||||
| git | URL of the git repository | | ||||||||||
| homepage | (Optional) | | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what this is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can be used as a link to the examples repository. The idea is to separate the git URL which might contain token (discouraged) from the link shown in the UI (if any). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also used to generate fallback icon from GitHub social cards There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
As far as I can tell, the UI doesn't link to the repository in any way. If I hover the gallery tile, I just have the options to download or go to the folder. Is this link provided to the users somewhere else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's correct, it is not available in the UI. For god security practice the git URL is separated from user facing URL even though it is not currently in the UI. My plan was to add a new button with link icon but I guess it is low priority. It would be rather low effort too though. |
||||||||||
| description | Description of the repository to appear on the gallery tile (Optional) | | ||||||||||
| icon | base64 encoded image to use an icon to appear on the gallery tile (Optional) | | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alternatively, this can be an URL.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though base64 encoding the image is probably best practice as it ensures that it will never break. |
||||||||||
| account | (Optional) | | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure what this is? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you log in using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is defined in https://github.com/nebari-dev/jupyterlab-gallery/blob/ef56fc616bae4ec8305c01e3341b773ca4cfd48f/jupyterlab_gallery/manager.py#L30-L82 You can access the documentation via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @krassowski for For example, if I go to "clone from https" on the nebari-dev repo, it gives this url: For gitlab the "clone from https" could looks like this: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not a part of the URL. It is used during login sequence, the same way as you would login via CLI when issuing say There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||
| token | Private Access Token to enable access to private repositories (Optional) | | ||||||||||
|
||||||||||
### Sample configuration | ||||||||||
|
||||||||||
Below is an example of the Gallery settings from the `nebari-config.yaml`. Note that \<encoding\> | ||||||||||
and \<PAT\> should be replaced with the actual encoding an Private Access Token, respectively. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
``` | ||||||||||
jupyterlab: | ||||||||||
gallery_settings: | ||||||||||
title: Demos | ||||||||||
destination: demos | ||||||||||
exhibits: | ||||||||||
- title: Data of an Unusual Size | ||||||||||
git: https://github.com/nebari-dev/big-data-tutorial.git | ||||||||||
description: Big data tutorial focusing on Dask usage in Nebari | ||||||||||
icon: "data:image/png;base64,<encoding>" | ||||||||||
homepage: https://github.com/nebari-dev/big-data-tutorial/ | ||||||||||
- title: From RAGs to riches | ||||||||||
git: https://github.com/Quansight/ragna-presentations.git | ||||||||||
homepage: https://github.com/Quansight/ragna-presentations/ | ||||||||||
- title: Private Examples | ||||||||||
description: Internal company examples | ||||||||||
icon: "data:image/png;base64,<encoding>" | ||||||||||
git: https://gitlab....net/companyxyz/examples.git | ||||||||||
account: examples | ||||||||||
token: "<PAT>" | ||||||||||
``` | ||||||||||
|
||||||||||
## Using JupyterLab-Gallery | ||||||||||
|
||||||||||
Once the repositories are configured in the Nebari config and redeployed, all users will have | ||||||||||
a section on their JupyterLab Launcher screen for the Gallery. | ||||||||||
|
||||||||||
![JupyterLab Gallery tiles on JupyterLab Launcher screen](/img/how-tos/jupyter-gallery-tiles.png) | ||||||||||
|
||||||||||
Each tile points to a different gallery entry in the configuration. The Gallery repositories | ||||||||||
will not be downloaded until users trigger the download for each gallery item. To do so, users | ||||||||||
will hover over the tile and click the download button. | ||||||||||
|
||||||||||
![JupyterLab Gallery tile on hover for undownloaded repo](/img/how-tos/jupyter-gallery-tile-download.png) | ||||||||||
|
||||||||||
The repository will download to the location specified in the config (in each user's private | ||||||||||
space). After the download is complete, hover on the gallery tile present the users with two | ||||||||||
new options - the folder icon allows them to jump to the location in the JupyterLab file browser, | ||||||||||
and the download button allows them to fetch an updated copy of the repo (if available). | ||||||||||
|
||||||||||
![JupyterLab Gallery tile on hover to update repo](/img/how-tos/jupyter-gallery-tile-update.png) | ||||||||||
|
||||||||||
## Conclusion | ||||||||||
|
||||||||||
For more information on the JupyterLab-Gallery project, visit the | ||||||||||
[JupyterLab-Gallery codebase repo](https://github.com/nebari-dev/jupyterlab-gallery). | ||||||||||
|
||||||||||
For more information about custom JupyterLab Overrides in the Nebari config, visit the [Custom Overrides Configurations](../explanations/custom-overrides-configuration#jupyterlab) documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong opinions, I am just using the wording of "gallery composed of multiple exhibits" in jupyterlab-gallery and it seems to make more sense here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I struggled with this wording - that is perfect!