Skip to content

Commit

Permalink
Merge pull request #103 from rapidsai/branch-0.6
Browse files Browse the repository at this point in the history
Release 0.6.0
  • Loading branch information
ajschmidt8 authored May 25, 2021
2 parents 694690f + 47a46c8 commit 7ee63f7
Show file tree
Hide file tree
Showing 33 changed files with 3,943 additions and 983 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
coverage
**/*.d.ts
tests
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended'
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module'
},
plugins: ['@typescript-eslint'],
rules: {
'@typescript-eslint/interface-name-prefix': [
'error',
{ prefixWithI: 'always' }
],
'@typescript-eslint/no-unused-vars': ['warn', { args: 'none' }],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/quotes': [
'error',
'single',
{ avoidEscape: true, allowTemplateLiterals: false }
],
curly: ['error', 'all'],
eqeqeq: 'error',
'prefer-arrow-callback': 'error'
}
};
105 changes: 105 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,112 @@ lib/
node_modules/
*.egg-info/
.ipynb_checkpoints
*.tsbuildinfo
jupyterlab_nvdashboard/labextension

# Created by https://www.gitignore.io/api/python
# Edit at https://www.gitignore.io/?templates=python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
dask-worker-space/
.pytest_cache/

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# End of https://www.gitignore.io/api/python

# OSX files
.DS_Store
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
node_modules
**/node_modules
**/lib
**/package.json
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"singleQuote": true
}
}
28 changes: 28 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BSD 3-Clause License

Copyright (c) 2020, NVDashboard Contributors All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13 changes: 0 additions & 13 deletions LICENSE.txt

This file was deleted.

28 changes: 21 additions & 7 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
recursive-include jupyterlab_nvdashboard *.py

include setup.py
include LICENSE
include README.md
include LICENSE.txt
include requirements.txt
include MANIFEST.in
include pyproject.toml
include jupyter-config/jupyterlab_nvdashboard.json

include package.json
include install.json
include ts*.json
include requirements.txt

graft jupyterlab_nvdashboard/labextension

# Javascript files
graft src
graft style
prune **/node_modules
prune lib

recursive-exclude * __pycache__
# Patterns to exclude from any directory
global-exclude *~
global-exclude *.pyc
global-exclude *.pyo
global-exclude .git
global-exclude .ipynb_checkpoints
94 changes: 48 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,83 +1,85 @@
JupyterLab GPU Dashboards
===========================
# jupyterlab_nvdashboard

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

A JupyterLab extension for displaying GPU usage dashboards

A JupyterLab extension for displaying dashboards of GPU usage.

![demo](./demo.gif)
This extension is composed of a Python package named `jupyterlab_nvdashboard`
for the server extension and a NPM package named `jupyterlab-nvdashboard`
for the frontend extension.

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

## Requirements

What's here
-----------
* JupyterLab >= 3.0

This repository contains two sets of code:
## Install

- Python code defining a Bokeh Server application that generates the dashboards
in the `jupyterlab_nvdashboard/` directory
- TypeScript code integrating these dashboards into JupyterLab in the `src/`
directory

You should be able to modify only the Python code to edit the dashboards
without modifying the TypeScript code.

## Prerequisites

* JupyterLab 1.0
* bokeh
* pynvml

## Installation
```bash
pip install jupyterlab_nvdashboard
```

This extension has a server-side (Python) and a client-side (Typescript) component,
and we must install both in order for it to work.

> **Note: Currently nvdashboard does not support Windows**
## Troubleshoot

To install the server-side component, run the following in your terminal
If you are seeing the frontend extension, but it is not working, check
that the server extension is enabled:

```bash
pip install jupyterlab-nvdashboard
jupyter server extension list
```

To install the client-side component, run
If the server extension is installed and enabled, but you are not seeing
the frontend extension, check the frontend extension is installed:

```bash
jupyter labextension install jupyterlab-nvdashboard
jupyter labextension list
```

## Development

To install the server-side part, run the following in your terminal from the repository directory:
## Contributing

### Development install

Note: You will need NodeJS to build the extension package.

The `jlpm` command is JupyterLab's pinned version of
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
`yarn` or `npm` in lieu of `jlpm` below.

```bash
# Clone the repo to your local environment
# Change directory to the jupyterlab_nvdashboard directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build
```

In order to install the client-side component (requires node version 8 or later), run the following in the repository directory:
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.

```bash
jlpm install
jlpm run build
jupyter labextension install .
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
```

To rebuild the package and the JupyterLab app:
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).

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:

```bash
jlpm run build
jupyter lab build
jupyter lab build --minimize=False
```

## Publishing

This application is distributed as two subpackages.
### Uninstall

The JupyterLab frontend part is published to [npm](https://www.npmjs.com/package/jupyterlab-nvdashboard),
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)).
```bash
pip uninstall jupyterlab_nvdashboard
```

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.
8 changes: 1 addition & 7 deletions ci/cpu/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ conda list --show-channel-urls
conda config --set ssl_verify False

################################################################################
# BUILD - Conda, pip, & npm package
# BUILD - Conda & pip package
################################################################################

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

gpuci_logger "Build npm pkg for jupyterlab-nvdashboard"
gpuci_conda_retry install -y nodejs=10 jupyterlab
npm i -g npm@latest
jlpm install
jlpm build

################################################################################
# UPLOAD - Packages
################################################################################
Expand Down
Loading

0 comments on commit 7ee63f7

Please sign in to comment.