Running the Visual Studio Code Web IDE inside the Jupyter environment
Project description
jupyter-code-server
Running VSCode Web IDE code-server inside the Jupyter environment.
Table of Contents
Requirements
- Installed version of https://github.com/coder/code-server
- If code-server is installed via Lmod: Loading code-server using Lmod
jupyter-server-proxy>=4.1.2
Installation
python3 -m pip install jupyter-code-server
Configuration
Setting the working directory
The environment variable CODE_WORKING_DIRECTORY
is prioritised and can be changed for the VSCode Web IDE independently of the Jupyter working/notebook directory.
The order/priority is as follows:
CODE_WORKING_DIRECTORY
, if not set:JUPYTERHUB_ROOT_DIR
, if not set:JUPYTER_SERVER_ROOT
, if not set:HOME
Using pre-started code-server
In case code-server is already running (e.g. started in sidecar container with Jupyter running in Kubernetes)
and servig either via TCP port or UNIX socket, it is possible to proxy this already running instance instead
of starting a new one with jupyter-server-proxy. Variables JSP_CODE_SERVER_PORT
and JSP_CODE_SERVER_SOCKET
set command
to empty list which makes jupyter-server-proxy
pass requests to specified port of socket.
If running code-server is listening to TCP port, environment variable JSP_CODE_SERVER_PORT
may be set to
port number.
If running code-server is listening to UNIX socket, environment variable JSP_CODE_SERVER_SOCKET
may be set to
socket file path.
If none of these environment variables are set, jupyter-code-server starts new code-server process and proxies requests to its socket.
Enable/disable launcher
By default code-server launcher is enabled and visible in JupyterLab. Option JSP_CODE_SERVER_LAUNCHER_DISABLED
may be set to any non-empty value to disable launcher. This is useful when e.g. certain users are not supposed
to have code-server available in Jupyterhub as there is no easy way to disable loading of entire jupyter-code-server
module for these users if module is for example built into Docker image.
Loading code-server using Lmod
If code-server needs to be loaded from an Lmod environment you can set the JSP_CODE_SERVER_LMOD_MODULE
variable to the path of the module.
Example: JSP_CODE_SERVER_LMOD_MODULE=tools/code-server/4.22.1
The module will then be loaded with the help of LMOD_CMD
and MODULEPATH
before the code-server is started.
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 Distributions
Built Distribution
File details
Details for the file jupyter_code_server-1.0-py3-none-any.whl
.
File metadata
- Download URL: jupyter_code_server-1.0-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16e80a773f5af18b19fd6b0fdf3fd2fc1e3b4380fe5eae9b8e3c917c64a57c48 |
|
MD5 | 439501c87bb4176d83cdae084f76d971 |
|
BLAKE2b-256 | efec29263024762c88df89088ae9f615d731e28aa194e93264dcafce5916d144 |