Skip to content

Commit

Permalink
getting started
Browse files Browse the repository at this point in the history
  • Loading branch information
akosyakov committed Sep 6, 2021
1 parent 8e0cd66 commit 83304ac
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 60 deletions.
36 changes: 0 additions & 36 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
FROM gitpod/workspace-full:latest

USER root

# leeway
ENV LEEWAY_NESTED_WORKSPACE=true
RUN cd /usr/bin && curl -fsSL https://github.com/gitpod-io/leeway/releases/download/v0.2.5/leeway_0.2.5_Linux_x86_64.tar.gz | tar xz

USER gitpod

# We use latest major version of Node.js distributed VS Code. (see about dialog in your local VS Code)
Expand All @@ -25,33 +19,3 @@ RUN sudo apt-get update \
libasound2 libgbm1 xfonts-base xfonts-terminus fonts-noto fonts-wqy-microhei \
fonts-droid-fallback vim-tiny nano libgconf2-dev libgtk-3-dev twm \
&& sudo apt-get clean && sudo rm -rf /var/cache/apt/* && sudo rm -rf /var/lib/apt/lists/* && sudo rm -rf /tmp/*

## Register leeway autocompletion in bashrc
RUN bash -c "echo . \<\(leeway bash-completion\) >> ~/.bashrc"

### Google Cloud ###
# not installed via repository as then 'docker-credential-gcr' is not available
ARG GCS_DIR=/opt/google-cloud-sdk
ENV PATH=$GCS_DIR/bin:$PATH
RUN sudo chown gitpod: /opt \
&& mkdir $GCS_DIR \
&& curl -fsSL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-344.0.0-linux-x86_64.tar.gz \
| tar -xzvC /opt \
&& /opt/google-cloud-sdk/install.sh --quiet --usage-reporting=false --bash-completion=true \
--additional-components docker-credential-gcr alpha beta \
# needed for access to our private registries
&& docker-credential-gcr configure-docker

# Install tools for gsutil
RUN sudo install-packages \
gcc \
python-dev \
python-setuptools

RUN bash -c "pip uninstall crcmod; pip install --no-cache-dir -U crcmod"

# Set Application Default Credentials (ADC) based on user-provided env var
RUN echo ". /workspace/vscode/scripts/setup-google-adc.sh" >> ~/.bashrc

ENV LEEWAY_WORKSPACE_ROOT=/workspace/vscode
ENV LEEWAY_REMOTE_CACHE_BUCKET=gitpod-core-leeway-cache-branch
5 changes: 2 additions & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ ports:
onOpen: open-browser
tasks:
- init: |
export VSCODE_INIT_BUILD_DIR=$(leeway describe "//:init" -t "/tmp/build/{{ .Metadata.Name }}.{{ .Metadata.Version }}")
leeway build
sudo cp -rup "$VSCODE_INIT_BUILD_DIR/install/." . | true
yarn
yarn gitpod:init
command: |
gp sync-done init
export NODE_ENV=development
Expand Down
17 changes: 0 additions & 17 deletions BUILD.yaml

This file was deleted.

45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,24 @@ At Gitpod we've been asked a lot about how we do it. So we thought we might just

## Getting started

The easiest way to get started is ...
### Docker

- Start the server:
```bash
docker run -it --init -p 3000:3000 -v "$(pwd):/home/workspace:cached" gitpod/vscode
```
- after this, visit [localhost:3000](http://localhost:3000).

### Linux

- [Download the latest release](https://github.com/gitpod-io/vscode-releases/releases/latest)
- untar and run the server:
```bash
tar -xzf code-web-server-v*.tar.gz
cd code-web-server-v*
./server.sh
```
- after this, visit [localhost:3000](http://localhost:3000).

## The scope of this project

Expand All @@ -27,3 +44,29 @@ This project really only adds the minimal bits required to run VS Code in a web
> **For any feature requests, bug reports, or contributions that are not specific to running VS Code in a web server context,**
>
> **please go to [Visual Studio Code - Open Source "OSS"](https://github.com/microsoft/vscode)**
## Contributing

### Starting from sources

- [Start a Gitpod workspace](https://gitpod.io/#https://github.com/gitpod-io/vscode/tree/web-server)
- 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).

### 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](./.gitpod.Dockerfile) and [remote/.yarnrc](./remote/.yarnrc) has latest major Node.js version of local VS Code's Node.js version.
- Recompile everything: `git clean -dfx && yarn && yarn gitpod:init`
- Run smoke tests: `yarn gitpod: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 agaist `gitpod-io/vscode` repo and `web-server` branch!
1 change: 0 additions & 1 deletion WORKSPACE.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@
"minify-vscode-reh-web": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js minify-vscode-reh-web",
"hygiene": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js hygiene",
"core-ci": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js core-ci",
"extensions-ci": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js extensions-ci"
"extensions-ci": "node --max_old_space_size=4095 ./node_modules/gulp/bin/gulp.js extensions-ci",
"gitpod:init": "yarn --cwd ./build compile && yarn compile && yarn download-builtin-extensions",
"gitpod:smoketest": "yarn --cwd ./test/smoke compile && yarn smoketest-no-compile --web --verbose --headless --electronArgs=\"--disable-dev-shm-usage --use-gl=swiftshader\""
},
"dependencies": {
"@vscode/vscode-languagedetection": "1.0.15",
Expand Down
1 change: 1 addition & 0 deletions product.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"GitHub.vscode-pull-request-github",
"GitHub.vscode-pull-request-github-insiders",
"ms-python.python",
"ms-toolsai.jupyter",
"ms-vscode.js-debug-nightly",
"ms-vscode.js-debug",
"ms-vscode.lsif-browser",
Expand Down
2 changes: 1 addition & 1 deletion test/smoke/src/areas/extensions/extensions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import minimist = require('minimist');
import { Application, Quality } from '../../../../automation';
import { Application } from '../../../../automation';
import { afterSuite, beforeSuite } from '../../utils';

export function setup(opts: minimist.ParsedArgs) {
Expand Down

0 comments on commit 83304ac

Please sign in to comment.