Skip to content

Commit

Permalink
feat(docs): update README with info on how to make db semi-persistent (
Browse files Browse the repository at this point in the history
…#3257)

* update README with info on how to make db semi-persistent

* add to helm chart
  • Loading branch information
anna-parker authored Nov 20, 2024
1 parent 99d2386 commit 341511d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 35 deletions.
6 changes: 6 additions & 0 deletions docs/src/content/docs/reference/helm-chart-config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ The configuration for the Helm chart is provided as a YAML file. It has the foll
<td>true</td>
<td>If true, runs a development Keycloak database within the cluster.</td>
</tr>
<tr>
<td>`developmentDatabasePersistence`</td>
<td>Boolean</td>
<td>true</td>
<td>If true, makes the database on the argocd preview persistent.</td>
</tr>
</tbody>
</table>

Expand Down
8 changes: 4 additions & 4 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
60 changes: 29 additions & 31 deletions kubernetes/appset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}'
Expand All @@ -54,5 +52,5 @@ spec:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
- CreateNamespace=true
- ServerSideApply=true

0 comments on commit 341511d

Please sign in to comment.