|
1 | | -JupyterLab GPU Dashboards |
2 | | -=========================== |
| 1 | +# jupyterlab_nvdashboard |
3 | 2 |
|
4 | | -[](https://pypi.org/project/jupyterlab-nvdashboard/) |
5 | | -[](https://www.npmjs.com/package/jupyterlab-nvdashboard) |
| 3 | + |
6 | 4 |
|
| 5 | +A JupyterLab extension for displaying GPU usage dashboards |
7 | 6 |
|
8 | | -A JupyterLab extension for displaying dashboards of GPU usage. |
9 | 7 |
|
10 | | - |
| 8 | +This extension is composed of a Python package named `jupyterlab_nvdashboard` |
| 9 | +for the server extension and a NPM package named `jupyterlab-nvdashboard` |
| 10 | +for the frontend extension. |
11 | 11 |
|
12 | | -Built with [JupyterLab and Bokeh Server](https://github.com/ian-r-rose/jupyterlab-bokeh-server) |
13 | 12 |
|
| 13 | +## Requirements |
14 | 14 |
|
15 | | -What's here |
16 | | ------------ |
| 15 | +* JupyterLab >= 3.0 |
17 | 16 |
|
18 | | -This repository contains two sets of code: |
| 17 | +## Install |
19 | 18 |
|
20 | | -- Python code defining a Bokeh Server application that generates the dashboards |
21 | | - in the `jupyterlab_nvdashboard/` directory |
22 | | -- TypeScript code integrating these dashboards into JupyterLab in the `src/` |
23 | | - directory |
24 | | - |
25 | | -You should be able to modify only the Python code to edit the dashboards |
26 | | -without modifying the TypeScript code. |
27 | | - |
28 | | -## Prerequisites |
29 | | - |
30 | | -* JupyterLab 1.0 |
31 | | -* bokeh |
32 | | -* pynvml |
33 | | - |
34 | | -## Installation |
| 19 | +```bash |
| 20 | +pip install jupyterlab_nvdashboard |
| 21 | +``` |
35 | 22 |
|
36 | | -This extension has a server-side (Python) and a client-side (Typescript) component, |
37 | | -and we must install both in order for it to work. |
38 | 23 |
|
39 | | -> **Note: Currently nvdashboard does not support Windows** |
| 24 | +## Troubleshoot |
40 | 25 |
|
41 | | -To install the server-side component, run the following in your terminal |
| 26 | +If you are seeing the frontend extension, but it is not working, check |
| 27 | +that the server extension is enabled: |
42 | 28 |
|
43 | 29 | ```bash |
44 | | -pip install jupyterlab-nvdashboard |
| 30 | +jupyter server extension list |
45 | 31 | ``` |
46 | 32 |
|
47 | | -To install the client-side component, run |
| 33 | +If the server extension is installed and enabled, but you are not seeing |
| 34 | +the frontend extension, check the frontend extension is installed: |
48 | 35 |
|
49 | 36 | ```bash |
50 | | -jupyter labextension install jupyterlab-nvdashboard |
| 37 | +jupyter labextension list |
51 | 38 | ``` |
52 | 39 |
|
53 | | -## Development |
54 | 40 |
|
55 | | -To install the server-side part, run the following in your terminal from the repository directory: |
| 41 | +## Contributing |
| 42 | + |
| 43 | +### Development install |
| 44 | + |
| 45 | +Note: You will need NodeJS to build the extension package. |
| 46 | + |
| 47 | +The `jlpm` command is JupyterLab's pinned version of |
| 48 | +[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use |
| 49 | +`yarn` or `npm` in lieu of `jlpm` below. |
56 | 50 |
|
57 | 51 | ```bash |
| 52 | +# Clone the repo to your local environment |
| 53 | +# Change directory to the jupyterlab_nvdashboard directory |
| 54 | +# Install package in development mode |
58 | 55 | pip install -e . |
| 56 | +# Link your development version of the extension with JupyterLab |
| 57 | +jupyter labextension develop . --overwrite |
| 58 | +# Rebuild extension Typescript source after making changes |
| 59 | +jlpm run build |
59 | 60 | ``` |
60 | 61 |
|
61 | | -In order to install the client-side component (requires node version 8 or later), run the following in the repository directory: |
| 62 | +You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. |
62 | 63 |
|
63 | 64 | ```bash |
64 | | -jlpm install |
65 | | -jlpm run build |
66 | | -jupyter labextension install . |
| 65 | +# Watch the source directory in one terminal, automatically rebuilding when needed |
| 66 | +jlpm run watch |
| 67 | +# Run JupyterLab in another terminal |
| 68 | +jupyter lab |
67 | 69 | ``` |
68 | 70 |
|
69 | | -To rebuild the package and the JupyterLab app: |
| 71 | +With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). |
| 72 | + |
| 73 | +By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: |
70 | 74 |
|
71 | 75 | ```bash |
72 | | -jlpm run build |
73 | | -jupyter lab build |
| 76 | +jupyter lab build --minimize=False |
74 | 77 | ``` |
75 | 78 |
|
76 | | -## Publishing |
77 | | - |
78 | | -This application is distributed as two subpackages. |
| 79 | +### Uninstall |
79 | 80 |
|
80 | | -The JupyterLab frontend part is published to [npm](https://www.npmjs.com/package/jupyterlab-nvdashboard), |
81 | | -and the server-side part to both [PyPI](https://pypi.org/project/jupyterlab-nvdashboard/) and [Anaconda](https://anaconda.org/rapidsai/jupyterlab-nvdashboard) ([nightlies](https://anaconda.org/rapidsai-nightly/jupyterlab-nvdashboard)). |
| 81 | +```bash |
| 82 | +pip uninstall jupyterlab_nvdashboard |
| 83 | +``` |
82 | 84 |
|
83 | 85 | Releases for both packages are handled by [gpuCI](https://gpuci.gpuopenanalytics.com/job/rapidsai/job/gpuci/job/jupyterlab-nvdashboard/). Nightly builds are triggered when a push to a versioned branch occurs (i.e. `branch-0.5`). Stable builds are triggered when a push to the `main` branch occurs. |
0 commit comments