Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/kubernetes-charts-build.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
name: Kubernetes - Lint, Test, and Publish Helm Charts

on: pull_request
on:
push:
branches: [ main ]
pull_request:
paths:
- 'deployment/kubernetes/**'
- '.github/workflows/kubernetes**'
tags:
- 'v*.*.*' # e.g., v0.1.1

defaults:
run:
working-directory: ./deployment/kubernetes


jobs:
helm-lint-test:
runs-on: ubuntu-latest
Expand All @@ -17,9 +25,9 @@ jobs:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v4.2.0
uses: azure/setup-helm@v4.3.0
with:
version: v3.17.0
version: v3.18.3

- uses: actions/setup-python@v5.3.0
with:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/observability-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: ci-build

on:
push:
branches:
- '**'
branches: [ main ]
pull_request:
paths:
- 'observability/**'
- '.github/workflows/observability**'
tags:
- 'v*.*.*' # e.g., v0.1.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ spec:
selector:
matchLabels:
{{- include "medcat-service.selectorLabels" . | nindent 6 }}
strategy: {{ toYaml .Values.updateStrategy | nindent 4 }}
template:
metadata:
{{- with .Values.podAnnotations }}
Expand Down
30 changes: 26 additions & 4 deletions deployment/kubernetes/charts/medcat-service-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ env:
# DEID_MODE: true
# DEID_REDACT: true

# Set SERVER_GUNICORN_MAX_REQUESTS to a high number instead of the default 1000. Trust k8s instead to restart pod when needed.
SERVER_GUNICORN_MAX_REQUESTS: 1000000

# Recommended env vars to set to try to limit to 1 CPU for scaling
# OMP_NUM_THREADS: "1"
# OPENBLAS_NUM_THREADS: "1"
# MKL_NUM_THREADS: "1"
# VECLIB_MAXIMUM_THREADS: "1"
# NUMEXPR_NUM_THREADS: "1"
# TOKENIZERS_PARALLELISM: "false"
# PYTORCH_ENABLE_MPS_FALLBACK: "1"
# SERVER_GUNICORN_EXTRA_ARGS: "--worker-connections 1 --backlog 1"

# Enable downloading of public models using wget on startup. Model will be downloaded to /models/<name> and used for APP_MEDCAT_MODEL_PACK
model: {}
# Public URL to download a model pack from
Expand All @@ -44,6 +57,14 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

updateStrategy:
# Used for Kubernetes deployment .spec.strategy.type. Allowed values are "Recreate" or "RollingUpdate".
type: RollingUpdate
# RollingUpdate default options example
# rollingUpdate:
# maxSurge: 25%
# maxUnavailable: 25%

# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
serviceAccount:
# Specifies whether a service account should be created
Expand Down Expand Up @@ -108,11 +129,11 @@ resources: {}
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# cpu: 2 # Note one general k8s recommendation is to leave CPU limit unset
# memory: 4Gi
# requests:
# cpu: 100m
# memory: 128Mi
# cpu: 1
# memory: 2Gi

# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
livenessProbe:
Expand All @@ -129,6 +150,7 @@ startupProbe:
port: http
failureThreshold: 30
periodSeconds: 10
initialDelaySeconds: 2

# This section is for setting up autoscaling more information can be found here: https://kubernetes.io/docs/concepts/workloads/autoscaling/
autoscaling:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
matchLabels:
{{- include "medcat-trainer-helm.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: medcat-trainer
strategy: {{ toYaml .Values.updateStrategy | nindent 4 }}
template:
metadata:
{{- with .Values.podAnnotations }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ spec:
matchLabels:
{{- include "medcat-trainer-helm.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: nginx
strategy: {{ toYaml .Values.nginxUpdateStrategy | nindent 4 }}
template:
metadata:
{{- with .Values.podAnnotations }}
Expand Down
8 changes: 8 additions & 0 deletions deployment/kubernetes/charts/medcat-trainer-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

updateStrategy:
# Used for Kubernetes deployment .spec.strategy.type. Allowed values are "Recreate" or "RollingUpdate".
type: RollingUpdate

nginxUpdateStrategy:
# Used for Kubernetes deployment .spec.strategy.type. Allowed values are "Recreate" or "RollingUpdate".
type: RollingUpdate

# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
serviceAccount:
# Specifies whether a service account should be created
Expand Down