Skip to content

Commit

Permalink
Web based VSCODE example (#78)
Browse files Browse the repository at this point in the history
* vscode web example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update samples/code-server/README.md

Co-authored-by: Duc Trung Le <[email protected]>

* update readme

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Duc Trung Le <[email protected]>
  • Loading branch information
3 people authored Dec 30, 2024
1 parent 4e9381e commit 2d62b9f
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions samples/code-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# [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.
> 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**

```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.LabApp.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
```

0 comments on commit 2d62b9f

Please sign in to comment.