|
| 1 | +--- |
| 2 | +title: Share Git Repository via JupyterLab-Gallery |
| 3 | +description: Share files or tutorials with your team |
| 4 | +--- |
| 5 | + |
| 6 | +# How to set up a Git Repository via JupyterLab-Gallery |
| 7 | + |
| 8 | +[JupyterLab-Gallery ](https://github.com/nebari-dev/jupyterlab-gallery) is a JupyterLab plugin |
| 9 | +that allows users to share a Git Repository. JupyterLab users are presented with a tile in |
| 10 | +the JupyterLab launch screen. Users can choose to download the Exhibit. |
| 11 | + |
| 12 | +By default, if no JupyterLab-Gallery items are added to the config, users will not see this section |
| 13 | +in the JupyterLab Launcher. |
| 14 | + |
| 15 | +This feature was added to Nebari in the 2024.6.1 release. |
| 16 | + |
| 17 | +## Configure JupyterLb-Gallery |
| 18 | + |
| 19 | +In Nebari, the JupyterLab-Gallery configuration is set in the Nebari configuration, `nebari-config.yaml`. |
| 20 | + |
| 21 | +The configuration is set under the `jupyterlab` section under the subsection `gallery_settings`. |
| 22 | +Users may set a title for the Gallery section of the Launcher screen and a destination (i.e. folder) |
| 23 | +for the location of the cloned repos. |
| 24 | + |
| 25 | +Several repositories can be configured to display as individual gallery tiles. Under the `exhibits` |
| 26 | +section, each repository must have a `title` and a `git` location. There are also several other |
| 27 | +optional config options. |
| 28 | + |
| 29 | +The configuration is set at two different levels. Top level gallery settings define the title of |
| 30 | +the Gallery section and the location in which the repositories are downloaded. The repository |
| 31 | +level settings are defined for each repository. The settings in each section are described |
| 32 | +below. |
| 33 | + |
| 34 | +**Top Level Gallery Settings** |
| 35 | + |
| 36 | +| Section | Description | |
| 37 | +| ----------- | -------------------------------------------------- | |
| 38 | +| title | Title on the gallery tile | |
| 39 | +| destination | Location on disk where the repo will be downloaded | |
| 40 | + |
| 41 | +**Repository Level Settings** |
| 42 | + |
| 43 | +| Section | Description | |
| 44 | +| ----------- | ----------------------------------------------------------------------------------- | |
| 45 | +| title | Title on the gallery tile | |
| 46 | +| git | URL of the git repository | |
| 47 | +| homepage | (Optional) | |
| 48 | +| description | Description of the repository to appear on the gallery tile (Optional) | |
| 49 | +| icon | URL or base64 encoded image to use an icon to appear on the gallery tile (Optional) | |
| 50 | +| account | (Optional) | |
| 51 | +| token | Private Access Token to enable access to private repositories (Optional) | |
| 52 | + |
| 53 | +### Sample configuration |
| 54 | + |
| 55 | +Below is an example of the Gallery settings from the `nebari-config.yaml`. Note that \<encoding\> |
| 56 | +and \<PAT\> should be replaced with the actual encoding and Private Access Token, respectively. |
| 57 | + |
| 58 | +``` |
| 59 | +jupyterlab: |
| 60 | + gallery_settings: |
| 61 | + title: Demos |
| 62 | + destination: demos |
| 63 | + exhibits: |
| 64 | + - title: Data of an Unusual Size |
| 65 | + git: https://github.com/nebari-dev/big-data-tutorial.git |
| 66 | + description: Big data tutorial focusing on Dask usage in Nebari |
| 67 | + icon: "data:image/png;base64,<encoding>" |
| 68 | + homepage: https://github.com/nebari-dev/big-data-tutorial/ |
| 69 | + - title: From RAGs to riches |
| 70 | + git: https://github.com/Quansight/ragna-presentations.git |
| 71 | + homepage: https://github.com/Quansight/ragna-presentations/ |
| 72 | + - title: Private Examples |
| 73 | + description: Internal company examples |
| 74 | + icon: "data:image/png;base64,<encoding>" |
| 75 | + git: https://gitlab....net/companyxyz/examples.git |
| 76 | + account: examples |
| 77 | + token: "<PAT>" |
| 78 | +``` |
| 79 | + |
| 80 | +## Using JupyterLab-Gallery |
| 81 | + |
| 82 | +Once the repositories are configured in the Nebari config and redeployed, all users will have |
| 83 | +a section on their JupyterLab Launcher screen for the Gallery. |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +Each tile points to a different gallery entry in the configuration. The Gallery repositories |
| 88 | +will not be downloaded until users trigger the download for each gallery item. To do so, users |
| 89 | +will hover over the tile and click the download button. |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +The repository will download to the location specified in the config (in each user's private |
| 94 | +space). After the download is complete, hover on the gallery tile present the users with two |
| 95 | +new options - the folder icon allows them to jump to the location in the JupyterLab file browser, |
| 96 | +and the download button allows them to fetch an updated copy of the repo (if available). |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | +## Conclusion |
| 101 | + |
| 102 | +For more information on the JupyterLab-Gallery project, visit the |
| 103 | +[JupyterLab-Gallery codebase repo](https://github.com/nebari-dev/jupyterlab-gallery). |
| 104 | + |
| 105 | +For more information about custom JupyterLab Overrides in the Nebari config, visit the [Custom Overrides Configurations](../explanations/custom-overrides-configuration#jupyterlab) documentation. |
0 commit comments