Skip to main content

JupyterLab extension to open the Spark Web UI via the notebook proxy

Project description

jupyterlab-spark-webui

A JupyterLab extension that adds a Spark UI menu entry to the menu bar. When clicked, it checks whether Apache Spark is running on port 4040 and opens the Spark jobs page as an embedded JupyterLab tab via jupyter-server-proxy.

Requirements

Requirement Version
JupyterLab ≥ 4.0
jupyter-server-proxy ≥ 4.0
Python ≥ 3.8

Installation

pip install jupyterlab-spark-webui

No additional steps are needed. JupyterLab discovers the extension automatically after installation.

Verify installation

jupyter labextension list
# jupyterlab-spark-webui v0.1.0 enabled OK

Usage

  1. Start a Spark session in a notebook (this starts the Spark UI on port 4040).
  2. Click Spark UI in the JupyterLab menu bar.
  3. Click Open Spark UI.
    • If Spark is running → the jobs page opens as a JupyterLab tab.
    • If Spark is not running → a dialog displays "No Spark found (port 4040)."

The extension resolves the proxy URL from the current page path, so it works in JupyterHub deployments at any base URL prefix (e.g. /notebook/<namespace>/<name>/lab).

Uninstallation

pip uninstall jupyterlab-spark-webui

Development

Prerequisites

  • Python ≥ 3.8 with uv
  • Node.js ≥ 18 with npm

Setup and build

git clone https://github.com/your-org/jupyterlab-spark-webui
cd jupyterlab-spark-webui

./build.sh          # build everything + produce dist/*.whl
./start-lab.sh      # launch JupyterLab with the extension loaded

Pass --no-wheel to skip the wheel build during development iteration:

./build.sh --no-wheel

Project structure

├── src/
│   └── index.ts          # Extension entry point (TypeScript)
├── jupyterlab_spark_webui/
│   ├── __init__.py       # Python package / labextension path declaration
│   └── labextension/     # Built JS bundle (generated by build.sh)
├── style/
│   └── index.css
├── pyproject.toml        # Python package metadata and build config
├── package.json          # npm package and TypeScript dependencies
├── tsconfig.json         # TypeScript compiler config
├── build.sh              # Full build + deploy + wheel script
└── start-lab.sh          # Launch JupyterLab using the uv environment

Publishing to PyPI

1. Prerequisites

  • A PyPI account
  • A PyPI API token (generate one at Account settings → API tokens)

2. Update metadata

Edit pyproject.toml and set the correct authors, [project.urls], and bump version before each release.

3. Build

./build.sh          # produces dist/jupyterlab_spark_webui-<version>-py3-none-any.whl

4. Publish

With uv (recommended):

uv publish --token pypi-<your-token>

Or with twine:

pip install twine
twine upload dist/* --username __token__ --password pypi-<your-token>

5. Test on TestPyPI first (optional but recommended)

# Publish to the test registry
uv publish --publish-url https://test.pypi.org/legacy/ --token pypi-<test-token>

# Install from the test registry
pip install --index-url https://test.pypi.org/simple/ jupyterlab-spark-webui

Checklist before publishing

  • version bumped in pyproject.toml and package.json
  • authors and [project.urls] filled in
  • ./build.sh ran successfully and dist/*.whl exists
  • Extension verified working locally via ./start-lab.sh
  • git tag v<version> created and pushed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyterlab_spark_webui-0.1.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file jupyterlab_spark_webui-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_spark_webui-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e88c45b39564286566bf3504aba70be44a318e33a4a3afc8083bd97198a0e4a
MD5 ab4af5bc44a093fc6e598d972e8a59da
BLAKE2b-256 181e8346fa2958b08a3efd0ecdba8115e84bd3a85c819c9d3f557716612ff9d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page