Skip to content

Commit 7ee63f7

Browse files
authored
Merge pull request #103 from rapidsai/branch-0.6
Release 0.6.0
2 parents 694690f + 47a46c8 commit 7ee63f7

33 files changed

+3943
-983
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
coverage
4+
**/*.d.ts
5+
tests

.eslintrc.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
module.exports = {
2+
extends: [
3+
'eslint:recommended',
4+
'plugin:@typescript-eslint/eslint-recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:prettier/recommended'
7+
],
8+
parser: '@typescript-eslint/parser',
9+
parserOptions: {
10+
project: 'tsconfig.json',
11+
sourceType: 'module'
12+
},
13+
plugins: ['@typescript-eslint'],
14+
rules: {
15+
'@typescript-eslint/interface-name-prefix': [
16+
'error',
17+
{ prefixWithI: 'always' }
18+
],
19+
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
'@typescript-eslint/no-namespace': 'off',
22+
'@typescript-eslint/no-use-before-define': 'off',
23+
'@typescript-eslint/quotes': [
24+
'error',
25+
'single',
26+
{ avoidEscape: true, allowTemplateLiterals: false }
27+
],
28+
curly: ['error', 'all'],
29+
eqeqeq: 'error',
30+
'prefer-arrow-callback': 'error'
31+
}
32+
};

.gitignore

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,112 @@ lib/
33
node_modules/
44
*.egg-info/
55
.ipynb_checkpoints
6+
*.tsbuildinfo
7+
jupyterlab_nvdashboard/labextension
8+
9+
# Created by https://www.gitignore.io/api/python
10+
# Edit at https://www.gitignore.io/?templates=python
11+
12+
### Python ###
13+
# Byte-compiled / optimized / DLL files
614
__pycache__/
15+
*.py[cod]
16+
*$py.class
717
dask-worker-space/
818
.pytest_cache/
19+
20+
# C extensions
21+
*.so
22+
23+
# Distribution / packaging
24+
.Python
25+
build/
26+
develop-eggs/
927
dist/
28+
downloads/
29+
eggs/
30+
.eggs/
31+
lib/
32+
lib64/
33+
parts/
34+
sdist/
35+
var/
36+
wheels/
37+
pip-wheel-metadata/
38+
share/python-wheels/
39+
.installed.cfg
40+
*.egg
41+
MANIFEST
42+
43+
# PyInstaller
44+
# Usually these files are written by a python script from a template
45+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
46+
*.manifest
47+
*.spec
48+
49+
# Installer logs
50+
pip-log.txt
51+
pip-delete-this-directory.txt
52+
53+
# Unit test / coverage reports
54+
htmlcov/
55+
.tox/
56+
.nox/
57+
.coverage
58+
.coverage.*
59+
.cache
60+
nosetests.xml
61+
coverage.xml
62+
*.cover
63+
.hypothesis/
64+
.pytest_cache/
65+
66+
# Translations
67+
*.mo
68+
*.pot
69+
70+
# Scrapy stuff:
71+
.scrapy
72+
73+
# Sphinx documentation
74+
docs/_build/
75+
76+
# PyBuilder
77+
target/
78+
79+
# pyenv
80+
.python-version
81+
82+
# celery beat schedule file
83+
celerybeat-schedule
84+
85+
# SageMath parsed files
86+
*.sage.py
87+
88+
# Spyder project settings
89+
.spyderproject
90+
.spyproject
91+
92+
# Rope project settings
93+
.ropeproject
94+
95+
# Mr Developer
96+
.mr.developer.cfg
97+
.project
98+
.pydevproject
99+
100+
# mkdocs documentation
101+
/site
102+
103+
# mypy
104+
.mypy_cache/
105+
.dmypy.json
106+
dmypy.json
107+
108+
# Pyre type checker
109+
.pyre/
110+
111+
# End of https://www.gitignore.io/api/python
112+
113+
# OSX files
114+
.DS_Store

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_modules
2+
**/node_modules
23
**/lib
4+
**/package.json

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"singleQuote": true
3-
}
3+
}

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2020, NVDashboard Contributors All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
* Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

LICENSE.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

MANIFEST.in

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
recursive-include jupyterlab_nvdashboard *.py
2-
3-
include setup.py
1+
include LICENSE
42
include README.md
5-
include LICENSE.txt
6-
include requirements.txt
7-
include MANIFEST.in
3+
include pyproject.toml
4+
include jupyter-config/jupyterlab_nvdashboard.json
5+
86
include package.json
7+
include install.json
8+
include ts*.json
9+
include requirements.txt
10+
11+
graft jupyterlab_nvdashboard/labextension
12+
13+
# Javascript files
14+
graft src
15+
graft style
16+
prune **/node_modules
17+
prune lib
918

10-
recursive-exclude * __pycache__
19+
# Patterns to exclude from any directory
20+
global-exclude *~
21+
global-exclude *.pyc
22+
global-exclude *.pyo
23+
global-exclude .git
24+
global-exclude .ipynb_checkpoints

README.md

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,85 @@
1-
JupyterLab GPU Dashboards
2-
===========================
1+
# jupyterlab_nvdashboard
32

4-
[![PyPI](https://img.shields.io/pypi/v/jupyterlab-nvdashboard)](https://pypi.org/project/jupyterlab-nvdashboard/)
5-
[![npm](https://img.shields.io/npm/v/jupyterlab-nvdashboard)](https://www.npmjs.com/package/jupyterlab-nvdashboard)
3+
![Github Actions Status](https://github.com/rapidsai/jupyterlab-nvdashboard/workflows/Build/badge.svg)
64

5+
A JupyterLab extension for displaying GPU usage dashboards
76

8-
A JupyterLab extension for displaying dashboards of GPU usage.
97

10-
![demo](./demo.gif)
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.
1111

12-
Built with [JupyterLab and Bokeh Server](https://github.com/ian-r-rose/jupyterlab-bokeh-server)
1312

13+
## Requirements
1414

15-
What's here
16-
-----------
15+
* JupyterLab >= 3.0
1716

18-
This repository contains two sets of code:
17+
## Install
1918

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+
```
3522

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.
3823

39-
> **Note: Currently nvdashboard does not support Windows**
24+
## Troubleshoot
4025

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:
4228

4329
```bash
44-
pip install jupyterlab-nvdashboard
30+
jupyter server extension list
4531
```
4632

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:
4835

4936
```bash
50-
jupyter labextension install jupyterlab-nvdashboard
37+
jupyter labextension list
5138
```
5239

53-
## Development
5440

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.
5650

5751
```bash
52+
# Clone the repo to your local environment
53+
# Change directory to the jupyterlab_nvdashboard directory
54+
# Install package in development mode
5855
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
5960
```
6061

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.
6263

6364
```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
6769
```
6870

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:
7074

7175
```bash
72-
jlpm run build
73-
jupyter lab build
76+
jupyter lab build --minimize=False
7477
```
7578

76-
## Publishing
77-
78-
This application is distributed as two subpackages.
79+
### Uninstall
7980

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+
```
8284

8385
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.

ci/cpu/build.sh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ conda list --show-channel-urls
4848
conda config --set ssl_verify False
4949

5050
################################################################################
51-
# BUILD - Conda, pip, & npm package
51+
# BUILD - Conda & pip package
5252
################################################################################
5353

5454
gpuci_logger "Build conda pkg for jupyterlab-nvdashboard"
@@ -58,12 +58,6 @@ gpuci_logger "Build pip pkg for jupyterlab-nvdashboard"
5858
rm -rf dist/
5959
python setup.py sdist bdist_wheel
6060

61-
gpuci_logger "Build npm pkg for jupyterlab-nvdashboard"
62-
gpuci_conda_retry install -y nodejs=10 jupyterlab
63-
npm i -g npm@latest
64-
jlpm install
65-
jlpm build
66-
6761
################################################################################
6862
# UPLOAD - Packages
6963
################################################################################

0 commit comments

Comments
 (0)