From 341511dbae056f7c7dbacc0836d7c29eb692db13 Mon Sep 17 00:00:00 2001
From: "Anna (Anya) Parker" <50943381+anna-parker@users.noreply.github.com>
Date: Wed, 20 Nov 2024 09:48:35 +0100
Subject: [PATCH] feat(docs): update README with info on how to make db
semi-persistent (#3257)
* update README with info on how to make db semi-persistent
* add to helm chart
---
.../docs/reference/helm-chart-config.mdx | 6 ++
kubernetes/README.md | 8 +--
kubernetes/appset.yaml | 60 +++++++++----------
3 files changed, 39 insertions(+), 35 deletions(-)
diff --git a/docs/src/content/docs/reference/helm-chart-config.mdx b/docs/src/content/docs/reference/helm-chart-config.mdx
index 03713a2c4..4b1f0d0c9 100644
--- a/docs/src/content/docs/reference/helm-chart-config.mdx
+++ b/docs/src/content/docs/reference/helm-chart-config.mdx
@@ -354,6 +354,12 @@ The configuration for the Helm chart is provided as a YAML file. It has the foll
true |
If true, runs a development Keycloak database within the cluster. |
+
+ `developmentDatabasePersistence` |
+ Boolean |
+ true |
+ If true, makes the database on the argocd preview persistent. |
+
diff --git a/kubernetes/README.md b/kubernetes/README.md
index d8f1eec73..273e1affe 100644
--- a/kubernetes/README.md
+++ b/kubernetes/README.md
@@ -35,7 +35,7 @@ We also recommend installing [k9s](https://k9scli.io/) to inspect cluster resour
We deploy to kubernetes via the `../deploy.py` script. It requires you to have `pyyaml` and `requests` installed.
-NOTE: On MacOS, make sure that you have configured enough RAM in Docker, we recommend 8GB.
+NOTE: On MacOS, make sure that you have configured enough RAM in Docker, we recommend 8GB.
### Setup for local development
@@ -124,11 +124,11 @@ Install the chart to deploy the services:
## Argo CD
-ArgoCD will aim to build preview instances for any open PR with the `preview` label. It may take 5 minutes for an instance to appear. The preview will appear at `[branch_name].loculus.org`. Long branch names are shortened, and some special characters are not supported. You can find the exact URL in the ArgoCD UI: https://argocd.k3s.pathoplexus.org/ (login details are on [Slack](https://loculus.slack.com/archives/C05G172HL6L/p1698940904615039).
+ArgoCD will aim to build preview instances for any open PR with the `preview` label. It may take 5 minutes for an instance to appear. The preview will appear at `[branch_name].loculus.org`. Long branch names are shortened, and some special characters are not supported. You can find the exact URL in the ArgoCD UI: https://argocd.k3s.pathoplexus.org/ (login details are on [Slack](https://loculus.slack.com/archives/C05G172HL6L/p1698940904615039)).
-The preview is intended to simulate the full backend and associated containers. It may be necessary to update this directory when changes are made to how containers need to be deployed.
+The preview is intended to simulate the full backend and associated containers. It may be necessary to update this directory when changes are made to how containers need to be deployed. It you would like to test your changes on a persistent DB add `developmentDatabasePersistence: true` to your `values.yaml`.
-We do not currently support branch names containing underscores and other characters that can't go in domain names.
+We do not currently support branch names containing characters that can't go in domain names with the exception of '/' and '\_' (see [kubernetes/appset.yaml](https://github.com/loculus-project/loculus/blob/main/kubernetes/appset.yaml) for details).
## Secrets
diff --git a/kubernetes/appset.yaml b/kubernetes/appset.yaml
index 4db23cae1..481f5c41b 100644
--- a/kubernetes/appset.yaml
+++ b/kubernetes/appset.yaml
@@ -6,46 +6,44 @@ metadata:
namespace: argocd
spec:
generators:
- - pullRequest:
- github:
- labels:
- - preview
- owner: loculus-project
- repo: loculus
- tokenRef:
- key: token
- secretName: github-access-token
- requeueAfterSeconds: 60
- - git:
- files:
- - path: config.json
- repoURL: https://github.com/loculus-project/argocd_metadata.git
- revision: HEAD
+ - pullRequest:
+ github:
+ labels:
+ - preview
+ owner: loculus-project
+ repo: loculus
+ tokenRef:
+ key: token
+ secretName: github-access-token
+ requeueAfterSeconds: 60
+ - git:
+ files:
+ - path: config.json
+ repoURL: https://github.com/loculus-project/argocd_metadata.git
+ revision: HEAD
goTemplate: true
template:
metadata:
- name: pp-{{ (printf "%.25s" .branch) | replace "_" "-" | replace "/" "-" | trimSuffix "-" | lower }}-{{.number}}
+ name: pp-{{ (printf "%.25s" .branch) | replace "_" "-" | replace "/" "-" | trimSuffix "-" | lower }}-{{.number}}
spec:
destination:
- namespace: prev-{{ (printf "%.25s" .branch) | replace "_" "-" | replace "/" "-" | trimSuffix "-" | lower }}
+ namespace: prev-{{ (printf "%.25s" .branch) | replace "_" "-" | replace "/" "-" | trimSuffix "-" | lower }}
server: https://kubernetes.default.svc
project: default
source:
helm:
parameters:
- - name: shortbranch
- value: '{{ (printf "%.25s" .branch) | replace "_" "-" | replace "/" "-"
- | trimSuffix "-" | lower }}'
- - name: sha
- value: '{{.head_short_sha_7}}'
- - name: branch
- value: '{{.branch}}'
- - name: host
- value: '{{ (printf "%.25s" .branch) | replace "_" "-" | replace "/" "-"
- | trimSuffix "-" | lower }}.loculus.org'
+ - name: shortbranch
+ value: '{{ (printf "%.25s" .branch) | replace "_" "-" | replace "/" "-" | trimSuffix "-" | lower }}'
+ - name: sha
+ value: '{{.head_short_sha_7}}'
+ - name: branch
+ value: '{{.branch}}'
+ - name: host
+ value: '{{ (printf "%.25s" .branch) | replace "_" "-" | replace "/" "-" | trimSuffix "-" | lower }}.loculus.org'
valueFiles:
- - values.yaml
- - values_preview_server.yaml
+ - values.yaml
+ - values_preview_server.yaml
path: kubernetes/loculus/
repoURL: https://github.com/loculus-project/loculus.git
targetRevision: '{{.branch}}'
@@ -54,5 +52,5 @@ spec:
prune: true
selfHeal: true
syncOptions:
- - CreateNamespace=true
- - ServerSideApply=true
+ - CreateNamespace=true
+ - ServerSideApply=true