Skip to content

Commit 16a21f2

Browse files
committed
feat(helm): Create Cogstack Community Edition Chart
1 parent 41de94f commit 16a21f2

8 files changed

Lines changed: 257 additions & 2 deletions

File tree

.github/workflows/kubernetes-charts-build.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ jobs:
9494
echo "chart_version=$CHART_VERSION" >> "$GITHUB_OUTPUT"
9595
9696
- name: Package Helm Charts
97+
# TODO: List the dir instead of hardcoding each one
9798
run: |
9899
helm package ./charts/medcat-service-helm --version ${{ steps.version.outputs.chart_version }}
99100
helm package ./charts/medcat-trainer-helm --version ${{ steps.version.outputs.chart_version }} --dependency-update
101+
helm package ./charts/cogstack-helm-ce --version ${{ steps.version.outputs.chart_version }} --dependency-update
100102
101103
- name: Helm OCI login to Docker Hub
102104
run: helm registry login registry-1.docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
@@ -105,12 +107,12 @@ jobs:
105107
run: |
106108
helm push ./medcat-service-helm-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
107109
helm push ./medcat-trainer-helm-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
110+
helm push ./cogstack-helm-ce-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
108111
109112
- name: Release
110113
uses: softprops/action-gh-release@v2
111114
if: github.ref_type == 'tag'
112115
with:
113116
draft: true
114117
files: |
115-
./deployment/kubernetes/medcat-service-helm-${{ steps.version.outputs.chart_version }}.tgz
116-
./deployment/kubernetes/medcat-trainer-helm-${{ steps.version.outputs.chart_version }}.tgz
118+
./deployment/kubernetes/*.tgz
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
dependencies:
2+
- name: medcat-service-helm
3+
repository: file://../medcat-service-helm
4+
version: 0.0.1
5+
- name: medcat-service-helm
6+
repository: file://../medcat-service-helm
7+
version: 0.0.1
8+
- name: medcat-trainer-helm
9+
repository: file://../medcat-trainer-helm
10+
version: 0.0.1
11+
digest: sha256:ed3f7c95117421145affc912bbec79151b7dd55062c7358b837074f0e0bf4641
12+
generated: "2026-02-26T12:55:11.318221565Z"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: v2
2+
name: cogstack-helm-ce
3+
description: CogStack Community Edition Helm Chart
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.0.0"
25+
26+
maintainers:
27+
- name: alhendrickson
28+
email: alistair@cogstack.org
29+
30+
dependencies:
31+
- name: medcat-service-helm
32+
alias: medcat-service
33+
version: "0.0.1"
34+
repository: "file://../medcat-service-helm"
35+
- name: medcat-service-helm
36+
alias: anoncat-service
37+
version: "0.0.1"
38+
repository: "file://../medcat-service-helm"
39+
- name: medcat-trainer-helm
40+
version: "0.0.1"
41+
repository: "file://../medcat-trainer-helm"
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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+
From the chart directory (or repo root), update dependencies and install:
23+
24+
```bash
25+
cd deployment/kubernetes/charts/cogstack-helm-ce
26+
helm dependency update
27+
helm install cogstack-ce . --namespace cogstack --create-namespace
28+
```
29+
30+
Or from the repo root:
31+
32+
```bash
33+
helm dependency update deployment/kubernetes/charts/cogstack-helm-ce
34+
helm install cogstack-ce deployment/kubernetes/charts/cogstack-helm-ce --namespace cogstack --create-namespace
35+
```
36+
37+
## Configuration
38+
39+
Key values in `values.yaml`:
40+
41+
| Value | Default | Description |
42+
|-------|---------|-------------|
43+
| `imagePullSecrets` | `[]` | Secrets for pulling images from a private registry. |
44+
| `nameOverride` | `""` | Override the chart name used in resource names. |
45+
| `fullnameOverride` | `""` | Override the full name used in resource names. |
46+
| `medcat-service.replicasCount` | `1` | Number of MedCAT service replicas. |
47+
| `anoncat-service.replicasCount` | `1` | Number of AnonCAT service replicas. |
48+
| `anoncat-service.env.APP_ENABLE_DEMO_UI` | `true` | Enable AnonCAT demo UI. |
49+
| `anoncat-service.env.DEID_MODE` | `true` | Run AnonCAT in de-identification mode. |
50+
| `anoncat-service.env.DEID_REDACT` | `false` | Redaction behaviour for de-identification. |
51+
52+
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.*`).
53+
54+
Example override file:
55+
56+
```yaml
57+
# my-values.yaml
58+
medcat-service:
59+
replicasCount: 2
60+
anoncat-service:
61+
replicasCount: 1
62+
env:
63+
APP_ENABLE_DEMO_UI: true
64+
DEID_MODE: true
65+
```
66+
67+
Install with overrides:
68+
69+
```bash
70+
helm install cogstack-ce . -f my-values.yaml --namespace cogstack --create-namespace
71+
```
72+
73+
## Dependencies
74+
75+
The chart uses local subcharts via relative paths:
76+
77+
- `medcat-service-helm` (as `medcat-service` and `anoncat-service`)
78+
- `medcat-trainer-helm`
79+
80+
## Uninstall
81+
82+
```bash
83+
helm uninstall cogstack-ce --namespace cogstack
84+
```
85+
86+
If the namespace was created only for this release, remove it with:
87+
88+
```bash
89+
kubectl delete namespace cogstack
90+
```

deployment/kubernetes/charts/cogstack-helm-ce/templates/NOTES.txt

Whitespace-only changes.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "cogstack-helm-ce.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "cogstack-helm-ce.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "cogstack-helm-ce.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "cogstack-helm-ce.labels" -}}
37+
helm.sh/chart: {{ include "cogstack-helm-ce.chart" . }}
38+
{{ include "cogstack-helm-ce.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "cogstack-helm-ce.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "cogstack-helm-ce.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "cogstack-helm-ce.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "cogstack-helm-ce.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Default values for cogstack-helm-ce.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
# 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/
6+
imagePullSecrets: []
7+
# This is to override the chart name.
8+
nameOverride: ""
9+
fullnameOverride: ""
10+
11+
anoncat-service:
12+
replicasCount: 1
13+
env:
14+
APP_MEDCAT_MODEL_PACK: "/cat/models/examples/example-deid-model-pack.zip"
15+
DEID_MODE: true
16+
DEID_REDACT: false
17+
image:
18+
repository: cogstacksystems/medcat-service
19+
tag: "1.2.0"
20+
21+
medcat-service:
22+
replicasCount: 1
23+
image:
24+
repository: cogstacksystems/medcat-service
25+
tag: "1.2.0"

0 commit comments

Comments
 (0)