Skip to content

Commit

Permalink
Backport PR #1334 on branch 0.4.x (Do not clean up resources after ex…
Browse files Browse the repository at this point in the history
…ecution) (#1335)

* Backport PR #1334: Do not clean up resources after execution

* Only clean kernel client

* Fix CI

* OpenSSL issue workaround

---------

Co-authored-by: martinRenou <[email protected]>
  • Loading branch information
meeseeksmachine and martinRenou authored Jun 26, 2023
1 parent 9e76783 commit aa3aecb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn=1 flake8 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn=1 flake8 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6"

- name: Install dependencies
shell: bash -l {0}
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn=1 flake8 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn=1 flake8 ipywidgets matplotlib xeus-cling "traitlets>=5.0.3,<6"

- name: Install dependencies
shell: bash -l {0}
Expand Down
1 change: 1 addition & 0 deletions packages/jupyterlab-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
},
"jupyterlab": {
"extension": true,
"webpackConfig": "webpack.lab.config.js",
"schemaDir": "schema",
"outputDir": "../../voila/labextension",
"discovery": {
Expand Down
6 changes: 6 additions & 0 deletions packages/jupyterlab-preview/webpack.lab.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm === 'md4' ? 'sha256' : algorithm);
4 changes: 2 additions & 2 deletions packages/voila/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
},
"style": "style/index.css",
"scripts": {
"build": "npm run build:lib && webpack",
"build": "jlpm run build:lib && webpack",
"build:lib": "tsc",
"build:prod": "npm run build:lib && webpack --production",
"build:prod": "jlpm run build:lib && webpack --production",
"clean": "jlpm run clean:lib",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
7 changes: 7 additions & 0 deletions packages/voila/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
var path = require('path');

const crypto = require('crypto');

// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL
const cryptoOrigCreateHash = crypto.createHash;
crypto.createHash = algorithm =>
cryptoOrigCreateHash(algorithm === 'md4' ? 'sha256' : algorithm);

var rules = [
{ test: /\.css$/, use: ['style-loader', 'css-loader'] },
// required to load font-awesome
Expand Down
1 change: 0 additions & 1 deletion voila/notebook_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ async def _jinja_cell_generator(self, nb, kernel_id):
await self._cleanup_resources()

async def _cleanup_resources(self):
await ensure_async(self.executor.km.cleanup_resources())
await ensure_async(self.executor.kc.stop_channels())

async def load_notebook(self, path):
Expand Down

0 comments on commit aa3aecb

Please sign in to comment.