To get started quickly, it is recommended to use Gitpod as default with the development environment already configured.
To run the Open VSX registry in a development environment, you can use docker compose
by following these steps:
-
Verify Docker Compose is installed by running
docker compose version
. If an error occurs, you may need to install docker compose on your machine. -
Decide which profile(s) to run based on your needs. By default, only the PostgreSQL and Elasticsearch containers start, which suits running the OpenVSX server and web UI locally for easier debugging. The [docker-compose.yml] file defines additional profiles for specific components:
backend
: Starts the OpenVSX server container (java).frontend
: Starts the web UI container.commandline
: Starts a container with the OpenVSX CLI tools.openvsx
: Combinesbackend
,frontend
, andcommandline
profiles to start all related services.kibana
: Starts a kibana instance for easier access to the Elasticsearch service.
-
In the project root, initiate Docker Compose:
- Without profiles:
docker compose up
. - With profiles:
docker compose --profile <profile_name> up
. Use multiple--profile
flags for multiple profiles, e.g.,docker compose --profile openvsx --profile kibana up
.
- Without profiles:
-
Depending on which profile(s) you selected, after some seconds, the respective services become available:
- registry backend is available at http://localhost:8080/ if the
backend
oropenvsx
profile was selected. - web ui is available at http://localhost:3000/ if the
frontend
oropenvsx
profile was selected. - kibana is exposed at http://localhost:5601/ if the
kibana
profile was selected.
- registry backend is available at http://localhost:8080/ if the
-
Open VSX CLI commands can be run via
docker compose exec cli lib/ovsx
if thecommandline
oropenvsx
profile was selected. -
To load some extensions from the main registry (openvsx.org), run
docker compose exec cli yarn load-extensions <N>
, where N is the number of extensions you would like to publish in your local registry. -
For troubleshooting or manual intervention, access a service's interactive shell with
docker compose run --rm <service> /bin/bash
. Service names are listed in the docker-compose.yml file.
-
Install WSL
-
Make sure the firewall is not blocking internet access on WSL2 - need to check every time before running the application or installing new tools.
- Try to ping a random website, for example, "ping -c 3 www.google.ca", if fails, proceed below
- sudo vi /etc/resolv.conf
- Change nameserver to 8.8.8.8
- Ping google again to see if it works this time
- Related issue: microsoft/WSL#3669
- Solution that I'm following: https://stackoverflow.com/questions/60269422/windows10-wsl2-ubuntu-debian-no-network
-
clone the repository from github
-
set up vscode on WSL
-
Install postgres
- sudo apt update
- sudo apt install postgresql postgresql-contrib
- sudo service postgresql start
- sudo service postgresql status (this is to check if the service is really on)
- sudo -u postgres psql (connect to the postgres service)
- CREATE ROLE gitpod with LOGIN PASSWORD 'gitpod';
- https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-database
-
Install node.js using nvm
-
Set up JDK 17
- sudo apt install -y wget apt-transport-https
- mkdir -p /etc/apt/keyrings
- wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc
- echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
- sudo apt update
- sudo apt install temurin-17-jdk
-
Install docker
-
Install Elasticsearch with Docker
- sudo docker pull elasticsearch:8.7.1
- sudo docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.ml.enabled=false" -e "xpack.security.enabled=false" elasticsearch:8.7.1
-
Set up postgreSQL using Homebrew
-
brew install postgresql@12
-
Use
postgres –V
to check if it is the correct version -
brew services start postgresql@12
-
From the terminal, run the command
createdb postgres
(NOT insidepsql
) -
psql –d postgres
to enter the database -
CREATE ROLE gitpod with LOGIN PASSWORD 'gitpod';
-
Using \d to display all tables and relations, now empty
-
-
Make sure the correct Java version is being used
-
Download Java 17 if you don't have it already: https://adoptium.net/temurin/releases/
-
Run the command
/usr/libexec/java_home –V
to see your matching Java virtual machines -
Pick Java 17 accordingly
-
export JAVA_HOME='/usr/libexec/java_home –v 17.0.7+7'
-
Run
java –version
to check if Java 17 is indeed being used
-
-
Set up Elasticsearch using Docker
-
Download Docker Desktop from https://www.docker.com/
-
Download the Elasticsearch image from Docker Hub and enable it in the Docker Desktop
-
cd cli
- yarn install
- yarn build
-
cd server
- ./scripts/generate-properties.sh
- ./gradlew build
- ./gradlew runServer
-
cd webui
- yarn install
- yarn build
- yarn build:default
- yarn start:default
-
Go to localhost:3000 on browser and it should be up and running
Run:
- in
server/
:
gradlew downloadTestExtensions
to download vsix files from the official store and from Github. - in project root (the server application must be running):
export OVSX_REGISTRY_URL=http://localhost:8080 export OVSX_PAT=super_token export PUBLISHERS="DotJoshJohnson eamodio felixfbecker formulahendry HookyQR ms-azuretools ms-mssql ms-python ms-vscode octref redhat ritwickdey sburg vscode vscodevim Wscats" for pub in $PUBLISHERS; do cli/lib/ovsx create-namespace $pub; done find server/build/test-extensions-builtin -name '*.vsix' -exec cli/lib/ovsx publish '{}' \; find server/build/test-extensions -name '*.vsix' -exec cli/lib/ovsx publish '{}' \;