From 1c577bef58d21d837ab5526d6cdbc0364bb1cd94 Mon Sep 17 00:00:00 2001 From: MiXaiLL76 Date: Mon, 30 Dec 2024 10:52:02 +0300 Subject: [PATCH 1/5] vscode web example --- samples/code-server/README.md | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 samples/code-server/README.md diff --git a/samples/code-server/README.md b/samples/code-server/README.md new file mode 100644 index 0000000..95e6079 --- /dev/null +++ b/samples/code-server/README.md @@ -0,0 +1,46 @@ +# [VSCODE web based](https://github.com/coder/code-server) with jupyter + +## Install vscode +> Run in jupyter terminal + +```bash +curl -fsSL https://code-server.dev/install.sh | sh +``` + +## Setting up server parameters + +> In the server config, you need to add the following lines + +**jupyter_lab_config.py** +```py +from tornado import websocket +websocket_max_message_size = 1048 * 1024 * 1024 +# fix module +setattr(websocket, "_default_max_message_size", websocket_max_message_size) +# fix config +c.NotebookApp.tornado_settings = {"websocket_max_message_size": websocket_max_message_size} +``` + +## Setting up jupyter_app_launcher with open in new TAB + +Open [juyter_app_launcher config file](https://jupyter-app-launcher.readthedocs.io/en/latest/usage.html#configuration-file-location) + +> Add application launch parameters + +``` +- title: Open VSCODE + description: Open web based VSCODE + icon: /usr/lib/code-server/lib/vscode/out/media/code-icon.svg + source: http://localhost:$PORT/ + cwd: ./ + type: local-server + args: + - code-server + - --auth=none + - --app-name='Remote VSCode Server' + - --disable-telemetry + - --disable-update-check + - --disable-workspace-trust + - --bind-addr=0.0.0.0:$PORT + catalog: VSCODE +``` \ No newline at end of file From b14cc913e5b1fdf552a0293cd3dac213c88fe7c4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 07:58:24 +0000 Subject: [PATCH 2/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- samples/code-server/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/samples/code-server/README.md b/samples/code-server/README.md index 95e6079..3cfae07 100644 --- a/samples/code-server/README.md +++ b/samples/code-server/README.md @@ -1,7 +1,8 @@ # [VSCODE web based](https://github.com/coder/code-server) with jupyter ## Install vscode -> Run in jupyter terminal + +> Run in jupyter terminal ```bash curl -fsSL https://code-server.dev/install.sh | sh @@ -12,6 +13,7 @@ curl -fsSL https://code-server.dev/install.sh | sh > In the server config, you need to add the following lines **jupyter_lab_config.py** + ```py from tornado import websocket websocket_max_message_size = 1048 * 1024 * 1024 @@ -43,4 +45,4 @@ Open [juyter_app_launcher config file](https://jupyter-app-launcher.readthedocs. - --disable-workspace-trust - --bind-addr=0.0.0.0:$PORT catalog: VSCODE -``` \ No newline at end of file +``` From 56f345b422ac9e7b13ef6fbea9954b70fc444bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B8=D1=85=D0=B0=D0=B8=D0=BB?= Date: Mon, 30 Dec 2024 12:00:12 +0300 Subject: [PATCH 3/5] Update samples/code-server/README.md Co-authored-by: Duc Trung Le --- samples/code-server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/code-server/README.md b/samples/code-server/README.md index 3cfae07..864364a 100644 --- a/samples/code-server/README.md +++ b/samples/code-server/README.md @@ -20,7 +20,7 @@ websocket_max_message_size = 1048 * 1024 * 1024 # fix module setattr(websocket, "_default_max_message_size", websocket_max_message_size) # fix config -c.NotebookApp.tornado_settings = {"websocket_max_message_size": websocket_max_message_size} +c.LabApp.tornado_settings = {"websocket_max_message_size": websocket_max_message_size} ``` ## Setting up jupyter_app_launcher with open in new TAB From 1b9b35371c5d95d1aae168fc715d2ac1206e729f Mon Sep 17 00:00:00 2001 From: MiXaiLL76 Date: Mon, 30 Dec 2024 12:30:43 +0300 Subject: [PATCH 4/5] update readme --- samples/code-server/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/code-server/README.md b/samples/code-server/README.md index 864364a..9cb9f88 100644 --- a/samples/code-server/README.md +++ b/samples/code-server/README.md @@ -10,7 +10,8 @@ curl -fsSL https://code-server.dev/install.sh | sh ## Setting up server parameters -> In the server config, you need to add the following lines +> In the server config, you need to add the following lines. +> This is necessary because to run such applications, jupyter-server-proxy is used, which uses **\_default_max_message_size** directly from the **tornado.websocket** module, and not from the **c.LabApp.tornado_settings** configuration. [websocket.py#L52](https://github.com/jupyterhub/jupyter-server-proxy/blob/76a98c900605e31a9209e0897d3010d2c6057960/jupyter_server_proxy/websocket.py#L52) **jupyter_lab_config.py** From 1971b0a7789bb5f50e93db9d010aa0b64d7d9c66 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 30 Dec 2024 09:31:04 +0000 Subject: [PATCH 5/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- samples/code-server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/code-server/README.md b/samples/code-server/README.md index 9cb9f88..850d681 100644 --- a/samples/code-server/README.md +++ b/samples/code-server/README.md @@ -10,7 +10,7 @@ curl -fsSL https://code-server.dev/install.sh | sh ## Setting up server parameters -> In the server config, you need to add the following lines. +> In the server config, you need to add the following lines. > This is necessary because to run such applications, jupyter-server-proxy is used, which uses **\_default_max_message_size** directly from the **tornado.websocket** module, and not from the **c.LabApp.tornado_settings** configuration. [websocket.py#L52](https://github.com/jupyterhub/jupyter-server-proxy/blob/76a98c900605e31a9209e0897d3010d2c6057960/jupyter_server_proxy/websocket.py#L52) **jupyter_lab_config.py**