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
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "medcat-trainer-helm.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "medcat-trainer-helm.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=medcat-trainer" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "medcat-trainer-helm.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[?(@.name==\"nginx\")].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ data:
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
autorestart=true
autorestart=true
{{- if and .Values.provisioning .Values.provisioning.enabled }}
provisioning.yaml: |
{{ toYaml .Values.provisioning.config | indent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ spec:
name: api-media
- mountPath: /home/api/static
name: api-static
{{- if and .Values.provisioning .Values.provisioning.enabled }}
- mountPath: /home/configs/provisioning.yaml
name: medcat-trainer-config
subPath: provisioning.yaml
{{- end }}
{{- if eq .Values.DB_ENGINE "sqlite3" }}
- mountPath: /home/api/db
name: api-db
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ data:
DB_PATH: "/home/api/db/db.sqlite3"
MCT_VERSION: {{ .Values.image.tag | default .Chart.AppVersion }}
API_URL: http://localhost:{{ .Values.service.apiPort }}/api/
{{- if and .Values.provisioning .Values.provisioning.enabled }}
LOAD_EXAMPLES: "1"
PROVISIONING_CONFIG_PATH: "/home/configs/provisioning.yaml"
{{- end }}
{{- range $key, $value := .Values.env }}
{{ $key }}: {{ $value | quote }}
{{- end }}
19 changes: 18 additions & 1 deletion deployment/kubernetes/charts/medcat-trainer-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ env:
EMAIL_PORT: "465"
EMAIL_USER: "example@cogstack.org"
ENV: "non-prod"
LOAD_EXAMPLES: "0"
LOAD_NUM_DOC_PAGES: "10"
MAX_DATASET_SIZE: "10000"
MAX_MEDCAT_MODELS: "2"
Expand All @@ -40,6 +39,24 @@ env:
DB_ENGINE: "postgresql"
DB_PORT: "5432"

provisioning:
# -- Set to true to enable provisioning of projects and models on startup..
enabled: false
# -- Put yaml file contents here.See https://docs.cogstack.org/projects/medcat-trainer/en/latest/provisioning/
config:
projects:
- dataset:
name: "Example Dataset - psych.csv"
url: "https://raw.githubusercontent.com/CogStack/cogstack-nlp/be9825f151da2d3b6faac80d49e5be91a1629c68/medcat-trainer/notebook_docs/example_data/psych.csv"
description: "Dataset from https://raw.githubusercontent.com/CogStack/cogstack-nlp/be9825f151da2d3b6faac80d49e5be91a1629c68/medcat-trainer/notebook_docs/example_data/psych.csv"
modelPack:
name: "Example Model Pack"
url: "https://github.com/CogStack/cogstack-nlp/raw/be9825f151da2d3b6faac80d49e5be91a1629c68/medcat-service/models/examples/example-medcat-v2-model-pack.zip"
project:
name: "Example Project"
description: "Example project for medcat trainer"
annotationGuidelineLink: "https://docs.google.com/document/d/1xxelBOYbyVzJ7vLlztP2q1Kw9F5Vr1pRwblgrXPS7QM/edit?usp=sharing"

postgresql:
enabled: true
# TODO: Support custom DB overrides
Expand Down
2 changes: 1 addition & 1 deletion deployment/kubernetes/local_dev_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ helm test medcat-service --logs
# Test medcat trainer
# kubectl port-forward svc/nginx 8000:8000

# helm upgrade x ./medcat-trainer-helm --install --wait --timeout 5m0s # Install if it doesnt already exist, else upgrade
# helm upgrade medcat-trainer-helm ./medcat-trainer-helm --install --wait --timeout 5m0s # Install if it doesnt already exist, else upgrade
# kubectl port-forward svc/medcat-trainer-solr 8983:8983

## helm install trainer-registry oci://registry-1.docker.io/cogstacksystems/medcat-trainer-helm --wait --timeout 5m0s
Expand Down
Loading