dask-labextension


Namedask-labextension JSON
Version 7.0.0 PyPI version JSON
download
home_page
SummaryA JupyterLab extension for Dask.
upload_time2023-08-04 14:55:05
maintainer
docs_urlNone
authorIan Rose, Matt Rocklin, Jacob Tomlinson
requires_python>=3.8
licenseCopyright (c) 2016, Project Jupyter Contributors and Anaconda Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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. 3. 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.
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Dask JupyterLab Extension

[![Build Status](https://github.com/dask/dask-labextension/actions/workflows/python.yaml/badge.svg)](https://github.com/dask/dask-labextension/actions/workflows/python.yaml) [![Version](https://img.shields.io/npm/v/dask-labextension.svg)](https://www.npmjs.com/package/dask-labextension) [![Downloads](https://img.shields.io/npm/dm/dask-labextension.svg)](https://www.npmjs.com/package/dask-labextension) [![Dependencies](https://img.shields.io/librariesio/release/npm/dask-labextension.svg)](https://libraries.io/npm/dask-labextension)

This package provides a JupyterLab extension to manage Dask clusters,
as well as embed Dask's dashboard plots directly into JupyterLab panes.

![Dask Extension](./dask.png)

## Explanatory Video (5 minutes)

<a href="http://www.youtube.com/watch?feature=player_embedded&v=EX_voquHdk0 "
   target="_blank">
<img src="http://img.youtube.com/vi/EX_voquHdk0/0.jpg"
       alt="Dask + JupyterLab Screencast" width="560" height="315" border="10" />
</a>

## Requirements

JupyterLab >= 1.0
distributed >= 1.24.1

## Installation

To install the Dask JupyterLab extension you will need to have JupyterLab installed.
For JupyterLab < 3.0, you will also need [Node.js](https://nodejs.org/) version >= 12.
These are available through a variety of sources.
One source common to Python users is the conda package manager.

```bash
conda install jupyterlab
conda install -c conda-forge nodejs
```

### JupyterLab 4.x

Install the latest version of the extension for the JupyterLab 4
support. You should be able to install this extension with pip or conda,
and start using it immediately, e.g.

```bash
pip install dask-labextension
```

### JupyterLab 3.x

For JupyterLab 3.x, use lastest supported version `6.2.0`.

```bash
pip install dask-labextension==6.2.0
```

### JupyterLab 2.x

Prior to JupyterLab 3.0 client-side and server-side components needed
to be installed separately, with node available on the machine.

The server-side component can be installed via pip or conda-forge:

```bash
pip install 'dask_labextension<5'
```

```bash
conda install -c conda-forge 'dask-labextension<5'
```

You then build the client-side extension into JupyterLab with:

```bash
jupyter labextension install dask-labextension
```

If you are running Notebook 5.2 or earlier, enable the server extension by running

```bash
jupyter serverextension enable --py --sys-prefix dask_labextension
```

## Configuration of Dask cluster management

This extension has the ability to launch and manage several kinds of Dask clusters,
including local clusters and kubernetes clusters.
Options for how to launch these clusters are set via the
[dask configuration system](http://docs.dask.org/en/latest/configuration.html#configuration),
typically a `.yml` file on disk.

By default the extension launches a `LocalCluster`, for which the configuration is:

```yaml
labextension:
  factory:
    module: 'dask.distributed'
    class: 'LocalCluster'
    args: []
    kwargs: {}
  default:
    workers: null
    adapt:
      null
      # minimum: 0
      # maximum: 10
  initial:
    []
    # - name: "My Big Cluster"
    #   workers: 100
    # - name: "Adaptive Cluster"
    #   adapt:
    #     minimum: 0
    #     maximum: 50
```

In this configuration, `factory` gives the module, class name, and arguments needed to create the cluster.
The `default` key describes the initial number of workers for the cluster, as well as whether it is adaptive.
The `initial` key gives a list of initial clusters to start upon launch of the notebook server.

In addition to `LocalCluster`, this extension has been used to launch several other Dask cluster
objects, a few examples of which are:

- A SLURM cluster, using

```yaml
labextension:
    factory:
      module: 'dask_jobqueue'
       class: 'SLURMCluster'
       args: []
       kwargs: {}
```

- A PBS cluster, using

```yaml
labextension:
  factory:
    module: 'dask_jobqueue'
    class: 'PBSCluster'
    args: []
    kwargs: {}
```

- A [Kubernetes cluster](https://github.com/pangeo-data/pangeo-cloud-federation/blob/8f7f4bf9963ef1ed180dd20c952ff1aa8df54ca2/deployments/ocean/image/binder/dask_config.yaml#L37-L42), using

```yaml
labextension:
  factory:
    module: dask_kubernetes
    class: KubeCluster
    args: []
    kwargs: {}
```

## Configuring a default layout

This extension can store a default layout for the Dask dashboard panes,
which is useful if you find yourself reaching for the same dashboard charts over and over.
You can launch the default layout via the command palette,
or by going to the File menu and choosing "Launch Dask Dashboard Layout".

Default layouts can be configured via the JupyterLab config system
(either using the JSON editor or the user interface).
Specify a layout by writing a JSON object keyed by the
[individual charts](https://github.com/dask/distributed/blob/f31fbde748294065ed70dd5c4399821fa664a9f1/distributed/dashboard/scheduler.py#L72-L117)
you would like to open.
Each chart is opened with a `mode`, and a `ref`.
`mode` refers to how the chart is to be added to the workspace.
For example, if you want to split a panel and add the new one to the right, choose `split-right`.
Other options are `split-top`, `split-bottom`, `split-left`, `tab-after`, and `tab-before`.
`ref` refers to the panel to which `mode` is applied, and might be the names of other dashboard panels.
If `ref` is `null`, the panel in question is added at the top of the layout hierarchy.

A concrete example of a default layout is

```json
{
  "individual-task-stream": {
    "mode": "split-right",
    "ref": null
  },
  "individual-workers-memory": {
    "mode": "split-bottom",
    "ref": "individual-task-stream"
  },
  "individual-progress": {
    "mode": "split-right",
    "ref": "individual-workers-memory"
  }
}
```

which adds the task stream to the right of the workspace,
then adds the worker memory chart below the task stream,
then adds the progress chart to the right of the worker memory chart.

## Development install

As described in the [JupyterLab documentation](https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#developing-a-prebuilt-extension)
for a development install of the labextension you can run the following in this directory:

```bash
jlpm  # Install npm package dependencies
jlpm build  # Compile the TypeScript sources to Javascript
jupyter labextension develop . --overwrite  # Install the current directory as an extension
```

To rebuild the extension:

```bash
jlpm build
```

You should then be able to refresh the JupyterLab page
and it will pick up the changes to the extension.

To run an editable install of the server extension, run

```bash
pip install -e .
jupyter serverextension enable --sys-prefix dask_labextension
```

## Publishing

This extension contains a front-end component written in TypeScript
and a back-end component written in Python.
The front-end is compiled to Javascript during the build process
and is distributed as static assets along with the Python package.

### Release process

This requires `node`, `build`, `hatch` and `twine` to be installed.

```bash
# To set version (e.g. 7.0.0). hatch will update version string in package.json
hatch version "7.0.0"

# Examples of bumping version
# minor bump
hatch version minor  # Bumps to 7.1.0
# beta pre-release bump
# If published to pypi this can be installed with the --pre flag to pip
hatch version b  # Bumps to 7.1.0b0
# bump minor and beta
hatch version minor,b  # Bumps to 7.2.0b0
# release all of the --pre-release flags such as alpha beta rc
hatch release  # Bumps to 7.2.0

# git commit after bumping version
git add package.json && git commit -m "Bump version: {version}"
# Tag this version
git tag {version}

# Finally push to main, build and upload package to PyPI
git push upstream main && git push upstream main --tags  # pushes to GitHub
python -m build .  # Build the package
twine upload dist/*  # Upload the package to PyPI
```

### Handling Javascript package version conflicts

Unlike Python, Javascript packages can include more than one version of the same dependency.
Usually the `yarn` package manager handles this okay, but occasionally you might end up with conflicting versions,
or with unexpected package bloat.
You can try to fix this by deduplicating dependencies:

```bash
jlpm yarn-deduplicate -s fewer
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "dask-labextension",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "",
    "author": "Ian Rose, Matt Rocklin, Jacob Tomlinson",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/ae/d5/0a32e550dfdac1afd2f4783edc957054c10e6c4abac3d90c665052a42c19/dask_labextension-7.0.0.tar.gz",
    "platform": null,
    "description": "# Dask JupyterLab Extension\n\n[![Build Status](https://github.com/dask/dask-labextension/actions/workflows/python.yaml/badge.svg)](https://github.com/dask/dask-labextension/actions/workflows/python.yaml) [![Version](https://img.shields.io/npm/v/dask-labextension.svg)](https://www.npmjs.com/package/dask-labextension) [![Downloads](https://img.shields.io/npm/dm/dask-labextension.svg)](https://www.npmjs.com/package/dask-labextension) [![Dependencies](https://img.shields.io/librariesio/release/npm/dask-labextension.svg)](https://libraries.io/npm/dask-labextension)\n\nThis package provides a JupyterLab extension to manage Dask clusters,\nas well as embed Dask's dashboard plots directly into JupyterLab panes.\n\n![Dask Extension](./dask.png)\n\n## Explanatory Video (5 minutes)\n\n<a href=\"http://www.youtube.com/watch?feature=player_embedded&v=EX_voquHdk0 \"\n   target=\"_blank\">\n<img src=\"http://img.youtube.com/vi/EX_voquHdk0/0.jpg\"\n       alt=\"Dask + JupyterLab Screencast\" width=\"560\" height=\"315\" border=\"10\" />\n</a>\n\n## Requirements\n\nJupyterLab >= 1.0\ndistributed >= 1.24.1\n\n## Installation\n\nTo install the Dask JupyterLab extension you will need to have JupyterLab installed.\nFor JupyterLab < 3.0, you will also need [Node.js](https://nodejs.org/) version >= 12.\nThese are available through a variety of sources.\nOne source common to Python users is the conda package manager.\n\n```bash\nconda install jupyterlab\nconda install -c conda-forge nodejs\n```\n\n### JupyterLab 4.x\n\nInstall the latest version of the extension for the JupyterLab 4\nsupport. You should be able to install this extension with pip or conda,\nand start using it immediately, e.g.\n\n```bash\npip install dask-labextension\n```\n\n### JupyterLab 3.x\n\nFor JupyterLab 3.x, use lastest supported version `6.2.0`.\n\n```bash\npip install dask-labextension==6.2.0\n```\n\n### JupyterLab 2.x\n\nPrior to JupyterLab 3.0 client-side and server-side components needed\nto be installed separately, with node available on the machine.\n\nThe server-side component can be installed via pip or conda-forge:\n\n```bash\npip install 'dask_labextension<5'\n```\n\n```bash\nconda install -c conda-forge 'dask-labextension<5'\n```\n\nYou then build the client-side extension into JupyterLab with:\n\n```bash\njupyter labextension install dask-labextension\n```\n\nIf you are running Notebook 5.2 or earlier, enable the server extension by running\n\n```bash\njupyter serverextension enable --py --sys-prefix dask_labextension\n```\n\n## Configuration of Dask cluster management\n\nThis extension has the ability to launch and manage several kinds of Dask clusters,\nincluding local clusters and kubernetes clusters.\nOptions for how to launch these clusters are set via the\n[dask configuration system](http://docs.dask.org/en/latest/configuration.html#configuration),\ntypically a `.yml` file on disk.\n\nBy default the extension launches a `LocalCluster`, for which the configuration is:\n\n```yaml\nlabextension:\n  factory:\n    module: 'dask.distributed'\n    class: 'LocalCluster'\n    args: []\n    kwargs: {}\n  default:\n    workers: null\n    adapt:\n      null\n      # minimum: 0\n      # maximum: 10\n  initial:\n    []\n    # - name: \"My Big Cluster\"\n    #   workers: 100\n    # - name: \"Adaptive Cluster\"\n    #   adapt:\n    #     minimum: 0\n    #     maximum: 50\n```\n\nIn this configuration, `factory` gives the module, class name, and arguments needed to create the cluster.\nThe `default` key describes the initial number of workers for the cluster, as well as whether it is adaptive.\nThe `initial` key gives a list of initial clusters to start upon launch of the notebook server.\n\nIn addition to `LocalCluster`, this extension has been used to launch several other Dask cluster\nobjects, a few examples of which are:\n\n- A SLURM cluster, using\n\n```yaml\nlabextension:\n    factory:\n      module: 'dask_jobqueue'\n       class: 'SLURMCluster'\n       args: []\n       kwargs: {}\n```\n\n- A PBS cluster, using\n\n```yaml\nlabextension:\n  factory:\n    module: 'dask_jobqueue'\n    class: 'PBSCluster'\n    args: []\n    kwargs: {}\n```\n\n- A [Kubernetes cluster](https://github.com/pangeo-data/pangeo-cloud-federation/blob/8f7f4bf9963ef1ed180dd20c952ff1aa8df54ca2/deployments/ocean/image/binder/dask_config.yaml#L37-L42), using\n\n```yaml\nlabextension:\n  factory:\n    module: dask_kubernetes\n    class: KubeCluster\n    args: []\n    kwargs: {}\n```\n\n## Configuring a default layout\n\nThis extension can store a default layout for the Dask dashboard panes,\nwhich is useful if you find yourself reaching for the same dashboard charts over and over.\nYou can launch the default layout via the command palette,\nor by going to the File menu and choosing \"Launch Dask Dashboard Layout\".\n\nDefault layouts can be configured via the JupyterLab config system\n(either using the JSON editor or the user interface).\nSpecify a layout by writing a JSON object keyed by the\n[individual charts](https://github.com/dask/distributed/blob/f31fbde748294065ed70dd5c4399821fa664a9f1/distributed/dashboard/scheduler.py#L72-L117)\nyou would like to open.\nEach chart is opened with a `mode`, and a `ref`.\n`mode` refers to how the chart is to be added to the workspace.\nFor example, if you want to split a panel and add the new one to the right, choose `split-right`.\nOther options are `split-top`, `split-bottom`, `split-left`, `tab-after`, and `tab-before`.\n`ref` refers to the panel to which `mode` is applied, and might be the names of other dashboard panels.\nIf `ref` is `null`, the panel in question is added at the top of the layout hierarchy.\n\nA concrete example of a default layout is\n\n```json\n{\n  \"individual-task-stream\": {\n    \"mode\": \"split-right\",\n    \"ref\": null\n  },\n  \"individual-workers-memory\": {\n    \"mode\": \"split-bottom\",\n    \"ref\": \"individual-task-stream\"\n  },\n  \"individual-progress\": {\n    \"mode\": \"split-right\",\n    \"ref\": \"individual-workers-memory\"\n  }\n}\n```\n\nwhich adds the task stream to the right of the workspace,\nthen adds the worker memory chart below the task stream,\nthen adds the progress chart to the right of the worker memory chart.\n\n## Development install\n\nAs described in the [JupyterLab documentation](https://jupyterlab.readthedocs.io/en/stable/extension/extension_dev.html#developing-a-prebuilt-extension)\nfor a development install of the labextension you can run the following in this directory:\n\n```bash\njlpm  # Install npm package dependencies\njlpm build  # Compile the TypeScript sources to Javascript\njupyter labextension develop . --overwrite  # Install the current directory as an extension\n```\n\nTo rebuild the extension:\n\n```bash\njlpm build\n```\n\nYou should then be able to refresh the JupyterLab page\nand it will pick up the changes to the extension.\n\nTo run an editable install of the server extension, run\n\n```bash\npip install -e .\njupyter serverextension enable --sys-prefix dask_labextension\n```\n\n## Publishing\n\nThis extension contains a front-end component written in TypeScript\nand a back-end component written in Python.\nThe front-end is compiled to Javascript during the build process\nand is distributed as static assets along with the Python package.\n\n### Release process\n\nThis requires `node`, `build`, `hatch` and `twine` to be installed.\n\n```bash\n# To set version (e.g. 7.0.0). hatch will update version string in package.json\nhatch version \"7.0.0\"\n\n# Examples of bumping version\n# minor bump\nhatch version minor  # Bumps to 7.1.0\n# beta pre-release bump\n# If published to pypi this can be installed with the --pre flag to pip\nhatch version b  # Bumps to 7.1.0b0\n# bump minor and beta\nhatch version minor,b  # Bumps to 7.2.0b0\n# release all of the --pre-release flags such as alpha beta rc\nhatch release  # Bumps to 7.2.0\n\n# git commit after bumping version\ngit add package.json && git commit -m \"Bump version: {version}\"\n# Tag this version\ngit tag {version}\n\n# Finally push to main, build and upload package to PyPI\ngit push upstream main && git push upstream main --tags  # pushes to GitHub\npython -m build .  # Build the package\ntwine upload dist/*  # Upload the package to PyPI\n```\n\n### Handling Javascript package version conflicts\n\nUnlike Python, Javascript packages can include more than one version of the same dependency.\nUsually the `yarn` package manager handles this okay, but occasionally you might end up with conflicting versions,\nor with unexpected package bloat.\nYou can try to fix this by deduplicating dependencies:\n\n```bash\njlpm yarn-deduplicate -s fewer\n```\n",
    "bugtrack_url": null,
    "license": "Copyright (c) 2016, Project Jupyter Contributors and Anaconda Inc. All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. 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.  3. 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.",
    "summary": "A JupyterLab extension for Dask.",
    "version": "7.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/dask/dask-labextension/issues",
        "Homepage": "https://github.com/dask/dask-labextension",
        "Repository": "https://github.com/dask/dask-labextension"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "450de72831b33686a435d2d34909ffc8d9f92b5177d9f620b31c1abff2eaaa10",
                "md5": "7903cb800d7430359484fc06b1c43ffe",
                "sha256": "34fd1ee80a7259dc292a789cc82e4563d7cd1f5a26eb2ee8b434517482f82027"
            },
            "downloads": -1,
            "filename": "dask_labextension-7.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7903cb800d7430359484fc06b1c43ffe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 39450,
            "upload_time": "2023-08-04T14:55:02",
            "upload_time_iso_8601": "2023-08-04T14:55:02.006483Z",
            "url": "https://files.pythonhosted.org/packages/45/0d/e72831b33686a435d2d34909ffc8d9f92b5177d9f620b31c1abff2eaaa10/dask_labextension-7.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aed50a32e550dfdac1afd2f4783edc957054c10e6c4abac3d90c665052a42c19",
                "md5": "7abeb6a092cfa54104d0e0c2b746ca64",
                "sha256": "45a60bd0ad31c5e425986b7e40a5aa242aa582ea868025ac2b82d0aa16ffcb8a"
            },
            "downloads": -1,
            "filename": "dask_labextension-7.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7abeb6a092cfa54104d0e0c2b746ca64",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1601360,
            "upload_time": "2023-08-04T14:55:05",
            "upload_time_iso_8601": "2023-08-04T14:55:05.559659Z",
            "url": "https://files.pythonhosted.org/packages/ae/d5/0a32e550dfdac1afd2f4783edc957054c10e6c4abac3d90c665052a42c19/dask_labextension-7.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-04 14:55:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dask",
    "github_project": "dask-labextension",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dask-labextension"
}
        
Elapsed time: 0.35480s