From 0b786b3fdd1cebfc3a4cfcbd43c61075d5c1aef0 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Wed, 13 Sep 2023 13:02:50 -0700 Subject: [PATCH] Remove use of local-path-provisioner and create PVs --- deploy/helm-charts/.gitignore | 1 + deploy/helm-charts/Chart.lock | 7 +- deploy/helm-charts/Chart.yaml | 5 +- deploy/helm-charts/charts/.gitignore | 1 - deploy/helm-charts/docs/01.installation.md | 19 +- .../files/informatics-gateway.json | 4 +- .../hello-world-argo-template.yml | 4 +- .../files/sample-workflows/hello-world.json | 2 +- deploy/helm-charts/files/welcome.sh | 11 +- .../helm-charts/templates/01-mongodb-pv.yaml | 28 +++ .../helm-charts/templates/01-mongodb-pvc.yaml | 11 -- .../helm-charts/templates/02-rabbitmq-pv.yaml | 28 +++ .../templates/02-rabbitmq-pvc.yaml | 11 -- deploy/helm-charts/templates/03-minio-pv.yaml | 59 +++++++ .../helm-charts/templates/03-minio-pvc.yaml | 23 --- .../helm-charts/templates/04-orthanc-pv.yaml | 28 +++ .../helm-charts/templates/04-orthanc-pvc.yaml | 11 -- .../helm-charts/templates/05-postgres-pv.yaml | 30 ++++ .../templates/05-postgres-pvc.yaml | 13 -- .../templates/10-informatics-gateway-pv.yaml | 59 +++++++ .../templates/10-informatics-gateway-pvc.yaml | 23 --- .../11-workflow-manager-deployment.yaml | 6 + .../templates/11-workflow-manager-pv.yaml | 29 +++ .../templates/12-task-manager-deployment.yaml | 6 + .../templates/12-task-manager-pv.yaml | 29 +++ .../99-internal-svc-network-policy.yaml | 16 ++ deploy/helm-charts/values.yaml | 36 +++- performance-testing/scripts/1.mongo.sh | 43 +++++ performance-testing/scripts/2.perf.sh | 166 ++++++++++++++++++ performance-testing/scripts/3.storescu.sh | 24 +++ performance-testing/scripts/README.md | 17 ++ 31 files changed, 632 insertions(+), 118 deletions(-) create mode 100644 deploy/helm-charts/.gitignore delete mode 100644 deploy/helm-charts/charts/.gitignore create mode 100644 deploy/helm-charts/templates/01-mongodb-pv.yaml delete mode 100644 deploy/helm-charts/templates/01-mongodb-pvc.yaml create mode 100644 deploy/helm-charts/templates/02-rabbitmq-pv.yaml delete mode 100644 deploy/helm-charts/templates/02-rabbitmq-pvc.yaml create mode 100644 deploy/helm-charts/templates/03-minio-pv.yaml delete mode 100644 deploy/helm-charts/templates/03-minio-pvc.yaml create mode 100644 deploy/helm-charts/templates/04-orthanc-pv.yaml delete mode 100644 deploy/helm-charts/templates/04-orthanc-pvc.yaml create mode 100644 deploy/helm-charts/templates/05-postgres-pv.yaml delete mode 100644 deploy/helm-charts/templates/05-postgres-pvc.yaml create mode 100644 deploy/helm-charts/templates/10-informatics-gateway-pv.yaml delete mode 100644 deploy/helm-charts/templates/10-informatics-gateway-pvc.yaml create mode 100644 deploy/helm-charts/templates/11-workflow-manager-pv.yaml create mode 100644 deploy/helm-charts/templates/12-task-manager-pv.yaml create mode 100644 deploy/helm-charts/templates/99-internal-svc-network-policy.yaml create mode 100755 performance-testing/scripts/1.mongo.sh create mode 100755 performance-testing/scripts/2.perf.sh create mode 100755 performance-testing/scripts/3.storescu.sh create mode 100755 performance-testing/scripts/README.md diff --git a/deploy/helm-charts/.gitignore b/deploy/helm-charts/.gitignore new file mode 100644 index 0000000..268bba3 --- /dev/null +++ b/deploy/helm-charts/.gitignore @@ -0,0 +1 @@ +charts/*.tgz \ No newline at end of file diff --git a/deploy/helm-charts/Chart.lock b/deploy/helm-charts/Chart.lock index 5a58f68..e2a37ac 100644 --- a/deploy/helm-charts/Chart.lock +++ b/deploy/helm-charts/Chart.lock @@ -2,8 +2,5 @@ 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" +digest: sha256:bc9fd492011835b2ebb1d418f860eda28691ab8805d3215be2f488fc00cfe236 +generated: "2023-09-07T10:32:16.447050486-07:00" diff --git a/deploy/helm-charts/Chart.yaml b/deploy/helm-charts/Chart.yaml index b2e52de..bec470c 100644 --- a/deploy/helm-charts/Chart.yaml +++ b/deploy/helm-charts/Chart.yaml @@ -31,8 +31,5 @@ sources: - https://github.com/Project-MONAI/monai-deploy-workflow-manager/ dependencies: - name: argo-workflows - version: 0.33.1 + version: 0.33.3 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/charts/.gitignore b/deploy/helm-charts/charts/.gitignore deleted file mode 100644 index 9e30eb9..0000000 --- a/deploy/helm-charts/charts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.tgz \ No newline at end of file diff --git a/deploy/helm-charts/docs/01.installation.md b/deploy/helm-charts/docs/01.installation.md index 9804925..7ac35bc 100644 --- a/deploy/helm-charts/docs/01.installation.md +++ b/deploy/helm-charts/docs/01.installation.md @@ -102,7 +102,6 @@ Use the following commands to install MONAI Deploy Helm charts and its dependenc - Orthanc - RabbitMQ - [Argo Workflows](https://github.com/argoproj/argo-helm/tree/main/charts/argo-workflows) -- [local-path-provisioner](https://github.com/rancher/local-path-provisioner) - Postgres - archives Argo jobs (can be disabled in `values.yaml` > `argo-workflows` > `controller` > `persistence` > `archive=false`) ```bash @@ -110,6 +109,24 @@ helm upgrade -i monai-deploy . # default/current namespace helm upgrade -i monai-deploy -n my-space . # install in namespace "my-namespace" ``` +> **Note** +> Persistent volumes are created in `/opt/monai-deploy` by default, please ensure the volume has enough space required for each service: +> - Informatics Gateway: 1Gi (logs), 10Gi (payloads) - `/opt/monai-deploy/mig` +> - MinIO: 100Gi (data), 1Gi (config) - `/opt/monai-deploy/minio` +> - Mongo: 1Gi - `/opt/monai-deploy/mongo` +> - Orthanc: 100Gi - `/opt/monai-deploy/orthanc` +> - RabbitMQ: 1Gi - `/opt/monai-deploy/rabbitmq` +> - Postgres: 1Gi - `/opt/monai-deploy/postgres` + +> **Note** +> Informatics Gateway creates two buckets at startup: +> 1. monaideploy - stores input and output +> 2. argologs - archives application logs from Argo + +> **Warning** +> While data can be persisted between reinstallations, you may still need to reconfigure DICOM AE Titles so the IP addresses and ports +> can be configured correctly. + Upon successfully installation, optionally follow the on screen instructions to initialize Informatics Gateway & Orthanc. ## Advanced Configuration diff --git a/deploy/helm-charts/files/informatics-gateway.json b/deploy/helm-charts/files/informatics-gateway.json index 0ef34ef..f49879c 100644 --- a/deploy/helm-charts/files/informatics-gateway.json +++ b/deploy/helm-charts/files/informatics-gateway.json @@ -11,7 +11,7 @@ "scp": { "port": 104, "logDimseDatasets": false, - "rejectUnknownSources": true + "rejectUnknownSources": false }, "scu": { "aeTitle": "MONAISCU", @@ -47,7 +47,7 @@ "region": "local", "executableLocation": "/bin/mc", "serviceName": "MinIO", - "createBuckets": "monaideploy" + "createBuckets": "monaideploy,argologs" } }, "hl7": { diff --git a/deploy/helm-charts/files/sample-workflows/hello-world-argo-template.yml b/deploy/helm-charts/files/sample-workflows/hello-world-argo-template.yml index 3dde89f..8bcff64 100644 --- a/deploy/helm-charts/files/sample-workflows/hello-world-argo-template.yml +++ b/deploy/helm-charts/files/sample-workflows/hello-world-argo-template.yml @@ -55,9 +55,9 @@ spec: metadata: {} container: name: '' - image: alpine:latest + image: ubuntu:latest command: - /bin/sh args: - '-c' - - date && cp -vr /var/monai/input/* /var/monai/output && date \ No newline at end of file + - date -Ins && cp -r /var/monai/input/* /var/monai/output && date -Ins \ No newline at end of file diff --git a/deploy/helm-charts/files/sample-workflows/hello-world.json b/deploy/helm-charts/files/sample-workflows/hello-world.json index 43b502c..f342f5a 100644 --- a/deploy/helm-charts/files/sample-workflows/hello-world.json +++ b/deploy/helm-charts/files/sample-workflows/hello-world.json @@ -5,7 +5,7 @@ "informatics_gateway": { "ae_title": "MONAI-DEPLOY", "data_origins": [ - "ORTHANC" + "ORTHANC", "STORESCU" ], "export_destinations": [ "ORTHANC" diff --git a/deploy/helm-charts/files/welcome.sh b/deploy/helm-charts/files/welcome.sh index 5becd0b..2ad5183 100755 --- a/deploy/helm-charts/files/welcome.sh +++ b/deploy/helm-charts/files/welcome.sh @@ -102,13 +102,18 @@ 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 +curl -s --request DELETE "http://$NODE_IP:$MIG_API_PORT/config/source/STORESCU" >/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..." +printf "\nAdding MONAI Deploy AE Title (MONAI-DEPLOY)..." +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\", \"timeout\": 3}" >/dev/null +printf "\nAdding DICOM Source (ORTHANC)..." 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 + +HOST_IP=$(hostname -I | awk '{print $1}') +printf "\nAdding DICOM Source (STORESCU @ $HOST_IP)..." +curl -s --request POST "http://$NODE_IP:$MIG_API_PORT/config/source" --header "Content-Type: application/json" --data-raw "{\"name\": \"STORESCU\",\"hostIp\": \"$HOST_IP\",\"aeTitle\": \"STORESCU\"}" >/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 diff --git a/deploy/helm-charts/templates/01-mongodb-pv.yaml b/deploy/helm-charts/templates/01-mongodb-pv.yaml new file mode 100644 index 0000000..345d3fe --- /dev/null +++ b/deploy/helm-charts/templates/01-mongodb-pv.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.mongo.name }}-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mongo.name }}-volume-class + capacity: + storage: {{ .Values.mongo.size }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.mongo.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.mongo.name }}-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mongo.name }}-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.mongo.size }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/01-mongodb-pvc.yaml b/deploy/helm-charts/templates/01-mongodb-pvc.yaml deleted file mode 100644 index 7f047ee..0000000 --- a/deploy/helm-charts/templates/01-mongodb-pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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/02-rabbitmq-pv.yaml b/deploy/helm-charts/templates/02-rabbitmq-pv.yaml new file mode 100644 index 0000000..c9b0409 --- /dev/null +++ b/deploy/helm-charts/templates/02-rabbitmq-pv.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.rabbitmq.name }}-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.rabbitmq.name }}-volume-class + capacity: + storage: {{ .Values.rabbitmq.size }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.rabbitmq.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.rabbitmq.name }}-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.rabbitmq.name }}-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.rabbitmq.size }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/02-rabbitmq-pvc.yaml b/deploy/helm-charts/templates/02-rabbitmq-pvc.yaml deleted file mode 100644 index b0c1fb9..0000000 --- a/deploy/helm-charts/templates/02-rabbitmq-pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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/03-minio-pv.yaml b/deploy/helm-charts/templates/03-minio-pv.yaml new file mode 100644 index 0000000..cdcf6aa --- /dev/null +++ b/deploy/helm-charts/templates/03-minio-pv.yaml @@ -0,0 +1,59 @@ +# MinIO data volume and volume claim +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.minio.name }}-data-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.minio.name }}-data-volume-class + capacity: + storage: {{ .Values.minio.dataSize }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.minio.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.minio.name }}-data-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.minio.name }}-data-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.minio.dataSize }} +--- +# MinIO config volume and volume claim +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.minio.name }}-config-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.minio.name }}-config-volume-class + capacity: + storage: {{ .Values.minio.configSize }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.minio.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.minio.name }}-config-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.minio.name }}-config-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.minio.configSize }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/03-minio-pvc.yaml b/deploy/helm-charts/templates/03-minio-pvc.yaml deleted file mode 100644 index f814954..0000000 --- a/deploy/helm-charts/templates/03-minio-pvc.yaml +++ /dev/null @@ -1,23 +0,0 @@ -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/04-orthanc-pv.yaml b/deploy/helm-charts/templates/04-orthanc-pv.yaml new file mode 100644 index 0000000..56b78b1 --- /dev/null +++ b/deploy/helm-charts/templates/04-orthanc-pv.yaml @@ -0,0 +1,28 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.orthanc.name }}-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.orthanc.name }}-volume-class + capacity: + storage: {{ .Values.orthanc.size }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.orthanc.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.orthanc.name }}-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.orthanc.name }}-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.orthanc.size }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/04-orthanc-pvc.yaml b/deploy/helm-charts/templates/04-orthanc-pvc.yaml deleted file mode 100644 index b2fbaf3..0000000 --- a/deploy/helm-charts/templates/04-orthanc-pvc.yaml +++ /dev/null @@ -1,11 +0,0 @@ -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/05-postgres-pv.yaml b/deploy/helm-charts/templates/05-postgres-pv.yaml new file mode 100644 index 0000000..c242a63 --- /dev/null +++ b/deploy/helm-charts/templates/05-postgres-pv.yaml @@ -0,0 +1,30 @@ +{{- if index .Values "argo-workflows" "controller" "persistence" "archive" -}} +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.postgres.name }}-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.postgres.name }}-volume-class + capacity: + storage: {{ .Values.postgres.size }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.postgres.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.postgres.name }}-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.postgres.name }}-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.postgres.size }} +{{- end }} diff --git a/deploy/helm-charts/templates/05-postgres-pvc.yaml b/deploy/helm-charts/templates/05-postgres-pvc.yaml deleted file mode 100644 index 6cc5f44..0000000 --- a/deploy/helm-charts/templates/05-postgres-pvc.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if index .Values "argo-workflows" "controller" "persistence" "archive" -}} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: {{ .Release.Name }}-{{ .Values.postgres.name }}-volume-claim -spec: - accessModes: - - ReadWriteOnce - storageClassName: local-path - resources: - requests: - storage: {{ .Values.postgres.size }} -{{- end }} diff --git a/deploy/helm-charts/templates/10-informatics-gateway-pv.yaml b/deploy/helm-charts/templates/10-informatics-gateway-pv.yaml new file mode 100644 index 0000000..9a7990a --- /dev/null +++ b/deploy/helm-charts/templates/10-informatics-gateway-pv.yaml @@ -0,0 +1,59 @@ +# MIG log volume and volume claim +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.mig.name }}-log-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mig.name }}-log-volume-class + capacity: + storage: {{ .Values.mig.logsSize }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.mig.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.mig.name }}-logs-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mig.name }}-log-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.mig.logsSize }} +--- +# MIG payloads volume and volume claim +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.mig.name }}-payloads-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mig.name }}-payloads-volume-class + capacity: + storage: {{ .Values.mig.payloadSize }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.mig.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.mig.name }}-payloads-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mig.name }}-payloads-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.mig.payloadSize }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/10-informatics-gateway-pvc.yaml b/deploy/helm-charts/templates/10-informatics-gateway-pvc.yaml deleted file mode 100644 index 61f8868..0000000 --- a/deploy/helm-charts/templates/10-informatics-gateway-pvc.yaml +++ /dev/null @@ -1,23 +0,0 @@ -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/11-workflow-manager-deployment.yaml b/deploy/helm-charts/templates/11-workflow-manager-deployment.yaml index 278bb13..6e2817b 100644 --- a/deploy/helm-charts/templates/11-workflow-manager-deployment.yaml +++ b/deploy/helm-charts/templates/11-workflow-manager-deployment.yaml @@ -53,6 +53,9 @@ spec: path: /health port: 5000 volumeMounts: + - name: {{ .Release.Name }}-logs + mountPath: /opt/monai/wm/logs + subPath: logs - name: {{ .Release.Name }}-mwm-config mountPath: "/opt/monai/wm/appsettings.json" subPath: "appsettings.json" @@ -102,6 +105,9 @@ spec: name: {{ .Values.rabbitmq.name }}-secret key: password volumes: + - name: {{ .Release.Name }}-logs + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.mwm.name }}-logs-volume-claim - name: {{ .Release.Name }}-mwm-config configMap: name: {{ .Release.Name }}-mwm-configmap diff --git a/deploy/helm-charts/templates/11-workflow-manager-pv.yaml b/deploy/helm-charts/templates/11-workflow-manager-pv.yaml new file mode 100644 index 0000000..39f2e9c --- /dev/null +++ b/deploy/helm-charts/templates/11-workflow-manager-pv.yaml @@ -0,0 +1,29 @@ +# mwm log volume and volume claim +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.mwm.name }}-log-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mwm.name }}-log-volume-class + capacity: + storage: {{ .Values.mwm.logsSize }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.mwm.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.mwm.name }}-logs-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mwm.name }}-log-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.mwm.logsSize }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/12-task-manager-deployment.yaml b/deploy/helm-charts/templates/12-task-manager-deployment.yaml index b977c5e..596d118 100644 --- a/deploy/helm-charts/templates/12-task-manager-deployment.yaml +++ b/deploy/helm-charts/templates/12-task-manager-deployment.yaml @@ -53,6 +53,9 @@ spec: path: /health port: 5000 volumeMounts: + - name: {{ .Release.Name }}-logs + mountPath: /opt/monai/wm/logs + subPath: logs - name: {{ .Release.Name }}-mtm-config mountPath: "/opt/monai/wm/appsettings.json" subPath: "appsettings.json" @@ -102,6 +105,9 @@ spec: name: {{ .Values.rabbitmq.name }}-secret key: password volumes: + - name: {{ .Release.Name }}-logs + persistentVolumeClaim: + claimName: {{ .Release.Name }}-{{ .Values.mtm.name }}-logs-volume-claim - name: {{ .Release.Name }}-mtm-config configMap: name: {{ .Release.Name }}-mtm-configmap diff --git a/deploy/helm-charts/templates/12-task-manager-pv.yaml b/deploy/helm-charts/templates/12-task-manager-pv.yaml new file mode 100644 index 0000000..87040e9 --- /dev/null +++ b/deploy/helm-charts/templates/12-task-manager-pv.yaml @@ -0,0 +1,29 @@ +# mtm log volume and volume claim +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ .Release.Name }}-{{ .Values.mtm.name }}-log-volume + labels: + type: local +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mtm.name }}-log-volume-class + capacity: + storage: {{ .Values.mtm.logsSize }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + hostPath: + path: {{ .Values.mtm.storagePath }} + type: "DirectoryOrCreate" +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }}-{{ .Values.mtm.name }}-logs-volume-claim +spec: + storageClassName: {{ .Release.Name }}-{{ .Values.mtm.name }}-log-volume-class + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.mtm.logsSize }} \ No newline at end of file diff --git a/deploy/helm-charts/templates/99-internal-svc-network-policy.yaml b/deploy/helm-charts/templates/99-internal-svc-network-policy.yaml new file mode 100644 index 0000000..f0768d4 --- /dev/null +++ b/deploy/helm-charts/templates/99-internal-svc-network-policy.yaml @@ -0,0 +1,16 @@ +# kind: NetworkPolicy +# apiVersion: networking.k8s.io/v1 +# metadata: +# name: {{ .Values.mig.serviceName }}-policy +# spec: +# podSelector: +# matchLabels: +# role: internal-svcs +# ingress: +# - from: +# - namespaceSelector: +# matchLabels: +# role: external-svcs +# ports: +# - protocol: TCP +# port: {{ .Values.mongo.port }} \ No newline at end of file diff --git a/deploy/helm-charts/values.yaml b/deploy/helm-charts/values.yaml index 297dfaa..b639ddf 100644 --- a/deploy/helm-charts/values.yaml +++ b/deploy/helm-charts/values.yaml @@ -8,13 +8,13 @@ mig: name: informatics-gateway serviceName: mig repository: ghcr.io/project-monai/monai-deploy-informatics-gateway - tag: 0.4.0-rc.1 + tag: 0.5.0-alpha.api-nuget.1 pullPolicy: IfNotPresent imagePullSecrets: [] serviceType: NodePort dimsePort: 104 apiPort: 6000 - databaseSize: 1Gi + storagePath: /opt/monai-deploy/mig logsSize: 1Gi payloadSize: 10Gi appSettings: @@ -37,11 +37,13 @@ mwm: name: workflow-manager serviceName: mwm repository: ghcr.io/project-monai/monai-deploy-workflow-manager - tag: 2023.5.0-beta.161 + tag: 2023.5.0-pr0874.169 pullPolicy: IfNotPresent imagePullSecrets: [] serviceType: NodePort apiPort: 6000 + storagePath: /opt/monai-deploy/mwm + logsSize: 1Gi 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 @@ -58,11 +60,13 @@ mtm: name: task-manager serviceName: mtm repository: ghcr.io/project-monai/monai-deploy-task-manager - tag: 2023.5.0-beta.161 + tag: 2023.5.0-pr0874.169 pullPolicy: IfNotPresent imagePullSecrets: [] serviceType: NodePort apiPort: 6000 + storagePath: /opt/monai-deploy/mtm + logsSize: 1Gi 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 @@ -85,7 +89,9 @@ minio: username: monai password: minioadmin serviceType: NodePort - size: 50Gi + storagePath: /opt/monai-deploy/minio + dataSize: 100Gi + configSize: 1Gi port: 9000 consolePort: 9001 resources: {} @@ -121,6 +127,7 @@ mongo: username: monai password: monai serviceType: NodePort + storagePath: /opt/monai-deploy/mongo size: 1Gi port: 27017 resources: {} @@ -144,7 +151,8 @@ orthanc: imagePullSecrets: [] username: monai password: monai - size: 50Gi + storagePath: /opt/monai-deploy/orthanc + size: 100Gi serviceType: NodePort port: 8042 dimsePort: 4242 @@ -175,6 +183,7 @@ rabbitmq: erlangCookie: SWQOKODSQALRPCLNMEQG vhost: monaideploy serviceType: NodePort + storagePath: /opt/monai-deploy/rabbitmq size: 1Gi port: 5672 mgtPort: 15672 @@ -202,6 +211,7 @@ postgres: erlangCookie: SWQOKODSQALRPCLNMEQG vhost: monaideploy serviceType: NodePort + storagePath: /opt/monai-deploy/postgres size: 1Gi port: 5432 resources: {} @@ -334,4 +344,16 @@ argo-workflows: while ! psql -c 'select 1' > /dev/null 2>&1; do echo "waiting for Postgres" sleep 1 - done \ No newline at end of file + done + artifactRepository: + archiveLogs: true + s3: + bucket: argologs + endpoint: minio:9000 + insecure: true + accessKeySecret: + name: minio-secret + key: username + secretKeySecret: + name: minio-secret + key: password \ No newline at end of file diff --git a/performance-testing/scripts/1.mongo.sh b/performance-testing/scripts/1.mongo.sh new file mode 100755 index 0000000..1529644 --- /dev/null +++ b/performance-testing/scripts/1.mongo.sh @@ -0,0 +1,43 @@ +#!/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. + +NAMESPACE=${1:-default} +export MONGO_PORT=$(kubectl get --namespace $NAMESPACE service/mongo -o jsonpath="{.spec.ports[0].nodePort}") +OUTFILE=$(mktemp) +docker run --network host --rm -it rtsp/mongosh mongoexport "mongodb://localhost:$MONGO_PORT/InformaticsGateway" --quiet --jsonArray --type=json --pretty -c DicomAssociationInfo --authenticationDatabase admin -u monai -p monai > $OUTFILE + +COUNTER=1 +for row in $(cat $OUTFILE | jq -r '.[] | @base64'); do + _jq() { + echo ${row} | base64 --decode | jq -r "${1}" + } + _jqdate() { + echo ${row} | base64 --decode | jq -r "${1} | .[]" + } + + if [ ! -z "$(echo $row | base64 --decode | jq -r .Errors)" ]; then + echo "Skipping $(_jq '.CorrelationId') due to errors $(_jq '.Errors')" + continue + fi + echo "$COUNTER. $(_jq '.CorrelationId')" + echo " Duration: $(_jq '.Duration')" + echo " Start: $(_jqdate '.DateTimeCreated')" + echo " End: $(_jqdate '.DateTimeDisconnected')" + let COUNTER=COUNTER+1 + echo "===========================================================================================" + CORRELATIONID=$(_jq '.CorrelationId') + ./2.perf.sh $CORRELATIONID + echo "===========================================================================================" +done diff --git a/performance-testing/scripts/2.perf.sh b/performance-testing/scripts/2.perf.sh new file mode 100755 index 0000000..fd7aabf --- /dev/null +++ b/performance-testing/scripts/2.perf.sh @@ -0,0 +1,166 @@ +#!/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. + +CORRELATIONID=$1 +NAMESPACE=${2:-default} +MC_ALIAS=argologs +MC_LOGS_BUCKET=argologs +MIG_LOGS=/opt/monai-deploy/mig/logs/MIG*.log +MWM_LOGS=/opt/monai-deploy/mwm/logs/MWM*.log +MTM_LOGS=/opt/monai-deploy/mtm/logs/MWM*.log + +print_header() { + echo "NAME Start TIme End Time Duration" + +} +print_time() { + local name=$1 + local start_time=$2 + local end_time=$3 + local duration=$4 + + if [ "$start_time" != "N/A" ]; then + start_time=$(date --date="$start_time" -Ins -u) + else + start_time="N/A................................" + fi + if [ "$end_time" != "N/A" ]; then + end_time=$(date --date="$end_time" -Ins -u) + else + end_time="N/A................................" + fi + + echo "$name $start_time $end_time $duration" +} + +time_diff() { + local start_time_str=$1 + local end_time_str=$2 + + local start_time=$(date --date="$start_time_str" '+%s.%N') + local end_time=$(date --date="$end_time_str" '+%s.%N') + local time_diff=$(echo $end_time - $start_time | bc -l) + echo $time_diff +} +export NODE_IP=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}") +export MIG_POD=$(kubectl get po --namespace $NAMESPACE -l app=mig -o jsonpath={..metadata.name}) +export MWM_POD=$(kubectl get po --namespace $NAMESPACE -l app=mwm -o jsonpath={..metadata.name}) +export MTM_POD=$(kubectl get po --namespace $NAMESPACE -l app=mtm -o jsonpath={..metadata.name}) +export ARGO_SERVICE_NAME=$(kubectl get svc --namespace $NAMESPACE -l app.kubernetes.io/name=argo-workflows-server -o jsonpath={..metadata.name}) +export ARGO_PORT=$(kubectl get --namespace $NAMESPACE service/$ARGO_SERVICE_NAME -o jsonpath="{.spec.ports[0].port}") +export ARGO_IP=$(kubectl get --namespace $NAMESPACE service/$ARGO_SERVICE_NAME -o jsonpath="{.spec.clusterIP}") +export MINIO_PORT=$(kubectl get --namespace $NAMESPACE service/minio -o jsonpath="{.spec.ports[0].port}") +export MINIO_IP=$(kubectl get --namespace $NAMESPACE service/minio -o jsonpath="{.spec.clusterIP}") + +# echo NODE_IP=$NODE_IP +# echo MIG_POD=$MIG_POD +# echo MWM_POD=$MWM_POD +# echo MTM_POD=$MTM_POD +# echo ARGO_SERVICE_NAME=$ARGO_SERVICE_NAME +# echo ARGO_PORT=$ARGO_PORT +# echo ARGO_IP=$ARGO_IP +# echo MINIO_PORT=$MINIO_PORT +# echo MINIO_IP=$MINIO_IP + +echo Setting up MinIO client argocli=http://$MINIO_IP:$MINIO_PORT/... +mc alias set $MC_ALIAS http://$MINIO_IP:$MINIO_PORT/ monai minioadmin >/dev/null + +echo Scanning logs for CORRELATIONID=${CORRELATIONID}... +# ====== PERF.01 ================================================================ +START_TIME=$(grep -h "EventId\": 210" $MIG_LOGS | jq -r "select(.Association | test(\"$CORRELATIONID\")) | .timestamp") +TIME=$(grep -h "EventId\": 214" $MIG_LOGS | jq -r "select(.correlationId==\"$CORRELATIONID\") | .durationSeconds" ) +print_time "PERF.01" "$START_TIME" "N/A" "$TIME" + +# ====== PERF.02 ================================================================ +TIME=$(grep -h "EventId\": 712" $MIG_LOGS | jq -r "select(.CorrelationId==\"$CORRELATIONID\") | .durationSeconds" ) +print_time "PERF.02" "N/A" "N/A" "$TIME" + +# ====== PERF.03 ================================================================ +WORKFLOW_REQUEST_MESSAGEID=$(grep -h "EventId\": 10002" $MWM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .topic==\"md.workflow.request\") | .[\"@messageId\"]" ) +TASK_DISPATCH_MESSAGEID=$(grep -h "EventId\": 10000" $MWM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .topic==\"md.tasks.dispatch\") | .[\"@messageId\"]" ) +DURATION=$(grep -h "EventId\": 10005" $MWM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .messageId==\"$WORKFLOW_REQUEST_MESSAGEID\") | .durationMilliseconds" ) +DURATION_MS=`echo "scale=2;${DURATION}/1000" | bc` +print_time "PERF.03" "N/A" "N/A" "$DURATION_MS" + +# ====== PERF.04 ================================================================ +DURATION=$(grep -h "EventId\": 10005" $MTM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .[\"@messageId\"]==\"$TASK_DISPATCH_MESSAGEID\") | .durationMilliseconds" ) +DURATION_MS=`echo "scale=2;${DURATION}/1000" | bc` +print_time "PERF.04" "N/A" "N/A" "$DURATION_MS" + +# ====== PERF.05 ================================================================ +TASK_CALLBACK_LOG=$(grep -h "EventId\": 10002" $MTM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .topic==\"md.tasks.callback\")" ) +TASK_CALLBACK_MESSAGE_ID=$(echo $TASK_CALLBACK_LOG | jq -r .[\"@messageId\"]) + +TIME_START=$(echo $TASK_CALLBACK_LOG | jq -r .timestamp) +TIME_END=$(grep -h "EventId\": 107" $MTM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .[\"@messageId\"]==\"$TASK_CALLBACK_MESSAGE_ID\") | .timestamp" ) +print_time "PERF.05" "$TIME_START" "$TIME_END" $(time_diff "$TIME_START" "$TIME_END") + +# ====== PERF.06 ================================================================ +TASK_UPDATE_MESSAGEID=$(grep -h "EventId\": 10000" $MTM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .messageType==\"md.tasks.callback\" and .messageId==\"$TASK_CALLBACK_MESSAGE_ID\") | .[\"@messageId\"]") +TIME_START=$(grep -h "EventId\": 10000" $MTM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .messageType==\"md.tasks.callback\" and .messageId==\"$TASK_CALLBACK_MESSAGE_ID\") | .timestamp") +TIME_END=$(grep -h "EventId\": 200016" $MWM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\" and .[\"@messageId\"]==\"$TASK_UPDATE_MESSAGEID\") | .timestamp") + +print_time "PERF.06" "$TIME_START" "$TIME_END" $(time_diff "$TIME_START" "$TIME_END") + +ARGO_JOB_NAME=$(grep -h "EventId\": 1008" $MTM_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\") | .name" ) +ARGO_JOB_ID=$(curl -s http://$ARGO_IP:$ARGO_PORT/api/v1/archived-workflows | jq -r --arg name "${ARGO_JOB_NAME}" '.items[] | select(.metadata.name == $name) | .metadata.uid') + +# ====== PERF.07 ================================================================ +TIME_START=$(curl -s http://$ARGO_IP:$ARGO_PORT/api/v1/archived-workflows/${ARGO_JOB_ID} | jq -r .status.startedAt) +TIME_END=$(curl -s http://$ARGO_IP:$ARGO_PORT/api/v1/archived-workflows/${ARGO_JOB_ID} | jq -r .status.finishedAt) +print_time "PERF.07" "$TIME_START" "$TIME_END" $(time_diff "$TIME_START" "$TIME_END") + +# ====== PERF.08 ================================================================ + +TIME_START=$(curl -s http://$ARGO_IP:$ARGO_PORT/api/v1/archived-workflows/${ARGO_JOB_ID} | jq -r '.status.nodes | map(select(.displayName=="hello-world-step")) | .[].startedAt') +TIME_END=$(curl -s http://$ARGO_IP:$ARGO_PORT/api/v1/archived-workflows/${ARGO_JOB_ID} | jq -r '.status.nodes | map(select(.displayName=="hello-world-step")) | .[].finishedAt') +print_time "PERF.08" "$TIME_START" "$TIME_END" $(time_diff "$TIME_START" "$TIME_END") + +# ====== PERF.09 ================================================================ + +LOG_FILE=$(curl -s http://$ARGO_IP:$ARGO_PORT/api/v1/archived-workflows/${ARGO_JOB_ID} | jq -r '.status.nodes | map(select(.displayName=="hello-world-step")) | .[].outputs.artifacts | map (select(.name=="main-logs")) | .[].s3.key') +LOG_CONTENT=$(mc cat $MC_ALIAS/$MC_LOGS_BUCKET/$LOG_FILE) + +TIME_START=$(mc cat $MC_ALIAS/$MC_LOGS_BUCKET/$LOG_FILE | head -n 1) +TIME_END=$(mc cat $MC_ALIAS/$MC_LOGS_BUCKET/$LOG_FILE | tail -n 1) +print_time "PERF.09" "$TIME_START" "$TIME_END" $(time_diff "$TIME_START" "$TIME_END") + +# ====== PERF.10 ================================================================ + +TIME_START=$(curl -s http://$ARGO_IP:$ARGO_PORT/api/v1/archived-workflows/${ARGO_JOB_ID} | jq -r '.status.nodes | map(select(.displayName=="send-message")) | .[].startedAt') +TIME_END=$(curl -s http://$ARGO_IP:$ARGO_PORT/api/v1/archived-workflows/${ARGO_JOB_ID} | jq -r '.status.nodes | map(select(.displayName=="send-message")) | .[].finishedAt') +print_time "PERF.10" "$TIME_START" "$TIME_END" $(time_diff "$TIME_START" "$TIME_END") + +# ====== PERF.11 ================================================================ +TIME_TO_EXPORT=$(grep -h "EventId\": 505" $MIG_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\") | .durationMilliseconds") +EXOORT_COMPLETE_TIME=$(grep -h "EventId\": 505" $MIG_LOGS | jq -r "select(.[\"@correlationId\"]==\"$CORRELATIONID\") | .timestamp") + +DURATION_MS=`echo "scale=2;${TIME_TO_EXPORT}/1000" | bc` +print_time "PERF.11" "N/A" "$EXOORT_COMPLETE_TIME" "$DURATION_MS" + +# ====== PERF.12 ================================================================ + +print_time "PERF.12" "$START_TIME" "$EXOORT_COMPLETE_TIME" "$(time_diff "$START_TIME" "$EXOORT_COMPLETE_TIME")" + + + +echo =========================================================================== +echo Workflow Request Message ID = ${WORKFLOW_REQUEST_MESSAGEID} +echo Task Dispatch Message ID = ${TASK_DISPATCH_MESSAGEID} +echo Task Callback Message ID = ${TASK_CALLBACK_MESSAGE_ID} +echo Task Update Message ID = ${TASK_UPDATE_MESSAGEID} +echo Argo Job Name = ${ARGO_JOB_NAME} +echo Argo Job UID = ${ARGO_JOB_ID} + diff --git a/performance-testing/scripts/3.storescu.sh b/performance-testing/scripts/3.storescu.sh new file mode 100755 index 0000000..fd19d70 --- /dev/null +++ b/performance-testing/scripts/3.storescu.sh @@ -0,0 +1,24 @@ +#!/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. + +COUNT=${2:-1} +FILES=$(ls -1 $1 | wc -l) +for (( c=1; c<=${COUNT}; c++ )) +do + echo Sending $FILES from $1 to MONAI-DEPLOY + storescu -v +sd +II +IR $FILES -aec MONAI-DEPLOY localhost 104 $1 + echo "Sleeping for 20s" + sleep 20 +done diff --git a/performance-testing/scripts/README.md b/performance-testing/scripts/README.md new file mode 100755 index 0000000..0aed32a --- /dev/null +++ b/performance-testing/scripts/README.md @@ -0,0 +1,17 @@ +# Performance Test Scripts + + +## perf.sh + +Scrapes logs from all services to collect metrics. + +1. Install MinIo Client from [MinIO](https://min.io/docs/minio/linux/reference/minio-mc.html#install-mc) +2. Clear the `DicomAssociationInfo` collection in the MongoDB. + ```bash + MONGO_PORT=$(kubectl get service/mongo -o jsonpath="{.spec.ports[0].nodePort}") + docker run --network host --rm -it -v $(pwd)/mongo.js:/mongo.js rtsp/mongosh mongosh "mongodb://localhost:$MONGO_PORT/InformaticsGateway" --quiet --username monai --password monai --authenticationDatabase admin --eval "db.DicomAssociationInfo.deleteMany({})" + ``` +3. Run the script with the correlation ID of a given DICOM association: + ```bash + ./perf.sh 953166c2-b705-4bc7-a945-aa95f3c21618 + ```