Skip to content

Latest commit

 

History

History
56 lines (40 loc) · 4.75 KB

development.md

File metadata and controls

56 lines (40 loc) · 4.75 KB

Developing OpenVSCode Server

This guide implies that you have a good understanding of source code organization and development flow of Code-OSS.

Source Code Organization

We add server layer glueing everything required to run the server including the web workbench, the remote server and the remote CLI.

The server consist of 2 applications:

  • The web workbench is an entry point to a browser application configuring various services like how to establish the connection with the backend, resolve remote resources, load webviews, and so on.
  • The server is running on a remote machine that serves the web workbench and static resources for webviews, extensions, and so on, as well as provides access to the file system, terminals, extensions, and so on.

The workbench and the server are communicating via RPC calls over web socket connections. There are 2 kinds of connections that we support right now:

  • the management connection provides access to the server RPC channels, like filesystem and terminals;
  • the extension connection creates the remote extension host process per a browser window to run extensions.

For each window, the server installs the CLI socket server and injects a special env var pointing to the socket file into each terminal. It allows the remote CLI to send commands to a proper window, for instance, to open a file.

Note that the workbench can be also bundled independently to serve from some CDN services. The server can run in headless mode if sources of the web workbench are missing.

Building

Starting from sources

  • Start a Gitpod workspace
  • Dev version of the server should be already up and running. Notice that the dev version is slower to load since it is not bundled (around 2000 files).

Bundling

Run yarn gulp vscode-reh-web-linux-x64-min to create production-ready distributable from sources. After the build is finished, you will be able to find the vscode-reh-web-linux-x64 folder next to the repository folder (one level up from where you executed the command). In this folder, under bin/ you will find a openvscode-server script: your entrypoint to the OpenVSCode server.

Different platforms and CPU architectures

If you want to have distributables for more types of hardware and operating systems, your folder names and the main command for compiling will change. You can find all of the gulp bundling tasks here and if you execute yarn gulp --tasks | grep "vscode-reh-web" you will get all of the different distribution targets available (the options here are also the corresponding commands for bundling, which you need to prefix with yarn gulp in the terminal).

Updating VS Code

  • Update your local VS Code, open the About dialog and remember the release commit and Node.js version.
  • Fetch latest upstream changes and rebase the branch based on the local VS Code's commit. Drop all commits before code web server initial commit.
  • Check that .gitpod.Dockerfile and remote/.yarnrc has latest major Node.js version of local VS Code's Node.js version.
  • Recompile everything: git clean -dfx && yarn && yarn server:init
  • Run smoke tests: yarn server:smoketest.
  • Start the dev server and play:
    • filesystem (open some project)
    • extension host process: check language smartness
    • extension management (installing/uninstalling)
    • install VIM extension to test web extensions
    • terminals
    • code cli should open files and manage extensions: alias code='export VSCODE_DEV=1 && node out/server-cli.js'
  • Check server/browser logs for any warnings/errors about missing capabilities and fix them.
  • Build the production server with all changes: yarn gulp server-min.
  • Run it and play as with the dev server: /workspace/server-pkg/server.sh
  • Open a PR with your changes and ask for help if needed. It should be against gitpod-io/openvscode-server repo and main branch!

Releases

The Dockerfile used for creating releases is located in a separate repository in an effort to minimize clutter. Please consult: https://github.com/gitpod-io/openvscode-releases/