diff --git a/deploy/helm-charts/Chart.lock b/deploy/helm-charts/Chart.lock new file mode 100644 index 0000000..5a58f68 --- /dev/null +++ b/deploy/helm-charts/Chart.lock @@ -0,0 +1,9 @@ +dependencies: +- name: argo-workflows + repository: https://argoproj.github.io/argo-helm + version: 0.33.1 +- name: local-path-provisioner + repository: https://charts.containeroo.ch + version: 0.0.24 +digest: sha256:6c6f22833d7b04577238156ef04787025ff112a3fce93e1b7aef4664cf483b4b +generated: "2023-09-01T14:33:33.804030468-07:00" diff --git a/deploy/helm-charts/Chart.yaml b/deploy/helm-charts/Chart.yaml new file mode 100644 index 0000000..b2e52de --- /dev/null +++ b/deploy/helm-charts/Chart.yaml @@ -0,0 +1,38 @@ +apiVersion: v2 +name: monai-deploy +description: MONAI Deploy for local deployment +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# 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: "0.1.0" +keywords: + - ai + - dicom + - dicomweb + - ehr + - emr + - fhir + - healthcare + - hl7 + - monai-deploy + - medical-imaging + - radiology +home: https://github.com/Project-MONAI/monai-deploy +sources: + - https://github.com/Project-MONAI/monai-deploy-informatics-gateway + - https://github.com/Project-MONAI/monai-deploy-workflow-manager/ +dependencies: + - name: argo-workflows + version: 0.33.1 + repository: https://argoproj.github.io/argo-helm + - name: local-path-provisioner + version: 0.0.24 + repository: https://charts.containeroo.ch diff --git a/deploy/helm-charts/README b/deploy/helm-charts/README new file mode 100644 index 0000000..92ca865 --- /dev/null +++ b/deploy/helm-charts/README @@ -0,0 +1,75 @@ +# MONAI Deploy Helm Charts + + +## Install Tools +```bash +# Install kubernetes tools +sudo apt-get install -y -q kubelet kubectl kubeadm +sudo apt-mark hold kubelet kubeadm kubectl + +# Install Helm +curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash +``` + +## Installing Kubernetes +Select one of the following Kubernetes distribution: +- [k3s](https://k3s.io/) + ```bash + curl -sfL https://get.k3s.io | sh -s - --flannel-backend host-gw --flannel-external-i + # Copy default configuration + mkdir -p $HOME/.kube + sudo cp -i /etc/rancher/k3s/k3s.yaml $HOME/.kube/config + sudo chown $(id -u):$(id -g) $HOME/.kube/config + ``` + +- [K8s](https://kubernetes.io/) + ```bash + kubeadm init --pod-network-cidr=192.168.0.0/16 + # Copy default configuration + mkdir -p $HOME/.kube + sudo cp -i /etc/rancher/k3s/k3s.yaml $HOME/.kube/config + sudo chown $(id -u):$(id -g) $HOME/.kube/config + + kubectl taint nodes --all node-role.kubernetes.io/control-plane- + + ``` + +# Install MONAI Deploy + +Build & download dependencies + +```bash +helm dependency build +``` + +If you are reinstalling, run the following to remove existing `local-path-provisioner` Storage Class: + +```bash +kubectl delete StorageClass local-path +``` + +Install: + +```bash +helm upgrade -i monai-deploy . +``` + +Upon successfully installation, optinally follow the on screen instructions to initialize Informatics Gateway & Orthanc. + +Uninstall: +``` +helm uninstall monai-deploy +``` + + +## Advanced Configuration + +Most of the configurations may be found in the following files: + +- `values.yaml`: contains container image repo, application secrets, ports, etc... +- `files/informatics-gateway.json`: Informatics Gateway specific configurations... +- `files/workflow-manager.json`: Workflow Manager specific configurations... +- `files/task-manager.json`: Task Manager specific configurations... +- `files/orthanc.json`: Orthanc specific configurations... + +# \ No newline at end of file diff --git a/deploy/helm-charts/charts/.gitignore b/deploy/helm-charts/charts/.gitignore new file mode 100644 index 0000000..9e30eb9 --- /dev/null +++ b/deploy/helm-charts/charts/.gitignore @@ -0,0 +1 @@ +*.tgz \ No newline at end of file diff --git a/deploy/helm-charts/files/informatics-gateway.json b/deploy/helm-charts/files/informatics-gateway.json new file mode 100644 index 0000000..0ef34ef --- /dev/null +++ b/deploy/helm-charts/files/informatics-gateway.json @@ -0,0 +1,85 @@ +{ + "MonaiDeployAuthentication": { + "bypassAuthentication": true + }, + "ConnectionStrings": { + "Type": "mongodb", + "DatabaseName": "InformaticsGateway" + }, + "InformaticsGateway": { + "dicom": { + "scp": { + "port": 104, + "logDimseDatasets": false, + "rejectUnknownSources": true + }, + "scu": { + "aeTitle": "MONAISCU", + "logDimseDatasets": false, + "logDataPDUs": false + } + }, + "messaging": { + "publisherServiceAssemblyName": "Monai.Deploy.Messaging.RabbitMQ.RabbitMQMessagePublisherService, Monai.Deploy.Messaging.RabbitMQ", + "publisherSettings": { + "exchange": "monaideploy" + }, + "subscriberServiceAssemblyName": "Monai.Deploy.Messaging.RabbitMQ.RabbitMQMessageSubscriberService, Monai.Deploy.Messaging.RabbitMQ", + "subscriberSettings": { + "exchange": "monaideploy", + "exportRequestQueue": "export_tasks", + "deadLetterExchange": "monaideploy-dead-letter", + "deliveryLimit": 3, + "requeueDelay": 30 + } + }, + "storage": { + "localTemporaryStoragePath": "/payloads", + "remoteTemporaryStoragePath": "/incoming", + "bucketName": "monaideploy", + "storageRootPath": "/payloads", + "temporaryBucketName": "monaideploy", + "serviceAssemblyName": "Monai.Deploy.Storage.MinIO.MinIoStorageService, Monai.Deploy.Storage.MinIO", + "watermarkPercent": 75, + "reserveSpaceGB": 5, + "settings": { + "securedConnection": false, + "region": "local", + "executableLocation": "/bin/mc", + "serviceName": "MinIO", + "createBuckets": "monaideploy" + } + }, + "hl7": { + "port": 2575, + "maximumNumberOfConnections": 10, + "clientTimeout": 60000, + "sendAck": true + }, + "dicomWeb": { + "plugins": [] + }, + "plugins": { + "remoteApp": { + "ReplaceTags": "AccessionNumber" + } + } + }, + "Kestrel": { + "EndPoints": { + "Http": { + "Url": "http://+:5000" + } + } + }, + "AllowedHosts": "*", + "Cli": { + "Runner": "Docker", + "HostDataStorageMount": "~/.mig/data", + "HostPlugInsStorageMount": "~/.mig/plug-ins", + "HostDatabaseStorageMount": "~/.mig/database", + "HostLogsStorageMount": "~/.mig/logs", + "InformaticsGatewayServerEndpoint": "http://localhost:5000", + "DockerImagePrefix": "ghcr.io/project-monai/monai-deploy-informatics-gateway" + } + } \ No newline at end of file diff --git a/deploy/helm-charts/files/orthanc.json b/deploy/helm-charts/files/orthanc.json new file mode 100644 index 0000000..964c9fd --- /dev/null +++ b/deploy/helm-charts/files/orthanc.json @@ -0,0 +1,84 @@ +{ + "Name": "Orthanc", + "StorageDirectory": "/var/lib/orthanc/db", + "IndexDirectory": "/var/lib/orthanc/db", + "StorageCompression": false, + "MaximumStorageSize": 0, + "MaximumPatientCount": 0, + "LuaScripts": [], + "Plugins": [ + "/usr/share/orthanc/plugins", + "/usr/local/share/orthanc/plugins" + ], + "ConcurrentJobs": 2, + "HttpServerEnabled": true, + "HttpPort": 8042, + "HttpDescribeErrors": true, + "HttpCompressionEnabled": true, + "DicomServerEnabled": true, + "DicomCheckCalledAet": false, + "DicomPort": 4242, + "DefaultEncoding": "Latin1", + "DeflatedTransferSyntaxAccepted": true, + "JpegTransferSyntaxAccepted": true, + "Jpeg2000TransferSyntaxAccepted": true, + "JpegLosslessTransferSyntaxAccepted": true, + "JpipTransferSyntaxAccepted": true, + "Mpeg2TransferSyntaxAccepted": true, + "RleTransferSyntaxAccepted": true, + "UnknownSopClassAccepted": true, + "DicomScpTimeout": 30, + "RemoteAccessAllowed": true, + "SslEnabled": false, + "SslCertificate": "certificate.pem", + "AuthenticationEnabled": false, + "DicomModalitiesInDatabase": false, + "DicomAlwaysAllowEcho": true, + "DicomAlwaysAllowStore": true, + "DicomCheckModalityHost": false, + "DicomScuTimeout": 10, + "OrthancPeers": {}, + "OrthancPeersInDatabase": false, + "HttpProxy": "", + "HttpVerbose": true, + "HttpTimeout": 10, + "HttpsVerifyPeers": true, + "HttpsCACertificates": "", + "UserMetadata": {}, + "UserContentType": {}, + "StableAge": 60, + "StrictAetComparison": false, + "StoreMD5ForAttachments": true, + "LimitFindResults": 0, + "LimitFindInstances": 0, + "LimitJobs": 10, + "LogExportedResources": false, + "KeepAlive": true, + "TcpNoDelay": true, + "HttpThreadsCount": 50, + "StoreDicom": true, + "DicomAssociationCloseDelay": 5, + "QueryRetrieveSize": 10, + "CaseSensitivePN": false, + "LoadPrivateDictionary": true, + "Dictionary": {}, + "SynchronousCMove": true, + "JobsHistorySize": 10, + "SaveJobs": true, + "OverwriteInstances": true, + "MediaArchiveSize": 1, + "StorageAccessOnFind": "Always", + "MetricsEnabled": true, + "RemoteAccessEnabled": true, + "DicomWeb": { + "Enable": true, // Whether DICOMweb support is enabled + "Root": "/dicom-web/", // Root URI of the DICOMweb API (for QIDO-RS, STOW-RS and WADO-RS) + "EnableWado": true, // Whether WADO-URI (previously known as WADO) support is enabled + "WadoRoot": "/wado", // Root URI of the WADO-URI (aka. WADO) API + "Host": "localhost:8042", // Hard-codes the name of the host for subsequent WADO-RS requests + "Ssl": false, // Whether HTTPS should be used for subsequent WADO-RS requests + "StowMaxInstances": 10, // For STOW-RS client, the maximum number of instances in one single HTTP query (0 = no limit) + "StowMaxSize": 10, // For STOW-RS client, the maximum size of the body in one single HTTP query (in MB, 0 = no limit) + "QidoCaseSensitive": true // For QIDO-RS server, whether search is case sensitive (since release 0.5) + } +} \ No newline at end of file diff --git a/deploy/helm-charts/files/task-manager.json b/deploy/helm-charts/files/task-manager.json new file mode 100644 index 0000000..f6b94ae --- /dev/null +++ b/deploy/helm-charts/files/task-manager.json @@ -0,0 +1,98 @@ +{ + "MonaiDeployAuthentication": { + "BypassAuthentication": true + }, + "WorkloadManagerDatabase": { + "DatabaseName": "WorkloadManager" + }, + "WorkflowManager": { + "taskTimeoutMinutes": 60, + "argoTtlStrategySuccessSeconds": 60, + "argoTtlStrategyFailureSeconds": 60, + "minArgoTtlStrategySeconds": 30, + "endpointSettings": { + "defaultPageSize": 10, + "maxPageSize": 1000000 + }, + "TaskManager": { + "concurrency": 1, + "plug-ins": { + "argo": "Monai.Deploy.WorkflowManager.TaskManager.Argo.ArgoPlugin, Monai.Deploy.WorkflowManager.TaskManager.Argo", + }, + "meta-data": { + "argo": "Monai.Deploy.WorkflowManager.TaskManager.Argo.Repositories.ArgoMetadataRepository, Monai.Deploy.WorkflowManager.TaskManager.Argo", + }, + "argoPluginArguments": { + "server_url": "http://monai-deploy-argo-workflows-server:2746", + "initContainerCpuLimit": "1", + "initContainerMemoryLimit": "500Mi", + "waitContainerCpuLimit": "1", + "waitContainerMemoryLimit": "500Mi", + "messageGeneratorContainerCpuLimit": "1", + "messageGeneratorContainerMemoryLimit": "500Mi", + "messageSenderContainerCpuLimit": "1", + "messageSenderContainerMemoryLimit": "500Mi" + }, + "argoExitHookSendMessageContainerImage": "ghcr.io/project-monai/monai-deploy-task-manager-callback:0.1.27" + }, + "messaging": { + "retries": { + "retryDelays": "3" + }, + "topics": { + "workflowRequest": "md.workflow.request", + "exportComplete": "md.export.complete", + "exportRequestPrefix": "md.export.request", + "taskCallback": "md.tasks.callback", + "aideClinicalReviewRequest": "aide.clinical_review.request", + "aideClinicalReviewCancelation": "aide.clinical_review.cancellation", + "notificationEmailRequest": "aide.notification_email.request", + "notificationEmailCancelation": "aide.notification_email.cancellation", + }, + "dicomAgents": { + "dicomWebAgentName": "monaidicomweb", + "scuAgentName": "monaiscu" + }, + "argoCallback": { + "argoRabbitOverrideEnabled": false, + "argoRabbitOverrideEndpoint": "monai-deploy-argo-workflows-server" + }, + "publisherServiceAssemblyName": "Monai.Deploy.Messaging.RabbitMQ.RabbitMQMessagePublisherService, Monai.Deploy.Messaging.RabbitMQ", + "publisherSettings": { + "exchange": "monaideploy", + "deadLetterExchange": "deadLetterExchange", + "deliveryLimit": "5", + "requeueDelay": "0" + }, + "subscriberServiceAssemblyName": "Monai.Deploy.Messaging.RabbitMQ.RabbitMQMessageSubscriberService, Monai.Deploy.Messaging.RabbitMQ", + "subscriberSettings": { + "exchange": "monaideploy", + "deadLetterExchange": "monaideploy-dead-letter", + "exportRequestQueue": "export_tasks", + "deliveryLimit": 3, + "requeueDelay": 30 + } + }, + "storage": { + "serviceAssemblyName": "Monai.Deploy.Storage.MinIO.MinIoStorageService, Monai.Deploy.Storage.MinIO", + "settings": { + "region": "eu-west-2", + "bucket": "monaideploy", + "securedConnection": false, + "executableLocation": "mc", + "serviceName": "test" + } + } + }, + "Kestrel": { + "EndPoints": { + "Http": { + "Url": "http://+:5000" + } + }, + "LogHttpRequestQuery": false, + "LogHttpRequestBody": false, + "LogHttpResponseBody": true + }, + "AllowedHosts": "*" +} diff --git a/deploy/helm-charts/files/welcome.sh b/deploy/helm-charts/files/welcome.sh new file mode 100755 index 0000000..242dbfc --- /dev/null +++ b/deploy/helm-charts/files/welcome.sh @@ -0,0 +1,120 @@ +#!/bin/bash +# Copyright 2023 MONAI Consortium +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +echo Waiting for MONAI Deploy service to be ready... +kubectl wait --for=condition=Ready po -l 'app in (mig,mwm,mtm)' >/dev/null +sleep 3 +echo "" + +export NODE_IP=$(kubectl get nodes --namespace $1 -o jsonpath="{.items[0].status.addresses[0].address}") + +export MIG_POD=$(kubectl get po --namespace $1 -l app=mig -o jsonpath={..metadata.name}) +export MIG_API_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[1].nodePort}" services mig) +export MIG_DIMSE_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[0].nodePort}" services mig) + +export MWM_POD=$(kubectl get po --namespace $1 -l app=mwm -o jsonpath={..metadata.name}) +export MWM_API_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[0].nodePort}" services mwm) + +export MTM_POD=$(kubectl get po --namespace $1 -l app=mtm -o jsonpath={..metadata.name}) +export MTM_API_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[0].nodePort}" services mtm) + +ORTHANC_POD=$(kubectl get pod --namespace $1 -l app=orthanc -o jsonpath={..metadata.name}) +export ORTHANC_IP=$(kubectl get pod --namespace $1 $ORTHANC_POD -o jsonpath={.status.podIP}) +export ORTHANC_API_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[0].nodePort}" services orthanc) +export ORTHANC_DIMSE_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[1].nodePort}" services orthanc) + +export MINIO_API_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[0].nodePort}" services minio) +export MINIO_CONSOLE_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[1].nodePort}" services minio) + +export RABBITMQ_API_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[0].nodePort}" services rabbitmq) +export RABBITMQ_CONSOLE_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[1].nodePort}" services rabbitmq) + +export ARGO_SERVICE_NAME=$(kubectl get svc --namespace $1 -l app.kubernetes.io/name=argo-workflows-server -o jsonpath={..metadata.name}) +export ARGO_PORT=$(kubectl get --namespace $1 service/$ARGO_SERVICE_NAME -o jsonpath="{.spec.ports[0].port}") +export ARGO_IP=$(kubectl get --namespace $1 service/$ARGO_SERVICE_NAME -o jsonpath="{.spec.clusterIP}") + +export MONGO_PORT=$(kubectl get --namespace $1 -o jsonpath="{.spec.ports[0].nodePort}" services mongo) + +echo ==================================== +echo Informatics Gateway: +echo - POD: $MIG_POD +echo - API: http://$NODE_IP:$MIG_API_PORT +echo - DIMSE Port: $MIG_DIMSE_PORT +echo - Commands: +echo . - kubectl describe pod/$MIG_POD +echo . - kubectl logs -f $MIG_POD +echo ==================================== +echo Workflow Manager: +echo - POD: $MWM_POD +echo - API: http://$NODE_IP:$MWM_API_PORT +echo - Commands: +echo . - kubectl describe pod/$MWM_POD +echo . - kubectl logs -f $MWM_POD +echo ==================================== +echo Task Manager: +echo - POD: $MTM_POD +echo - API: http://$NODE_IP:$MTM_API_PORT +echo - Commands: +echo . - kubectl describe pod/$MTM_POD +echo . - kubectl logs -f $MTM_POD +echo ==================================== +echo Orthanc: +echo - POD: $(kubectl get po --namespace $1 -l app=orthanc -o jsonpath={..metadata.name}) +echo - POD IP $ORTHANC_IP +echo - API: http://$NODE_IP:$ORTHANC_API_PORT +echo - DIMSE Port: $ORTHANC_DIMSE_PORT +echo ==================================== +echo MinIO: +echo - POD: $(kubectl get po --namespace $1 -l app=minio -o jsonpath={..metadata.name}) +echo - API: http://$NODE_IP:$MINIO_API_PORT +echo - Console: http://$NODE_IP:$MINIO_CONSOLE_PORT +echo ==================================== +echo RabbitMQ: +echo - POD: $(kubectl get po --namespace $1 -l app=rabbitmq -o jsonpath={..metadata.name}) +echo - API: http://$NODE_IP:$RABBITMQ_API_PORT +echo - Console: http://$NODE_IP:$RABBITMQ_CONSOLE_PORT +echo ==================================== +echo MongoDB: +echo - POD: $(kubectl get po --namespace $1 -l app=mongodb -o jsonpath={..metadata.name}) +echo - POrt: $MONGO_PORT +echo ==================================== +echo Argo Workflow: +echo - POD: $(kubectl get po --namespace $1 -l app=mongodb -o jsonpath={..metadata.name}) +echo - Console: http://$ARGO_IP:$ARGO_PORT +echo - Commands: +echo . - kubectl port-forward services/$ARGO_SERVICE_NAME $ARGO_PORT:$ARGO_PORT +echo ==================================== + + +printf "\nDeleting existing MONAI Deploy AE Title..." +curl -s --request DELETE "http://$NODE_IP:$MIG_API_PORT/config/ae/MONAI-DEPLOY" >/dev/null +printf "\nDeleting existing DICOM Source..." +curl -s --request DELETE "http://$NODE_IP:$MIG_API_PORT/config/source/ORTHANC" >/dev/null +printf "\nDeleting existing DICOM Destination..." +curl -s --request DELETE "http://$NODE_IP:$MIG_API_PORT/config/destination/ORTHANC" >/dev/null + +printf "\nAdding MONAI Deploy AE Title..." +curl -s --request POST "http://$NODE_IP:$MIG_API_PORT/config/ae" --header "Content-Type: application/json" --data-raw "{\"name\": \"MONAI-DEPLOY\",\"aeTitle\": \"MONAI-DEPLOY\"}" >/dev/null +printf "\nAdding DICOM Source..." +curl -s --request POST "http://$NODE_IP:$MIG_API_PORT/config/source" --header "Content-Type: application/json" --data-raw "{\"name\": \"ORTHANC\",\"hostIp\": \"$ORTHANC_IP\",\"aeTitle\": \"ORTHANC\"}" >/dev/null +printf "\nAdding DICOM Destination..." +curl -s --request POST "http://$NODE_IP:$MIG_API_PORT/config/destination" --header "Content-Type: application/json" --data-raw "{\"name\": \"ORTHANC\",\"hostIp\": \"$NODE_IP\",\"port\": $ORTHANC_DIMSE_PORT,\"aeTitle\": \"ORTHANC\"}" >/dev/null + +printf "\nMONAI Deploy AE Titles:\n" +curl -f --request GET "http://$NODE_IP:$MIG_API_PORT/config/ae" 2>/dev/null | jq +printf "\nDICOM Sources:\n" +curl -f --request GET "http://$NODE_IP:$MIG_API_PORT/config/source" 2>/dev/null | jq +printf "\nDICOM Destinations:\n" +curl -f --request GET "http://$NODE_IP:$MIG_API_PORT/config/destination" 2>/dev/null | jq diff --git a/deploy/helm-charts/files/workflow-manager.json b/deploy/helm-charts/files/workflow-manager.json new file mode 100644 index 0000000..3e329e9 --- /dev/null +++ b/deploy/helm-charts/files/workflow-manager.json @@ -0,0 +1,86 @@ +{ + "WorkloadManagerDatabase": { + "DatabaseName": "WorkloadManager" + }, + "MonaiDeployAuthentication": { + "BypassAuthentication": true + }, + "WorkflowManager": { + "endpointSettings": { + "defaultPageSize": 10, + "maxPageSize": 1000000 + }, + "TaskManager": { + "concurrency": 1, + "taskTimeoutMinutes": 60, + "perTaskTypeTimeoutMinutes": { + }, + "plug-ins": { + "argo": "Monai.Deploy.WorkflowManager.TaskManager.Argo.ArgoPlugin, Monai.Deploy.WorkflowManager.TaskManager.Argo", + "test": "Monai.Deploy.WorkflowManager.TaskManager.TestPlugin.TestPlugin, Monai.Deploy.WorkflowManager.TaskManager.TestPlugin" + }, + "meta-data": { + "argo": "Monai.Deploy.WorkflowManager.TaskManager.Argo.Repositories.ArgoMetadataRepository, Monai.Deploy.WorkflowManager.TaskManager.Argo", + "test": "Monai.Deploy.WorkflowManager.TaskManager.TestPlugin.Repositories.TestPluginRepository, Monai.Deploy.WorkflowManager.TaskManager.TestPlugin" + } + }, + "messaging": { + "retries": { + "retryDelays": "3" + }, + "topics": { + "workflowRequest": "md.workflow.request", + "exportComplete": "md.export.complete", + "exportRequestPrefix": "md.export.request", + "callbackRequest": "md.tasks.callback", + "aideClinicalReviewRequest": "aide.clinical_review.request" + }, + "dicomAgents": { + "dicomWebAgentName": "monaidicomweb", + "scuAgentName": "monaiscu" + }, + "publisherServiceAssemblyName": "Monai.Deploy.Messaging.RabbitMQ.RabbitMQMessagePublisherService, Monai.Deploy.Messaging.RabbitMQ", + "publisherSettings": { + "exchange": "monaideploy", + "deadLetterExchange": "deadLetterExchange", + "deliveryLimit": "5", + "requeueDelay": "0" + }, + "subscriberServiceAssemblyName": "Monai.Deploy.Messaging.RabbitMQ.RabbitMQMessageSubscriberService, Monai.Deploy.Messaging.RabbitMQ", + "subscriberSettings": { + "exchange": "monaideploy", + "deadLetterExchange": "monaideploy-dead-letter", + "exportRequestQueue": "export_tasks", + "deliveryLimit": 3, + "requeueDelay": 30 + } + }, + "storage": { + "serviceAssemblyName": "Monai.Deploy.Storage.MinIO.MinIoStorageService, Monai.Deploy.Storage.MinIO", + "settings": { + "region": "eu-west-2", + "bucket": "monaideploy", + "securedConnection": false, + "executableLocation": "mc", + "serviceName": "monaideploy" + } + }, + "dicomTagsDisallowed": "PatientName,PatientID,IssuerOfPatientID,TypeOfPatientID,IssuerOfPatientIDQualifiersSequence,SourcePatientGroupIdentificationSequence,GroupOfPatientsIdentificationSequence,SubjectRelativePositionInImage,PatientBirthDate,PatientBirthTime,PatientBirthDateInAlternativeCalendar,PatientDeathDateInAlternativeCalendar,PatientAlternativeCalendar,PatientSex,PatientInsurancePlanCodeSequence,PatientPrimaryLanguageCodeSequence,PatientPrimaryLanguageModifierCodeSequence,QualityControlSubject,QualityControlSubjectTypeCodeSequence,StrainDescription,StrainNomenclature,StrainStockNumber,StrainSourceRegistryCodeSequence,StrainStockSequence,StrainSource,StrainAdditionalInformation,StrainCodeSequence,GeneticModificationsSequence,GeneticModificationsDescription,GeneticModificationsNomenclature,GeneticModificationsCodeSequence,OtherPatientIDsRETIRED,OtherPatientNames,OtherPatientIDsSequence,PatientBirthName,PatientAge,PatientSize,PatientSizeCodeSequence,PatientBodyMassIndex,MeasuredAPDimension,MeasuredLateralDimension,PatientWeight,PatientAddress,InsurancePlanIdentificationRETIRED,PatientMotherBirthName,MilitaryRank,BranchOfService,MedicalRecordLocatorRETIRED,ReferencedPatientPhotoSequence,MedicalAlerts,Allergies,CountryOfResidence,RegionOfResidence,PatientTelephoneNumbers,PatientTelecomInformation,EthnicGroup,Occupation,SmokingStatus,AdditionalPatientHistory,PregnancyStatus,LastMenstrualDate,PatientReligiousPreference,PatientSpeciesDescription,PatientSpeciesCodeSequence,PatientSexNeutered,AnatomicalOrientationType,PatientBreedDescription,PatientBreedCodeSequence,BreedRegistrationSequence,BreedRegistrationNumber,BreedRegistryCodeSequence,ResponsiblePerson,ResponsiblePersonRole,ResponsibleOrganization,PatientComments,ExaminedBodyThickness" + }, + "InformaticsGateway": { + "apiHost": "http://mig:5000", + "username": "", + "password": "" + }, + "Kestrel": { + "EndPoints": { + "Http": { + "Url": "http://+:5000" + } + }, + "LogHttpRequestQuery": false, + "LogHttpRequestBody": true, + "LogHttpResponseBody": true + }, + "AllowedHosts": "*" +} diff --git a/deploy/helm-charts/templates/00-secrets.yaml b/deploy/helm-charts/templates/00-secrets.yaml new file mode 100644 index 0000000..e96efa4 --- /dev/null +++ b/deploy/helm-charts/templates/00-secrets.yaml @@ -0,0 +1,36 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.minio.name }}-secret +data: + username: {{ .Values.minio.username | b64enc | quote }} + password: {{ .Values.minio.password | b64enc | quote }} + +--- + +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.mongo.name }}-secret +data: + username: {{ .Values.mongo.username | b64enc | quote }} + password: {{ .Values.mongo.password | b64enc | quote }} + +--- + +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.orthanc.name }}-secret +data: + users: {{ "{\"{{ .Values.orthanc.username }} \":\"{{ .Values.orthanc.password }} \"}" | b64enc | quote }} + +--- + +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Values.rabbitmq.name }}-secret +data: + username: {{ .Values.rabbitmq.username | b64enc | quote }} + password: {{ .Values.rabbitmq.password | b64enc | quote }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/00-serviceaccount.yaml b/deploy/helm-charts/templates/00-serviceaccount.yaml new file mode 100644 index 0000000..254e8eb --- /dev/null +++ b/deploy/helm-charts/templates/00-serviceaccount.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.create -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "local.serviceAccountName" . }} + labels: + {{- include "local.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/deploy/helm-charts/templates/01-mongodb-deployment.yaml b/deploy/helm-charts/templates/01-mongodb-deployment.yaml new file mode 100644 index 0000000..10b3747 --- /dev/null +++ b/deploy/helm-charts/templates/01-mongodb-deployment.yaml @@ -0,0 +1,90 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.mongo.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: mongodb + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "local.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.mongo.repository }}:{{ .Values.mongo.tag }}" + imagePullPolicy: {{ .Values.mongo.pullPolicy }} + ports: + - name: mongo-port + containerPort: 27017 + protocol: TCP + volumeMounts: + - name: {{ .Release.Name }}-mongodb + mountPath: /data/db + subPath: db + resources: + {{- toYaml .Values.mongo.resources | nindent 12 }} + env: + - name: MONGO_INITDB_ROOT_USERNAME + value: {{ .Values.mongo.username }} + - name: MONGO_INITDB_ROOT_PASSWORD + value: {{ .Values.mongo.password }} + livenessProbe: + exec: + command: + - /bin/bash + - -c + - "echo 'db.runCommand(\"ping\").ok' | /usr/bin/mongosh localhost:{{ .Values.mongo.port }}/productiondb --quiet" + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 10 + failureThreshold: 300 + readinessProbe: + exec: + command: + - /bin/bash + - -c + - "echo 'db.runCommand(\"ping\").ok' | /usr/bin/mongosh localhost:{{ .Values.mongo.port }}/productiondb --quiet" + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 10 + failureThreshold: 300 + volumes: + - name: {{ .Release.Name }}-mongodb + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.mongo.name }}-volume-claim + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/helm-charts/templates/01-mongodb-pvc.yaml b/deploy/helm-charts/templates/01-mongodb-pvc.yaml new file mode 100644 index 0000000..7f047ee --- /dev/null +++ b/deploy/helm-charts/templates/01-mongodb-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.mongo.name }}-volume-claim +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: {{ .Values.mongo.size }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/01-mongodb-service.yaml b/deploy/helm-charts/templates/01-mongodb-service.yaml new file mode 100644 index 0000000..2bbeb1d --- /dev/null +++ b/deploy/helm-charts/templates/01-mongodb-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.mongo.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + type: {{ .Values.mongo.serviceType }} + ports: + - port: {{ .Values.mongo.port }} + targetPort: mongo-port + protocol: TCP + name: mongo + selector: + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 4 }} diff --git a/deploy/helm-charts/templates/02-rabbitmq-deployment.yaml b/deploy/helm-charts/templates/02-rabbitmq-deployment.yaml new file mode 100644 index 0000000..c357c9f --- /dev/null +++ b/deploy/helm-charts/templates/02-rabbitmq-deployment.yaml @@ -0,0 +1,97 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.rabbitmq.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: rabbitmq + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "local.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.rabbitmq.repository }}:{{ .Values.rabbitmq.tag }}" + imagePullPolicy: {{ .Values.rabbitmq.pullPolicy }} + ports: + - name: rabbitmq-port + containerPort: 5672 + protocol: TCP + - name: rabbitmq-mport + containerPort: 15672 + protocol: TCP + volumeMounts: + - name: {{ .Release.Name }}-rabbitmqdb + mountPath: /var/lib/rabbitmq/mnesia/ + subPath: mnesia + resources: + {{- toYaml .Values.rabbitmq.resources | nindent 12 }} + env: + - name: RABBITMQ_DEFAULT_USER + value: {{ .Values.rabbitmq.username }} + - name: RABBITMQ_DEFAULT_PASS + value: {{ .Values.rabbitmq.password }} + - name: RABBITMQ_DEFAULT_VHOST + value: {{ .Values.rabbitmq.vhost }} + - name: RABBITMQ_ERLANG_COOKIE + value: {{ .Values.rabbitmq.erlangCookie }} + livenessProbe: + exec: + command: + - rabbitmq-diagnostics + - -q + - ping + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 10 + failureThreshold: 300 + readinessProbe: + exec: + command: + - rabbitmq-diagnostics + - -q + - ping + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 10 + failureThreshold: 300 + volumes: + - name: {{ .Release.Name }}-rabbitmqdb + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.rabbitmq.name }}-volume-claim + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/helm-charts/templates/02-rabbitmq-pvc.yaml b/deploy/helm-charts/templates/02-rabbitmq-pvc.yaml new file mode 100644 index 0000000..b0c1fb9 --- /dev/null +++ b/deploy/helm-charts/templates/02-rabbitmq-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.rabbitmq.name }}-volume-claim +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: {{ .Values.rabbitmq.size }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/02-rabbitmq-service.yaml b/deploy/helm-charts/templates/02-rabbitmq-service.yaml new file mode 100644 index 0000000..2fb3d6d --- /dev/null +++ b/deploy/helm-charts/templates/02-rabbitmq-service.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.rabbitmq.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + type: {{ .Values.rabbitmq.serviceType }} + ports: + - port: {{ .Values.rabbitmq.port }} + targetPort: rabbitmq-port + protocol: TCP + name: rabbitmq + - port: {{ .Values.rabbitmq.mgtPort }} + targetPort: rabbitmq-mport + protocol: TCP + name: rabbitmq-management + selector: + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 4 }} diff --git a/deploy/helm-charts/templates/03-minio-deployment.yaml b/deploy/helm-charts/templates/03-minio-deployment.yaml new file mode 100644 index 0000000..7ec0c9c --- /dev/null +++ b/deploy/helm-charts/templates/03-minio-deployment.yaml @@ -0,0 +1,102 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.minio.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: minio + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "local.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + args: + - server + - /data + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.minio.repository }}:{{ .Values.minio.tag }}" + imagePullPolicy: {{ .Values.minio.pullPolicy }} + ports: + - name: minio-port + containerPort: 9000 + protocol: TCP + - name: minio-cport + containerPort: 9001 + protocol: TCP + volumeMounts: + - name: {{ .Release.Name }}-minio-data + mountPath: /data + subPath: data + - name: {{ .Release.Name }}-minio-config + mountPath: /root/.minio + subPath: .minio + resources: + {{- toYaml .Values.minio.resources | nindent 12 }} + env: + - name: MINIO_ROOT_USER + value: {{ .Values.minio.username }} + - name: MINIO_ROOT_PASSWORD + value: {{ .Values.minio.password }} + - name: MINIO_ADDRESS + value: ":{{ .Values.minio.port }}" + - name: MINIO_CONSOLE_ADDRESS + value: ":{{ .Values.minio.consolePort }}" + livenessProbe: + httpGet: + path: /minio/health/live + port: {{ .Values.minio.port }} + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 10 + failureThreshold: 300 + readinessProbe: + httpGet: + path: /minio/health/ready + port: {{ .Values.minio.port }} + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 10 + failureThreshold: 300 + volumes: + - name: {{ .Release.Name }}-minio-data + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.minio.name }}-data-volume-claim + - name: {{ .Release.Name }}-minio-config + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.minio.name }}-config-volume-claim + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/helm-charts/templates/03-minio-pvc.yaml b/deploy/helm-charts/templates/03-minio-pvc.yaml new file mode 100644 index 0000000..f814954 --- /dev/null +++ b/deploy/helm-charts/templates/03-minio-pvc.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.minio.name }}-data-volume-claim +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: {{ .Values.minio.size }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.minio.name }}-config-volume-claim +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: {{ .Values.minio.size }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/03-minio-service.yaml b/deploy/helm-charts/templates/03-minio-service.yaml new file mode 100644 index 0000000..d958119 --- /dev/null +++ b/deploy/helm-charts/templates/03-minio-service.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.minio.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + type: {{ .Values.minio.serviceType }} + ports: + - port: {{ .Values.minio.port }} + targetPort: minio-port + protocol: TCP + name: minio + - port: {{ .Values.minio.consolePort }} + targetPort: minio-cport + protocol: TCP + name: minio-console + selector: + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 4 }} diff --git a/deploy/helm-charts/templates/04-orthanc-config-map.yaml b/deploy/helm-charts/templates/04-orthanc-config-map.yaml new file mode 100644 index 0000000..d83dc24 --- /dev/null +++ b/deploy/helm-charts/templates/04-orthanc-config-map.yaml @@ -0,0 +1,15 @@ +# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-orthanc-configmap +data: + orthanc.json: > +{{ .Files.Get "files/orthanc.json" | indent 4 }} diff --git a/deploy/helm-charts/templates/04-orthanc-deployment.yaml b/deploy/helm-charts/templates/04-orthanc-deployment.yaml new file mode 100644 index 0000000..a314c69 --- /dev/null +++ b/deploy/helm-charts/templates/04-orthanc-deployment.yaml @@ -0,0 +1,116 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.orthanc.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: orthanc + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "local.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.orthanc.repository }}:{{ .Values.orthanc.tag }}" + imagePullPolicy: {{ .Values.orthanc.pullPolicy }} + ports: + - name: orthanc-port + containerPort: 8042 + protocol: TCP + - name: orthanc-dimse + containerPort: 4242 + protocol: TCP + volumeMounts: + - name: {{ .Release.Name }}-orthancdb + mountPath: /var/lib/orthanc/db + subPath: db + - name: {{ .Release.Name }}-orthanc-config + mountPath: "/etc/orthanc/orthanc.json" + subPath: "orthanc.json" + resources: + {{- toYaml .Values.orthanc.resources | nindent 12 }} + env: + - name: VERBOSE_ENABLED + value: "true" + - name: DICOM_WEB_PLUGIN_ENABLED + value: "true" + - name: CONNECTIVITY_CHECKS_PLUGIN_ENABLED + value: "true" + - name: ORTHANC__DICOM_AET + value: {{ .Values.orthanc.appSettings.dicomAet }} + - name: ORTHANC__REGISTERED_USERS + valueFrom: + secretKeyRef: + name: {{ .Values.orthanc.name }}-secret + key: users + - name: ORTHANC__DICOM_MODALITIES + value: | + { + "MONAI-DEPLOY": ["MONAI-DEPLOY", "{{ .Values.mig.serviceName }}", {{ .Values.mig.dimsePort }}] + } + livenessProbe: + exec: + command: + - /bin/bash + - -c + - "/probes/test-aliveness.py" + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 10 + failureThreshold: 300 + readinessProbe: + exec: + command: + - /bin/bash + - -c + - "/probes/test-aliveness.py" + initialDelaySeconds: 15 + periodSeconds: 5 + timeoutSeconds: 10 + failureThreshold: 300 + volumes: + - name: {{ .Release.Name }}-orthancdb + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.orthanc.name }}-volume-claim + - name: {{ .Release.Name }}-orthanc-config + configMap: + name: {{ .Release.Name }}-orthanc-configmap + items: + - key: orthanc.json + path: "orthanc.json" + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/helm-charts/templates/04-orthanc-pvc.yaml b/deploy/helm-charts/templates/04-orthanc-pvc.yaml new file mode 100644 index 0000000..b2fbaf3 --- /dev/null +++ b/deploy/helm-charts/templates/04-orthanc-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.orthanc.name }}-volume-claim +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: {{ .Values.orthanc.size }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/04-orthanc-service.yaml b/deploy/helm-charts/templates/04-orthanc-service.yaml new file mode 100644 index 0000000..11f57d7 --- /dev/null +++ b/deploy/helm-charts/templates/04-orthanc-service.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.orthanc.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + type: {{ .Values.orthanc.serviceType }} + ports: + - port: {{ .Values.orthanc.port }} + targetPort: orthanc-port + protocol: TCP + name: orthanc + - port: {{ .Values.orthanc.dimsePort }} + targetPort: orthanc-dimse + protocol: TCP + name: orthanc-dimse + selector: + role: internal-svcs + {{- include "local.selectorLabels" . | nindent 4 }} diff --git a/deploy/helm-charts/templates/10-informatics-gateway-config-map.yaml b/deploy/helm-charts/templates/10-informatics-gateway-config-map.yaml new file mode 100644 index 0000000..cba9cb9 --- /dev/null +++ b/deploy/helm-charts/templates/10-informatics-gateway-config-map.yaml @@ -0,0 +1,20 @@ +# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-mig-configmap +data: +{{- with .Values.resultsConfig }} + appsettings.json: |- + {{- . | nindent 4 }} +{{- else }} + appsettings.json: > +{{ .Files.Get "files/informatics-gateway.json" | indent 4 }} +{{- end }} diff --git a/deploy/helm-charts/templates/10-informatics-gateway-deployment.yaml b/deploy/helm-charts/templates/10-informatics-gateway-deployment.yaml new file mode 100644 index 0000000..7110264 --- /dev/null +++ b/deploy/helm-charts/templates/10-informatics-gateway-deployment.yaml @@ -0,0 +1,144 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.mig.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + role: external-svcs + {{- include "local.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: mig + role: external-svcs + {{- include "local.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "local.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + initContainers: + {{ include "init.mongo" . }} + {{ include "init.rabbitmq" . }} + {{ include "init.minio" . }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.mig.repository }}:{{ .Values.mig.tag }}" + imagePullPolicy: {{ .Values.mig.pullPolicy }} + ports: + - name: dimse-port + containerPort: 104 + protocol: TCP + - name: mig-api-port + containerPort: 5000 + protocol: TCP + livenessProbe: + httpGet: + path: /health/ + port: 5000 + readinessProbe: + httpGet: + path: /health/ + port: 5000 + volumeMounts: + - name: {{ .Release.Name }}-logs + mountPath: /opt/monai/ig/logs + subPath: logs + - name: {{ .Release.Name }}-payloads + mountPath: /payloads + subPath: payloads + - name: {{ .Release.Name }}-mig-config + mountPath: "/opt/monai/ig/appsettings.json" + subPath: "appsettings.json" + resources: + {{- toYaml .Values.mig.resources | nindent 12 }} + env: + - name: InformaticsGateway__dicom__scu__aeTitle + value: {{ .Values.mig.appSettings.scuAeTItle}} + - name: InformaticsGateway__dicom__scp__rejectUnknownSources + value: {{ .Values.mig.appSettings.rejectUnknownSources | quote }} + - name: InformaticsGateway__storage__watermarkPercent + value: {{ .Values.mig.appSettings.storageWatermark | quote }} + - name: InformaticsGateway__messaging__publisherSettings__endpoint + value: {{ .Values.rabbitmq.serviceName }} + - name: InformaticsGateway__messaging__publisherSettings__virtualHost + value: {{ .Values.rabbitmq.vhost }} + - name: InformaticsGateway__messaging__subscriberSettings__endpoint + value: {{ .Values.rabbitmq.serviceName }} + - name: InformaticsGateway__messaging__subscriberSettings__virtualHost + value: {{ .Values.rabbitmq.vhost }} + - name: InformaticsGateway__storage__settings__endpoint + value: {{ .Values.minio.serviceName }}:{{ .Values.minio.port }} + - name: InformaticsGateway__storage__settings__accessKey + valueFrom: + secretKeyRef: + name: {{ .Values.minio.name }}-secret + key: username + - name: InformaticsGateway__storage__settings__accessToken + valueFrom: + secretKeyRef: + name: {{ .Values.minio.name }}-secret + key: password + - name: InformaticsGateway__messaging__subscriberSettings__username + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: username + - name: InformaticsGateway__messaging__subscriberSettings__password + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: password + - name: InformaticsGateway__messaging__publisherSettings__username + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: username + - name: InformaticsGateway__messaging__publisherSettings__password + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: password + - name: ConnectionStrings__InformaticsGatewayDatabase + value: mongodb://{{ .Values.mongo.username}}:{{ .Values.mongo.password}}@{{ .Values.mongo.serviceName}}:{{ .Values.mongo.port}} + volumes: + - name: {{ .Release.Name }}-logs + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.mig.name }}-logs-volume-claim + - name: {{ .Release.Name }}-payloads + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.mig.name }}-payloads-volume-claim + - name: {{ .Release.Name }}-mig-config + configMap: + name: {{ .Release.Name }}-mig-configmap + items: + - key: appsettings.json + path: "appsettings.json" + + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/helm-charts/templates/10-informatics-gateway-pvc.yaml b/deploy/helm-charts/templates/10-informatics-gateway-pvc.yaml new file mode 100644 index 0000000..61f8868 --- /dev/null +++ b/deploy/helm-charts/templates/10-informatics-gateway-pvc.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.mig.name }}-logs-volume-claim +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: {{ .Values.mig.logsSize }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.mig.name }}-payloads-volume-claim +spec: + accessModes: + - ReadWriteOnce + storageClassName: local-path + resources: + requests: + storage: {{ .Values.mig.payloadSize }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/10-informatics-gateway-service.yaml b/deploy/helm-charts/templates/10-informatics-gateway-service.yaml new file mode 100644 index 0000000..15c4deb --- /dev/null +++ b/deploy/helm-charts/templates/10-informatics-gateway-service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.mig.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + type: {{ .Values.mig.serviceType }} + ports: + - name: dimse + port: 104 + nodePort: {{ .Values.mig.dimsePort }} + targetPort: dimse-port + protocol: TCP + - name: mig-api + port: 5000 + nodePort: {{ .Values.mig.apiPort }} + targetPort: mig-api-port + protocol: TCP + selector: + role: external-svcs + {{- include "local.selectorLabels" . | nindent 4 }} diff --git a/deploy/helm-charts/templates/11-workflow-manager-config-map.yaml b/deploy/helm-charts/templates/11-workflow-manager-config-map.yaml new file mode 100644 index 0000000..6756446 --- /dev/null +++ b/deploy/helm-charts/templates/11-workflow-manager-config-map.yaml @@ -0,0 +1,20 @@ +# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-mwm-configmap +data: +{{- with .Values.resultsConfig }} + appsettings.json: |- + {{- . | nindent 4 }} +{{- else }} + appsettings.json: > +{{ .Files.Get "files/workflow-manager.json" | indent 4 }} +{{- end }} diff --git a/deploy/helm-charts/templates/11-workflow-manager-deployment.yaml b/deploy/helm-charts/templates/11-workflow-manager-deployment.yaml new file mode 100644 index 0000000..278bb13 --- /dev/null +++ b/deploy/helm-charts/templates/11-workflow-manager-deployment.yaml @@ -0,0 +1,122 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.mwm.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + role: external-svcs + {{- include "local.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: mwm + role: external-svcs + {{- include "local.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "local.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + initContainers: + {{ include "init.mongo" . }} + {{ include "init.rabbitmq" . }} + {{ include "init.minio" . }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.mwm.repository }}:{{ .Values.mwm.tag }}" + imagePullPolicy: {{ .Values.mwm.pullPolicy }} + ports: + - name: mwm-api-port + containerPort: 5000 + protocol: TCP + livenessProbe: + httpGet: + path: /health + port: 5000 + readinessProbe: + httpGet: + path: /health + port: 5000 + volumeMounts: + - name: {{ .Release.Name }}-mwm-config + mountPath: "/opt/monai/wm/appsettings.json" + subPath: "appsettings.json" + resources: + {{- toYaml .Values.mwm.resources | nindent 12 }} + env: + - name: WorkloadManagerDatabase__ConnectionString + value: mongodb://{{ .Values.mongo.username}}:{{ .Values.mongo.password}}@{{ .Values.mongo.serviceName}}:{{ .Values.mongo.port}} + - name: WorkflowManager__messaging__publisherSettings__endpoint + value: {{ .Values.rabbitmq.serviceName }} + - name: WorkflowManager__messaging__publisherSettings__virtualHost + value: {{ .Values.rabbitmq.vhost }} + - name: WorkflowManager__messaging__subscriberSettings__endpoint + value: {{ .Values.rabbitmq.serviceName }} + - name: WorkflowManager__messaging__subscriberSettings__virtualHost + value: {{ .Values.rabbitmq.vhost }} + - name: WorkflowManager__storage__settings__endpoint + value: {{ .Values.minio.serviceName }}:{{ .Values.minio.port }} + - name: WorkflowManager__storage__settings__accessKey + valueFrom: + secretKeyRef: + name: {{ .Values.minio.name }}-secret + key: username + - name: WorkflowManager__storage__settings__accessToken + valueFrom: + secretKeyRef: + name: {{ .Values.minio.name }}-secret + key: password + - name: WorkflowManager__messaging__subscriberSettings__username + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: username + - name: WorkflowManager__messaging__subscriberSettings__password + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: password + - name: WorkflowManager__messaging__publisherSettings__username + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: username + - name: WorkflowManager__messaging__publisherSettings__password + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: password + volumes: + - name: {{ .Release.Name }}-mwm-config + configMap: + name: {{ .Release.Name }}-mwm-configmap + items: + - key: appsettings.json + path: "appsettings.json" + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/helm-charts/templates/11-workflow-manager-service.yaml b/deploy/helm-charts/templates/11-workflow-manager-service.yaml new file mode 100644 index 0000000..843613c --- /dev/null +++ b/deploy/helm-charts/templates/11-workflow-manager-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.mwm.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + type: {{ .Values.mwm.serviceType }} + ports: + - port: {{ .Values.mwm.apiPort }} + targetPort: mwm-api-port + protocol: TCP + name: mwm-api + selector: + role: external-svcs + {{- include "local.selectorLabels" . | nindent 4 }} diff --git a/deploy/helm-charts/templates/12-task-manager-config-map.yaml b/deploy/helm-charts/templates/12-task-manager-config-map.yaml new file mode 100644 index 0000000..b0fc75d --- /dev/null +++ b/deploy/helm-charts/templates/12-task-manager-config-map.yaml @@ -0,0 +1,20 @@ +# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. +# +# NVIDIA CORPORATION and its licensors retain all intellectual property +# and proprietary rights in and to this software, related documentation +# and any modifications thereto. Any use, reproduction, disclosure or +# distribution of this software and related documentation without an express +# license agreement from NVIDIA CORPORATION is strictly prohibited. + +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-mtm-configmap +data: +{{- with .Values.resultsConfig }} + appsettings.json: |- + {{- . | nindent 4 }} +{{- else }} + appsettings.json: > +{{ .Files.Get "files/task-manager.json" | indent 4 }} +{{- end }} diff --git a/deploy/helm-charts/templates/12-task-manager-deployment.yaml b/deploy/helm-charts/templates/12-task-manager-deployment.yaml new file mode 100644 index 0000000..b977c5e --- /dev/null +++ b/deploy/helm-charts/templates/12-task-manager-deployment.yaml @@ -0,0 +1,122 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.mtm.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + role: external-svcs + {{- include "local.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + app: mtm + role: external-svcs + {{- include "local.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "local.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + initContainers: + {{ include "init.mongo" . }} + {{ include "init.rabbitmq" . }} + {{ include "init.minio" . }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.mtm.repository }}:{{ .Values.mtm.tag }}" + imagePullPolicy: {{ .Values.mtm.pullPolicy }} + ports: + - name: mtm-api-port + containerPort: 5000 + protocol: TCP + livenessProbe: + httpGet: + path: /health + port: 5000 + readinessProbe: + httpGet: + path: /health + port: 5000 + volumeMounts: + - name: {{ .Release.Name }}-mtm-config + mountPath: "/opt/monai/wm/appsettings.json" + subPath: "appsettings.json" + resources: + {{- toYaml .Values.mtm.resources | nindent 12 }} + env: + - name: WorkloadManagerDatabase__ConnectionString + value: mongodb://{{ .Values.mongo.username}}:{{ .Values.mongo.password}}@{{ .Values.mongo.serviceName}}:{{ .Values.mongo.port}} + - name: WorkflowManager__messaging__publisherSettings__endpoint + value: {{ .Values.rabbitmq.serviceName }} + - name: WorkflowManager__messaging__publisherSettings__virtualHost + value: {{ .Values.rabbitmq.vhost }} + - name: WorkflowManager__messaging__subscriberSettings__endpoint + value: {{ .Values.rabbitmq.serviceName }} + - name: WorkflowManager__messaging__subscriberSettings__virtualHost + value: {{ .Values.rabbitmq.vhost }} + - name: WorkflowManager__storage__settings__endpoint + value: {{ .Values.minio.serviceName }}:{{ .Values.minio.port }} + - name: WorkflowManager__storage__settings__accessKey + valueFrom: + secretKeyRef: + name: {{ .Values.minio.name }}-secret + key: username + - name: WorkflowManager__storage__settings__accessToken + valueFrom: + secretKeyRef: + name: {{ .Values.minio.name }}-secret + key: password + - name: WorkflowManager__messaging__subscriberSettings__username + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: username + - name: WorkflowManager__messaging__subscriberSettings__password + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: password + - name: WorkflowManager__messaging__publisherSettings__username + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: username + - name: WorkflowManager__messaging__publisherSettings__password + valueFrom: + secretKeyRef: + name: {{ .Values.rabbitmq.name }}-secret + key: password + volumes: + - name: {{ .Release.Name }}-mtm-config + configMap: + name: {{ .Release.Name }}-mtm-configmap + items: + - key: appsettings.json + path: "appsettings.json" + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/helm-charts/templates/12-task-manager-service.yaml b/deploy/helm-charts/templates/12-task-manager-service.yaml new file mode 100644 index 0000000..d688809 --- /dev/null +++ b/deploy/helm-charts/templates/12-task-manager-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.mtm.serviceName }} + labels: + {{- include "local.labels" . | nindent 4 }} +spec: + type: {{ .Values.mtm.serviceType }} + ports: + - port: {{ .Values.mtm.apiPort }} + targetPort: mtm-api-port + protocol: TCP + name: mtm-api + selector: + role: external-svcs + {{- include "local.selectorLabels" . | nindent 4 }} diff --git a/deploy/helm-charts/templates/NOTES.txt b/deploy/helm-charts/templates/NOTES.txt new file mode 100644 index 0000000..614f949 --- /dev/null +++ b/deploy/helm-charts/templates/NOTES.txt @@ -0,0 +1,5 @@ +Thank for installing MONAI Deploy. + +Run the following script to initialize Informatics Gateway and Orthanc: + +./files/welcome.sh {{ .Release.Namespace }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/_helpers.tpl b/deploy/helm-charts/templates/_helpers.tpl new file mode 100644 index 0000000..f302914 --- /dev/null +++ b/deploy/helm-charts/templates/_helpers.tpl @@ -0,0 +1,82 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "local.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "local.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "local.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "local.labels" -}} +helm.sh/chart: {{ include "local.chart" . }} +{{ include "local.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "local.selectorLabels" -}} +app.kubernetes.io/name: {{ include "local.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "local.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "local.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} + + + +{{- define "init.mongo" -}} + - name: init-mongo + image: busybox + command: ['sh', '-c', "until nslookup {{ .Values.mongo.serviceName }}.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for MongoDB; sleep 2; done"] +{{- end }} + +{{- define "init.rabbitmq" -}} + - name: init-rabbitmq + image: busybox + command: ['sh', '-c', "until wget http://{{ .Values.rabbitmq.username }}:{{ .Values.rabbitmq.password }}@{{ .Values.rabbitmq.serviceName }}:{{ .Values.rabbitmq.mgtPort }}/api/aliveness-test/{{ .Values.rabbitmq.vhost }}; do echo waiting for RabbitMQ; sleep 2; done;"] +{{- end }} + +{{- define "init.minio" -}} + - name: init-minio + image: busybox + command: ['sh', '-c', "until wget http://{{ .Values.minio.serviceName }}:{{ .Values.minio.port }}/minio/health/ready; do echo waiting for MinIO; sleep 2; done;"] +{{- end }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/tests/test-connection.yaml b/deploy/helm-charts/templates/tests/test-connection.yaml new file mode 100644 index 0000000..1cafa73 --- /dev/null +++ b/deploy/helm-charts/templates/tests/test-connection.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: "{{ include "local.fullname" . }}-test-connection" + labels: + {{- include "local.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": test +spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['{{ include "local.fullname" . }}:{{ .Values.mig.apiPort }}'] + restartPolicy: Never diff --git a/deploy/helm-charts/values.yaml b/deploy/helm-charts/values.yaml new file mode 100644 index 0000000..b16dfe8 --- /dev/null +++ b/deploy/helm-charts/values.yaml @@ -0,0 +1,243 @@ +# Default values for local. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +replicaCount: 1 + +mig: + name: informatics-gateway + serviceName: mig + repository: ghcr.io/project-monai/monai-deploy-informatics-gateway + tag: 0.4.0-rc.1 + pullPolicy: IfNotPresent + imagePullSecrets: [] + serviceType: NodePort + dimsePort: 104 + apiPort: 5000 + databaseSize: 1Gi + logsSize: 1Gi + payloadSize: 10Gi + appSettings: + storageWatermark: 90 + rejectUnknownSources: true + scuAeTItle: MONAISCU + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # 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 + # requests: + # cpu: 100m + # memory: 128Mi + +mwm: + name: workflow-manager + serviceName: mwm + repository: ghcr.io/project-monai/monai-deploy-workflow-manager + tag: develop-latest + pullPolicy: IfNotPresent + imagePullSecrets: [] + serviceType: NodePort + apiPort: 5000 + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # 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 + # requests: + # cpu: 100m + # memory: 128Mi + +mtm: + name: task-manager + serviceName: mtm + repository: ghcr.io/project-monai/monai-deploy-task-manager + tag: develop-latest + pullPolicy: IfNotPresent + imagePullSecrets: [] + serviceType: NodePort + apiPort: 5000 + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # 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 + # requests: + # cpu: 100m + # memory: 128Mi + +minio: + name: minio + serviceName: minio + repository: minio/minio + tag: latest + pullPolicy: IfNotPresent + imagePullSecrets: [] + username: monai + password: minioadmin + serviceType: NodePort + size: 50Gi + port: 9000 + consolePort: 9001 + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # 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 + # requests: + # cpu: 100m + # memory: 128Mi + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # 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 + # requests: + # cpu: 100m + # memory: 128Mi + +mongo: + name: mongodb + serviceName: mongo + repository: mongo + tag: 6.0 + pullPolicy: IfNotPresent + imagePullSecrets: [] + username: monai + password: monai + serviceType: NodePort + size: 1Gi + port: 27017 + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # 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 + # requests: + # cpu: 100m + # memory: 128Mi + +orthanc: + name: orthanc + serviceName: orthanc + repository: osimis/orthanc + tag: latest-full + pullPolicy: IfNotPresent + imagePullSecrets: [] + username: monai + password: monai + size: 50Gi + serviceType: NodePort + port: 8042 + dimsePort: 4242 + appSettings: + dicomAet: ORTHANC + + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # 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 + # requests: + # cpu: 100m + # memory: 128Mi + +rabbitmq: + name: rabbitmq + serviceName: rabbitmq + repository: rabbitmq + tag: 3.12.4-management + pullPolicy: IfNotPresent + imagePullSecrets: [] + username: monai + password: monai + erlangCookie: SWQOKODSQALRPCLNMEQG + vhost: monaideploy + serviceType: NodePort + size: 1Gi + port: 5672 + mgtPort: 15672 + resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # 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 + # requests: + # cpu: 100m + # memory: 128Mi + +serviceAccount: + # Specifies whether a service account should be created + create: true + # Annotations to add to the service account + annotations: {} + # The name of the service account to use. + # If not set and create is true, a name is generated using the fullname template + name: "monai-deploy-service-account" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} + + +### Argo Workflow ### +argo-workflows: + workflow: + serviceAccount: + create: true + name: "argo-workflow" + rbac: + create: true + controller: + workflowNamespaces: + - default + server: + extraArgs: + - --auth-mode=server \ No newline at end of file