From de8420d190220437e0ce5b5ab491fc32c57be82d Mon Sep 17 00:00:00 2001 From: Stefan <76208574+st-vi@users.noreply.github.com> Date: Tue, 14 Nov 2023 09:14:04 +0100 Subject: [PATCH 1/9] Update README.MD --- README.MD | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.MD b/README.MD index a3083c9..3b49887 100644 --- a/README.MD +++ b/README.MD @@ -1,8 +1,8 @@ # UVL Playground -[![Production Website https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/) +Production [![Production Website https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/) -[![Development Website https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/) +Development [![Development Website https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/) This project contains the code for the UVL playground, a small website that uses the [UVLS](https://github.com/Universal-Variability-Language/uvl-lsp) to provide syntax highlighting, autocompletion and simple analysis. It consists of static website utilizing the [monaco editor](https://github.com/microsoft/monaco-editor) und communicates via websockets with the language server by using the [monaco-languageclient package](https://github.com/TypeFox/monaco-languageclient). From 32f1dd4d0f0fa0680d4d036f7498ce86a7bf28b1 Mon Sep 17 00:00:00 2001 From: Stefan Date: Tue, 14 Nov 2023 09:29:10 +0100 Subject: [PATCH 2/9] feat: changed readme --- README.MD | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/README.MD b/README.MD index 3b49887..c95d167 100644 --- a/README.MD +++ b/README.MD @@ -32,10 +32,26 @@ When your changes are added to the master branch, a github action takes care of ## Hosting on a different machine -Currently, the language server as well as the website are hosted on the same server. To change that, you need to follow these steps: +To change the machine on which the playground is hosted, you need to take the following steps: - set up your new host instance - - - install and configure docker (must run without sudo) (version 20.10.24 has a bug, so make sure to install a newer version) + - install and configure docker (must run without sudo) (version 20.10.24 has a bug, so make sure to install a newer version) - create ssh key - change the `SSH_PRIVATE_KEY` github secret to the new private key - change the variables for hostname, username, email and working directory on the server at the beginning of the workflow files under `.github/workflows` + +# Hosting your own uvl playground + +- To host your own uvl playground setup a machine with docker +- Clone the repository +- Adapt `./WebSocketClient/src/config.ts` +- Set evn variables for example with a `.env` file with: + - `HOSTNAME= + - `EMAIL= + (the email is used for letsencrypt) +- run `docker compose up --build -d` +- This will run the uvl playground behind a reverse proxy with letsencrypt certificates + +# Hosting your own uvl playground without reverse proxy + +- Remove everything treafik related from the docker compose file From df31070b1b78a8ba3c624ea708e76187f52d60f7 Mon Sep 17 00:00:00 2001 From: Stefan <76208574+st-vi@users.noreply.github.com> Date: Tue, 14 Nov 2023 11:28:52 +0100 Subject: [PATCH 3/9] Delete .github/workflows/playground_deployment.yml --- .github/workflows/playground_deployment.yml | 46 --------------------- 1 file changed, 46 deletions(-) delete mode 100644 .github/workflows/playground_deployment.yml diff --git a/.github/workflows/playground_deployment.yml b/.github/workflows/playground_deployment.yml deleted file mode 100644 index ad11b43..0000000 --- a/.github/workflows/playground_deployment.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Deploy UVL Playground - -env: - HOSTNAME: 7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org - USERNAME: ubuntu - WORKDIR: /home/ubuntu - SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - EMAIL: uvl-playground@trash-mail.com - -on: - push: - branches: - - master - workflow_dispatch: - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Set hostname for WebSocketLanguageServer - run: | - sed -i "s/languageServerHostName: .*/languageServerHostName: \"$HOSTNAME\",/" ./WebSocketClient/src/config.ts - sed -i "s/debug: .*/debug: false,/" ./WebSocketClient/src/config.ts - - name: Set hostname mail for docker compose - run: | - echo "HOSTNAME=$HOSTNAME" > .env - echo "EMAIL=$EMAIL" >> .env - - name: Install SSH key - run: | - mkdir -p ~/.ssh - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - ssh-keyscan -H $HOSTNAME >> ~/.ssh/known_hosts - - name: Copy all necessary files to remote server - # Make sure to add the following command if dependencies change for the language server. It just takes forever - # scp -r ./WebSocketClient/UVLPlayground/node_modules $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground - run: | - scp -r ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR - scp -r ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient - scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR - scp -r ./.env $USERNAME@$HOSTNAME:$WORKDIR - - name: Build and run containers - run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d' From 6174a2e0174ea49c824fb05e3b3ef5814a3054c3 Mon Sep 17 00:00:00 2001 From: Stefan <76208574+st-vi@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:11:22 +0100 Subject: [PATCH 4/9] Update playground_deployment_dev.yml --- .github/workflows/playground_deployment_dev.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/playground_deployment_dev.yml b/.github/workflows/playground_deployment_dev.yml index 00c7f9b..f92b236 100644 --- a/.github/workflows/playground_deployment_dev.yml +++ b/.github/workflows/playground_deployment_dev.yml @@ -23,6 +23,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + ref: dev - name: Set hostname for WebSocketLanguageServer run: | sed -i "s/languageServerHostName: .*/languageServerHostName: \"$HOSTNAME\",/" ./WebSocketClient/src/config.ts From 9f3b9f097be33a13230a46b001119f10a74df083 Mon Sep 17 00:00:00 2001 From: Stefan <76208574+st-vi@users.noreply.github.com> Date: Tue, 14 Nov 2023 12:46:18 +0100 Subject: [PATCH 5/9] Update playground_deployment_dev.yml --- .github/workflows/playground_deployment_dev.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/playground_deployment_dev.yml b/.github/workflows/playground_deployment_dev.yml index f92b236..d983002 100644 --- a/.github/workflows/playground_deployment_dev.yml +++ b/.github/workflows/playground_deployment_dev.yml @@ -43,9 +43,9 @@ jobs: # Make sure to add the following command if dependencies change for the language server. It just takes forever # scp -r ./WebSocketClient/UVLPlayground/node_modules $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground run: | - scp -r ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR - scp -r ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient - scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR - scp -r ./.env $USERNAME@$HOSTNAME:$WORKDIR + rsync -avz --update ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR + rsync -avz --update ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR + rsync -avz --update ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR + rsync -avz --update ./.env $USERNAME@$HOSTNAME:$WORKDIR - name: Build and run containers run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d' From 845449d015babab464f0b6ab70a2d495b0d6a27f Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 17 Nov 2023 15:54:34 +0100 Subject: [PATCH 6/9] fix: added z3 --- WebSocketLanguageServer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebSocketLanguageServer/Dockerfile b/WebSocketLanguageServer/Dockerfile index 6cf915e..8d180d3 100644 --- a/WebSocketLanguageServer/Dockerfile +++ b/WebSocketLanguageServer/Dockerfile @@ -3,7 +3,7 @@ FROM node:18 WORKDIR /usr/src/app RUN apt-get update -# RUN apt-get install z3 +RUN apt-get install z3 COPY package*.json ./ From 89825b1cbe50b6cf5de90874099f9a98be9fda60 Mon Sep 17 00:00:00 2001 From: Stefan <76208574+st-vi@users.noreply.github.com> Date: Wed, 22 Nov 2023 12:56:13 +0100 Subject: [PATCH 7/9] Update playground_deployment_prod.yml --- .github/workflows/playground_deployment_prod.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/playground_deployment_prod.yml b/.github/workflows/playground_deployment_prod.yml index 97d9691..e73585b 100644 --- a/.github/workflows/playground_deployment_prod.yml +++ b/.github/workflows/playground_deployment_prod.yml @@ -1,7 +1,7 @@ name: Deploy UVL Playground env: - HOSTNAME: 55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org + HOSTNAME: uvl.uni-ulm.de USERNAME: ubuntu WORKDIR: /home/ubuntu SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} From 376932f8ada88135582d1808d9956946182ae1f0 Mon Sep 17 00:00:00 2001 From: Stefan <76208574+st-vi@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:04:10 +0100 Subject: [PATCH 8/9] Update playground_deployment_prod.yml --- .github/workflows/playground_deployment_prod.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/playground_deployment_prod.yml b/.github/workflows/playground_deployment_prod.yml index e73585b..199413d 100644 --- a/.github/workflows/playground_deployment_prod.yml +++ b/.github/workflows/playground_deployment_prod.yml @@ -41,9 +41,9 @@ jobs: # Make sure to add the following command if dependencies change for the language server. It just takes forever # scp -r ./WebSocketClient/UVLPlayground/node_modules $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient/UVLPlayground run: | - scp -r ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR - scp -r ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR/WebSocketClient - scp -r ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR - scp -r ./.env $USERNAME@$HOSTNAME:$WORKDIR + rsync -avz --update ./WebSocketLanguageServer $USERNAME@$HOSTNAME:$WORKDIR + rsync -avz --update ./WebSocketClient $USERNAME@$HOSTNAME:$WORKDIR + rsync -avz --update ./docker-compose.yaml $USERNAME@$HOSTNAME:$WORKDIR + rsync -avz --update ./.env $USERNAME@$HOSTNAME:$WORKDIR - name: Build and run containers run: ssh -i ~/.ssh/id_rsa $USERNAME@$HOSTNAME 'pwd && docker compose up --build -d' From 43995a8b77c6193b96ea95a565ad2167144f5fb9 Mon Sep 17 00:00:00 2001 From: Stefan <76208574+st-vi@users.noreply.github.com> Date: Tue, 5 Dec 2023 10:24:32 +0100 Subject: [PATCH 9/9] Update README.MD --- README.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.MD b/README.MD index c95d167..c01c799 100644 --- a/README.MD +++ b/README.MD @@ -1,6 +1,6 @@ # UVL Playground -Production [![Production Website https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://55568392-f169-4f7f-b552-57cf451a2d81.ul.bw-cloud-instance.org/) +Production [![Production Website uvl.uni-ulm.de/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://uvl.uni-ulm.de/) Development [![Development Website https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/](https://img.shields.io/website-up-down-green-red/https/perso.crans.org.svg)](https://7470a63e-7b47-4833-a06c-1513f4fc534d.ul.bw-cloud-instance.org/)