Skip to content

Commit

Permalink
SparkMonitor: update to Lab 4
Browse files Browse the repository at this point in the history
Mix of running Jupyter migration tool while keeping some of the old configurations (done in order to be quicker)
  • Loading branch information
diocas authored and etejedor committed Dec 13, 2023
1 parent a35015e commit 9fb9313
Show file tree
Hide file tree
Showing 13 changed files with 8,974 additions and 9,775 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2.4.0
uses: actions/setup-node@v4
with:
node-version: 12.x
node-version: 20.x
cache: yarn
cache-dependency-path: yarn.lock

Expand All @@ -30,10 +30,10 @@ jobs:
python-version: 3.x

- name: Install Jupyterlab
run: pip install jupyterlab==3
run: pip install jupyterlab==4

- name: Install JS dependencies
run: yarn install --immutable
run: jlpm install --immutable

- name: "JavaScript Checks"
run: yarn run check:all
run: jlpm check:all
6 changes: 2 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ jobs:
python-version: '3.x'

- name: Install node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
always-auth: true
node-version: '12.x'
registry-url: https://registry.npmjs.org
node-version: '20.x'

- name: Set up JDK 1.8
uses: actions/setup-java@v1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ venv
.metals
*.tsbuildinfo
scalalistener/.bsp
.yarn
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules
**/node_modules
**/lib
**/package.json
!/package.json
sparkmonitor
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
enableImmutableInstalls: false
nodeLinker: node-modules
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SparkMonitor is an extension for Jupyter Notebook & Lab that enables the live mo

## Requirements

- Jupyter Lab 3 OR Jupyter Notebook 4.4.0 or higher
- Jupyter Lab 4 OR Jupyter Notebook 4.4.0 or higher
- pyspark 2 or 3

## Features
Expand Down
238 changes: 119 additions & 119 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,121 +1,121 @@
{
"name": "sparkmonitor",
"version": "2.1.1",
"description": "Jupyter Notebook & Lab extension to monitor Apache Spark jobs from a notebook",
"repository": {
"type": "git",
"url": "git+https://github.com/swan-cern/sparkmonitor.git"
},
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension",
"Spark",
"sparkmonitor"
],
"main": "lib/lab-extension/index.js",
"author": {
"name": "Krishnan R",
"email": "[email protected]"
},
"maintainers": [
{
"name": "SWAN Team",
"email": "[email protected]"
}
],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/swan-cern/sparkmonitor/issues"
},
"homepage": "https://github.com/swan-cern/sparkmonitor#readme",
"devDependencies": {
"@babel/cli": "^7.14.8",
"@babel/core": "^7.14.8",
"@babel/preset-env": "^7.14.9",
"@babel/preset-react": "^7.14.5",
"@babel/preset-typescript": "^7.14.5",
"@jupyterlab/builder": "^3.0.0",
"@types/node": "^16.4.10",
"@types/plotly.js-basic-dist": "^1.54.0",
"@types/react-dom": "^17.0.9",
"@types/react-plotly.js": "^2.5.0",
"@types/react-timeago": "^4.1.3",
"@types/webpack": "^5.28.0",
"@typescript-eslint/eslint-plugin": "^4.28.3",
"@typescript-eslint/parser": "^4.28.3",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.2.2",
"css-loader": "^0.28.4",
"eslint": "^7.14.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^4.2.0",
"file-loader": "^6.0.0",
"html-loader": "^0.4.5",
"ify-loader": "^1.0.4",
"npm-run-all": "^4.1.5",
"prettier": "^2.1.1",
"rimraf": "^3.0.2",
"style-loader": "^0.18.2",
"typescript": "^4.3.5",
"url-loader": "^0.5.9",
"webpack-cli": "^3.3.10"
},
"scripts": {
"build:prod": "jlpm run build:lib && jlpm run build:labextension && jlpm run build:nbextension && jlpm run build:scalalistener",
"build": "jlpm run build:lib && jlpm run build:labextension",
"build:lib": "tsc -p tsconfig.lab.json",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:scalalistener": "cd scalalistener && sbt +assembly",
"clean": "rimraf lib jupyterlab_sparkmonior:labextension",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w -p tsconfig.lab.json",
"watch:labextension": "jupyter labextension watch .",
"build:nbextension": "webpack --config src/notebook-extension/webpack.config.js",
"watch:nbextension": "webpack --config src/notebook-extension/webpack.config.js --mode development --watch",
"check:all": "jlpm run check:eslint && jlpm run check:nbextension && jlpm run check:labextension",
"check:eslint": "eslint .",
"check:nbextension": "tsc -p tsconfig.notebook.json",
"check:labextension": "tsc -p tsconfig.lab.json --noEmit"
},
"dependencies": {
"@jupyterlab/application": "^3.0.4",
"@jupyterlab/cells": "^3.0.4",
"@jupyterlab/coreutils": "^5.0.2",
"@jupyterlab/docregistry": "^3.0.4",
"@jupyterlab/mainmenu": "^3.0.3",
"@jupyterlab/notebook": "^3.0.4",
"@jupyterlab/services": "^6.0.3",
"@lumino/coreutils": "^1.5.3",
"@lumino/widgets": "^1.16.1",
"es6-promise": "^4.2.8",
"javascript-time-ago": "^2.3.8",
"mobx": "^6.3.2",
"mobx-react-lite": "^3.2.0",
"plotly.js-basic-dist": "^2.3.1",
"pretty-ms": "^7.0.1",
"react-plotly.js": "^2.5.1",
"react-timeago": "^6.2.1",
"react-vis-timeline": "^2.0.3",
"uuid": "^7.0.2",
"vis-timeline": "^7.3.4",
"webpack": "^5.33.2",
"xss": "^1.0.9"
},
"jupyterlab": {
"extension": "lib/lab-extension/index",
"outputDir": "sparkmonitor/labextension"
},
"style": "style/lab.css",
"files": [
"lib/*",
"src/*"
]
"name": "sparkmonitor",
"version": "2.1.1",
"description": "Jupyter Notebook & Lab extension to monitor Apache Spark jobs from a notebook",
"repository": {
"type": "git",
"url": "git+https://github.com/swan-cern/sparkmonitor.git"
},
"keywords": [
"jupyter",
"jupyterlab",
"jupyterlab-extension",
"Spark",
"sparkmonitor"
],
"main": "lib/lab-extension/index.js",
"author": {
"name": "Krishnan R",
"email": "[email protected]"
},
"maintainers": [
{
"name": "SWAN Team",
"email": "[email protected]"
}
],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/swan-cern/sparkmonitor/issues"
},
"homepage": "https://github.com/swan-cern/sparkmonitor#readme",
"scripts": {
"build:prod": "jlpm run build:lib && jlpm run build:labextension && jlpm run build:nbextension && jlpm run build:scalalistener",
"build": "jlpm run build:lib && jlpm run build:labextension",
"build:lib": "tsc -p tsconfig.lab.json",
"build:labextension": "jupyter labextension build .",
"build:labextension:dev": "jupyter labextension build --development True .",
"build:scalalistener": "cd scalalistener && sbt +assembly",
"clean": "rimraf lib jupyterlab_sparkmonior:labextension",
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"watch": "run-p watch:src watch:labextension",
"watch:src": "tsc -w -p tsconfig.lab.json",
"watch:labextension": "jupyter labextension watch .",
"build:nbextension": "webpack --config src/notebook-extension/webpack.config.js",
"watch:nbextension": "webpack --config src/notebook-extension/webpack.config.js --mode development --watch",
"check:all": "jlpm run check:eslint && jlpm run check:nbextension && jlpm run check:labextension",
"check:eslint": "eslint .",
"check:nbextension": "tsc -p tsconfig.notebook.json",
"check:labextension": "tsc -p tsconfig.lab.json --noEmit"
},
"dependencies": {
"@jupyterlab/application": "^4.0.9",
"@jupyterlab/apputils": "^4.1.9",
"@jupyterlab/cells": "^4.0.9",
"@jupyterlab/mainmenu": "^4.0.9",
"@jupyterlab/notebook": "^4.0.9",
"@jupyterlab/services": "^7.0.9",
"@lumino/coreutils": "^2.1.2",
"@lumino/widgets": "^2.3.1",
"hammerjs": "^2.0.8",
"keycharm": "^0.4.0",
"mobx": "^6.12.0",
"mobx-react-lite": "^4.0.5",
"moment": "^2.29.4",
"plotly.js-basic-dist": "^2.27.1",
"pretty-ms": "^8.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-plotly.js": "^2.6.0",
"react-timeago": "^7.2.0",
"vis-data": "^7.1.9",
"vis-timeline": "^7.7.3",
"vis-util": "^5.0.7",
"xss": "^1.0.14"
},
"devDependencies": {
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.23.6",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@jupyterlab/builder": "^4.0.0",
"@types/hammerjs": "^2.0.45",
"@types/json-schema": "^7.0.11",
"@types/plotly.js-basic-dist": "^1.54.4",
"@types/react": "^18.0.26",
"@types/react-addons-linked-state-mixin": "^0.14.22",
"@types/react-plotly.js": "^2.6.3",
"@types/react-timeago": "^4.1.6",
"@typescript-eslint/eslint-plugin": "^6.1.0",
"@typescript-eslint/parser": "^6.1.0",
"babel-loader": "^9.1.3",
"css-loader": "^6.7.1",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.0",
"rimraf": "^5.0.1",
"source-map-loader": "^1.0.2",
"style-loader": "^3.3.1",
"stylelint": "^15.10.1",
"stylelint-config-recommended": "^13.0.0",
"stylelint-config-standard": "^34.0.0",
"stylelint-csstree-validator": "^3.0.0",
"stylelint-prettier": "^4.0.0",
"typescript": "~5.0.2",
"webpack": "^5.89.0",
"yjs": "^13.5.0"
},
"jupyterlab": {
"extension": "lib/lab-extension/index",
"outputDir": "sparkmonitor/labextension"
},
"style": "style/lab.css",
"files": [
"lib/*",
"src/*"
]
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["jupyter_packaging~=0.10.0,<2", "jupyterlab~=3.0", "setuptools>=40.8.0", "wheel"]
requires = ["jupyter_packaging~=0.10.0,<2", "jupyterlab>=4.0.0,<5", "setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
15 changes: 10 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,26 @@
packages=find_packages(),
license=pkg_json["license"],
zip_safe=False,
python_requires=">=3.6",
python_requires=">=3.8",
data_files=data_files,
install_requires=[
"jupyterlab~=3.0"
"jupyterlab>=4.0.0,<5"
],
platforms="Linux, Mac OS X, Windows",
keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
classifiers=[
"Framework :: Jupyter",
"Framework :: Jupyter :: JupyterLab",
"Framework :: Jupyter :: JupyterLab :: 4",
"Framework :: Jupyter :: JupyterLab :: Extensions",
"Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Framework :: Jupyter",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
)
6 changes: 3 additions & 3 deletions src/lab-extension/current-cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class CurrentCellTracker {
if (!(cellModel.id in this.cellSlotMap)) {
const fn = () => this.cellMetadataChanged(cellModel);
this.cellSlotMap[cellModel.id] = fn;
cellModel.metadata.changed.connect(fn);
cellModel.metadataChanged.connect(fn);
// In case there was already metadata (do not highlight on first load)
this.cellMetadataChanged(cellModel);
}
Expand All @@ -43,7 +43,7 @@ export default class CurrentCellTracker {
private deregisterMetadataChanges(cellModel: ICellModel) {
const fn = this.cellSlotMap[cellModel.id];
if (fn) {
cellModel.metadata.changed.disconnect(fn);
cellModel.metadataChanged.disconnect(fn);
}
delete this.cellSlotMap[cellModel.id];
}
Expand All @@ -60,7 +60,7 @@ export default class CurrentCellTracker {
const codeCell = this.getCodeCellFromModel(cellModel);

if (codeCell) {
const executionMetadata: any = codeCell.model.metadata.get('execution');
const executionMetadata: any = codeCell.model.metadata['execution'];
if (executionMetadata) {
if (
executionMetadata['iopub.status.busy'] &&
Expand Down
2 changes: 1 addition & 1 deletion src/lab-extension/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const extension = {
args: {},
});

mainMenu.addMenu(menu, { rank: 40 });
mainMenu.addMenu(menu, false, { rank: 40 });
},
};

Expand Down
Loading

0 comments on commit 9fb9313

Please sign in to comment.