JakuJ / qsharp-compiler-mirror

A mirror of the qsharp-compiler repository

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Language server for the Quantum Explorer

This repository contains code behind the WebSocket-based language server for Q#, used by the Quantum Exlorer app. It's built upon a mirror of the qsharp-compiler repository by Microsoft. Our code is located mostly at src/QsCompiler/WebSocketServer, with some modifications done to the original code as well.

For documentation on the rest of the code contained in this repository, refer to the original README.

Building

Requirements

Make sure you have the following installed:

  • .NET Core 3.1 SDK and runtime
  • Docker (optional)

Language server

If you want to build locally, you must first execute the bootstrap.ps1 script at the root of the repository with the correct value of the NUGET_VERSION environment variable (defined in the Dockerfile).

# On MacOS or Linux, pwsh is the Powershell binary
NUGET_VERSION=0.15.2103133969 pwsh bootstrap.ps1

# On Windows, in Powershell
$Env:NUGET_VERSION=0.15.2103133969
bootstrap.ps1

# build and run the Language Server afterwards
cd src/QsCompiler/WebSocketServer
dotnet run

By default, the app runs on port 8091.

The app can also be run inside a Docker container:

docker build -t language-server .
docker run -p 8091:8091 -t language-server

Deployment

The app is meant for two environments - development (Heroku) and production (Azure).

Development

The development version of the app, tracking the develop branch is running at https://qexplorer-ls.herokuapp.com. The deployment happens automatically using a push hook configured in Heroku.

The runtime config involves setting config vars as follows:

Variable Value
ASPNETCORE_ENVIRONMENT Development

Production

The production version of the app, used to be deployed to an Azure Web App for Containers running at https://language-server.azurewebsites.net.

The deployment is performed manually by pushing the Docker container (or rather, its build context, the build is remote) to Azure Container Repository (ACR). Run the following Azure CLI command from the root folder of the repository:

az acr build --registry QuantumExplorer --image language-server:<tag> --verbose .

where <tag> is the docker image tag for the release (e.g. latest or 1.0).

The runtime config involves setting application settings as follows:

Variable Value
ASPNETCORE_ENVIRONMENT Production

About

A mirror of the qsharp-compiler repository

License:GNU General Public License v3.0


Languages

Language:C# 53.2%Language:F# 33.8%Language:Q# 6.3%Language:LLVM 4.9%Language:TypeScript 1.0%Language:PowerShell 0.5%Language:ANTLR 0.2%Language:Dockerfile 0.0%Language:C++ 0.0%