From 207653084dcf88852e39f3ff23419f65df344573 Mon Sep 17 00:00:00 2001 From: Oleksandr Dzhychko Date: Wed, 3 Jul 2024 08:21:10 +0200 Subject: [PATCH 1/3] chore: add note about how to upgrade already installed charts --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0ca4356..8902b25 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,14 @@ This Helm chart is tightly coupled and has to be developed in together with [Mod ./helm/install.sh ``` + > [!NOTE] + > If you already have the chart installed, you can run: + > ```shell + > ./helm/upgrade.sh + > ``` + > This will only update all images while keeping all data. + + ### Making changes to [Modelix Workspace components](https://github.com/modelix/modelix.workspaces) 1. Follow the [instructions in Modelix Workspace components](https://github.com/modelix/modelix.workspaces?tab=readme-ov-file#development) to build OCI images with local changes. From a596c8d6c5f2e0407b3c71383c4a020ecf0324a4 Mon Sep 17 00:00:00 2001 From: Oleksandr Dzhychko Date: Wed, 3 Jul 2024 08:29:12 +0200 Subject: [PATCH 2/3] fix(workspace-client): enable probes on to redirect to projector UI only after MPS started --- .../common/workspace-client-deployment.yaml | 41 ++++++++++++------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/helm/modelix/templates/common/workspace-client-deployment.yaml b/helm/modelix/templates/common/workspace-client-deployment.yaml index ad29e2b..d0bc3ab 100644 --- a/helm/modelix/templates/common/workspace-client-deployment.yaml +++ b/helm/modelix/templates/common/workspace-client-deployment.yaml @@ -61,20 +61,33 @@ spec: limits: memory: "4.0Gi" # is replaced with the value in the workspace configuration cpu: "1.5" -# readinessProbe: -# httpGet: -# path: / -# port: 8887 -# initialDelaySeconds: 10 -# periodSeconds: 5 -# timeoutSeconds: 3 -# livenessProbe: -# httpGet: -# path: / -# port: 8887 -# initialDelaySeconds: 120 -# periodSeconds: 20 -# timeoutSeconds: 10 + # 8887 is the port used to access the MPS UI. + # http://localhost:8887/mainWindows can be used to list opened windows. + # See https://github.com/JetBrains/projector-client/blob/0f1e08a68f01c417a7ce8a58afe77d63603e22db/projector-server-core/src/main/kotlin/org/jetbrains/projector/server/core/websocket/HttpWsServer.kt#L68 + # The response is single line of JSON. + # Example responses values are: + # * `[]`, when no windows are opened yet + # * `[{"title":"splash","pngBase64Icon":null}]`, when the splash screen is loading + # * `[{"title":"","pngBase64Icon":"iVB<...>YII="}]`, when one project is opened + # + # With the different probes, we make sure to only redirect the user to the UI when MPS started. + # Use `wget` because `curl` does not exist in container. + startupProbe: + exec: + command: ["/bin/sh", "-c", "wget -qO- http://localhost:8887/mainWindows | grep -vqF '[]'"] + # Give MPS and projector 2 minutes (12 * 10 seconds) to startup. + failureThreshold: 12 + periodSeconds: 10 + livenessProbe: + exec: + command: ["/bin/sh", "-c", "wget -qO- http://localhost:8887/mainWindows | grep -vqF '[]'"] + periodSeconds: 20 + timeoutSeconds: 10 + readinessProbe: + exec: + command: ["/bin/sh", "-c", "wget -qO- http://localhost:8887/mainWindows | grep -vqF '[]'"] + periodSeconds: 5 + timeoutSeconds: 3 restartPolicy: Always {{- include "modelix.pullSecret" . | nindent 6 }} {{- end -}} \ No newline at end of file From 4ef3a95f26de084dd91609be06d5d5d87b014c3a Mon Sep 17 00:00:00 2001 From: Oleksandr Dzhychko Date: Wed, 3 Jul 2024 09:08:29 +0200 Subject: [PATCH 3/3] fix(workspace-manager): write secret entry `workspace-secret` into to expected file The workspace manager expects to find the secret in the file `workspace-credentials-key.txt`. See https://github.com/modelix/modelix.workspaces/blob/8f5a45adcd35c9d0333647b6d48b5a5aa972aa89/workspaces/src/main/kotlin/org/modelix/workspaces/Workspace.kt#L143 The previous deployment created the file `workspace-secret` in the folder `/secrets/workspacesecret/workspace-credentials-key.txt`. --- .../templates/common/workspace-manager-deployment.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helm/modelix/templates/common/workspace-manager-deployment.yaml b/helm/modelix/templates/common/workspace-manager-deployment.yaml index 1d2b9ff..a5880ce 100644 --- a/helm/modelix/templates/common/workspace-manager-deployment.yaml +++ b/helm/modelix/templates/common/workspace-manager-deployment.yaml @@ -72,7 +72,7 @@ spec: - mountPath: "/workspace-manager/modelix-workspaces/uploads" name: "{{ include "modelix.fullname" . }}-workspace-uploads" - name: "{{ include "modelix.fullname" . }}-workspace-secret" - mountPath: /secrets/workspacesecret/workspace-credentials-key.txt + mountPath: /secrets/workspacesecret readOnly: true restartPolicy: Always volumes: @@ -82,5 +82,8 @@ spec: - name: "{{ include "modelix.fullname" . }}-workspace-secret" secret: secretName: "{{ include "modelix.fullname" . }}-workspace-secret" + items: + - key: workspace-secret + path: workspace-credentials-key.txt {{- include "modelix.pullSecret" . | nindent 6 }} {{- end -}}