Skip to content

Commit 1c3a8eb

Browse files
author
Greg Van Liew
authored
Merge pull request #21 from Microsoft/kieferrm/blog
remote architecture section
2 parents f03a143 + 005e069 commit 1c3a8eb

File tree

1 file changed

+8
-29
lines changed

1 file changed

+8
-29
lines changed

blogs/2019/05/02/remote-development.md

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ Thousands of engineers at large enterprises such as Facebook work remotely again
2727

2828
We heard from Python developers who want to switch to VS Code but need to use development environments configured for a specific Python stack using [containers and virtual machines](https://matttrent.com/remote-development/).
2929

30-
![Vagrant Box testimonial](vagrant-box-testimonial.png)
30+
> ![Vagrant Box testimonial](vagrant-box-testimonial.png)
3131
3232
Data scientists often need massive storage and compute services to analyze large datasets that can't be stored or processed even on a robust desktop.
3333

3434
And, [the third most commented issue in the VS Code repository](https://github.com/Microsoft/vscode/issues/13138) is to support running `code` from a Bash terminal in a Linux distro on Windows with the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/about).
3535

36-
![VS Code Ubuntu on Windows testimonial](vscode-ubuntu-windows-testimonial.png)
36+
> ![VS Code Ubuntu on Windows testimonial](vscode-ubuntu-windows-testimonial.png)
3737
3838
WSL is a great way to use your Windows-based tools to build applications that deploy to and run on Linux, and doing development in WSL is really just remote development from a Windows machine to a Linux environment that happens to be running on the same machine.
3939

@@ -50,11 +50,14 @@ For example:
5050

5151
## A different approach
5252

53-
On the VS Code team, we've been looking at the problem slightly differently. We think that a better solution is to run the developer tools locally and connect to a set of development services running remotely in the context of a physical or virtual machine (for example, a container or VM).
53+
Hearing about these challenges we started to look into WSL support and it looked simple enough. Install VS Code and ([carefully at the time!](https://devblogs.microsoft.com/commandline/do-not-change-linux-files-using-windows-apps-and-tools/)) edit the Windows file system as normal. We did work to [enable remote debugging for Node.js](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_remote-debugging), and we figured we could simply install a small script to enable launching `code` from the bash shell.
54+
55+
But, it just wasn't right. It didn't make sense to do special work for every runtime, as we did for Node.js debugging. If you have Python 2.7 and Flask installed on Windows (or none at all!) and Python 3.7 and Django installed in the Linux distro, you wouldn't get proper completions or linting because VS Code was looking at the Windows versions of everything. Having to duplicate the development environment on both Windows and Linux defeated the purpose of having WSL at all.
56+
57+
We convinced ourselves that what we needed was a way to run VS Code in two places at once, to run the developer tools locally and connect to a set of development services running remotely in the context of a physical or virtual machine (for example, a container or VM). This gives you a rich local development experience in the context of what is on the remote machine.
5458

5559
![Remote environment](remote-environment.png)
5660

57-
This gives you a rich local development experience in the context of what is on the remote machine.
5861

5962
## Introducing the VS Code Remote Extensions
6063

@@ -110,33 +113,9 @@ Check out this quick, 2-minute video to see Development Containers in action.
110113

111114
For more information on development containers, please see the [Developing inside a Container](https://aka.ms/vscode-remote/containers) documentation as well as the [vscode-remote-try-* repositories](https://github.com/search?q=org%3AMicrosoft+vscode-remote-try-&unscoped_q=vscode-remote-try-) that contain samples you can use today.
112115

113-
## How it all started
114-
115-
The Talking Heads may have asked the question first, but [how did we get here](https://www.youtube.com/watch?v=5IsSpAOD6K8)? It started with WSL and it looked simple enough. Install VS Code and ([carefully at the time!](https://devblogs.microsoft.com/commandline/do-not-change-linux-files-using-windows-apps-and-tools/)) and edit the Windows file system as normal. We did work to [enable remote debugging for Node.js](https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_remote-debugging), and we figured we could simply install a small script to enable launching `code` from the bash shell.
116-
117-
But, it just wasn't right. It didn't make sense to do special work for every runtime, as we did for Node.js debugging. If you have Python 2.7 and Flask installed on Windows (or none at all!) and Python 3.7 and Django installed in the Linux distro, you wouldn't get proper completions or linting because VS Code was looking at the Windows versions of everything. Having to duplicate the development environment on both Windows and Linux defeated the purpose of having WSL at all.
118-
119-
What we needed was a way to run VS Code in two places at once.
120-
121-
## Architectural enablement
122-
123-
VS Code has always been a multi-process application. The UI you normally interact with (the editor, file explorer, dialogs, etc.) run in the Electron renderer process. Extensions and debuggers run in their own process, and they often spawn additional processes to do their work.
124-
125-
For example, the TypeScript extension runs in the extension host process and spawns the TypeScript server executable to compile and type check your source code.
126-
127-
![VS Code worker processes](worker-processes.png)
128-
129-
This model, while sometimes more memory intensive, provides isolation and stability, allowing the operating system to manage resources, which it is generally good at.
130-
131-
It also provides portability. Processes (or services) don't need to run on the same machine or even on the same operating system. As long as we have access, we can run the processes almost anywhere we want: WSL, a container, or on another machine. VS Code doesn't care where the extensions are running, it just cares about the communication between the processes.
132-
133-
![VS Code remote worker processes](remote-worker-processes.png)
134-
135-
Which, it turns out, is pretty fast, even with low powered machines, low bandwidth, or poor connections. Your development experience remains smooth as editing happens locally and doesn't block on computationally intensive work happening remotely.
136-
137116
## Managing extensions
138117

139-
VS Code will attempt to infer where to install an extension, locally or remotely, based on the functionality it exposes. Extensions fall into one of two categories:
118+
When developing remotely, VS Code will attempt to infer where to install an extension, locally or remotely, based on the functionality it exposes. Extensions fall into one of two categories:
140119

141120
* UI Extensions are installed locally. These extensions only customize the UI and do not access files in a workspace, which means they can run entirely on the local machine. Since they are installed locally, they are always available to you independent of the workspace you are working in. Examples of UI extensions are themes, snippets, language grammars, and keymaps.
142121

0 commit comments

Comments
 (0)