Skip to content

Latest commit

 

History

History
156 lines (105 loc) · 7.43 KB

development.md

File metadata and controls

156 lines (105 loc) · 7.43 KB

Quick Start

Using Gitpod

To get started quickly, it is recommended to use Gitpod as default with the development environment already configured.

Open in Gitpod

Using Docker Compose

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: Combines backend, frontend, and commandline 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.
  • Depending on which profile(s) you selected, after some seconds, the respective services become available:

  • Open VSX CLI commands can be run via docker compose exec cli lib/ovsx if the commandline or openvsx 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.

Setup locally on WSL

Setup locally on macOS

  • 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 inside psql)

    • 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

  • 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

Run the application locally

  • 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

Optional: Deploy example extensions to your local registry

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 '{}' \;