-
Notifications
You must be signed in to change notification settings - Fork 2
feat(cogstack-cohorter): Add helm chart for cogstack-cohorter #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ddbd8ad
feat(cogstack-cohorter): Add helm chart for cogstack-cohorter
jocelyneholdbrook 782b53a
feat(cogstack-cohorter): Update helm chart files
jocelyneholdbrook 26abcb4
feat(cogstack-cohorter): Add step to add Ollama Helm repo charts buil…
jocelyneholdbrook 7b4abe2
feat(cogstack-cohorter): Address code review feedback
jocelyneholdbrook 002dc29
feat(cogstack-cohorter): New line required at the end of ci-values.ya…
jocelyneholdbrook 99e596e
feat(cogstack-cohorter): Stub data for CI build
jocelyneholdbrook 86fa83a
feat(cogstack-cohorter): Fix lint errors
jocelyneholdbrook dabd833
feat(cogstack-cohorter): Remove helm repo step from k8s chart build p…
jocelyneholdbrook File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Patterns to ignore when building packages. | ||
| # This supports shell glob matching, relative path matching, and | ||
| # negation (prefixed with !). Only one pattern per line. | ||
| .DS_Store | ||
| # Common VCS dirs | ||
| .git/ | ||
| .gitignore | ||
| .bzr/ | ||
| .bzrignore | ||
| .hg/ | ||
| .hgignore | ||
| .svn/ | ||
| # Common backup files | ||
| *.swp | ||
| *.bak | ||
| *.tmp | ||
| *.orig | ||
| *~ | ||
| # Various IDEs | ||
| .project | ||
| .idea/ | ||
| *.tmproj | ||
| .vscode/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| dependencies: | ||
| - name: medcat-service-helm | ||
| repository: oci://registry-1.docker.io/cogstacksystems | ||
| version: 0.0.1 | ||
| - name: ollama | ||
| repository: https://otwld.github.io/ollama-helm/ | ||
| version: 1.54.0 | ||
| digest: sha256:c19deffe7da9495af6f74b6a6bb26157bf7faf6abac6be8fc94638deff3bc6d3 | ||
| generated: "2026-04-16T14:51:41.6563526+01:00" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| apiVersion: v2 | ||
| name: cogstack-cohorter-helm | ||
| description: CogStack Cohorter — cohort identification powered by Ollama and MedCAT | ||
| type: application | ||
| version: 0.0.1 | ||
| appVersion: "latest" | ||
|
|
||
| maintainers: | ||
| - name: jocelyneholdbrook | ||
| email: jocelyne@cogstack.org | ||
|
|
||
| icon: "https://avatars.githubusercontent.com/u/28688163" | ||
|
|
||
| dependencies: | ||
| # MedCAT annotation service | ||
| - name: medcat-service-helm | ||
| version: "0.0.1" | ||
| repository: "oci://registry-1.docker.io/cogstacksystems" | ||
| alias: medcat | ||
| condition: medcat.enabled | ||
|
|
||
| # Ollama LLM serving — https://github.com/otwld/ollama-helm | ||
| - name: ollama | ||
| version: ">=0.1.0" | ||
| repository: "https://otwld.github.io/ollama-helm/" | ||
| alias: ollama | ||
| condition: ollama.enabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,225 @@ | ||
| # CogStack Cohorter Helm Chart | ||
|
|
||
| CogStack Cohorter — cohort identification powered by Ollama and MedCAT | ||
|
|
||
| ## Architecture | ||
|
|
||
| | Component | Image | Description | | ||
| |-----------|-------|-------------| | ||
| | **WebApp** | `cogstacksystems/cogstack-cohorter-webapp` | React + Node.js frontend and API | | ||
| | **NL2DSL** | `cogstacksystems/cogstack-cohorter-nl2dsl` | Natural language → cohort DSL compiler | | ||
| | **MedCAT** | `cogstacksystems/medcat-service` | Clinical NER and concept normalisation (subchart) | | ||
| | **Ollama** | `ollama/ollama` | LLM serving backend (subchart) | | ||
|
|
||
| MedCAT and Ollama are deployed as **subcharts**: | ||
| - MedCAT: [`cogstacksystems/medcat-service-helm`](https://hub.docker.com/r/cogstacksystems/medcat-service-helm) (OCI) | ||
| - Ollama: [`otwld/ollama`](https://github.com/otwld/ollama-helm) | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Kubernetes 1.21+ | ||
| - Helm 3.10+ | ||
| - Sufficient node resources for the Ollama model (the default `gpt-oss:20b` requires ~14 GB of memory/VRAM) | ||
|
|
||
| ## Installation | ||
|
|
||
| From Docker Hub OCI (published chart): | ||
|
|
||
| ```bash | ||
| helm install cogstack-cohorter oci://registry-1.docker.io/cogstacksystems/cogstack-cohorter-helm | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| All configurable values are in [`values.yaml`](./values.yaml). Key sections: | ||
|
|
||
| ### Ollama | ||
|
|
||
| ```yaml | ||
| ollama: | ||
| enabled: true | ||
| ollama: | ||
| models: | ||
| pull: | ||
| - gpt-oss:20b # pulled automatically on first startup | ||
| persistentVolume: | ||
| enabled: true | ||
| size: 10Gi | ||
| ``` | ||
|
|
||
| Models are pulled automatically by the otwld subchart's built-in init container. Change `ollama.ollama.models.pull` to use a different model — make sure `nl2dsl.env.OLLAMA_MODEL` matches. | ||
|
|
||
| ### MedCAT | ||
|
|
||
| ```yaml | ||
| medcat: | ||
| enabled: true | ||
| env: | ||
| APP_MEDCAT_MODEL_PACK: "/cat/models/examples/example-medcat-v2-model-pack.zip" | ||
| ``` | ||
|
|
||
| To use a custom model pack, provide a download URL: | ||
|
|
||
| ```yaml | ||
| medcat: | ||
| model: | ||
| downloadUrl: "https://your-host/medcat_model_pack.zip" | ||
| name: "medcat_model_pack.zip" | ||
| ``` | ||
|
|
||
| ### WebApp data volume | ||
|
|
||
| The WebApp requires a SNOMED data directory mounted at `/usr/src/app/server/data`. A PVC is provisioned automatically: | ||
|
|
||
| ```yaml | ||
| webapp: | ||
| persistence: | ||
| enabled: true | ||
| size: 5Gi | ||
| ``` | ||
|
|
||
| Populate the PVC with either: | ||
| - `snomed_terms_data.tar.gz` — auto-extracted by the entrypoint on first startup, or | ||
| - Pre-extracted files: `snomed_terms.json`, `cui_pt2ch.json`, and patient data files | ||
|
|
||
| To generate synthetic patient data on first startup (demo mode): | ||
|
|
||
| ```yaml | ||
| webapp: | ||
| env: | ||
| RANDOM_DATA: "true" | ||
| ``` | ||
|
|
||
| ### Ingress | ||
|
|
||
| ```yaml | ||
| ingress: | ||
| enabled: true | ||
| className: nginx | ||
| hosts: | ||
| - host: cohorter.example.com | ||
| paths: | ||
| - path: / | ||
| pathType: ImplementationSpecific | ||
| tls: | ||
| - secretName: cohorter-tls | ||
| hosts: | ||
| - cohorter.example.com | ||
| ``` | ||
|
|
||
| ### Autoscaling (webapp only) | ||
|
|
||
| ```yaml | ||
| autoscaling: | ||
| enabled: true | ||
| minReplicas: 1 | ||
| maxReplicas: 3 | ||
| targetCPUUtilizationPercentage: 80 | ||
| ``` | ||
|
|
||
| ## Uninstallation | ||
|
|
||
| ```bash | ||
| helm uninstall cogstack-cohorter | ||
| ``` | ||
|
|
||
| ## Support | ||
|
|
||
| For issues and questions, please visit the [CogStack GitHub repository](https://github.com/CogStack/cogstack-platform). | ||
|
|
||
| ## Requirements | ||
|
|
||
| | Repository | Name | Version | | ||
| |------------|------|---------| | ||
| | https://otwld.github.io/ollama-helm/ | ollama(ollama) | >=0.1.0 | | ||
| | oci://registry-1.docker.io/cogstacksystems | medcat(medcat-service-helm) | 0.0.1 | | ||
|
|
||
| ## Values | ||
|
|
||
| | Key | Type | Default | Description | | ||
| |-----|------|---------|-------------| | ||
| | autoscaling.enabled | bool | `false` | | | ||
| | autoscaling.maxReplicas | int | `3` | | | ||
| | autoscaling.minReplicas | int | `1` | | | ||
| | autoscaling.targetCPUUtilizationPercentage | int | `80` | | | ||
| | fullnameOverride | string | `""` | | | ||
| | global.imagePullSecrets | list | `[]` | | | ||
| | ingress.annotations | object | `{}` | | | ||
| | ingress.className | string | `""` | | | ||
| | ingress.enabled | bool | `false` | | | ||
| | ingress.hosts[0].host | string | `"cogstack-cohort.local"` | | | ||
| | ingress.hosts[0].paths[0].path | string | `"/"` | | | ||
| | ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | | ||
| | ingress.tls | list | `[]` | | | ||
| | medcat.enabled | bool | `true` | | | ||
| | medcat.env.APP_ENABLE_METRICS | string | `"true"` | | | ||
| | medcat.env.APP_MEDCAT_MODEL_PACK | string | `"/cat/models/examples/example-medcat-v2-model-pack.zip"` | | | ||
| | medcat.image.tag | string | `"latest"` | | | ||
| | medcat.resources | object | `{}` | | | ||
| | medcat.service.port | int | `5000` | | | ||
| | nameOverride | string | `""` | | | ||
| | nl2dsl.affinity | object | `{}` | | | ||
| | nl2dsl.enabled | bool | `true` | | | ||
| | nl2dsl.env.ALLOW_ORIGINS | string | `"*"` | | | ||
| | nl2dsl.env.OLLAMA_MODEL | string | `"gpt-oss:20b"` | | | ||
| | nl2dsl.image.pullPolicy | string | `"IfNotPresent"` | | | ||
| | nl2dsl.image.repository | string | `"cogstacksystems/cogstack-cohorter-nl2dsl"` | | | ||
| | nl2dsl.image.tag | string | `"latest"` | | | ||
| | nl2dsl.livenessProbe.httpGet.path | string | `"/"` | | | ||
| | nl2dsl.livenessProbe.httpGet.port | string | `"http"` | | | ||
| | nl2dsl.livenessProbe.initialDelaySeconds | int | `30` | | | ||
| | nl2dsl.livenessProbe.periodSeconds | int | `10` | | | ||
| | nl2dsl.nodeSelector | object | `{}` | | | ||
| | nl2dsl.readinessProbe.httpGet.path | string | `"/"` | | | ||
| | nl2dsl.readinessProbe.httpGet.port | string | `"http"` | | | ||
| | nl2dsl.readinessProbe.initialDelaySeconds | int | `10` | | | ||
| | nl2dsl.readinessProbe.periodSeconds | int | `5` | | | ||
| | nl2dsl.replicaCount | int | `1` | | | ||
| | nl2dsl.resources | object | `{}` | | | ||
| | nl2dsl.service.port | int | `3002` | | | ||
| | nl2dsl.service.type | string | `"ClusterIP"` | | | ||
| | nl2dsl.tolerations | list | `[]` | | | ||
| | ollama.enabled | bool | `true` | | | ||
| | ollama.ollama.models.pull[0] | string | `"gpt-oss:20b"` | | | ||
| | ollama.persistentVolume.enabled | bool | `true` | | | ||
| | ollama.persistentVolume.size | string | `"10Gi"` | | | ||
| | ollama.persistentVolume.storageClass | string | `""` | | | ||
| | ollama.resources | object | `{}` | | | ||
| | ollama.service.port | int | `11434` | | | ||
| | ollama.service.type | string | `"ClusterIP"` | | | ||
| | podAnnotations | object | `{}` | | | ||
| | podLabels | object | `{}` | | | ||
| | podSecurityContext | object | `{}` | | | ||
| | securityContext | object | `{}` | | | ||
| | serviceAccount.annotations | object | `{}` | | | ||
| | serviceAccount.automount | bool | `true` | | | ||
| | serviceAccount.create | bool | `true` | | | ||
| | serviceAccount.name | string | `""` | | | ||
| | webapp.affinity | object | `{}` | | | ||
| | webapp.enabled | bool | `true` | | | ||
| | webapp.env.RANDOM_DATA | string | `"false"` | | | ||
| | webapp.image.pullPolicy | string | `"IfNotPresent"` | | | ||
| | webapp.image.repository | string | `"cogstacksystems/cogstack-cohorter-webapp"` | | | ||
| | webapp.image.tag | string | `"latest"` | | | ||
| | webapp.livenessProbe.httpGet.path | string | `"/"` | | | ||
| | webapp.livenessProbe.httpGet.port | string | `"http"` | | | ||
| | webapp.livenessProbe.initialDelaySeconds | int | `60` | | | ||
| | webapp.livenessProbe.periodSeconds | int | `15` | | | ||
| | webapp.nodeSelector | object | `{}` | | | ||
| | webapp.persistence.accessMode | string | `"ReadWriteOnce"` | | | ||
| | webapp.persistence.enabled | bool | `true` | | | ||
| | webapp.persistence.existingClaim | string | `""` | | | ||
| | webapp.persistence.size | string | `"5Gi"` | | | ||
| | webapp.persistence.storageClass | string | `""` | | | ||
| | webapp.readinessProbe.httpGet.path | string | `"/"` | | | ||
| | webapp.readinessProbe.httpGet.port | string | `"http"` | | | ||
| | webapp.readinessProbe.initialDelaySeconds | int | `30` | | | ||
| | webapp.readinessProbe.periodSeconds | int | `10` | | | ||
| | webapp.replicaCount | int | `1` | | | ||
| | webapp.resources | object | `{}` | | | ||
| | webapp.service.port | int | `3000` | | | ||
| | webapp.service.type | string | `"ClusterIP"` | | | ||
| | webapp.tolerations | list | `[]` | | | ||
|
|
||
| ---------------------------------------------- | ||
| Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we default to a smaller one? So it can demo on small hardware / CI easily - for example the Azure tutorial is bringing up just 4GB nodes - would prefer it running with bad results to then justify additional recommended hardware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah - happy to do this as part of a separate task. Would need to assess what can provide comparable results with less etc. At a glance, I'm thinking medgemma (I've heard David mention this) or qwen 3. thoughts?