Skip to content

Commit b44b41e

Browse files
feat(helm): Setup helm-docs and generate readme files for helm charts (#62)
* feat(helm): Create git precommit hook for helm docs
1 parent 978614d commit b44b41e

13 files changed

Lines changed: 726 additions & 71 deletions

File tree

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
repos:
2+
- repo: https://github.com/norwoodj/helm-docs
3+
rev: v1.14.2
4+
hooks:
5+
- id: helm-docs-container
6+
files: helm-charts/(.*)/values.yaml
7+
args:
8+
# Make the tool search for charts only under the `example-charts` directory
9+
- --chart-search-root=helm-charts

helm-charts/cogstack-helm-ce/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,58 @@ If the namespace was created only for this release, remove it with:
7272
```bash
7373
kubectl delete namespace cogstack
7474
```
75+
76+
## Requirements
77+
78+
| Repository | Name | Version |
79+
|------------|------|---------|
80+
| file://../medcat-service-helm | medcat-service(medcat-service-helm) | 0.0.1 |
81+
| file://../medcat-service-helm | anoncat-service(medcat-service-helm) | 0.0.1 |
82+
| file://../medcat-trainer-helm | medcat-trainer(medcat-trainer-helm) | 0.0.1 |
83+
| file://charts/jupyterhub | cogstack-jupyterhub | 0.1.0 |
84+
| https://opensearch-project.github.io/helm-charts/ | opensearch | 3.5.0 |
85+
| https://opensearch-project.github.io/helm-charts/ | opensearch-dashboards | 3.5.0 |
86+
87+
## Values
88+
89+
| Key | Type | Default | Description |
90+
|-----|------|---------|-------------|
91+
| anoncat-service.enabled | bool | `true` | Enable AnonCAT service deployment. |
92+
| anoncat-service.env.APP_MEDCAT_MODEL_PACK | string | `"/cat/models/examples/example-deid-model-pack.zip"` | Model pack used by the MedCAT service when running in DeID mode. |
93+
| anoncat-service.env.DEID_MODE | bool | `true` | Enable DeID mode. |
94+
| anoncat-service.env.DEID_REDACT | bool | `false` | Enable redaction behaviour for DeID. |
95+
| anoncat-service.image.repository | string | `"cogstacksystems/medcat-service"` | MedCAT service image repository for AnonCAT. |
96+
| anoncat-service.image.tag | string | `"1.2.0"` | MedCAT service image tag used by AnonCAT. |
97+
| anoncat-service.replicasCount | int | `1` | Number of AnonCAT (medcat-service in DeID mode) replicas. |
98+
| cogstack-jupyterhub.enabled | bool | `true` | Enable JupyterHub (with hub and singleuser components). |
99+
| cogstack-jupyterhub.jupyterhub.hub.config.Authenticator.admin_users | list | `["admin"]` | Allowed admin users for the dummy authenticator. |
100+
| cogstack-jupyterhub.jupyterhub.hub.config.Authenticator.admin_users[0] | string | `"admin"` | Admin user entry for the dummy authenticator. |
101+
| cogstack-jupyterhub.jupyterhub.hub.config.DummyAuthenticator.password | string | `"SuperSecret"` | Password for the dummy authenticator (do not use in production). |
102+
| cogstack-jupyterhub.jupyterhub.hub.config.JupyterHub.authenticator_class | string | `"dummy"` | Authenticator class used by JupyterHub (dummy authenticator for demo/non-prod). |
103+
| cogstack-jupyterhub.jupyterhub.hub.image.name | string | `"cogstacksystems/jupyter-hub"` | JupyterHub hub image name. |
104+
| cogstack-jupyterhub.jupyterhub.hub.image.tag | string | `"2.2.2"` | JupyterHub hub image tag. |
105+
| cogstack-jupyterhub.jupyterhub.singleuser.image.name | string | `"cogstacksystems/jupyter-singleuser"` | JupyterHub singleuser image name. |
106+
| cogstack-jupyterhub.jupyterhub.singleuser.image.pullPolicy | string | `"IfNotPresent"` | JupyterHub singleuser image pull policy. |
107+
| cogstack-jupyterhub.jupyterhub.singleuser.image.tag | string | `"2.2.2"` | JupyterHub singleuser image tag. |
108+
| fullnameOverride | string | `""` | Fully override the chart fullname. |
109+
| imagePullSecrets | list | `[]` | This is for the secrets for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ |
110+
| medcat-service.enabled | bool | `true` | Enable MedCAT service deployment. |
111+
| medcat-service.image.repository | string | `"cogstacksystems/medcat-service"` | MedCAT service image repository. |
112+
| medcat-service.image.tag | string | `"1.2.0"` | MedCAT service image tag. |
113+
| medcat-service.replicasCount | int | `1` | Number of MedCAT service replicas. |
114+
| medcat-trainer.enabled | bool | `true` | Enable MedCAT Trainer deployment. |
115+
| medcat-trainer.env.CSRF_TRUSTED_ORIGINS | string | `"http://localhost:8080"` | CSRF trusted origins for the MedCAT Trainer frontend (set for your deployment/port-forward). |
116+
| medcat-trainer.image.tag | string | `"latest@sha256:103215a7540ad614c32866f4cb00ddd91e7aff37cea9abc25dc226c577f9506d"` | MedCAT Trainer image tag (can be a digest-pinned tag). |
117+
| medcat-trainer.provisioning.enabled | bool | `true` | Enable provisioning of projects and models on startup. |
118+
| medcat-trainer.provisioning.existingConfigMap.name | string | `"cogstack-helm-ce-example-trainer-provisioining"` | Existing ConfigMap name containing the provisioning configuration. |
119+
| nameOverride | string | `""` | This is to override the chart name. |
120+
| opensearch-dashboards.enabled | bool | `true` | Deploy an opensearch-dashboards instance |
121+
| opensearch.enabled | bool | `true` | Deploy an opensearch cluster |
122+
| opensearch.extraEnvs | list | Sets the initial admin password for OpenSearch | Extra environment variables to pass to OpenSearch. |
123+
| provisioning.enabled | bool | `true` | Enable provisioning for supporting services (e.g. OpenSearch templates/documents). |
124+
| provisioning.opensearch.createExampleDocuments | bool | `true` | Create example documents in OpenSearch on startup. |
125+
| provisioning.opensearch.createIndexTemplate | bool | `true` | Create the OpenSearch index template on startup. |
126+
| provisioning.opensearchDashboards.createDashboards | bool | `true` | Create dashboards on startup. |
127+
128+
----------------------------------------------
129+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# CogStack Helm Community Edition
2+
3+
This is a all in one helm chart that runs CogStack on Kubernetes
4+
5+
## Overview
6+
7+
This chart is an umbrella chart that deploys:
8+
9+
| Component | Description |
10+
|------------------|-------------|
11+
| **MedCAT** | Medical Concept Annotation Tool — NER and linking for clinical text. |
12+
| **AnonCAT** | De-identification service (MedCAT in DEID mode) for anonymising text. |
13+
| **MedCAT Trainer** | Training and model management for MedCAT, with Solr and PostgreSQL. |
14+
15+
## Prerequisites
16+
17+
- Kubernetes cluster
18+
- Helm 3+
19+
20+
## Installation
21+
22+
```sh
23+
helm install cogstack oci://registry-1.docker.io/cogstacksystems/cogstack-helm-ce
24+
```
25+
26+
## Configuration
27+
These are some values that are likely to need customization for your deployment:
28+
29+
| Value | Default | Description |
30+
|-------|---------|-------------|
31+
| `medcat-service.replicasCount` | `1` | Number of MedCAT service replicas. |
32+
| `anoncat-service.replicasCount` | `1` | Number of AnonCAT service replicas. |
33+
| `anoncat-service.env.DEID_REDACT` | `false` | Redaction behaviour for de-identification. |
34+
| `medcat-trainer.env.CSRF_TRUSTED_ORIGINS` | `"http://localhost:8080"` | CSRF trusted origins for MedCAT Trainer frontend (set correct value for your deployment, this default works for port forwarding). |
35+
36+
Subcharts (MedCAT service, AnonCAT service, MedCAT Trainer) support additional options; see their respective charts under `../medcat-service-helm` and `../medcat-trainer-helm`. Pass them under the same keys as in this chart’s `values.yaml` (e.g. `medcat-service.*`, `anoncat-service.*`, `medcat-trainer-helm.*`).
37+
38+
Example override file:
39+
40+
```yaml
41+
# my-values.yaml
42+
medcat-service:
43+
replicasCount: 2
44+
anoncat-service:
45+
replicasCount: 1
46+
env:
47+
APP_ENABLE_DEMO_UI: true
48+
DEID_MODE: true
49+
```
50+
51+
Install with overrides:
52+
53+
```bash
54+
helm install cogstack . -f my-values.yaml --namespace cogstack --create-namespace
55+
```
56+
57+
## Dependencies
58+
59+
The chart uses local subcharts via relative paths:
60+
61+
- `medcat-service-helm` (as `medcat-service` and `anoncat-service`)
62+
- `medcat-trainer-helm`
63+
64+
## Uninstall
65+
66+
```bash
67+
helm uninstall cogstack-ce --namespace cogstack
68+
```
69+
70+
If the namespace was created only for this release, remove it with:
71+
72+
```bash
73+
kubectl delete namespace cogstack
74+
```
75+
76+
{{ template "chart.requirementsSection" . }}
77+
78+
{{ template "chart.valuesSection" . }}
79+
80+
{{ template "helm-docs.versionFooter" . }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# cogstack-jupyterhub
2+
3+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: latest](https://img.shields.io/badge/AppVersion-latest-informational?style=flat-square)
4+
5+
A Helm chart for CogStack Jupyter Hub using official JupyterHub chart
6+
7+
## Requirements
8+
9+
| Repository | Name | Version |
10+
|------------|------|---------|
11+
| https://hub.jupyter.org/helm-chart/ | jupyterhub | 4.3.2 |
12+
13+
## Values
14+
15+
| Key | Type | Default | Description |
16+
|-----|------|---------|-------------|
17+
| jupyterhub.cull.enabled | bool | false, so pods stay running indefinitely d | Enable culling of user pods |
18+
| jupyterhub.hub.config.Authenticator.admin_users[0] | string | `"admin"` | |
19+
| jupyterhub.hub.config.DummyAuthenticator.password | string | `"SuperSecret"` | |
20+
| jupyterhub.hub.config.JupyterHub.authenticator_class | string | `"dummy"` | |
21+
| jupyterhub.hub.config.KubeSpawner.fs_gid | int | `0` | |
22+
| jupyterhub.hub.config.KubeSpawner.http_timeout | int | `120` | |
23+
| jupyterhub.hub.config.KubeSpawner.notebook_dir | string | `"/home/jovyan/work"` | |
24+
| jupyterhub.hub.config.KubeSpawner.start_timeout | int | `300` | |
25+
| jupyterhub.hub.config.KubeSpawner.uid | int | `0` | |
26+
| jupyterhub.hub.config.Spawner.default_url | string | `"/lab/"` | |
27+
| jupyterhub.hub.config.Spawner.notebook_dir | string | `"/home/jovyan/work"` | |
28+
| jupyterhub.hub.extraConfig | object | `{"00-custom-spawner":"# Custom environment variables for user pods\nc.KubeSpawner.environment = {\n 'GRANT_SUDO': '1',\n 'CHOWN_HOME': 'yes',\n 'CHOWN_HOME_OPTS': '-R',\n}\n# Allow root in notebooks\nc.KubeSpawner.args = ['--allow-root']\n"}` | Extra hub configuration for custom spawner settings |
29+
| jupyterhub.hub.extraConfig.00-log-level | string | `"c.Application.log_level = 'DEBUG'\n"` | |
30+
| jupyterhub.hub.image.name | string | `"cogstacksystems/jupyter-hub"` | Image repository for the JupyterHub hub. |
31+
| jupyterhub.hub.image.pullPolicy | string | `"IfNotPresent"` | Pull policy for the JupyterHub hub. |
32+
| jupyterhub.hub.image.tag | string | `"2.2.2"` | Image tag for the JupyterHub hub. |
33+
| jupyterhub.prePuller.continuous.enabled | bool | `false` | |
34+
| jupyterhub.prePuller.hook | object | `{"enabled":false}` | Enable pulling the singleuser image before they are used to improve startup time |
35+
| jupyterhub.proxy.service.type | string | `"ClusterIP"` | |
36+
| jupyterhub.scheduling.userScheduler.replicas | int | `1` | |
37+
| jupyterhub.singleuser.cmd[0] | string | `"jupyterhub-singleuser"` | |
38+
| jupyterhub.singleuser.extraPodConfig | object | `{"securityContext":{"runAsGroup":0,"runAsUser":0}}` | Extra arguments passed to jupyterhub-singleuser |
39+
| jupyterhub.singleuser.fsGid | int | `0` | |
40+
| jupyterhub.singleuser.image.name | string | `"cogstacksystems/jupyter-singleuser"` | |
41+
| jupyterhub.singleuser.image.pullPolicy | string | `"IfNotPresent"` | |
42+
| jupyterhub.singleuser.image.tag | string | `"2.2.2"` | |
43+
| jupyterhub.singleuser.lifecycleHooks.postStart | object | `{"exec":{"command":["sh","-c","if [ ! -f /home/jovyan/work/.notebooks_initialized ]; then\n echo \"First run - copying notebooks and medcat-scripts...\";\n cp -r /srv/jupyterhub/notebooks/* /home/jovyan/work/;\n cp -r /srv/jupyterhub/medcat-scripts /home/jovyan/work/;\n touch /home/jovyan/work/.notebooks_initialized;\n echo \"Notebooks initialized successfully\";\nelse\n echo \"Notebooks already initialized - skipping\";\nfi\n"]}}` | Lifecycle hook to copy notebooks from image to PVC on first run |
44+
| jupyterhub.singleuser.networkPolicy.enabled | bool | `false` | |
45+
| jupyterhub.singleuser.startTimeout | int | `600` | |
46+
| jupyterhub.singleuser.storage.capacity | string | `"5Gi"` | Capacity of the storage for the user pods. |
47+
| jupyterhub.singleuser.storage.extraVolumeMounts.jupyter-examples.mountPath | string | `"/home/jovyan/work/examples"` | |
48+
| jupyterhub.singleuser.storage.extraVolumeMounts.jupyter-examples.name | string | `"jupyter-examples"` | |
49+
| jupyterhub.singleuser.storage.extraVolumeMounts.jupyter-examples.readOnly | bool | `true` | |
50+
| jupyterhub.singleuser.storage.extraVolumes | object | `{"jupyter-examples":{"configMap":{"name":"jupyter-examples"},"name":"jupyter-examples"}}` | NOTE: Prefer dictionary-form here to avoid Helm merge issues when this subchart is configured by a parent chart. |
51+
| jupyterhub.singleuser.uid | int | `0` | |
52+
53+
----------------------------------------------
54+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{ template "chart.header" . }}
2+
{{ template "chart.deprecationWarning" . }}
3+
4+
{{ template "chart.badgesSection" . }}
5+
6+
{{ template "chart.description" . }}
7+
8+
{{ template "chart.homepageLine" . }}
9+
10+
{{ template "chart.maintainersSection" . }}
11+
12+
{{ template "chart.sourcesSection" . }}
13+
14+
{{ template "chart.requirementsSection" . }}
15+
16+
{{ template "chart.valuesSection" . }}
17+
18+
{{ template "helm-docs.versionFooter" . }}

helm-charts/cogstack-helm-ce/charts/jupyterhub/values.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
jupyterhub:
33
hub:
44
image:
5+
# -- Image repository for the JupyterHub hub.
56
name: cogstacksystems/jupyter-hub
7+
# -- Image tag for the JupyterHub hub.
68
tag: "2.2.2"
9+
# -- Pull policy for the JupyterHub hub.
710
pullPolicy: IfNotPresent
811
extraConfig:
912
00-log-level: |
@@ -28,7 +31,7 @@ jupyterhub:
2831
default_url: /lab/
2932
notebook_dir: /home/jovyan/work
3033

31-
# Extra hub configuration for custom spawner settings
34+
# -- Extra hub configuration for custom spawner settings
3235
extraConfig:
3336
00-custom-spawner: |
3437
# Custom environment variables for user pods
@@ -48,8 +51,8 @@ jupyterhub:
4851
name: cogstacksystems/jupyter-singleuser
4952
tag: "2.2.2"
5053
pullPolicy: IfNotPresent
51-
# Lifecycle hook to copy notebooks from image to PVC on first run
5254
lifecycleHooks:
55+
# -- Lifecycle hook to copy notebooks from image to PVC on first run
5356
postStart:
5457
exec:
5558
command:
@@ -73,15 +76,16 @@ jupyterhub:
7376
fsGid: 0
7477
cmd: ["jupyterhub-singleuser"]
7578

76-
# Extra arguments passed to jupyterhub-singleuser
79+
# -- Extra arguments passed to jupyterhub-singleuser
7780
extraPodConfig:
7881
securityContext:
7982
runAsUser: 0
8083
runAsGroup: 0
8184

8285
storage:
86+
# -- Capacity of the storage for the user pods.
8387
capacity: 5Gi
84-
# NOTE: Prefer dictionary-form here to avoid Helm merge issues
88+
# -- NOTE: Prefer dictionary-form here to avoid Helm merge issues
8589
# when this subchart is configured by a parent chart.
8690
extraVolumes:
8791
jupyter-examples:
@@ -94,11 +98,14 @@ jupyterhub:
9498
mountPath: /home/jovyan/work/examples
9599
readOnly: true
96100
cull:
101+
# -- Enable culling of user pods
102+
# @default -- false, so pods stay running indefinitely
97103
enabled: false
98104
scheduling:
99105
userScheduler:
100106
replicas: 1
101107
prePuller:
108+
# -- Enable pulling the singleuser image before they are used to improve startup time
102109
hook:
103110
enabled: false
104111
continuous:

0 commit comments

Comments
 (0)