From e3bf310ca10d3496b1b357f56e7ab9322707ac33 Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Tue, 24 Feb 2026 16:37:28 +0000 Subject: [PATCH 1/8] build(helm): Fix helm chart testing list-changed. Bump trainer version --- .github/workflows/kubernetes-charts-build.yaml | 11 +++++++---- .../kubernetes/charts/medcat-trainer-helm/Chart.yaml | 2 +- .../kubernetes/charts/medcat-trainer-helm/values.yaml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/kubernetes-charts-build.yaml b/.github/workflows/kubernetes-charts-build.yaml index 7c64764..821e1db 100644 --- a/.github/workflows/kubernetes-charts-build.yaml +++ b/.github/workflows/kubernetes-charts-build.yaml @@ -39,15 +39,17 @@ jobs: - name: Run chart-testing (list-changed) id: list-changed + working-directory: . run: | - changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch}}) + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }} --chart-dirs deployment/kubernetes/charts) if [[ -n "$changed" ]]; then - echo "changed=true" >> "$GITHUB_UTPUT" + echo "changed=true" >> "$GITHUB_OUTPUT" fi - name: Run chart-testing (lint) if: steps.list-changed.outputs.changed == 'true' - run: ct lint --target-branch ${{ github.event.repository.default_branch }} + working-directory: . + run: ct lint --target-branch ${{ github.event.repository.default_branch }} --chart-dirs deployment/kubernetes/charts - name: Create kind cluster if: steps.list-changed.outputs.changed == 'true' @@ -55,7 +57,8 @@ jobs: - name: Run chart-testing (install) if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} + working-directory: . + run: ct install --target-branch ${{ github.event.repository.default_branch }} --chart-dirs deployment/kubernetes/charts helm-publish: runs-on: ubuntu-latest diff --git a/deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml b/deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml index 9a74ccd..e77569a 100644 --- a/deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml +++ b/deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml @@ -21,7 +21,7 @@ version: 0.0.1 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "latest" +appVersion: "3.5.1" # Chart.yaml dependencies: diff --git a/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml b/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml index c2d9f4e..2429111 100644 --- a/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml +++ b/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml @@ -11,7 +11,7 @@ image: # This sets the pull policy for images. pullPolicy: Always # Overrides the image tag whose default is the chart appVersion. - tag: "latest" + # tag: "latest" nginxImage: repository: nginx pullPolicy: IfNotPresent From 4527fec475f5cbaf557b2d94eb0ad879e11c685a Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Tue, 24 Feb 2026 16:49:28 +0000 Subject: [PATCH 2/8] build(helm): Ignore version reuse --- .github/workflows/kubernetes-charts-build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/kubernetes-charts-build.yaml b/.github/workflows/kubernetes-charts-build.yaml index 821e1db..f50b674 100644 --- a/.github/workflows/kubernetes-charts-build.yaml +++ b/.github/workflows/kubernetes-charts-build.yaml @@ -49,6 +49,8 @@ jobs: - name: Run chart-testing (lint) if: steps.list-changed.outputs.changed == 'true' working-directory: . + env: + CT_CHECK_VERSION_INCREMENT: "false" run: ct lint --target-branch ${{ github.event.repository.default_branch }} --chart-dirs deployment/kubernetes/charts - name: Create kind cluster From 8ac4d42101e74e11d47e42807a1cb8f46008b2b2 Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Tue, 24 Feb 2026 16:54:52 +0000 Subject: [PATCH 3/8] build(helm): Update helm action versions --- .github/workflows/kubernetes-charts-build.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/kubernetes-charts-build.yaml b/.github/workflows/kubernetes-charts-build.yaml index f50b674..a5f811b 100644 --- a/.github/workflows/kubernetes-charts-build.yaml +++ b/.github/workflows/kubernetes-charts-build.yaml @@ -20,22 +20,20 @@ jobs: if: github.event.pull_request.user.login != 'dependabot[bot]' && github.repository == 'CogStack/cogstack-platform-toolkit' steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v5.0.0 with: fetch-depth: 0 - name: Set up Helm - uses: azure/setup-helm@v4.3.0 - with: - version: v3.18.3 + uses: azure/setup-helm@v4.3.1 - - uses: actions/setup-python@v5.3.0 + - uses: actions/setup-python@v6.0.0 with: python-version: '3.x' check-latest: true - name: Set up chart-testing - uses: helm/chart-testing-action@v2.7.0 + uses: helm/chart-testing-action@v2.8.0 - name: Run chart-testing (list-changed) id: list-changed From 1afc6823b234736607df994a6930e6d74a50bcd1 Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Tue, 24 Feb 2026 17:09:41 +0000 Subject: [PATCH 4/8] build(helm): Fix lint errors and format yaml --- .../charts/medcat-trainer-helm/Chart.yaml | 18 +++++--- .../charts/medcat-trainer-helm/values.yaml | 46 +++++++++---------- 2 files changed, 34 insertions(+), 30 deletions(-) diff --git a/deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml b/deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml index e77569a..1f75d14 100644 --- a/deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml +++ b/deployment/kubernetes/charts/medcat-trainer-helm/Chart.yaml @@ -23,12 +23,16 @@ version: 0.0.1 # It is recommended to use it with quotes. appVersion: "3.5.1" +maintainers: + - name: alhendrickson + email: alistair@cogstack.org + # Chart.yaml dependencies: -- name: solr - version: "9.6.10" - repository: "oci://registry-1.docker.io/bitnamicharts" -- name: postgresql - version: 16.7.27 - repository: "oci://registry-1.docker.io/bitnamicharts" - condition: postgresql.enabled + - name: solr + version: "9.6.10" + repository: "oci://registry-1.docker.io/bitnamicharts" + - name: postgresql + version: 16.7.27 + repository: "oci://registry-1.docker.io/bitnamicharts" + condition: postgresql.enabled diff --git a/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml b/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml index 2429111..10a0dde 100644 --- a/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml +++ b/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml @@ -55,7 +55,7 @@ postgresql: repository: bitnamilegacy/postgresql # Pin legacy version of postgresql following bitnami change to remove free images. Match prefect version tag: 17.6.0-debian-12-r4 - + persistence: media: # Size of PVC for files like model packs and other media downloaded by medcat trainer @@ -64,7 +64,7 @@ persistence: # Size of the PVC for the static HTML site size: 100Mi sqlite: - # Size of the PVC for the Sqlite database + # Size of the PVC for the Sqlite database size: 100Mi # Size of the PVC for the Sqlite backups backupDbSize: 300Mi @@ -72,20 +72,20 @@ persistence: # MedCAT config as described here: https://github.com/CogStack/cogstack-nlp/blob/main/medcat-v2/medcat/config/config.py medcatConfig: | - cat.linking.optim = {'type': 'standard', 'lr': 0.1} - cat.linking.filter_before_disamb = True - # 20 - INFO; 10 - DEBUG - cat.general.log_level = 20 - # Recommended is to have this one negative - cat.linking.similarity_threshold = -5 - # And this one to be used as the real th - cat.linking.similarity_threshold_trainer = -5 - # Used for limiting the number of occ of a concept in a project - cat.general.cui_count_limit = 100000000 - # Is unlink full - cat.general.full_unlink = False - # use this spacy model - cat.general.spacy_model = 'en_core_web_md' + cat.linking.optim = {'type': 'standard', 'lr': 0.1} + cat.linking.filter_before_disamb = True + # 20 - INFO; 10 - DEBUG + cat.general.log_level = 20 + # Recommended is to have this one negative + cat.linking.similarity_threshold = -5 + # And this one to be used as the real th + cat.linking.similarity_threshold_trainer = -5 + # Used for limiting the number of occ of a concept in a project + cat.general.cui_count_limit = 100000000 + # Is unlink full + cat.general.full_unlink = False + # use this spacy model + cat.general.spacy_model = 'en_core_web_md' solr: replicaCount: 1 @@ -109,10 +109,10 @@ solr: image: repository: bitnamilegacy/zookeeper tag: 3.9.3-debian-12-r22 - replicaCount: 1 # + replicaCount: 1 persistence: - size: 1Gi # Default is 8Gi - + # Set size of the PVC for zookeper. Default is 8Gi + size: 1Gi # 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/ imagePullSecrets: [] @@ -164,9 +164,10 @@ service: type: ClusterIP # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports port: 8001 - apiPort: 8000 # Note medcat-trainer API is currently hardcoded on 8000 in the run.sh script + # Note medcat-trainer API is currently hardcoded on 8000 in the run.sh script + apiPort: 8000 # nodePort: 30001 - + # This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ ingress: enabled: false @@ -224,7 +225,6 @@ nginx: path: /nginx/health/live port: http - # This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/ autoscaling: enabled: false @@ -253,4 +253,4 @@ tolerations: [] affinity: {} # Runtime class name for the pod (e.g., "nvidia" for GPU workloads) -runtimeClassName: "" \ No newline at end of file +runtimeClassName: "" From 3d2f30ad5ba2890cee0794b6d180133d1fc33188 Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Tue, 24 Feb 2026 17:14:30 +0000 Subject: [PATCH 5/8] build(helm): Trainer - disable example download by default --- deployment/kubernetes/charts/medcat-trainer-helm/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml b/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml index 10a0dde..610ca43 100644 --- a/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml +++ b/deployment/kubernetes/charts/medcat-trainer-helm/values.yaml @@ -26,7 +26,7 @@ env: EMAIL_PORT: "465" EMAIL_USER: "example@cogstack.org" ENV: "non-prod" - LOAD_EXAMPLES: "1" + LOAD_EXAMPLES: "0" LOAD_NUM_DOC_PAGES: "10" MAX_DATASET_SIZE: "10000" MAX_MEDCAT_MODELS: "2" From 8b4e17565c996e07f6ae96853bec19e78d28ae87 Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Tue, 24 Feb 2026 17:16:33 +0000 Subject: [PATCH 6/8] build(helm): Trainer - fix helm test --- .../medcat-trainer-helm/templates/tests/test-connection.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml b/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml index 8a9f4cb..44cee28 100644 --- a/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml +++ b/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml @@ -11,5 +11,5 @@ spec: - name: wget image: busybox command: ['wget'] - args: ['{{ include "medcat-trainer-helm.fullname" . }}-nginx:{{ .Values.service.port }}/nginx/health/live', '-U helm-test {{ .Chart.Name }}-v{{ .Chart.Version }}'] + args: ['{{ include "medcat-trainer-helm.fullname" . }}:{{ .Values.service.port }}/nginx/health/live', '-U helm-test {{ .Chart.Name }}-v{{ .Chart.Version }}'] restartPolicy: Never From 8a9163f9863ef383c0b61a1a2a9bab2b1f3e165f Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Tue, 24 Feb 2026 17:26:41 +0000 Subject: [PATCH 7/8] build(helm): Fix test --- .../templates/tests/test-connection.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml b/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml index 44cee28..d82f0b1 100644 --- a/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml +++ b/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml @@ -10,6 +10,9 @@ spec: containers: - name: wget image: busybox - command: ['wget'] - args: ['{{ include "medcat-trainer-helm.fullname" . }}:{{ .Values.service.port }}/nginx/health/live', '-U helm-test {{ .Chart.Name }}-v{{ .Chart.Version }}'] + command: ['wget', '-q', '--spider'] + args: + - 'http://{{ include "medcat-trainer-helm.fullname" . }}-medcat-trainer:{{ .Values.service.port }}/nginx/health/live' + - '-U' + - 'helm-test {{ .Chart.Name }}-v{{ .Chart.Version }}' restartPolicy: Never From d1417662e2dc04fc3051ebbecdfe98d701ec7331 Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Tue, 24 Feb 2026 17:28:43 +0000 Subject: [PATCH 8/8] build(helm): Trainer - fix helm test --- .../templates/tests/test-connection.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml b/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml index d82f0b1..d03f3b1 100644 --- a/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml +++ b/deployment/kubernetes/charts/medcat-trainer-helm/templates/tests/test-connection.yaml @@ -10,9 +10,6 @@ spec: containers: - name: wget image: busybox - command: ['wget', '-q', '--spider'] - args: - - 'http://{{ include "medcat-trainer-helm.fullname" . }}-medcat-trainer:{{ .Values.service.port }}/nginx/health/live' - - '-U' - - 'helm-test {{ .Chart.Name }}-v{{ .Chart.Version }}' + command: ['wget'] + args: ['{{ include "medcat-trainer-helm.fullname" . }}-medcat-trainer:{{ .Values.service.port }}/nginx/health/live', '-U helm-test {{ .Chart.Name }}-v{{ .Chart.Version }}'] restartPolicy: Never