A JupyterLab extension for workflow sustainability metrics.
Project description
๐ฑ๐โป๏ธ EcoJupyter (a GreenDIGIT project)
EcoJupyter is an platform-agnostic sustainability assessment tool for AI infrastructures. The current version is focused on Jupyter Notebook.
This tool was developed for the GreenDIGIT EU Project, with the main goal of providing a platform agnostic and easily-pluggable sustainability and reproducibility tool.
Main features
- Read energy metrics through Prometheus and Scaphandre in real-time charts.
- Energy computed KPIs such as SCI, SCI/Unit and Energy/Unit.
- Metadata manager and exporter for Federated Data Management Infrastructures (FDMI).
It works best with JupyterK8sMonitor infrastructure configuration and scripts. For more info please contact the main contributor.
Installation
In order to install the tool as an extension in Jupyter Notebook or Lab (not in development), simply install the tool in your Python environment where Jupyter is running.
pip install --upgrade ecojupyter
Development & Extension Framework
This repository was initially scaffolded using the official JupyterLab Extension Tutorial.
As a result, the extension supports a development mode with live reloading, allowing for real-time updates to the UI as you modify TypeScript/React components.
To launch the development environment (as per the tutorial), run:
./scripts/start-jupyterlab-dev.sh
This will start JupyterLab in development mode, ideal for iterating on the UI and debugging extension logic interactively.
Python Package & Deployment The Python package is published on PyPI and can be built locally via:
./scripts/build-rel-package.sh
This script automatically packages the extension and prepares it for upload, enabling a simple and consistent release workflow.
Future Improvements
- Version-based deployment: easily extendable via GitHub releases or semantic versioning.
- CI/CD integration: GitHub Actions workflows are already present and can be extended for linting, testing, and publishing.
- Custom builds: additional scripts like
install-conda.shanduninstall-conda.shsupport environment setup and teardown, aiding reproducibility.
Project structure
API definitions
EcoJupyter's front-end connects with the server's back-end using the IPython kernel through the IKernelConnection.executeRequest() channelโused to execute Kernel request on demand, written in Python or as a shell script. In the future a full-fledge RESTful API should be implemented to properly enforce types, definitions and methods. For the POC timeline this was the most reasonable trade-off between flexibility and effectiveness.
The methods can be found in apiScripts.ts module file, with all the API-like methods used defined and self-described.
Folder Structure
EcoJupyter/
โโโ .copier-answers.yml
โโโ .gitignore
โโโ .prettierignore
โโโ .yarnrc.yml
โโโ CHANGELOG.md
โโโ LICENSE
โโโ README.md
โโโ RELEASE.md
โโโ Untitled.ipynb
โโโ install.json
โโโ package.json
โโโ pyproject.toml
โโโ setup.py
โโโ tsconfig.json
โโโ yarn.lock
โโโ .github
โ โโโ workflows
โ โโโ binder-on-pr.yml
โ โโโ build.yml
โ โโโ check-release.yml
โ โโโ enforce-label.yml
โ โโโ prep-release.yml
โ โโโ publish-release.yml
โ โโโ update-integration-tests.yml
โโโ assets
โ โโโ EcoJupyter_screenshot.png
โโโ ecojupyter
โ โโโ __init__.py
โโโ scripts
โ โโโ add-catalogue-entry.sh
โ โโโ build-rel-package.sh
โ โโโ install-conda.sh
โ โโโ start-jupyterlab-dev.sh
โ โโโ uninstall-conda.sh
โโโ src
โโโ api
โ โโโ ApiTemp.ts
โ โโโ api-temp-openapi.yml
โ โโโ apiScripts.ts
โ โโโ getCarbonIntensityData.ts
โ โโโ getScaphData.ts
โ โโโ handleNotebookContents.ts
โ โโโ monitorCellExecutions.ts
โโโ components
โ โโโ FetchMetricsComponents.tsx
โ โโโ KPIComponent.tsx
โ โโโ KpiValue.tsx
โ โโโ MetricSelector.tsx
โ โโโ ...
โโโ dialog
โ โโโ CreateChartDialog.tsx
โโโ helpers
โ โโโ constants.ts
โ โโโ types.ts
โ โโโ utils.ts
โโโ index.ts
โโโ widget.tsx
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file ecojupyter-0.1.246.tar.gz.
File metadata
- Download URL: ecojupyter-0.1.246.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2918ad5b5da49a6849461016ec98436d280d19657adfadc8cd364ba9cf9d579f
|
|
| MD5 |
b3e1f96a0205de5b7c6c07f2de23de14
|
|
| BLAKE2b-256 |
7e4c827c2504c6bde4d29e387cd109415348268f576f5dac598354f8c3c92de2
|