From 6b7a0e7576c73952d1d8562eee6af9f55dbbabf1 Mon Sep 17 00:00:00 2001 From: Neil South Date: Mon, 24 Jul 2023 11:43:07 +0100 Subject: [PATCH 01/18] adding some tests around new fields Signed-off-by: Neil South --- ...eploy.WorkflowManager.Configuration.csproj | 2 +- src/Shared/Configuration/packages.lock.json | 6 +- src/Shared/Shared/ValidationConstants.cs | 8 +- src/Shared/Shared/Wrappers/Response.cs | 4 +- src/Shared/Shared/packages.lock.json | 6 +- src/TaskManager/API/ExecutionStatus.cs | 2 +- ...loy.WorkflowManager.TaskManager.API.csproj | 2 +- src/TaskManager/API/packages.lock.json | 6 +- src/TaskManager/Database/packages.lock.json | 6 +- .../AideClinicalReview/packages.lock.json | 16 +- .../Plug-ins/Argo/packages.lock.json | 16 +- ....Deploy.WorkflowManager.TaskManager.csproj | 4 +- .../TaskManager/packages.lock.json | 37 +-- .../Contracts/Constants/TaskTypeConstants.cs | 2 + .../Contracts/Models/ExportDestination.cs | 2 +- .../Contracts/Models/WorkflowUpdateRequest.cs | 4 +- ...ai.Deploy.WorkflowManager.Contracts.csproj | 2 +- .../Database/packages.lock.json | 6 +- .../Logging/packages.lock.json | 6 +- .../packages.lock.json | 8 +- .../PayloadListener/packages.lock.json | 62 ++-- .../Storage/packages.lock.json | 6 +- .../WorkflowExecuter/Common/EventMapper.cs | 24 +- .../Services/WorkflowExecuterService.cs | 30 +- .../WorkflowExecuter/packages.lock.json | 46 +-- .../Monai.Deploy.WorkflowManager.csproj | 4 +- .../WorkflowManager/packages.lock.json | 26 +- ...anager.TaskManager.IntegrationTests.csproj | 4 +- ...r.WorkflowExecutor.IntegrationTests.csproj | 4 +- .../PayloadListener.Tests/packages.lock.json | 8 +- .../Services/WorkflowExecuterServiceTests.cs | 303 +++++++++++++++++- .../WorkflowManager.Tests/packages.lock.json | 26 +- 32 files changed, 501 insertions(+), 187 deletions(-) diff --git a/src/Shared/Configuration/Monai.Deploy.WorkflowManager.Configuration.csproj b/src/Shared/Configuration/Monai.Deploy.WorkflowManager.Configuration.csproj index 59cff5a15..128ea6399 100755 --- a/src/Shared/Configuration/Monai.Deploy.WorkflowManager.Configuration.csproj +++ b/src/Shared/Configuration/Monai.Deploy.WorkflowManager.Configuration.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/Shared/Configuration/packages.lock.json b/src/Shared/Configuration/packages.lock.json index 6bf7fe84f..a16832752 100755 --- a/src/Shared/Configuration/packages.lock.json +++ b/src/Shared/Configuration/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[0.1.23, )", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "requested": "[0.1.24-rc0005, )", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", diff --git a/src/Shared/Shared/ValidationConstants.cs b/src/Shared/Shared/ValidationConstants.cs index a69e45fc8..a244cfe69 100644 --- a/src/Shared/Shared/ValidationConstants.cs +++ b/src/Shared/Shared/ValidationConstants.cs @@ -147,6 +147,11 @@ public enum NotificationValues /// public static readonly string ExportTaskType = "export"; + /// + /// Key for the export task type. + /// + public static readonly string ExternalAppTaskType = "external-app"; + /// /// Key for the export task type. /// @@ -167,7 +172,8 @@ public enum NotificationValues RouterTaskType, ExportTaskType, DockerTaskType, - Email + Email, + ExternalAppTaskType }; } } diff --git a/src/Shared/Shared/Wrappers/Response.cs b/src/Shared/Shared/Wrappers/Response.cs index 53052dea7..cdbb767b0 100644 --- a/src/Shared/Shared/Wrappers/Response.cs +++ b/src/Shared/Shared/Wrappers/Response.cs @@ -44,7 +44,7 @@ public Response(T data) /// /// Gets or sets Data. /// - public T Data { get; set; } + public T? Data { get; set; } /// /// Gets or sets a value indicating whether response has succeeded. @@ -54,7 +54,7 @@ public Response(T data) /// /// Gets or sets errors. /// - public string?[] Errors { get; set; } + public string?[] Errors { get; set; } = Array.Empty(); /// /// Gets or sets message. diff --git a/src/Shared/Shared/packages.lock.json b/src/Shared/Shared/packages.lock.json index 6d24d4f4f..a8f4615ec 100644 --- a/src/Shared/Shared/packages.lock.json +++ b/src/Shared/Shared/packages.lock.json @@ -163,8 +163,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -257,7 +257,7 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Monai.Deploy.Storage": "[0.2.15, )" } } diff --git a/src/TaskManager/API/ExecutionStatus.cs b/src/TaskManager/API/ExecutionStatus.cs index 09c30900a..f79606cc9 100644 --- a/src/TaskManager/API/ExecutionStatus.cs +++ b/src/TaskManager/API/ExecutionStatus.cs @@ -38,6 +38,6 @@ public class ExecutionStatus /// /// Contains various stats /// - public Dictionary Stats { get; set; } + public Dictionary Stats { get; set; } = new(); } } diff --git a/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj b/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj index c1304e3c8..f06709db5 100755 --- a/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj +++ b/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj @@ -39,7 +39,7 @@ - + diff --git a/src/TaskManager/API/packages.lock.json b/src/TaskManager/API/packages.lock.json index aaf4e3f87..a7c60dd26 100755 --- a/src/TaskManager/API/packages.lock.json +++ b/src/TaskManager/API/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[0.1.23, )", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "requested": "[0.1.24-rc0005, )", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", diff --git a/src/TaskManager/Database/packages.lock.json b/src/TaskManager/Database/packages.lock.json index 55ff9e2d3..0dddf3517 100755 --- a/src/TaskManager/Database/packages.lock.json +++ b/src/TaskManager/Database/packages.lock.json @@ -258,8 +258,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -705,7 +705,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json index 4d2dfb878..ed652f101 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json +++ b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json @@ -260,8 +260,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -733,8 +733,8 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "0.1.23", - "Monai.Deploy.Storage": "0.2.15" + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.shared": { @@ -749,11 +749,11 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "0.1.23", - "Mongo.Migration": "3.1.4", - "MongoDB.Bson": "2.19.0" + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Mongo.Migration": "[3.1.4, )", + "MongoDB.Bson": "[2.19.0, )" } } } } -} +} \ No newline at end of file diff --git a/src/TaskManager/Plug-ins/Argo/packages.lock.json b/src/TaskManager/Plug-ins/Argo/packages.lock.json index 8760538cd..6ee0f6841 100644 --- a/src/TaskManager/Plug-ins/Argo/packages.lock.json +++ b/src/TaskManager/Plug-ins/Argo/packages.lock.json @@ -536,8 +536,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -1203,8 +1203,8 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "0.1.23", - "Monai.Deploy.Storage": "0.2.15" + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.shared": { @@ -1219,11 +1219,11 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "0.1.23", - "Mongo.Migration": "3.1.4", - "MongoDB.Bson": "2.19.0" + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Mongo.Migration": "[3.1.4, )", + "MongoDB.Bson": "[2.19.0, )" } } } } -} +} \ No newline at end of file diff --git a/src/TaskManager/TaskManager/Monai.Deploy.WorkflowManager.TaskManager.csproj b/src/TaskManager/TaskManager/Monai.Deploy.WorkflowManager.TaskManager.csproj index 8ff9362b0..984705744 100755 --- a/src/TaskManager/TaskManager/Monai.Deploy.WorkflowManager.TaskManager.csproj +++ b/src/TaskManager/TaskManager/Monai.Deploy.WorkflowManager.TaskManager.csproj @@ -62,9 +62,9 @@ - + - + diff --git a/src/TaskManager/TaskManager/packages.lock.json b/src/TaskManager/TaskManager/packages.lock.json index e9ba4d952..3153f75d7 100644 --- a/src/TaskManager/TaskManager/packages.lock.json +++ b/src/TaskManager/TaskManager/packages.lock.json @@ -74,9 +74,9 @@ }, "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[0.1.23, )", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "requested": "[0.1.24-rc0005, )", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -89,11 +89,11 @@ }, "Monai.Deploy.Messaging.RabbitMQ": { "type": "Direct", - "requested": "[0.1.23, )", - "resolved": "0.1.23", - "contentHash": "+Y1eLKz9FtPbASOVtTaM1ktyUqOxmyIjksNukZ8dUhtDJrT3CF9ISw6BGajxwJfq2jUjacli3jNSc1OAnLJRcQ==", + "requested": "[0.1.24-rc0005, )", + "resolved": "0.1.24-rc0005", + "contentHash": "esuZvQZntA1UX6cXvp38gGfTulOCo3HecaOgw/IAcW9Q6qJHwUHKzCCzYJLJ1TfvInkSWVGFu+YDb5NQ6mwX1A==", "dependencies": { - "Monai.Deploy.Messaging": "0.1.23", + "Monai.Deploy.Messaging": "0.1.24-rc0005", "Polly": "7.2.3", "RabbitMQ.Client": "6.4.0", "System.Collections.Concurrent": "4.3.0" @@ -1920,8 +1920,8 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "0.1.23", - "Monai.Deploy.Storage": "0.2.15" + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.shared": { @@ -1944,7 +1944,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } @@ -1969,18 +1969,9 @@ "monai.deploy.workflowmanager.taskmanager.docker": { "type": "Project", "dependencies": { - "Docker.DotNet": "3.125.13", - "Monai.Deploy.WorkflowManager.Configuration": "1.0.0", - "Monai.Deploy.WorkflowManager.TaskManager.API": "1.0.0" - } - }, - "monai.deploy.workflowmanager.taskmanager.email": { - "type": "Project", - "dependencies": { - "Monai.Deploy.WorkflowManager.Configuration": "1.0.0", - "Monai.Deploy.WorkflowManager.Shared": "1.0.0", - "Monai.Deploy.WorkflowManager.TaskManager.API": "1.0.0", - "fo-dicom": "5.0.3" + "Docker.DotNet": "[3.125.13, )", + "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.TaskManager.API": "[1.0.0, )" } }, "monai.deploy.workflowmanager.taskmanager.email": { @@ -1994,4 +1985,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs b/src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs index 0be64fdfa..b2a5bbc94 100644 --- a/src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs +++ b/src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs @@ -21,5 +21,7 @@ public static class TaskTypeConstants public const string RouterTask = "router"; public const string ExportTask = "export"; + + public const string ExternalAppTask = "external-app"; } } diff --git a/src/WorkflowManager/Contracts/Models/ExportDestination.cs b/src/WorkflowManager/Contracts/Models/ExportDestination.cs index 7cc856f19..2890a4067 100644 --- a/src/WorkflowManager/Contracts/Models/ExportDestination.cs +++ b/src/WorkflowManager/Contracts/Models/ExportDestination.cs @@ -21,6 +21,6 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models public class ExportDestination { [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + public string Name { get; set; } = ""; } } diff --git a/src/WorkflowManager/Contracts/Models/WorkflowUpdateRequest.cs b/src/WorkflowManager/Contracts/Models/WorkflowUpdateRequest.cs index 90daca353..b486d3b42 100644 --- a/src/WorkflowManager/Contracts/Models/WorkflowUpdateRequest.cs +++ b/src/WorkflowManager/Contracts/Models/WorkflowUpdateRequest.cs @@ -21,9 +21,9 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models public class WorkflowUpdateRequest { [JsonProperty(PropertyName = "original_workflow_name")] - public string OriginalWorkflowName { get; set; } + public string OriginalWorkflowName { get; set; } = ""; [JsonProperty(PropertyName = "workflow")] - public Workflow Workflow { get; set; } + public Workflow Workflow { get; set; } = new(); } } diff --git a/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj b/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj index 1126257f2..dd0f7d4e9 100755 --- a/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj +++ b/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj @@ -38,7 +38,7 @@ - + diff --git a/src/WorkflowManager/Database/packages.lock.json b/src/WorkflowManager/Database/packages.lock.json index 24de264cf..a9245b157 100755 --- a/src/WorkflowManager/Database/packages.lock.json +++ b/src/WorkflowManager/Database/packages.lock.json @@ -280,8 +280,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -706,7 +706,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/Logging/packages.lock.json b/src/WorkflowManager/Logging/packages.lock.json index 04721f81c..9d9ca7771 100755 --- a/src/WorkflowManager/Logging/packages.lock.json +++ b/src/WorkflowManager/Logging/packages.lock.json @@ -221,8 +221,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -662,7 +662,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json b/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json index 8c034592d..352f69541 100644 --- a/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json +++ b/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json @@ -257,8 +257,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -746,14 +746,14 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/PayloadListener/packages.lock.json b/src/WorkflowManager/PayloadListener/packages.lock.json index 51a3849c5..2f7d4fd5f 100644 --- a/src/WorkflowManager/PayloadListener/packages.lock.json +++ b/src/WorkflowManager/PayloadListener/packages.lock.json @@ -272,8 +272,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -771,31 +771,31 @@ "monai.deploy.workflowmanager.common": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Database": "1.0.0", - "Monai.Deploy.WorkflowManager.Storage": "1.0.0" + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Database": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Storage": "[1.0.0, )" } }, "monai.deploy.workflowmanager.conditionsresolver": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Common": "1.0.0", - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Database": "1.0.0", - "Monai.Deploy.WorkflowManager.Storage": "1.0.0" + "Monai.Deploy.WorkflowManager.Common": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Database": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Storage": "[1.0.0, )" } }, "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } @@ -803,46 +803,46 @@ "monai.deploy.workflowmanager.database": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Logging": "1.0.0", - "Mongo.Migration": "3.1.4", - "MongoDB.Driver": "2.19.0" + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Logging": "[1.0.0, )", + "Mongo.Migration": "[3.1.4, )", + "MongoDB.Driver": "[2.19.0, )" } }, "monai.deploy.workflowmanager.logging": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0" + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )" } }, "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", - "Monai.Deploy.WorkflowManager.Configuration": "1.0.0", - "fo-dicom": "5.0.3" + "Ardalis.GuardClauses": "[4.0.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", + "fo-dicom": "[5.0.3, )" } }, "monai.deploy.workflowmanager.storage": { "type": "Project", "dependencies": { - "Monai.Deploy.Storage": "0.2.15", - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Logging": "1.0.0" + "Monai.Deploy.Storage": "[0.2.15, )", + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Logging": "[1.0.0, )" } }, "monai.deploy.workloadmanager.workfowexecuter": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Common": "1.0.0", - "Monai.Deploy.WorkflowManager.ConditionsResolver": "1.0.0", - "Monai.Deploy.WorkflowManager.Configuration": "1.0.0", - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Database": "1.0.0", - "Monai.Deploy.WorkflowManager.Logging": "1.0.0", - "Monai.Deploy.WorkflowManager.Shared": "1.0.0", - "Monai.Deploy.WorkflowManager.Storage": "1.0.0" + "Monai.Deploy.WorkflowManager.Common": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.ConditionsResolver": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Database": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Logging": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Shared": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Storage": "[1.0.0, )" } } } diff --git a/src/WorkflowManager/Storage/packages.lock.json b/src/WorkflowManager/Storage/packages.lock.json index e9da6dc7c..44c1ebd17 100755 --- a/src/WorkflowManager/Storage/packages.lock.json +++ b/src/WorkflowManager/Storage/packages.lock.json @@ -249,8 +249,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -699,7 +699,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/WorkflowExecuter/Common/EventMapper.cs b/src/WorkflowManager/WorkflowExecuter/Common/EventMapper.cs index b00199b6f..9e5f73be2 100644 --- a/src/WorkflowManager/WorkflowExecuter/Common/EventMapper.cs +++ b/src/WorkflowManager/WorkflowExecuter/Common/EventMapper.cs @@ -15,6 +15,7 @@ */ using Ardalis.GuardClauses; +using Monai.Deploy.Messaging.Common; using Monai.Deploy.Messaging.Events; using Monai.Deploy.Messaging.Messages; using Monai.Deploy.Storage.Configuration; @@ -24,21 +25,21 @@ namespace Monai.Deploy.WorkflowManager.WorkfowExecuter.Common { public class GenerateTaskUpdateEventParams { - public string CorrelationId { get; set; } + public string CorrelationId { get; set; } = ""; - public string ExecutionId { get; set; } + public string ExecutionId { get; set; } = ""; - public string WorkflowInstanceId { get; set; } + public string WorkflowInstanceId { get; set; } = ""; - public string TaskId { get; set; } + public string TaskId { get; set; } = ""; public FailureReason FailureReason { get; set; } public TaskExecutionStatus TaskExecutionStatus { get; set; } - public Dictionary Stats { get; set; } + public Dictionary Stats { get; set; } = new(); - public string Errors { get; set; } + public string Errors { get; set; } = ""; } public static class EventMapper @@ -170,7 +171,13 @@ public static TaskDispatchEvent ToTaskDispatchEvent(TaskExecution task, }; } - public static ExportRequestEvent ToExportRequestEvent(IList dicomImages, string[] exportDestinations, string taskId, string workflowInstanceId, string correlationId) + public static ExportRequestEvent ToExportRequestEvent( + IList dicomImages, + string[] exportDestinations, + string taskId, + string workflowInstanceId, + string correlationId, + ExportRequestType exportRequestType = ExportRequestType.None) { Guard.Against.NullOrWhiteSpace(taskId, nameof(taskId)); Guard.Against.NullOrWhiteSpace(workflowInstanceId, nameof(workflowInstanceId)); @@ -184,7 +191,8 @@ public static ExportRequestEvent ToExportRequestEvent(IList dicomImages, ExportTaskId = taskId, CorrelationId = correlationId, Files = dicomImages, - Destinations = exportDestinations + Destinations = exportDestinations, + ExportRequest = exportRequestType }; } } diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index 3813b2234..2cb32e2be 100755 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -19,6 +19,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Monai.Deploy.Messaging.API; +using Monai.Deploy.Messaging.Common; using Monai.Deploy.Messaging.Events; using Monai.Deploy.Messaging.Messages; using Monai.Deploy.Storage.API; @@ -199,6 +200,13 @@ public async Task ProcessFirstWorkflowTask(WorkflowInstance workflowInstance, st return; } + if (string.Equals(task.TaskType, TaskTypeConstants.ExternalAppTask, StringComparison.InvariantCultureIgnoreCase)) + { + await HandleExternalAppAsync(workflow, workflowInstance, task, correlationId); + + return; + } + if (task.Status != TaskExecutionStatus.Created) { _logger.TaskPreviouslyDispatched(workflowInstance.PayloadId, task.TaskId); @@ -393,7 +401,11 @@ public async Task ProcessExportComplete(ExportCompleteEvent message, strin return false; } - return await HandleTaskDestinations(workflowInstance, workflow, task, correlationId); + if (message.ExportRequest == ExportRequestType.None) + { + return await HandleTaskDestinations(workflowInstance, workflow, task, correlationId); + } + return true; } if ((message.Status.Equals(ExportStatus.Failure) || message.Status.Equals(ExportStatus.PartialFailure)) && @@ -453,8 +465,12 @@ private async Task UpdateWorkflowInstanceStatus(WorkflowInstance workflowI return true; } + private async Task HandleExternalAppAsync(WorkflowRevision workflow, WorkflowInstance workflowInstance, TaskExecution task, string correlationId) + { + await HandleDicomExportAsync(workflow, workflowInstance, task, correlationId, ExportRequestType.ExternalProcessing).ConfigureAwait(false); + } - private async Task HandleDicomExportAsync(WorkflowRevision workflow, WorkflowInstance workflowInstance, TaskExecution task, string correlationId) + private async Task HandleDicomExportAsync(WorkflowRevision workflow, WorkflowInstance workflowInstance, TaskExecution task, string correlationId, ExportRequestType exportRequestType = ExportRequestType.None) { var exportList = workflow.Workflow?.Tasks?.FirstOrDefault(t => t.Id == task.TaskId)?.ExportDestinations.Select(e => e.Name).ToArray(); @@ -490,7 +506,7 @@ private async Task HandleDicomExportAsync(WorkflowRevision workflow, WorkflowIns return; } - await DispatchDicomExport(workflowInstance, task, exportList, artifactValues, correlationId); + await DispatchDicomExport(workflowInstance, task, exportList, artifactValues, correlationId, exportRequestType); } private string[] GetDicomExports(WorkflowRevision workflow, TaskExecution task, string[]? exportDestinations) @@ -521,14 +537,14 @@ private string[] GetDicomExports(WorkflowRevision workflow, TaskExecution task, return new List(task.InputArtifacts.Values).ToArray(); } - private async Task DispatchDicomExport(WorkflowInstance workflowInstance, TaskExecution task, string[]? exportDestinations, string[] artifactValues, string correlationId) + private async Task DispatchDicomExport(WorkflowInstance workflowInstance, TaskExecution task, string[]? exportDestinations, string[] artifactValues, string correlationId, ExportRequestType exportRequestType = ExportRequestType.None) { if (exportDestinations is null || !exportDestinations.Any()) { return false; } - await ExportRequest(workflowInstance, task, exportDestinations, artifactValues, correlationId); + await ExportRequest(workflowInstance, task, exportDestinations, artifactValues, correlationId, exportRequestType); return await _workflowInstanceRepository.UpdateTaskStatusAsync(workflowInstance.Id, task.TaskId, TaskExecutionStatus.Dispatched); } @@ -756,9 +772,9 @@ private async Task DispatchTask(WorkflowInstance workflowInstance, Workflo } } - private async Task ExportRequest(WorkflowInstance workflowInstance, TaskExecution taskExec, string[] exportDestinations, IList dicomImages, string correlationId) + private async Task ExportRequest(WorkflowInstance workflowInstance, TaskExecution taskExec, string[] exportDestinations, IList dicomImages, string correlationId, ExportRequestType exportRequestType = ExportRequestType.None) { - var exportRequestEvent = EventMapper.ToExportRequestEvent(dicomImages, exportDestinations, taskExec.TaskId, workflowInstance.Id, correlationId); + var exportRequestEvent = EventMapper.ToExportRequestEvent(dicomImages, exportDestinations, taskExec.TaskId, workflowInstance.Id, correlationId, exportRequestType); var jsonMesssage = new JsonMessage(exportRequestEvent, MessageBrokerConfiguration.WorkflowManagerApplicationId, exportRequestEvent.CorrelationId, Guid.NewGuid().ToString()); await _messageBrokerPublisherService.Publish(ExportRequestRoutingKey, jsonMesssage.ToMessage()); diff --git a/src/WorkflowManager/WorkflowExecuter/packages.lock.json b/src/WorkflowManager/WorkflowExecuter/packages.lock.json index 6da93086c..92b216cee 100644 --- a/src/WorkflowManager/WorkflowExecuter/packages.lock.json +++ b/src/WorkflowManager/WorkflowExecuter/packages.lock.json @@ -272,8 +272,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -771,31 +771,31 @@ "monai.deploy.workflowmanager.common": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Database": "1.0.0", - "Monai.Deploy.WorkflowManager.Storage": "1.0.0" + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Database": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Storage": "[1.0.0, )" } }, "monai.deploy.workflowmanager.conditionsresolver": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Common": "1.0.0", - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Database": "1.0.0", - "Monai.Deploy.WorkflowManager.Storage": "1.0.0" + "Monai.Deploy.WorkflowManager.Common": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Database": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Storage": "[1.0.0, )" } }, "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } @@ -803,33 +803,33 @@ "monai.deploy.workflowmanager.database": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Logging": "1.0.0", - "Mongo.Migration": "3.1.4", - "MongoDB.Driver": "2.19.0" + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Logging": "[1.0.0, )", + "Mongo.Migration": "[3.1.4, )", + "MongoDB.Driver": "[2.19.0, )" } }, "monai.deploy.workflowmanager.logging": { "type": "Project", "dependencies": { - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0" + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )" } }, "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", - "Monai.Deploy.WorkflowManager.Configuration": "1.0.0", - "fo-dicom": "5.0.3" + "Ardalis.GuardClauses": "[4.0.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", + "fo-dicom": "[5.0.3, )" } }, "monai.deploy.workflowmanager.storage": { "type": "Project", "dependencies": { - "Monai.Deploy.Storage": "0.2.15", - "Monai.Deploy.WorkflowManager.Contracts": "1.0.0", - "Monai.Deploy.WorkflowManager.Logging": "1.0.0" + "Monai.Deploy.Storage": "[0.2.15, )", + "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", + "Monai.Deploy.WorkflowManager.Logging": "[1.0.0, )" } } } diff --git a/src/WorkflowManager/WorkflowManager/Monai.Deploy.WorkflowManager.csproj b/src/WorkflowManager/WorkflowManager/Monai.Deploy.WorkflowManager.csproj index 3115e5070..c46b9570d 100755 --- a/src/WorkflowManager/WorkflowManager/Monai.Deploy.WorkflowManager.csproj +++ b/src/WorkflowManager/WorkflowManager/Monai.Deploy.WorkflowManager.csproj @@ -45,11 +45,11 @@ - + - + diff --git a/src/WorkflowManager/WorkflowManager/packages.lock.json b/src/WorkflowManager/WorkflowManager/packages.lock.json index 054bbc0d2..1e904e319 100755 --- a/src/WorkflowManager/WorkflowManager/packages.lock.json +++ b/src/WorkflowManager/WorkflowManager/packages.lock.json @@ -70,9 +70,9 @@ }, "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[0.1.23, )", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "requested": "[0.1.24-rc0005, )", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -85,11 +85,11 @@ }, "Monai.Deploy.Messaging.RabbitMQ": { "type": "Direct", - "requested": "[0.1.23, )", - "resolved": "0.1.23", - "contentHash": "+Y1eLKz9FtPbASOVtTaM1ktyUqOxmyIjksNukZ8dUhtDJrT3CF9ISw6BGajxwJfq2jUjacli3jNSc1OAnLJRcQ==", + "requested": "[0.1.24-rc0005, )", + "resolved": "0.1.24-rc0005", + "contentHash": "esuZvQZntA1UX6cXvp38gGfTulOCo3HecaOgw/IAcW9Q6qJHwUHKzCCzYJLJ1TfvInkSWVGFu+YDb5NQ6mwX1A==", "dependencies": { - "Monai.Deploy.Messaging": "0.1.23", + "Monai.Deploy.Messaging": "0.1.24-rc0005", "Polly": "7.2.3", "RabbitMQ.Client": "6.4.0", "System.Collections.Concurrent": "4.3.0" @@ -1551,14 +1551,14 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } @@ -1607,10 +1607,10 @@ "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", - "Monai.Deploy.WorkflowManager.Configuration": "1.0.0", - "fo-dicom": "5.0.3" + "Ardalis.GuardClauses": "[4.0.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", + "fo-dicom": "[5.0.3, )" } }, "monai.deploy.workflowmanager.storage": { diff --git a/tests/IntegrationTests/TaskManager.IntegrationTests/Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj b/tests/IntegrationTests/TaskManager.IntegrationTests/Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj index 484b2924f..38911a2ce 100755 --- a/tests/IntegrationTests/TaskManager.IntegrationTests/Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj +++ b/tests/IntegrationTests/TaskManager.IntegrationTests/Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj @@ -27,8 +27,8 @@ - - + + diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Monai.Deploy.WorkflowManager.WorkflowExecutor.IntegrationTests.csproj b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Monai.Deploy.WorkflowManager.WorkflowExecutor.IntegrationTests.csproj index c67d5c6b0..aef218352 100755 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Monai.Deploy.WorkflowManager.WorkflowExecutor.IntegrationTests.csproj +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Monai.Deploy.WorkflowManager.WorkflowExecutor.IntegrationTests.csproj @@ -34,8 +34,8 @@ - - + + diff --git a/tests/UnitTests/PayloadListener.Tests/packages.lock.json b/tests/UnitTests/PayloadListener.Tests/packages.lock.json index 2b4f335d3..3c0436283 100644 --- a/tests/UnitTests/PayloadListener.Tests/packages.lock.json +++ b/tests/UnitTests/PayloadListener.Tests/packages.lock.json @@ -343,8 +343,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -882,14 +882,14 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index 52ec45dc7..fb14b387f 100755 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -18,12 +18,14 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; using System.Threading; using System.Threading.Tasks; using FluentAssertions; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Monai.Deploy.Messaging.API; +using Monai.Deploy.Messaging.Common; using Monai.Deploy.Messaging.Events; using Monai.Deploy.Messaging.Messages; using Monai.Deploy.Storage.API; @@ -494,11 +496,19 @@ public async Task ProcessPayload_WithExportTask_DispatchesExport() new VirtualFileInfo("testfile.dcm", "/dcm/testfile.dcm", "test", ulong.MaxValue) }); + Message? messageSent = null; + _messageBrokerPublisherService.Setup(m => m.Publish(It.IsAny(), It.IsAny())) + .Callback((string topic, Message m) => messageSent = m); + var result = await WorkflowExecuterService.ProcessPayload(workflowRequest, new Payload() { Id = Guid.NewGuid().ToString() }); _messageBrokerPublisherService.Verify(w => w.Publish($"{_configuration.Value.Messaging.Topics.ExportRequestPrefix}.{_configuration.Value.Messaging.DicomAgents.ScuAgentName}", It.IsAny()), Times.Exactly(1)); Assert.True(result); + Assert.NotNull(messageSent); +#pragma warning disable CS8604 // Possible null reference argument. + Assert.Contains("\"export_request\":1", Encoding.UTF8.GetString(messageSent?.Body)); +#pragma warning restore CS8604 // Possible null reference argument. } [Fact] @@ -2028,7 +2038,7 @@ public async Task ProcessExportComplete_ValidExportCompleteEventMultipleTaskDest new TaskObject { Id = "doughnuts", Type = "type", - Description = "taskdesc" + Description = "taskdesc", } } } @@ -2048,12 +2058,13 @@ public async Task ProcessExportComplete_ValidExportCompleteEventMultipleTaskDest { TaskId = "pizza", Status = TaskExecutionStatus.Created - }, - new TaskExecution - { - TaskId = "coffee", - Status = TaskExecutionStatus.Created } + //, + //new TaskExecution + //{ + // TaskId = "coffee", + // Status = TaskExecutionStatus.Created + //} } }; @@ -2377,5 +2388,285 @@ public async Task TaskExecShouldPickUpConfiguredDefaultTimeout() Assert.Equal(_timeoutForDefault, newPizza.TimeoutInterval); } + + [Fact] + public async Task ProcessPayload_WithExternalAppTask_Dispatches() + { + var workflowId1 = Guid.NewGuid().ToString(); + var workflowId2 = Guid.NewGuid().ToString(); + var workflowRequest = new WorkflowRequestEvent + { + Bucket = "testbucket", + CalledAeTitle = "aetitle", + CallingAeTitle = "aetitle", + CorrelationId = Guid.NewGuid().ToString(), + Timestamp = DateTime.UtcNow, + Workflows = new List + { + workflowId1.ToString() + } + }; + + var workflows = new List + { + new WorkflowRevision + { + Id = Guid.NewGuid().ToString(), + WorkflowId = workflowId1, + Revision = 1, + Workflow = new Workflow + { + Name = "Workflowname1", + Description = "Workflowdesc1", + Version = "1", + InformaticsGateway = new InformaticsGateway + { + AeTitle = "aetitle", + ExportDestinations = new string[] { "PROD_PACS" } + }, + Tasks = new TaskObject[] + { + new TaskObject { + Id = Guid.NewGuid().ToString(), + Type = "external-app", + Description = "taskdesc", + Artifacts = new ArtifactMap + { + Input = new Artifact[] { new Artifact { Name = "dicomexport", Value = "{{ context.input }}" } } + }, + TaskDestinations = Array.Empty(), + ExportDestinations = new ExportDestination[] + { + new ExportDestination + { + Name = "PROD_PACS" + } + } + } + } + } + } + }; + + _workflowRepository.Setup(w => w.GetByWorkflowsIdsAsync(new List { workflowId1.ToString() })).ReturnsAsync(workflows); + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync(workflowId1.ToString())).ReturnsAsync(workflows[0]); + _workflowInstanceRepository.Setup(w => w.CreateAsync(It.IsAny>())).ReturnsAsync(true); + _workflowInstanceRepository.Setup(w => w.UpdateTasksAsync(It.IsAny(), It.IsAny>())).ReturnsAsync(true); + _workflowInstanceRepository.Setup(w => w.GetByWorkflowsIdsAsync(It.IsAny>())).ReturnsAsync(new List()); + _workflowInstanceRepository.Setup(w => w.UpdateTaskStatusAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(true); + var dcmInfo = new Dictionary() { { "dicomexport", "/dcm" } }; + _artifactMapper.Setup(a => a.TryConvertArtifactVariablesToPath(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny(), out dcmInfo)).Returns(true); + _storageService.Setup(w => w.ListObjectsAsync(workflowRequest.Bucket, "/dcm", true, It.IsAny())) + .ReturnsAsync(new List() + { + new VirtualFileInfo("testfile.dcm", "/dcm/testfile.dcm", "test", ulong.MaxValue) + }); + Message? messageSent = null; + _messageBrokerPublisherService.Setup(m => m.Publish(It.IsAny(), It.IsAny())) + .Callback((string topic, Message m) => messageSent = m); + + var result = await WorkflowExecuterService.ProcessPayload(workflowRequest, new Payload() { Id = Guid.NewGuid().ToString() }); + + _messageBrokerPublisherService.Verify(w => w.Publish($"{_configuration.Value.Messaging.Topics.ExportRequestPrefix}.{_configuration.Value.Messaging.DicomAgents.ScuAgentName}", It.IsAny()), Times.Exactly(1)); + + Assert.True(result); + Assert.NotNull(messageSent); +#pragma warning disable CS8604 // Possible null reference argument. + Assert.Contains("\"export_request\":1", Encoding.UTF8.GetString(messageSent?.Body)); +#pragma warning restore CS8604 // Possible null reference argument. + } + + [Fact] + public async Task ProcessPayload_WithExportComplete_Resumes() + { + var workflowInstanceId = Guid.NewGuid().ToString(); + var correlationId = Guid.NewGuid().ToString(); + + var exportEvent = new ExportCompleteEvent + { + WorkflowInstanceId = workflowInstanceId, + ExportTaskId = "pizza", + Status = ExportStatus.Success, + Message = "This is a message", + ExportRequest = ExportRequestType.None + }; + + var workflowId = Guid.NewGuid().ToString(); + + var workflow = new WorkflowRevision + { + Id = Guid.NewGuid().ToString(), + WorkflowId = workflowId, + Revision = 1, + Workflow = new Workflow + { + Name = "Workflowname2", + Description = "Workflowdesc2", + Version = "1", + InformaticsGateway = new InformaticsGateway + { + AeTitle = "aetitle" + }, + Tasks = new TaskObject[] + { + new TaskObject { + Id = "pizza", + Type = "type", + Description = "taskdesc", + TaskDestinations = new TaskDestination[] + { + new TaskDestination + { + Name = "coffee" + }, + new TaskDestination + { + Name = "doughnuts" + } + } + }, + new TaskObject { + Id = "coffee", + Type = "type", + Description = "taskdesc" + }, + new TaskObject { + Id = "doughnuts", + Type = "type", + Description = "taskdesc", + } + } + } + }; + + var workflowInstance = new WorkflowInstance + { + Id = workflowInstanceId, + WorkflowId = workflowId, + WorkflowName = workflow.Workflow.Name, + PayloadId = Guid.NewGuid().ToString(), + Status = Status.Created, + BucketId = "bucket", + Tasks = new List + { + new TaskExecution + { + TaskId = "pizza", + Status = TaskExecutionStatus.Created + } + //, + //new TaskExecution + //{ + // TaskId = "coffee", + // Status = TaskExecutionStatus.Created + //} + } + }; + + _workflowInstanceRepository.Setup(w => w.UpdateTaskStatusAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(true); + _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(workflowInstance.Id)).ReturnsAsync(workflowInstance); + _workflowInstanceRepository.Setup(w => w.UpdateTasksAsync(workflowInstance.Id, It.IsAny>())).ReturnsAsync(true); + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync(workflowInstance.WorkflowId)).ReturnsAsync(workflow); + _payloadService.Setup(p => p.GetByIdAsync(It.IsAny())).ReturnsAsync(new Payload { PatientDetails = new PatientDetails { } }); + + var response = await WorkflowExecuterService.ProcessExportComplete(exportEvent, correlationId); + + _messageBrokerPublisherService.Verify(w => w.Publish(_configuration.Value.Messaging.Topics.TaskDispatchRequest, It.IsAny()), Times.Exactly(2)); + + response.Should().BeTrue(); + } + [Fact] + public async Task ProcessPayload_WithExternalAppComplete_Pauses() + { + var workflowInstanceId = Guid.NewGuid().ToString(); + var correlationId = Guid.NewGuid().ToString(); + + var exportEvent = new ExportCompleteEvent + { + WorkflowInstanceId = workflowInstanceId, + ExportTaskId = "pizza", + Status = ExportStatus.Success, + Message = "This is a message", + ExportRequest = ExportRequestType.ExternalProcessing + }; + + var workflowId = Guid.NewGuid().ToString(); + + var workflow = new WorkflowRevision + { + Id = Guid.NewGuid().ToString(), + WorkflowId = workflowId, + Revision = 1, + Workflow = new Workflow + { + Name = "Workflowname2", + Description = "Workflowdesc2", + Version = "1", + InformaticsGateway = new InformaticsGateway + { + AeTitle = "aetitle" + }, + Tasks = new TaskObject[] + { + new TaskObject { + Id = "pizza", + Type = "type", + Description = "taskdesc", + TaskDestinations = new TaskDestination[] + { + new TaskDestination + { + Name = "coffee" + }, + new TaskDestination + { + Name = "doughnuts" + } + } + }, + new TaskObject { + Id = "coffee", + Type = "type", + Description = "taskdesc" + }, + new TaskObject { + Id = "doughnuts", + Type = "type", + Description = "taskdesc", + } + } + } + }; + + var workflowInstance = new WorkflowInstance + { + Id = workflowInstanceId, + WorkflowId = workflowId, + WorkflowName = workflow.Workflow.Name, + PayloadId = Guid.NewGuid().ToString(), + Status = Status.Created, + BucketId = "bucket", + Tasks = new List + { + new TaskExecution + { + TaskId = "pizza", + Status = TaskExecutionStatus.Created + } + } + }; + + _workflowInstanceRepository.Setup(w => w.UpdateTaskStatusAsync(It.IsAny(), It.IsAny(), It.IsAny())).ReturnsAsync(true); + _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(workflowInstance.Id)).ReturnsAsync(workflowInstance); + _workflowInstanceRepository.Setup(w => w.UpdateTasksAsync(workflowInstance.Id, It.IsAny>())).ReturnsAsync(true); + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync(workflowInstance.WorkflowId)).ReturnsAsync(workflow); + _payloadService.Setup(p => p.GetByIdAsync(It.IsAny())).ReturnsAsync(new Payload { PatientDetails = new PatientDetails { } }); + + var response = await WorkflowExecuterService.ProcessExportComplete(exportEvent, correlationId); + + _messageBrokerPublisherService.Verify(w => w.Publish(_configuration.Value.Messaging.Topics.TaskDispatchRequest, It.IsAny()), Times.Exactly(0)); + + response.Should().BeTrue(); + } } } diff --git a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json index 5d5cefa6e..af95f55aa 100755 --- a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json +++ b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json @@ -639,8 +639,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "wz93Hk2kq5cKR/8kJlCEA8DHACrPFo+lVEjWv3nvLbPhJ4N0aDzbcQoqA4P/duSWXFi0jhUzXsSwBX3rt4l7Xw==", + "resolved": "0.1.24-rc0005", + "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", "dependencies": { "Ardalis.GuardClauses": "4.0.1", "Microsoft.Extensions.Configuration": "6.0.1", @@ -653,10 +653,10 @@ }, "Monai.Deploy.Messaging.RabbitMQ": { "type": "Transitive", - "resolved": "0.1.23", - "contentHash": "+Y1eLKz9FtPbASOVtTaM1ktyUqOxmyIjksNukZ8dUhtDJrT3CF9ISw6BGajxwJfq2jUjacli3jNSc1OAnLJRcQ==", + "resolved": "0.1.24-rc0005", + "contentHash": "esuZvQZntA1UX6cXvp38gGfTulOCo3HecaOgw/IAcW9Q6qJHwUHKzCCzYJLJ1TfvInkSWVGFu+YDb5NQ6mwX1A==", "dependencies": { - "Monai.Deploy.Messaging": "0.1.23", + "Monai.Deploy.Messaging": "0.1.24-rc0005", "Polly": "7.2.3", "RabbitMQ.Client": "6.4.0", "System.Collections.Concurrent": "4.3.0" @@ -1695,8 +1695,8 @@ "Microsoft.Extensions.DependencyInjection.Abstractions": "[7.0.0, )", "Microsoft.Extensions.Hosting": "[6.0.1, )", "Microsoft.Extensions.Options": "[6.0.0, )", - "Monai.Deploy.Messaging": "[0.1.23, )", - "Monai.Deploy.Messaging.RabbitMQ": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging.RabbitMQ": "[0.1.24-rc0005, )", "Monai.Deploy.Security": "[0.1.3, )", "Monai.Deploy.Storage": "[0.2.15, )", "Monai.Deploy.Storage.MinIO": "[0.2.15, )", @@ -1736,14 +1736,14 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", + "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } @@ -1792,10 +1792,10 @@ "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", - "Monai.Deploy.WorkflowManager.Configuration": "1.0.0", - "fo-dicom": "5.0.3" + "Ardalis.GuardClauses": "[4.0.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", + "fo-dicom": "[5.0.3, )" } }, "monai.deploy.workflowmanager.storage": { From 821329ffec9fa872dd9090ff3fac127f1b6bfa87 Mon Sep 17 00:00:00 2001 From: Neil South Date: Fri, 28 Jul 2023 15:05:12 +0100 Subject: [PATCH 02/18] adding validation Signed-off-by: Neil South --- guidelines/mwm-workflow-spec.md | 6 + src/Shared/Shared/ValidationConstants.cs | 2 +- .../Contracts/Constants/TaskTypeConstants.cs | 2 +- .../Validators/WorkflowValidator.cs | 99 +++++-- .../Services/WorkflowExecuterServiceTests.cs | 2 +- .../Validators/WorkflowValidatorTests.cs | 246 ++++++++++++++++++ 6 files changed, 335 insertions(+), 22 deletions(-) diff --git a/guidelines/mwm-workflow-spec.md b/guidelines/mwm-workflow-spec.md index c6cf37cf9..275d1e470 100644 --- a/guidelines/mwm-workflow-spec.md +++ b/guidelines/mwm-workflow-spec.md @@ -249,6 +249,7 @@ These tasks are borken down into different types: | ---- | ------- | | Router | A task to control the flow through a workflow | | Export | A task to trigger the exporting of data | +| External App | A task to trigger execution of an external app | | `Plugin_Name` | A task which has a matching Plugin installed & enabled | @@ -402,6 +403,11 @@ Example (output sent to another task if the patient is female, otherwise to PACS Export destinations define an external location to which the output of the task can be sent. This will take the form of an event published to a pub/sub service notifying of an available export to a specific destination reference. Most commonly, the export location will be a PACs system and the notification will be picked up by the Monai Informatics Gateway. +#### External App +These are task types that allow for execution of external apps and in +structure are identical to the Export type above. + + #### Plugin These are tasks are Named the same as the installed Pluging. The task also requires these extra attributes:- diff --git a/src/Shared/Shared/ValidationConstants.cs b/src/Shared/Shared/ValidationConstants.cs index a244cfe69..77419e212 100644 --- a/src/Shared/Shared/ValidationConstants.cs +++ b/src/Shared/Shared/ValidationConstants.cs @@ -150,7 +150,7 @@ public enum NotificationValues /// /// Key for the export task type. /// - public static readonly string ExternalAppTaskType = "external-app"; + public static readonly string ExternalAppTaskType = "remote_app_execution"; /// /// Key for the export task type. diff --git a/src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs b/src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs index b2a5bbc94..c2d749448 100644 --- a/src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs +++ b/src/WorkflowManager/Contracts/Constants/TaskTypeConstants.cs @@ -22,6 +22,6 @@ public static class TaskTypeConstants public const string ExportTask = "export"; - public const string ExternalAppTask = "external-app"; + public const string ExternalAppTask = "remote_app_execution"; } } diff --git a/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs b/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs index 95a3d453e..31d210f4f 100644 --- a/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs +++ b/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs @@ -144,9 +144,9 @@ private void ValidateTasks(Workflow workflow, string firstTaskId) var destinations = new List(); foreach (var task in workflow.Tasks) { - ValidateTaskArtifacts(task); + ValidateTaskOutputArtifacts(task); - TaskTypeSpecificValidation(workflow.Tasks, task); + TaskTypeSpecificValidation(workflow, task); if (task.TaskDestinations.Any(td => td.Name == firstTaskId)) { @@ -179,6 +179,28 @@ private void ValidateTasks(Workflow workflow, string firstTaskId) } } + private int CheckDestinationInMigDestinations(TaskObject task, InformaticsGateway gateway) + { + var taskDestinationNames = task.ExportDestinations.Select(td => td.Name); + if (taskDestinationNames.Any() && (gateway.ExportDestinations?.IsNullOrEmpty() ?? true)) + { + Errors.Add("InformaticsGateway ExportDestinations destinations can not be null with an Export Task."); + return 1; + } + + var diff = taskDestinationNames.Except(gateway.ExportDestinations).ToList(); + if (!diff.IsNullOrEmpty()) + { + foreach (var missingDestination in diff) + { + Errors.Add($"Task: '{task.Id}' export_destination: '{missingDestination}' must be registered in the informatics_gateway object."); + } + + return diff.Count; + } + return 0; + } + private void ValidateExportDestinations(Workflow workflow) { if (workflow.Tasks.Any() is false) @@ -188,21 +210,7 @@ private void ValidateExportDestinations(Workflow workflow) foreach (var task in workflow.Tasks.Where(task => task.ExportDestinations.IsNullOrEmpty() is false)) { - var taskExportDestinationNames = task.ExportDestinations.Select(td => td.Name); - if (taskExportDestinationNames.Any() && (workflow.InformaticsGateway?.ExportDestinations?.IsNullOrEmpty() ?? true)) - { - Errors.Add("InformaticsGateway ExportDestinations destinations can not be null with an Export Task."); - return; - } - - var diff = taskExportDestinationNames.Except(workflow.InformaticsGateway?.ExportDestinations).ToList(); - if (!diff.IsNullOrEmpty()) - { - foreach (var missingDestination in diff) - { - Errors.Add($"Task: '{task.Id}' export_destination: '{missingDestination}' must be registered in the informatics_gateway object."); - } - } + CheckDestinationInMigDestinations(task, workflow.InformaticsGateway); } } @@ -293,7 +301,7 @@ private async Task ValidateInformaticsGateaway(InformaticsGateway informaticsGat } } - private void ValidateTaskArtifacts(TaskObject currentTask) + private void ValidateTaskOutputArtifacts(TaskObject currentTask) { if (currentTask.Artifacts != null && currentTask.Artifacts.Output.IsNullOrEmpty() is false) { @@ -307,8 +315,9 @@ private void ValidateTaskArtifacts(TaskObject currentTask) } } - private void TaskTypeSpecificValidation(TaskObject[] tasks, TaskObject currentTask) + private void TaskTypeSpecificValidation(Workflow workflow, TaskObject currentTask) { + var tasks = workflow.Tasks; if (ValidTaskTypes.Contains(currentTask.Type.ToLower()) is false) { Errors.Add($"Task: '{currentTask.Id}' has an invalid type{Comma}please specify: {string.Join(Comma, ValidTaskTypes)}"); @@ -317,6 +326,16 @@ private void TaskTypeSpecificValidation(TaskObject[] tasks, TaskObject currentTa ValidateInputs(currentTask); + if (currentTask.Type.Equals(ExportTaskType, StringComparison.OrdinalIgnoreCase) is true) + { + ValidateExportTask(workflow, currentTask); + } + + if (currentTask.Type.Equals(ExternalAppTaskType, StringComparison.OrdinalIgnoreCase) is true) + { + ValidateExternalAppTask(workflow, currentTask); + } + if (currentTask.Type.Equals(ArgoTaskType, StringComparison.OrdinalIgnoreCase) is true) { ValidateArgoTask(currentTask); @@ -584,5 +603,47 @@ private void ValidateClinicalReviewRequiredFields(TaskObject[] tasks, TaskObject Errors.Add($"Task: '{currentTask.Id}' reviewed_task_id: '{currentTask.Args[ReviewedTaskId]}' does not reference an Argo task."); } } + + private void ValidateExportTask(Workflow workflow, TaskObject currentTask) + { + if (currentTask.ExportDestinations.Any() is false) + { + Errors.Add($"Task: '{currentTask.Id}' does not contain a destination."); + } + + CheckDestinationInMigDestinations(currentTask, workflow.InformaticsGateway); + + if (currentTask.ExportDestinations.Count() != currentTask.ExportDestinations.Select(t => t.Name).Distinct().Count()) + { + Errors.Add($"Task: '{currentTask.Id}' contains duplicate destinations."); + } + + ValidateInputs(currentTask); + + } + + private void ValidateExternalAppTask(Workflow workflow, TaskObject currentTask) + { + if (currentTask.ExportDestinations.Any() is false) + { + Errors.Add($"Task: '{currentTask.Id}' does not contain a destination."); + } + + CheckDestinationInMigDestinations(currentTask, workflow.InformaticsGateway); + + if (currentTask.ExportDestinations.Count() != currentTask.ExportDestinations.Select(t => t.Name).Distinct().Count()) + { + Errors.Add($"Task: '{currentTask.Id}' contains duplicate destinations."); + } + + ValidateTaskOutputArtifacts(currentTask); + + if (currentTask.Artifacts == null + || currentTask.Artifacts.Output.IsNullOrEmpty() + || (currentTask.Artifacts.Output.Select(a => a.Name).Any() is false)) + { + Errors.Add($"Task: '{currentTask.Id}' must contain at lease a single output."); + } + } } } diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index fb14b387f..292d86bb8 100755 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -2428,7 +2428,7 @@ public async Task ProcessPayload_WithExternalAppTask_Dispatches() { new TaskObject { Id = Guid.NewGuid().ToString(), - Type = "external-app", + Type = "remote_app_execution", Description = "taskdesc", Artifacts = new ArtifactMap { diff --git a/tests/UnitTests/WorkflowManager.Tests/Validators/WorkflowValidatorTests.cs b/tests/UnitTests/WorkflowManager.Tests/Validators/WorkflowValidatorTests.cs index 6bded1702..121f7b11d 100644 --- a/tests/UnitTests/WorkflowManager.Tests/Validators/WorkflowValidatorTests.cs +++ b/tests/UnitTests/WorkflowManager.Tests/Validators/WorkflowValidatorTests.cs @@ -16,8 +16,10 @@ using System; using System.Threading.Tasks; +using FellowOakDicom.Imaging.Reconstruction; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Monai.Deploy.Messaging.Events; using Monai.Deploy.WorkflowManager.Common.Interfaces; using Monai.Deploy.WorkflowManager.Configuration; using Monai.Deploy.WorkflowManager.Contracts.Models; @@ -921,5 +923,249 @@ public async Task ValidateWorkflow_correct_podPriorityClassName_ReturnsNoErrors( Assert.Empty(errors); } + + [Fact] + public async Task ValidateWorkflow_ExportAppWithoutDestination_ReturnsErrors() + { + var workflow = new Workflow + { + Name = "Workflowname1", + Description = "Workflowdesc1", + Version = "1", + InformaticsGateway = new InformaticsGateway + { + AeTitle = "aetitle", + ExportDestinations = new string[] { "oneDestination", "twoDestination", "threeDestination" } + }, + Tasks = new TaskObject[] + { + new TaskObject + { + Id = "rootTask", + Type = "router", + Description = "TestDesc", + Artifacts = new ArtifactMap + { + Input = new Artifact[]{ + new Artifact + { + Name = "non_unique_artifact", + Value = "Example Value" + } + } + }, + TaskDestinations = new TaskDestination[] + { + new TaskDestination{ Name = "externalTask" } + } + }, + new TaskObject + { + Id = "externalTask", + Type = "remote_app_execution", + //ExportDestinations = new ExportDestination[] + //{ + // new ExportDestination { Name = "oneDestination" } + //}, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] + { + new Artifact { Name = "output", Value = "{{ context.executions.artifact_task_1.artifacts.output }}" }, + }, + } + } + } + }; + + _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) + .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); + + var errors = await _workflowValidator.ValidateWorkflow(workflow); + + Assert.NotEmpty(errors); + } + + [Fact] + public async Task ValidateWorkflow_ExportAppWithSameDestinationTwice_ReturnsErrors() + { + var workflow = new Workflow + { + Name = "Workflowname1", + Description = "Workflowdesc1", + Version = "1", + InformaticsGateway = new InformaticsGateway + { + AeTitle = "aetitle", + ExportDestinations = new string[] { "oneDestination", "twoDestination", "threeDestination" } + }, + Tasks = new TaskObject[] + { + new TaskObject + { + Id = "rootTask", + Type = "router", + Description = "TestDesc", + Artifacts = new ArtifactMap + { + Input = new Artifact[]{ + new Artifact + { + Name = "non_unique_artifact", + Value = "Example Value" + } + } + }, + TaskDestinations = new TaskDestination[] + { + new TaskDestination{ Name = "externalTask" } + } + }, + new TaskObject + { + Id = "externalTask", + Type = "remote_app_execution", + ExportDestinations = new ExportDestination[] + { + new ExportDestination { Name = "oneDestination" }, + new ExportDestination { Name = "oneDestination" } + }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] + { + new Artifact { Name = "output", Value = "{{ context.executions.artifact_task_1.artifacts.output }}" }, + }, + } + } + } + }; + + _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) + .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); + + var errors = await _workflowValidator.ValidateWorkflow(workflow); + + Assert.NotEmpty(errors); + } + + [Fact] + public async Task ValidateWorkflow_ExportAppWithInputs_ReturnsErrors() + { + var workflow = new Workflow + { + Name = "Workflowname1", + Description = "Workflowdesc1", + Version = "1", + InformaticsGateway = new InformaticsGateway + { + AeTitle = "aetitle", + ExportDestinations = new string[] { "oneDestination", "twoDestination", "threeDestination" } + }, + Tasks = new TaskObject[] + { + new TaskObject + { + Id = "rootTask", + Type = "router", + Description = "TestDesc", + Artifacts = new ArtifactMap + { + Input = new Artifact[]{ + new Artifact + { + Name = "non_unique_artifact", + Value = "Example Value" + } + } + }, + TaskDestinations = new TaskDestination[] + { + new TaskDestination{ Name = "externalTask" } + } + }, + new TaskObject + { + Id = "externalTask", + Type = "remote_app_execution", + ExportDestinations = new ExportDestination[] + { + new ExportDestination { Name = "oneDestination" } + }, + Artifacts = new ArtifactMap() + { + } + } + } + }; + + _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) + .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); + + var errors = await _workflowValidator.ValidateWorkflow(workflow); + + Assert.NotEmpty(errors); + } + [Fact] + public async Task ValidateWorkflow_ExportAppWithOutputs_ReturnsErrors() + { + var workflow = new Workflow + { + Name = "Workflowname1", + Description = "Workflowdesc1", + Version = "1", + InformaticsGateway = new InformaticsGateway + { + AeTitle = "aetitle", + ExportDestinations = new string[] { "oneDestination", "twoDestination", "threeDestination" } + }, + Tasks = new TaskObject[] + { + new TaskObject + { + Id = "rootTask", + Type = "router", + Description = "TestDesc", + Artifacts = new ArtifactMap + { + Input = new Artifact[]{ + new Artifact + { + Name = "non_unique_artifact", + Value = "Example Value" + } + } + }, + TaskDestinations = new TaskDestination[] + { + new TaskDestination{ Name = "externalTask" } + } + }, + new TaskObject + { + Id = "externalTask", + Type = "remote_app_execution", + ExportDestinations = new ExportDestination[] + { + new ExportDestination { Name = "oneDestination" } + }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] + { + new Artifact { Name = "output", Value = "{{ context.executions.artifact_task_1.artifacts.output }}" }, + }, + } + } + } + }; + + _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) + .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); + + var errors = await _workflowValidator.ValidateWorkflow(workflow); + + Assert.Single(errors); + } } } From 677108038f001a20b3554961287c6976d1e85534 Mon Sep 17 00:00:00 2001 From: Neil South Date: Fri, 28 Jul 2023 15:46:12 +0100 Subject: [PATCH 03/18] fixups Signed-off-by: Neil South --- doc/dependency_decisions.yml | 6 ++++-- .../Services/WorkflowExecuterServiceTests.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/dependency_decisions.yml b/doc/dependency_decisions.yml index 56ea892e4..7ab762d8b 100755 --- a/doc/dependency_decisions.yml +++ b/doc/dependency_decisions.yml @@ -2336,7 +2336,8 @@ :versions: - 0.1.21 - 0.1.23 - :when: 2022-12-15 21:43:10.781625468 Z + - 0.1.24-rc0005 + :when: 2023-07-27 21:43:10.781625468 Z - - :approve - Monai.Deploy.Messaging.RabbitMQ - :who: samrooke @@ -2344,7 +2345,8 @@ :versions: - 0.1.21 - 0.1.23 - :when: 2022-12-15 21:43:20.975488411 Z + - 0.1.24-rc0005 + :when: 2023-07-27 21:43:20.975488411 Z - - :approve - Monai.Deploy.Storage - :who: neildsouth diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index 292d86bb8..534c41ade 100755 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -507,7 +507,7 @@ public async Task ProcessPayload_WithExportTask_DispatchesExport() Assert.True(result); Assert.NotNull(messageSent); #pragma warning disable CS8604 // Possible null reference argument. - Assert.Contains("\"export_request\":1", Encoding.UTF8.GetString(messageSent?.Body)); + Assert.Contains("\"export_request\":", Encoding.UTF8.GetString(messageSent?.Body)); #pragma warning restore CS8604 // Possible null reference argument. } From 2c2f29b77115049cf94b97e4b4f226669132e8d6 Mon Sep 17 00:00:00 2001 From: Neil South Date: Mon, 14 Aug 2023 16:43:35 +0100 Subject: [PATCH 04/18] fix up packages and warnings Signed-off-by: Neil South --- ...eploy.WorkflowManager.Configuration.csproj | 2 +- .../Configuration/WorkflowManagerOptions.cs | 3 + src/Shared/Configuration/packages.lock.json | 38 ++++----- src/Shared/Shared/ApiControllerBase.cs | 8 +- ...Monai.Deploy.WorkflowManager.Shared.csproj | 4 +- src/Shared/Shared/Wrappers/Response.cs | 2 +- src/Shared/Shared/packages.lock.json | 42 ++++------ ...loy.WorkflowManager.TaskManager.API.csproj | 2 +- src/TaskManager/API/packages.lock.json | 38 ++++----- .../Database/ITaskDispatchEventRepository.cs | 2 +- .../Database/TaskDispatchEventRepository.cs | 6 +- src/TaskManager/Database/packages.lock.json | 38 ++++----- .../AideClinicalReviewMetadataRepository.cs | 10 +-- .../AideClinicalReview/packages.lock.json | 44 +++++------ src/TaskManager/Plug-ins/Argo/ArgoClient.cs | 42 +++++----- src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs | 18 ++--- src/TaskManager/Plug-ins/Argo/ArgoProvider.cs | 3 +- src/TaskManager/Plug-ins/Argo/IArgoClient.cs | 6 +- .../Repositories/ArgoMetadataRepository.cs | 10 +-- .../Plug-ins/Argo/packages.lock.json | 44 +++++------ src/TaskManager/Plug-ins/Email/EmailPlugin.cs | 6 +- .../Repositories/TestPluginRepository.cs | 10 +-- ....Deploy.WorkflowManager.TaskManager.csproj | 4 +- .../Services/TaskDispatchEventService.cs | 4 +- .../TaskManager/packages.lock.json | 78 +++++++++---------- .../Common/Extensions/CollectionExtensions.cs | 2 +- .../Common/Services/PayloadService.cs | 6 +- .../Services/WorkflowInstanceService.cs | 10 +-- .../Common/Services/WorkflowService.cs | 12 +-- .../Parser/ConditionalParameterParser.cs | 18 ++--- .../Resovler/ConditionalGroup.cs | 8 +- ...ai.Deploy.WorkflowManager.Contracts.csproj | 2 +- .../Repositories/PayloadRepository.cs | 8 +- .../Database/Repositories/RepositoryBase.cs | 4 +- .../WorkflowInstanceRepository.cs | 1 - .../Repositories/WorkflowRepository.cs | 8 +- .../Database/packages.lock.json | 38 ++++----- .../Logging/packages.lock.json | 38 ++++----- .../packages.lock.json | 40 ++++------ .../Services/PayloadListenerService.cs | 78 +++++++++---------- .../PayloadListener/packages.lock.json | 44 +++++------ .../Storage/Services/DicomService.cs | 34 ++++---- .../Storage/packages.lock.json | 38 ++++----- .../WorkflowExecuter/Common/ArtifactMapper.cs | 10 +-- .../WorkflowExecuter/Common/EventMapper.cs | 12 +-- .../Common/TaskExecutionStatusExtensions.cs | 4 +- .../Services/WorkflowExecuterService.cs | 39 +++++----- .../WorkflowExecuter/packages.lock.json | 44 +++++------ .../Monai.Deploy.WorkflowManager.csproj | 4 +- .../WorkflowManager/appsettings.json | 3 +- .../WorkflowManager/packages.lock.json | 78 +++++++++---------- ...anager.TaskManager.IntegrationTests.csproj | 8 +- ...r.WorkflowExecutor.IntegrationTests.csproj | 6 +- .../PayloadListener.Tests/packages.lock.json | 44 +++++------ .../EmailPluginTests.cs | 8 +- .../Services/WorkflowExecuterServiceTests.cs | 9 +-- .../WorkflowManager.Tests/packages.lock.json | 78 +++++++++---------- 57 files changed, 538 insertions(+), 662 deletions(-) diff --git a/src/Shared/Configuration/Monai.Deploy.WorkflowManager.Configuration.csproj b/src/Shared/Configuration/Monai.Deploy.WorkflowManager.Configuration.csproj index 128ea6399..0a2fa6242 100755 --- a/src/Shared/Configuration/Monai.Deploy.WorkflowManager.Configuration.csproj +++ b/src/Shared/Configuration/Monai.Deploy.WorkflowManager.Configuration.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/Shared/Configuration/WorkflowManagerOptions.cs b/src/Shared/Configuration/WorkflowManagerOptions.cs index 689d6cff0..9207f09c3 100755 --- a/src/Shared/Configuration/WorkflowManagerOptions.cs +++ b/src/Shared/Configuration/WorkflowManagerOptions.cs @@ -71,6 +71,9 @@ public class WorkflowManagerOptions : PagedOptions [ConfigurationKeyName("dicomTagsDisallowed")] public string DicomTagsDisallowed { get; set; } = string.Empty; + [ConfigurationKeyName("migExternalAppPlugins")] + public List MigExternalAppPlugins { get; set; } + public WorkflowManagerOptions() { Messaging = new MessageBrokerConfiguration(); diff --git a/src/Shared/Configuration/packages.lock.json b/src/Shared/Configuration/packages.lock.json index a16832752..b828524f2 100755 --- a/src/Shared/Configuration/packages.lock.json +++ b/src/Shared/Configuration/packages.lock.json @@ -4,13 +4,13 @@ "net6.0": { "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[0.1.24-rc0005, )", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "requested": "[0.1.24, )", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -34,11 +34,8 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -53,11 +50,6 @@ "AWSSDK.Core": "[3.7.105.20, 4.0.0)" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "Microsoft.Extensions.Configuration": { "type": "Transitive", "resolved": "6.0.1", @@ -91,19 +83,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -137,8 +129,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", diff --git a/src/Shared/Shared/ApiControllerBase.cs b/src/Shared/Shared/ApiControllerBase.cs index 2bcf08114..e85fe25c0 100644 --- a/src/Shared/Shared/ApiControllerBase.cs +++ b/src/Shared/Shared/ApiControllerBase.cs @@ -69,10 +69,10 @@ public ApiControllerBase(IOptions Options) /// Returns . public PagedResponse> CreatePagedResponse(IEnumerable pagedData, PaginationFilter validFilter, long totalRecords, IUriService uriService, string route) { - Guard.Against.Null(pagedData); - Guard.Against.Null(validFilter); - Guard.Against.Null(route); - Guard.Against.Null(uriService); + Guard.Against.Null(pagedData, nameof(pagedData)); + Guard.Against.Null(validFilter, nameof(validFilter)); + Guard.Against.Null(route, nameof(route)); + Guard.Against.Null(uriService, nameof(uriService)); var pageSize = validFilter.PageSize ?? Options.Value.EndpointSettings.DefaultPageSize; var response = new PagedResponse>(pagedData, validFilter.PageNumber, pageSize); diff --git a/src/Shared/Shared/Monai.Deploy.WorkflowManager.Shared.csproj b/src/Shared/Shared/Monai.Deploy.WorkflowManager.Shared.csproj index 6c76ee19d..591f598b4 100755 --- a/src/Shared/Shared/Monai.Deploy.WorkflowManager.Shared.csproj +++ b/src/Shared/Shared/Monai.Deploy.WorkflowManager.Shared.csproj @@ -47,9 +47,9 @@ - + - + diff --git a/src/Shared/Shared/Wrappers/Response.cs b/src/Shared/Shared/Wrappers/Response.cs index cdbb767b0..2b69c610f 100644 --- a/src/Shared/Shared/Wrappers/Response.cs +++ b/src/Shared/Shared/Wrappers/Response.cs @@ -54,7 +54,7 @@ public Response(T data) /// /// Gets or sets errors. /// - public string?[] Errors { get; set; } = Array.Empty(); + public string[]? Errors { get; set; } = Array.Empty(); /// /// Gets or sets message. diff --git a/src/Shared/Shared/packages.lock.json b/src/Shared/Shared/packages.lock.json index a8f4615ec..c0436cf39 100644 --- a/src/Shared/Shared/packages.lock.json +++ b/src/Shared/Shared/packages.lock.json @@ -4,12 +4,9 @@ "net6.0": { "Ardalis.GuardClauses": { "type": "Direct", - "requested": "[4.0.1, )", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "requested": "[4.1.1, )", + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "fo-dicom": { "type": "Direct", @@ -30,9 +27,9 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Direct", - "requested": "[6.0.15, )", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "requested": "[6.0.20, )", + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -47,11 +44,6 @@ "AWSSDK.Core": "[3.7.105.20, 4.0.0)" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "Microsoft.Bcl.AsyncInterfaces": { "type": "Transitive", "resolved": "1.1.1", @@ -90,12 +82,12 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, @@ -131,8 +123,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Options": { "type": "Transitive", @@ -163,12 +155,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -257,7 +249,7 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Monai.Deploy.Storage": "[0.2.15, )" } } diff --git a/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj b/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj index f06709db5..b7527d40f 100755 --- a/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj +++ b/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj @@ -39,7 +39,7 @@ - + diff --git a/src/TaskManager/API/packages.lock.json b/src/TaskManager/API/packages.lock.json index a7c60dd26..066e10058 100755 --- a/src/TaskManager/API/packages.lock.json +++ b/src/TaskManager/API/packages.lock.json @@ -4,13 +4,13 @@ "net6.0": { "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[0.1.24-rc0005, )", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "requested": "[0.1.24, )", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -50,22 +50,14 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "DnsClient": { "type": "Transitive", "resolved": "1.4.0", "contentHash": "CO1NG1zQdV0nEAXmr/KppLZ0S1qkaPwV0kPX5YPgmYBtrBVh1XMYHM54IXy3RBJu1k4thFtpzwo4HNHqxiuFYw==" }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -151,19 +143,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.14", - "contentHash": "Gl5I5/zL2MUzg5S4FzrkfpEBh/xSZGJbBrJHS5KDiwrWIKw+yfxYCjmjq7hZN+OJrKZrjWbhRVJcXiqwN9FsNg==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.14", - "contentHash": "5QAO6QADZLRKFBDwMR34LtxPxTLmxEwG4OLFGgncvvIiTx8OjezILov4RFStCyzrqUvtlq6VJ88y9DnfgjAjNw==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -197,8 +189,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", diff --git a/src/TaskManager/Database/ITaskDispatchEventRepository.cs b/src/TaskManager/Database/ITaskDispatchEventRepository.cs index 2f7a7de5e..2a7a8de47 100644 --- a/src/TaskManager/Database/ITaskDispatchEventRepository.cs +++ b/src/TaskManager/Database/ITaskDispatchEventRepository.cs @@ -53,6 +53,6 @@ public interface ITaskDispatchEventRepository /// A TaskDispatchEvent to update. /// The plugin arguments to update. /// The updated TaskDispatchEventInfo. - Task UpdateTaskPluginArgsAsync(TaskDispatchEventInfo taskDispatchEventInfo, Dictionary pluginArgs); + Task UpdateTaskPluginArgsAsync(TaskDispatchEventInfo taskDispatchEventInfo, Dictionary pluginArgs); } } diff --git a/src/TaskManager/Database/TaskDispatchEventRepository.cs b/src/TaskManager/Database/TaskDispatchEventRepository.cs index d5b8c79d4..d6ec5cc2f 100755 --- a/src/TaskManager/Database/TaskDispatchEventRepository.cs +++ b/src/TaskManager/Database/TaskDispatchEventRepository.cs @@ -110,10 +110,10 @@ await _taskDispatchEventCollection.DeleteOneAsync( } } - public async Task UpdateTaskPluginArgsAsync(TaskDispatchEventInfo taskDispatchEventInfo, Dictionary pluginArgs) + public async Task UpdateTaskPluginArgsAsync(TaskDispatchEventInfo taskDispatchEventInfo, Dictionary pluginArgs) { - Guard.Against.Null(taskDispatchEventInfo); - Guard.Against.Null(pluginArgs); + Guard.Against.Null(taskDispatchEventInfo, nameof(taskDispatchEventInfo)); + Guard.Against.Null(pluginArgs, nameof(pluginArgs)); try { diff --git a/src/TaskManager/Database/packages.lock.json b/src/TaskManager/Database/packages.lock.json index 0dddf3517..ea61f3e3c 100755 --- a/src/TaskManager/Database/packages.lock.json +++ b/src/TaskManager/Database/packages.lock.json @@ -16,11 +16,8 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -43,11 +40,6 @@ "Microsoft.Win32.Registry": "5.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -133,19 +125,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.14", - "contentHash": "Gl5I5/zL2MUzg5S4FzrkfpEBh/xSZGJbBrJHS5KDiwrWIKw+yfxYCjmjq7hZN+OJrKZrjWbhRVJcXiqwN9FsNg==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.14", - "contentHash": "5QAO6QADZLRKFBDwMR34LtxPxTLmxEwG4OLFGgncvvIiTx8OjezILov4RFStCyzrqUvtlq6VJ88y9DnfgjAjNw==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -179,8 +171,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -258,12 +250,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -705,7 +697,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/Repositories/AideClinicalReviewMetadataRepository.cs b/src/TaskManager/Plug-ins/AideClinicalReview/Repositories/AideClinicalReviewMetadataRepository.cs index 004019eb1..dc46b139a 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/Repositories/AideClinicalReviewMetadataRepository.cs +++ b/src/TaskManager/Plug-ins/AideClinicalReview/Repositories/AideClinicalReviewMetadataRepository.cs @@ -50,12 +50,12 @@ public AideClinicalReviewMetadataRepository( private void Validate() { - Guard.Against.Null(DispatchEvent); - Guard.Against.Null(CallbackEvent); + Guard.Against.Null(DispatchEvent, nameof(DispatchEvent)); + Guard.Against.Null(CallbackEvent, nameof(CallbackEvent)); - Guard.Against.NullOrWhiteSpace(DispatchEvent.WorkflowInstanceId); - Guard.Against.NullOrWhiteSpace(DispatchEvent.ExecutionId); - Guard.Against.NullOrWhiteSpace(DispatchEvent.PayloadId); + Guard.Against.NullOrWhiteSpace(DispatchEvent.WorkflowInstanceId, nameof(DispatchEvent.WorkflowInstanceId)); + Guard.Against.NullOrWhiteSpace(DispatchEvent.ExecutionId, nameof(DispatchEvent.ExecutionId)); + Guard.Against.NullOrWhiteSpace(DispatchEvent.PayloadId, nameof(DispatchEvent.PayloadId)); } public override Task> RetrieveMetadata(CancellationToken cancellationToken = default) diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json index ed652f101..ef14a685f 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json +++ b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json @@ -4,11 +4,8 @@ "net6.0": { "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -44,11 +41,6 @@ "System.Threading.Channels": "6.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -139,19 +131,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -185,8 +177,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -260,12 +252,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -733,15 +725,15 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "[4.0.1, )", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Ardalis.GuardClauses": "[4.1.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.20, )", "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", "fo-dicom": "[5.0.3, )" } @@ -749,7 +741,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/TaskManager/Plug-ins/Argo/ArgoClient.cs b/src/TaskManager/Plug-ins/Argo/ArgoClient.cs index b802a9134..6598040ba 100755 --- a/src/TaskManager/Plug-ins/Argo/ArgoClient.cs +++ b/src/TaskManager/Plug-ins/Argo/ArgoClient.cs @@ -28,8 +28,8 @@ public ArgoClient(HttpClient httpClient) : base(httpClient) { } public async Task Argo_CreateWorkflowAsync(string argoNamespace, WorkflowCreateRequest body, CancellationToken cancellationToken) { - Guard.Against.NullOrWhiteSpace(argoNamespace); - Guard.Against.Null(body); + Guard.Against.NullOrWhiteSpace(argoNamespace, nameof(argoNamespace)); + Guard.Against.Null(body, nameof(body)); var urlBuilder = new StringBuilder(); urlBuilder.Append(CultureInfo.InvariantCulture, $"{FormattedBaseUrl}/api/v1/workflows/{argoNamespace}"); @@ -40,10 +40,10 @@ public async Task Argo_CreateWorkflowAsync(string argoNamespace, Workf } - public async Task Argo_GetWorkflowAsync(string argoNamespace, string name, string getOptions_resourceVersion, string fields, CancellationToken cancellationToken) + public async Task Argo_GetWorkflowAsync(string argoNamespace, string name, string? getOptions_resourceVersion, string? fields, CancellationToken cancellationToken) { - Guard.Against.NullOrWhiteSpace(argoNamespace); - Guard.Against.Null(name); + Guard.Against.NullOrWhiteSpace(argoNamespace, nameof(argoNamespace)); + Guard.Against.Null(name, nameof(name)); var urlBuilder = new StringBuilder(); urlBuilder.Append(CultureInfo.InvariantCulture, $"{FormattedBaseUrl}/api/v1/workflows/{argoNamespace}/{name}?"); @@ -64,9 +64,9 @@ public async Task Argo_GetWorkflowAsync(string argoNamespace, string n public async Task Argo_StopWorkflowAsync(string argoNamespace, string name, WorkflowStopRequest body) { - Guard.Against.NullOrWhiteSpace(argoNamespace); - Guard.Against.NullOrWhiteSpace(name); - Guard.Against.Null(body); + Guard.Against.NullOrWhiteSpace(argoNamespace, nameof(argoNamespace)); + Guard.Against.NullOrWhiteSpace(name, nameof(name)); + Guard.Against.Null(body, nameof(body)); var urlBuilder = new StringBuilder(); urlBuilder.Append(CultureInfo.InvariantCulture, $"{FormattedBaseUrl}/api/v1/workflows/{argoNamespace}/{name}/stop"); @@ -79,9 +79,9 @@ public async Task Argo_StopWorkflowAsync(string argoNamespace, string public async Task Argo_TerminateWorkflowAsync(string argoNamespace, string name, WorkflowTerminateRequest body) { - Guard.Against.NullOrWhiteSpace(argoNamespace); - Guard.Against.NullOrWhiteSpace(name); - Guard.Against.Null(body); + Guard.Against.NullOrWhiteSpace(argoNamespace, nameof(argoNamespace)); + Guard.Against.NullOrWhiteSpace(name, nameof(name)); + Guard.Against.Null(body, nameof(body)); var urlBuilder = new StringBuilder(); urlBuilder.Append(CultureInfo.InvariantCulture, $"{FormattedBaseUrl}/api/v1/workflows/{argoNamespace}/{name}/terminate"); @@ -91,10 +91,10 @@ public async Task Argo_TerminateWorkflowAsync(string argoNamespace, st return await SendRequest(content, urlBuilder, Method, new CancellationToken()).ConfigureAwait(false); } - public async Task Argo_GetWorkflowTemplateAsync(string argoNamespace, string name, string getOptions_resourceVersion) + public async Task Argo_GetWorkflowTemplateAsync(string argoNamespace, string name, string getOptions_resourceVersion) { - Guard.Against.NullOrWhiteSpace(argoNamespace); - Guard.Against.Null(name); + Guard.Against.NullOrWhiteSpace(argoNamespace, nameof(argoNamespace)); + Guard.Against.Null(name, nameof(name)); var urlBuilder = new StringBuilder(); urlBuilder.Append(CultureInfo.InvariantCulture, $"{FormattedBaseUrl}/api/v1/workflow-templates/{argoNamespace}/{name}?"); @@ -118,8 +118,8 @@ public async Task Argo_GetWorkflowTemplateAsync(string argoNam public async Task Argo_Get_WorkflowLogsAsync(string argoNamespace, string name, string podName, string logOptions_container) { - Guard.Against.NullOrWhiteSpace(argoNamespace); - Guard.Against.Null(name); + Guard.Against.NullOrWhiteSpace(argoNamespace, nameof(argoNamespace)); + Guard.Against.Null(name, nameof(name)); var urlBuilder = new StringBuilder(); urlBuilder.Append(CultureInfo.InvariantCulture, $"{FormattedBaseUrl}/api/v1/workflows/{argoNamespace}/{name}/log?"); @@ -142,8 +142,8 @@ public async Task Argo_GetWorkflowTemplateAsync(string argoNam /// A server side error occurred. public virtual async Task Argo_CreateWorkflowTemplateAsync(string argoNamespace, WorkflowTemplateCreateRequest body, CancellationToken cancellationToken) { - Guard.Against.NullOrWhiteSpace(argoNamespace); - Guard.Against.Null(body.Template); + Guard.Against.NullOrWhiteSpace(argoNamespace, nameof(argoNamespace)); + Guard.Against.Null(body.Template, nameof(body.Template)); var urlBuilder = new StringBuilder(); urlBuilder.Append(CultureInfo.InvariantCulture, $"{FormattedBaseUrl}/api/v1/workflow-templates/{argoNamespace}"); @@ -162,7 +162,7 @@ public virtual async Task Argo_CreateWorkflowTemplateAsync(str /// A server side error occurred. public virtual async Task Argo_DeleteWorkflowTemplateAsync(string argoNamespace, string templateName, CancellationToken cancellationToken) { - Guard.Against.NullOrWhiteSpace(argoNamespace); + Guard.Against.NullOrWhiteSpace(argoNamespace, nameof(argoNamespace)); var urlBuilder = new StringBuilder(); urlBuilder.Append(CultureInfo.InvariantCulture, $"{FormattedBaseUrl}/api/v1/workflow-templates/{argoNamespace}/{templateName}"); @@ -385,7 +385,7 @@ protected virtual async Task> ReadLogResponseAsync( { if (response == null || response.Content == null) { - return new ObjectResponseResult(default, string.Empty); + return new ObjectResponseResult(string.Empty, string.Empty); } try @@ -398,7 +398,7 @@ protected virtual async Task> ReadLogResponseAsync( var jsonBody = $"[{string.Join(",", rows)}]"; var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject>(jsonBody); - var outputLogs = string.Join("\n", typedBody.Select(b => b.Result.Content)); + var outputLogs = string.Join("\n", typedBody?.Select(b => b.Result.Content) ?? Array.Empty()); return new ObjectResponseResult(outputLogs, string.Empty); } diff --git a/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs b/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs index 5b08b0339..27ca4dab4 100755 --- a/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs +++ b/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs @@ -242,7 +242,7 @@ public override async Task GetStatus(string identity, TaskCallb // it take sometime for the Argo job to be in the final state after emitting the callback event. var retryCount = 30; - while (workflow.Status.Phase.Equals(Strings.ArgoPhaseRunning, StringComparison.OrdinalIgnoreCase) && retryCount-- > 0) + while (workflow!.Status.Phase.Equals(Strings.ArgoPhaseRunning, StringComparison.OrdinalIgnoreCase) && retryCount-- > 0) { await Task.Delay(1000, cancellationToken).ConfigureAwait(false); workflow = await client.Argo_GetWorkflowAsync(_namespace, identity, null, null, cancellationToken).ConfigureAwait(false); @@ -305,7 +305,7 @@ public override async Task GetStatus(string identity, TaskCallb private Dictionary GetExecutuionStats(Workflow workflow) { - Guard.Against.Null(workflow); + Guard.Against.Null(workflow, nameof(workflow)); TimeSpan? duration = null; if (workflow.Status?.StartedAt is not null && workflow.Status?.FinishedAt is not null) @@ -362,11 +362,11 @@ private async Task PipeExecutionLogs(IArgoClient client, string identity) try { #pragma warning disable CA2254 // Template should be a static expression - var logs = await client.Argo_Get_WorkflowLogsAsync(_namespace, identity, null, "init"); + var logs = await client.Argo_Get_WorkflowLogsAsync(_namespace, identity, null, "init") ?? ""; _logger.ArgoLog(logs); - logs = await client.Argo_Get_WorkflowLogsAsync(_namespace, identity, null, "wait"); + logs = await client.Argo_Get_WorkflowLogsAsync(_namespace, identity, null, "wait") ?? ""; _logger.ArgoLog(logs); - logs = await client.Argo_Get_WorkflowLogsAsync(_namespace, identity, null, "main"); + logs = await client.Argo_Get_WorkflowLogsAsync(_namespace, identity, null, "main") ?? ""; _logger.ArgoLog(logs); #pragma warning restore CA2254 // Template should be a static expression } @@ -431,7 +431,7 @@ private async Task BuildWorkflowWrapper(CancellationToken cancellation /// private void ProcessTaskPluginArguments(Workflow workflow) { - Guard.Against.Null(workflow); + Guard.Against.Null(workflow, nameof(workflow)); var priorityClassName = Event.GetTaskPluginArgumentsParameter(Keys.TaskPriorityClassName) ?? "standard"; foreach (var template in workflow.Spec.Templates) @@ -446,8 +446,8 @@ private void ProcessTaskPluginArguments(Workflow workflow) private void AddLimit(Template2 template, ResourcesKey key) { - Guard.Against.Null(template); - Guard.Against.Null(key); + Guard.Against.Null(template, nameof(template)); + Guard.Against.Null(key, nameof(key)); if (template.Container is null || !Event.TaskPluginArguments.TryGetValue(key.TaskKey, out var value) || string.IsNullOrWhiteSpace(value)) { return; @@ -932,7 +932,7 @@ public async Task CreateArgoTemplate(string template) throw new InvalidOperationException(mess); } - return await client.Argo_CreateWorkflowTemplateAsync(_namespace, templateCreateRequest, new CancellationToken()).ConfigureAwait(false); + return await client.Argo_CreateWorkflowTemplateAsync(_namespace, templateCreateRequest!, new CancellationToken()).ConfigureAwait(false); } catch (Exception ex) { diff --git a/src/TaskManager/Plug-ins/Argo/ArgoProvider.cs b/src/TaskManager/Plug-ins/Argo/ArgoProvider.cs index b91f7df8b..6a89f5de5 100644 --- a/src/TaskManager/Plug-ins/Argo/ArgoProvider.cs +++ b/src/TaskManager/Plug-ins/Argo/ArgoProvider.cs @@ -15,7 +15,6 @@ */ using Ardalis.GuardClauses; -using Argo; using IdentityModel.Client; using Microsoft.Extensions.Logging; using Monai.Deploy.WorkflowManager.TaskManager.Argo.Logging; @@ -45,7 +44,7 @@ public IArgoClient CreateClient(string baseUrl, string? apiToken, bool allowInse var httpClient = _httpClientFactory.CreateClient(ClientName); - Guard.Against.Null(httpClient); + Guard.Against.Null(httpClient, nameof(httpClient)); if (apiToken is not null) { diff --git a/src/TaskManager/Plug-ins/Argo/IArgoClient.cs b/src/TaskManager/Plug-ins/Argo/IArgoClient.cs index ea15b34bb..bb6bef590 100644 --- a/src/TaskManager/Plug-ins/Argo/IArgoClient.cs +++ b/src/TaskManager/Plug-ins/Argo/IArgoClient.cs @@ -23,9 +23,9 @@ public interface IArgoClient { Task Argo_CreateWorkflowAsync(string argoNamespace, WorkflowCreateRequest body, CancellationToken cancellationToken); - Task Argo_GetWorkflowAsync(string argoNamespace, string name, string getOptions_resourceVersion, string fields, CancellationToken cancellationToken); + Task Argo_GetWorkflowAsync(string argoNamespace, string name, string? getOptions_resourceVersion, string? fields, CancellationToken cancellationToken); - Task Argo_GetWorkflowTemplateAsync(string argoNamespace, string name, string getOptions_resourceVersion); + Task Argo_GetWorkflowTemplateAsync(string argoNamespace, string name, string getOptions_resourceVersion); Task Argo_StopWorkflowAsync(string argoNamespace, string name, WorkflowStopRequest body); @@ -33,7 +33,7 @@ public interface IArgoClient Task Argo_GetVersionAsync(); - Task Argo_Get_WorkflowLogsAsync(string argoNamespace, string name, string podName, string logOptions_container); + Task Argo_Get_WorkflowLogsAsync(string argoNamespace, string name, string? podName, string logOptions_container); Task Argo_CreateWorkflowTemplateAsync(string argoNamespace, WorkflowTemplateCreateRequest body, CancellationToken cancellationToken); diff --git a/src/TaskManager/Plug-ins/Argo/Repositories/ArgoMetadataRepository.cs b/src/TaskManager/Plug-ins/Argo/Repositories/ArgoMetadataRepository.cs index 2430df884..7bf0a0e14 100644 --- a/src/TaskManager/Plug-ins/Argo/Repositories/ArgoMetadataRepository.cs +++ b/src/TaskManager/Plug-ins/Argo/Repositories/ArgoMetadataRepository.cs @@ -52,12 +52,12 @@ public ArgoMetadataRepository( private void Validate() { - Guard.Against.Null(DispatchEvent); - Guard.Against.Null(CallbackEvent); + Guard.Against.Null(DispatchEvent, nameof(DispatchEvent)); + Guard.Against.Null(CallbackEvent, nameof(CallbackEvent)); - Guard.Against.NullOrWhiteSpace(DispatchEvent.WorkflowInstanceId); - Guard.Against.NullOrWhiteSpace(DispatchEvent.ExecutionId); - Guard.Against.NullOrWhiteSpace(DispatchEvent.PayloadId); + Guard.Against.NullOrWhiteSpace(DispatchEvent.WorkflowInstanceId, nameof(DispatchEvent.WorkflowInstanceId)); + Guard.Against.NullOrWhiteSpace(DispatchEvent.ExecutionId, nameof(DispatchEvent.ExecutionId)); + Guard.Against.NullOrWhiteSpace(DispatchEvent.PayloadId, nameof(DispatchEvent.PayloadId)); } public override async Task> RetrieveMetadata(CancellationToken cancellationToken = default) diff --git a/src/TaskManager/Plug-ins/Argo/packages.lock.json b/src/TaskManager/Plug-ins/Argo/packages.lock.json index 6ee0f6841..38223a5b9 100644 --- a/src/TaskManager/Plug-ins/Argo/packages.lock.json +++ b/src/TaskManager/Plug-ins/Argo/packages.lock.json @@ -46,11 +46,8 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -105,11 +102,6 @@ "Microsoft.Extensions.Logging": "6.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "KubernetesClient.Basic": { "type": "Transitive", "resolved": "10.1.4", @@ -357,19 +349,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -413,8 +405,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -536,12 +528,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -1203,15 +1195,15 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "[4.0.1, )", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Ardalis.GuardClauses": "[4.1.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.20, )", "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", "fo-dicom": "[5.0.3, )" } @@ -1219,7 +1211,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/TaskManager/Plug-ins/Email/EmailPlugin.cs b/src/TaskManager/Plug-ins/Email/EmailPlugin.cs index c29215111..07d863293 100644 --- a/src/TaskManager/Plug-ins/Email/EmailPlugin.cs +++ b/src/TaskManager/Plug-ins/Email/EmailPlugin.cs @@ -57,7 +57,7 @@ public EmailPlugin( _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _options = options ?? throw new ArgumentNullException(nameof(options)); - Guard.Against.Null(serviceScopeFactory); + Guard.Against.Null(serviceScopeFactory, nameof(serviceScopeFactory)); _scope = serviceScopeFactory.CreateScope(); _messageBrokerPublisherService = _scope.ServiceProvider.GetService() ?? throw new ServiceNotFoundException(nameof(IMessageBrokerPublisherService)); @@ -167,8 +167,8 @@ private async Task>> AddRawMetaFromFile(Dictiona foreach (var file in allFiles) { if (file.FilePath.EndsWith(".json", StringComparison.InvariantCultureIgnoreCase)) continue; - Guard.Against.NullOrWhiteSpace(bucketName); - Guard.Against.NullOrWhiteSpace(path); + Guard.Against.NullOrWhiteSpace(bucketName, nameof(bucketName)); + Guard.Against.NullOrWhiteSpace(path, nameof(path)); // load file from Minio ! var fileStream = await _storageService.GetObjectAsync(bucketName, $"{file.FilePath}"); diff --git a/src/TaskManager/Plug-ins/TestPlugin/Repositories/TestPluginRepository.cs b/src/TaskManager/Plug-ins/TestPlugin/Repositories/TestPluginRepository.cs index 3a10a30f6..44ca990cf 100644 --- a/src/TaskManager/Plug-ins/TestPlugin/Repositories/TestPluginRepository.cs +++ b/src/TaskManager/Plug-ins/TestPlugin/Repositories/TestPluginRepository.cs @@ -40,12 +40,12 @@ public TestPluginRepository( private void Validate() { - Guard.Against.Null(DispatchEvent); - Guard.Against.Null(CallbackEvent); + Guard.Against.Null(DispatchEvent, nameof(DispatchEvent)); + Guard.Against.Null(CallbackEvent, nameof(CallbackEvent)); - Guard.Against.NullOrWhiteSpace(DispatchEvent.WorkflowInstanceId); - Guard.Against.NullOrWhiteSpace(DispatchEvent.ExecutionId); - Guard.Against.NullOrWhiteSpace(DispatchEvent.PayloadId); + Guard.Against.NullOrWhiteSpace(DispatchEvent.WorkflowInstanceId, nameof(DispatchEvent.WorkflowInstanceId)); + Guard.Against.NullOrWhiteSpace(DispatchEvent.ExecutionId, nameof(DispatchEvent.ExecutionId)); + Guard.Against.NullOrWhiteSpace(DispatchEvent.PayloadId, nameof(DispatchEvent.PayloadId)); } public override async Task> RetrieveMetadata(CancellationToken cancellationToken = default) diff --git a/src/TaskManager/TaskManager/Monai.Deploy.WorkflowManager.TaskManager.csproj b/src/TaskManager/TaskManager/Monai.Deploy.WorkflowManager.TaskManager.csproj index 984705744..aa4f45d7b 100755 --- a/src/TaskManager/TaskManager/Monai.Deploy.WorkflowManager.TaskManager.csproj +++ b/src/TaskManager/TaskManager/Monai.Deploy.WorkflowManager.TaskManager.csproj @@ -62,9 +62,9 @@ - + - + diff --git a/src/TaskManager/TaskManager/Services/TaskDispatchEventService.cs b/src/TaskManager/TaskManager/Services/TaskDispatchEventService.cs index 49579a4fe..1ff14ec53 100644 --- a/src/TaskManager/TaskManager/Services/TaskDispatchEventService.cs +++ b/src/TaskManager/TaskManager/Services/TaskDispatchEventService.cs @@ -71,8 +71,8 @@ public TaskDispatchEventService(ITaskDispatchEventRepository taskDispatchEventRe public async Task UpdateTaskPluginArgsAsync(TaskDispatchEventInfo taskDispatchEvent, Dictionary pluginArgs) { - Guard.Against.Null(taskDispatchEvent); - Guard.Against.Null(pluginArgs); + Guard.Against.Null(taskDispatchEvent, nameof(taskDispatchEvent)); + Guard.Against.Null(pluginArgs, nameof(pluginArgs)); try { diff --git a/src/TaskManager/TaskManager/packages.lock.json b/src/TaskManager/TaskManager/packages.lock.json index 3153f75d7..d7edb74fd 100644 --- a/src/TaskManager/TaskManager/packages.lock.json +++ b/src/TaskManager/TaskManager/packages.lock.json @@ -74,13 +74,13 @@ }, "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[0.1.24-rc0005, )", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "requested": "[0.1.24, )", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -89,13 +89,13 @@ }, "Monai.Deploy.Messaging.RabbitMQ": { "type": "Direct", - "requested": "[0.1.24-rc0005, )", - "resolved": "0.1.24-rc0005", - "contentHash": "esuZvQZntA1UX6cXvp38gGfTulOCo3HecaOgw/IAcW9Q6qJHwUHKzCCzYJLJ1TfvInkSWVGFu+YDb5NQ6mwX1A==", + "requested": "[0.1.24, )", + "resolved": "0.1.24", + "contentHash": "qxPcI/h8YD9beEaLwbHetF4af7sEOpgmf8ojKuaB9B4U13MaInzw7JB0vS51AQ9fNZMtT0MaEnQRl28pkRzB/Q==", "dependencies": { - "Monai.Deploy.Messaging": "0.1.24-rc0005", - "Polly": "7.2.3", - "RabbitMQ.Client": "6.4.0", + "Monai.Deploy.Messaging": "0.1.24", + "Polly": "7.2.4", + "RabbitMQ.Client": "6.5.0", "System.Collections.Concurrent": "4.3.0" } }, @@ -201,11 +201,8 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -281,11 +278,6 @@ "Microsoft.Extensions.Logging": "6.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "KubernetesClient": { "type": "Transitive", "resolved": "10.1.4", @@ -633,19 +625,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -704,8 +696,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -982,8 +974,8 @@ }, "Polly": { "type": "Transitive", - "resolved": "7.2.3", - "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" + "resolved": "7.2.4", + "contentHash": "bw00Ck5sh6ekduDE3mnCo1ohzuad946uslCDEENu3091+6UKnBuKLo4e+yaNcCzXxOZCXWY2gV4a35+K1d4LDA==" }, "prometheus-net": { "type": "Transitive", @@ -996,11 +988,11 @@ }, "RabbitMQ.Client": { "type": "Transitive", - "resolved": "6.4.0", - "contentHash": "1znR1gGU+xYVSpO5z8nQolcUKA/yydnxQn7Ug9+RUXxTSLMm/eE58VKGwahPBjELXvDnX0k/kBrAitFLRjx9LA==", + "resolved": "6.5.0", + "contentHash": "9hY5HiWPtCla1/l0WmXmLnqoX7iKE3neBQUWnetIJrRpOvTbO//XQfQDh++xgHCshL40Kv/6bR0HDkmJz46twg==", "dependencies": { - "System.Memory": "4.5.4", - "System.Threading.Channels": "4.7.1" + "System.Memory": "4.5.5", + "System.Threading.Channels": "7.0.0" } }, "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { @@ -1440,8 +1432,8 @@ }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + "resolved": "4.5.5", + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" }, "System.Net.Http": { "type": "Transitive", @@ -1874,8 +1866,8 @@ }, "System.Threading.Channels": { "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q==" + "resolved": "7.0.0", + "contentHash": "qmeeYNROMsONF6ndEZcIQ+VxR4Q/TX/7uIVLJqtwIWL7dDWeh0l1UIqgo4wYyjG//5lUNhwkLDSFl+pAWO6oiA==" }, "System.Threading.Tasks": { "type": "Transitive", @@ -1920,15 +1912,15 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "[4.0.1, )", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Ardalis.GuardClauses": "[4.1.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.20, )", "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", "fo-dicom": "[5.0.3, )" } @@ -1944,7 +1936,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/Common/Extensions/CollectionExtensions.cs b/src/WorkflowManager/Common/Extensions/CollectionExtensions.cs index f66f3974b..25c3e7f9c 100644 --- a/src/WorkflowManager/Common/Extensions/CollectionExtensions.cs +++ b/src/WorkflowManager/Common/Extensions/CollectionExtensions.cs @@ -42,7 +42,7 @@ public static bool IsNullOrEmpty(this ICollection array) /// public static void Append(this Dictionary array, Dictionary otherArray) where TKey : notnull { - Guard.Against.Null(array); + Guard.Against.Null(array, nameof(array)); if (otherArray.IsNullOrEmpty()) { return; diff --git a/src/WorkflowManager/Common/Services/PayloadService.cs b/src/WorkflowManager/Common/Services/PayloadService.cs index e1873fcbd..d98287105 100644 --- a/src/WorkflowManager/Common/Services/PayloadService.cs +++ b/src/WorkflowManager/Common/Services/PayloadService.cs @@ -60,7 +60,7 @@ public PayloadService( public async Task CreateAsync(WorkflowRequestEvent eventPayload) { - Guard.Against.Null(eventPayload); + Guard.Against.Null(eventPayload, nameof(eventPayload)); try { @@ -109,7 +109,7 @@ public PayloadService( public async Task GetByIdAsync(string payloadId) { - Guard.Against.NullOrWhiteSpace(payloadId); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); return await _payloadRepository.GetByIdAsync(payloadId); } @@ -164,7 +164,7 @@ private async Task> CreatePayloadsDto(IList payloads) public async Task DeletePayloadFromStorageAsync(string payloadId) { - Guard.Against.NullOrWhiteSpace(payloadId); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); var payload = await GetByIdAsync(payloadId); diff --git a/src/WorkflowManager/Common/Services/WorkflowInstanceService.cs b/src/WorkflowManager/Common/Services/WorkflowInstanceService.cs index df2131918..535c28d1e 100644 --- a/src/WorkflowManager/Common/Services/WorkflowInstanceService.cs +++ b/src/WorkflowManager/Common/Services/WorkflowInstanceService.cs @@ -38,15 +38,15 @@ public WorkflowInstanceService(IWorkflowInstanceRepository workflowInstanceRepos public async Task GetByIdAsync(string id) { - Guard.Against.NullOrWhiteSpace(id); + Guard.Against.NullOrWhiteSpace(id, nameof(id)); return await _workflowInstanceRepository.GetByWorkflowInstanceIdAsync(id); } public async Task AcknowledgeTaskError(string workflowInstanceId, string executionId) { - Guard.Against.NullOrWhiteSpace(workflowInstanceId); - Guard.Against.NullOrWhiteSpace(executionId); + Guard.Against.NullOrWhiteSpace(workflowInstanceId, nameof(workflowInstanceId)); + Guard.Against.NullOrWhiteSpace(executionId, nameof(executionId)); var workflowInstance = await _workflowInstanceRepository.GetByWorkflowInstanceIdAsync(workflowInstanceId); @@ -79,8 +79,8 @@ public async Task AcknowledgeTaskError(string workflowInstance public async Task UpdateExportCompleteMetadataAsync(string workflowInstanceId, string executionId, Dictionary fileStatuses) { - Guard.Against.NullOrWhiteSpace(workflowInstanceId); - Guard.Against.NullOrWhiteSpace(executionId); + Guard.Against.NullOrWhiteSpace(workflowInstanceId, nameof(workflowInstanceId)); + Guard.Against.NullOrWhiteSpace(executionId, nameof(executionId)); var resultMetadata = fileStatuses.ToDictionary(f => f.Key, f => f.Value.ToString() as object); diff --git a/src/WorkflowManager/Common/Services/WorkflowService.cs b/src/WorkflowManager/Common/Services/WorkflowService.cs index 788e1a98b..1e61b1977 100644 --- a/src/WorkflowManager/Common/Services/WorkflowService.cs +++ b/src/WorkflowManager/Common/Services/WorkflowService.cs @@ -36,7 +36,7 @@ public WorkflowService(IWorkflowRepository workflowRepository, ILogger GetAsync(string id) { - Guard.Against.NullOrWhiteSpace(id); + Guard.Against.NullOrWhiteSpace(id, nameof(id)); var workflow = await _workflowRepository.GetByWorkflowIdAsync(id); @@ -45,14 +45,14 @@ public async Task GetAsync(string id) public async Task GetByNameAsync(string name) { - Guard.Against.NullOrWhiteSpace(name); + Guard.Against.NullOrWhiteSpace(name, nameof(name)); return await _workflowRepository.GetByWorkflowNameAsync(name); } public async Task CreateAsync(Workflow workflow) { - Guard.Against.Null(workflow); + Guard.Against.Null(workflow, nameof(workflow)); var id = await _workflowRepository.CreateAsync(workflow); _logger.WorkflowCreated(id, workflow.Name); @@ -61,8 +61,8 @@ public async Task CreateAsync(Workflow workflow) public async Task UpdateAsync(Workflow workflow, string id, bool isUpdateToWorkflowName = false) { - Guard.Against.Null(workflow); - Guard.Against.NullOrWhiteSpace(id); + Guard.Against.Null(workflow, nameof(workflow)); + Guard.Against.NullOrWhiteSpace(id, nameof(id)); var existingWorkflow = await _workflowRepository.GetByWorkflowIdAsync(id); @@ -78,7 +78,7 @@ public async Task CreateAsync(Workflow workflow) public Task DeleteWorkflowAsync(WorkflowRevision workflow) { - Guard.Against.Null(workflow); + Guard.Against.Null(workflow, nameof(workflow)); var result = _workflowRepository.SoftDeleteWorkflow(workflow); _logger.WorkflowDeleted(workflow.WorkflowId, workflow.Id, workflow.Workflow?.Name); return result; diff --git a/src/WorkflowManager/ConditionsResolver/Parser/ConditionalParameterParser.cs b/src/WorkflowManager/ConditionsResolver/Parser/ConditionalParameterParser.cs index 188ef092e..abcd5bdda 100644 --- a/src/WorkflowManager/ConditionsResolver/Parser/ConditionalParameterParser.cs +++ b/src/WorkflowManager/ConditionsResolver/Parser/ConditionalParameterParser.cs @@ -97,8 +97,8 @@ private set public bool TryParse(string[] conditions, WorkflowInstance workflowInstance, out string resolvedConditional) { - Guard.Against.NullOrEmpty(conditions); - Guard.Against.Null(workflowInstance); + Guard.Against.NullOrEmpty(conditions, nameof(conditions)); + Guard.Against.Null(workflowInstance, nameof(workflowInstance)); var joinedConditions = conditions.CombineConditionString(); return TryParse(joinedConditions, workflowInstance, out resolvedConditional); @@ -106,8 +106,8 @@ public bool TryParse(string[] conditions, WorkflowInstance workflowInstance, out public bool TryParse(string conditions, WorkflowInstance workflowInstance, out string resolvedConditional) { - Guard.Against.NullOrEmpty(conditions); - Guard.Against.Null(workflowInstance); + Guard.Against.NullOrEmpty(conditions, nameof(conditions)); + Guard.Against.Null(workflowInstance, nameof(workflowInstance)); resolvedConditional = string.Empty; try @@ -127,8 +127,8 @@ public bool TryParse(string conditions, WorkflowInstance workflowInstance, out s public string ResolveParameters(string conditions, WorkflowInstance workflowInstance) { - Guard.Against.NullOrEmpty(conditions); - Guard.Against.Null(workflowInstance); + Guard.Against.NullOrEmpty(conditions, nameof(conditions)); + Guard.Against.Null(workflowInstance, nameof(workflowInstance)); WorkflowInstance = workflowInstance; return ResolveParameters(conditions, workflowInstance.Id); @@ -222,7 +222,7 @@ private void ClearWorkflowParser() /// private (string? Result, ParameterContext Context) ResolveMatch(string value) { - Guard.Against.NullOrWhiteSpace(value); + Guard.Against.NullOrWhiteSpace(value, nameof(value)); value = value.Substring(2, value.Length - 4).Trim(); @@ -252,8 +252,8 @@ private void ClearWorkflowParser() private (string? Result, ParameterContext Context) ResolveDicom(string value) { - Guard.Against.NullOrWhiteSpace(value); - Guard.Against.Null(WorkflowInstance); + Guard.Against.NullOrWhiteSpace(value, nameof(value)); + Guard.Against.Null(WorkflowInstance, nameof(WorkflowInstance)); var subValue = value.Trim().Substring(ContextDicomSeries.Length, value.Length - ContextDicomSeries.Length); var valueArr = subValue.Split('\''); diff --git a/src/WorkflowManager/ConditionsResolver/Resovler/ConditionalGroup.cs b/src/WorkflowManager/ConditionsResolver/Resovler/ConditionalGroup.cs index 70b7dd4f3..6fb6e3182 100644 --- a/src/WorkflowManager/ConditionsResolver/Resovler/ConditionalGroup.cs +++ b/src/WorkflowManager/ConditionsResolver/Resovler/ConditionalGroup.cs @@ -82,7 +82,7 @@ public void Set(string left, string right, Keyword? keyword) public void Parse(string input, int groupedLogicalParent = 0) { - Guard.Against.NullOrEmpty(input); + Guard.Against.NullOrEmpty(input, nameof(input)); var foundOpenBrackets = FindBrackets.Matches(input); var foundClosingBrackets = FindCloseBrackets.Matches(input); @@ -127,7 +127,7 @@ public void Parse(string input, int groupedLogicalParent = 0) public void ParseBrackets(string input) { - Guard.Against.NullOrWhiteSpace(input); + Guard.Against.NullOrWhiteSpace(input, nameof(input)); var foundAnds = FindAnds.Matches(input); var foundOrs = FindOrs.Matches(input); @@ -169,7 +169,7 @@ public void ParseBrackets(string input) private void ParseComplex(string input) { - Guard.Against.NullOrWhiteSpace(input); + Guard.Against.NullOrWhiteSpace(input, nameof(input)); var foundBrackets = FindBrackets.Matches(input); @@ -299,7 +299,7 @@ private bool EvaluteAndsLogicalGroups() public static ConditionalGroup Create(string input, int groupedLogicalParent = 0) { - Guard.Against.NullOrEmpty(input); + Guard.Against.NullOrEmpty(input, nameof(input)); var conditionalGroup = new ConditionalGroup(); if (groupedLogicalParent == 0) { diff --git a/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj b/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj index dd0f7d4e9..7afd3a463 100755 --- a/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj +++ b/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj @@ -38,7 +38,7 @@ - + diff --git a/src/WorkflowManager/Database/Repositories/PayloadRepository.cs b/src/WorkflowManager/Database/Repositories/PayloadRepository.cs index 3fc10ce8a..442d9406c 100755 --- a/src/WorkflowManager/Database/Repositories/PayloadRepository.cs +++ b/src/WorkflowManager/Database/Repositories/PayloadRepository.cs @@ -69,7 +69,7 @@ public async Task CreateAsync(Payload payload) } } - public async Task> GetAllAsync(int? skip = null, int? limit = null, string patientId = "", string patientName = "") + public async Task> GetAllAsync(int? skip = null, int? limit = null, string? patientId = "", string? patientName = "") { var builder = Builders.Filter; var filter = builder.Empty; @@ -91,7 +91,7 @@ public async Task> GetAllAsync(int? skip = null, int? limit = nul public async Task GetByIdAsync(string payloadId) { - Guard.Against.NullOrWhiteSpace(payloadId); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); var payload = await _payloadCollection .Find(x => x.PayloadId == payloadId) @@ -120,8 +120,8 @@ public async Task UpdateAsync(Payload payload) public async Task UpdateAssociatedWorkflowInstancesAsync(string payloadId, IEnumerable workflowInstances) { - Guard.Against.NullOrEmpty(workflowInstances); - Guard.Against.NullOrWhiteSpace(payloadId); + Guard.Against.NullOrEmpty(workflowInstances, nameof(workflowInstances)); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); try { diff --git a/src/WorkflowManager/Database/Repositories/RepositoryBase.cs b/src/WorkflowManager/Database/Repositories/RepositoryBase.cs index 48367a335..9609c63c5 100644 --- a/src/WorkflowManager/Database/Repositories/RepositoryBase.cs +++ b/src/WorkflowManager/Database/Repositories/RepositoryBase.cs @@ -24,7 +24,7 @@ namespace Monai.Deploy.WorkflowManager.Database.Repositories { public abstract class RepositoryBase { - public static async Task CountAsync(IMongoCollection collection, FilterDefinition filter) + public static async Task CountAsync(IMongoCollection collection, FilterDefinition? filter) => await collection.CountDocumentsAsync(filter ?? Builders.Filter.Empty); /// @@ -37,7 +37,7 @@ public static async Task CountAsync(IMongoCollection collection, Fil /// Items to skip. /// Items to limit results by. /// - public static async Task> GetAllAsync(IMongoCollection collection, Expression> filterFunction, SortDefinition sortFunction, int? skip = null, int? limit = null) + public static async Task> GetAllAsync(IMongoCollection collection, Expression>? filterFunction, SortDefinition sortFunction, int? skip = null, int? limit = null) { return await collection .Find(filterFunction ?? Builders.Filter.Empty) diff --git a/src/WorkflowManager/Database/Repositories/WorkflowInstanceRepository.cs b/src/WorkflowManager/Database/Repositories/WorkflowInstanceRepository.cs index 5541f0164..4a7076c64 100755 --- a/src/WorkflowManager/Database/Repositories/WorkflowInstanceRepository.cs +++ b/src/WorkflowManager/Database/Repositories/WorkflowInstanceRepository.cs @@ -26,7 +26,6 @@ using Monai.Deploy.WorkflowManager.Database.Interfaces; using Monai.Deploy.WorkflowManager.Database.Options; using Monai.Deploy.WorkflowManager.Logging; -using MongoDB.Bson; using MongoDB.Driver; using MongoDB.Driver.Linq; diff --git a/src/WorkflowManager/Database/Repositories/WorkflowRepository.cs b/src/WorkflowManager/Database/Repositories/WorkflowRepository.cs index c8fe0b574..8acb50806 100755 --- a/src/WorkflowManager/Database/Repositories/WorkflowRepository.cs +++ b/src/WorkflowManager/Database/Repositories/WorkflowRepository.cs @@ -201,8 +201,8 @@ public async Task> GetWorkflowsByAeTitleAsync(List> GetWorkflowsForWorkflowRequestAsync(string calledAeTitle, string callingAeTitle) { - Guard.Against.NullOrEmpty(calledAeTitle); - Guard.Against.NullOrEmpty(callingAeTitle); + Guard.Against.NullOrEmpty(calledAeTitle, nameof(calledAeTitle)); + Guard.Against.NullOrEmpty(callingAeTitle, nameof(callingAeTitle)); var wfs = await _workflowCollection .Find(x => @@ -221,7 +221,7 @@ public async Task> GetWorkflowsForWorkflowRequestAsync(s public async Task CreateAsync(Workflow workflow) { - Guard.Against.Null(workflow); + Guard.Against.Null(workflow, nameof(workflow)); var workflowRevision = new WorkflowRevision { @@ -258,7 +258,7 @@ public async Task UpdateAsync(Workflow workflow, WorkflowRevision existi public async Task SoftDeleteWorkflow(WorkflowRevision workflow) { - Guard.Against.Null(workflow); + Guard.Against.Null(workflow, nameof(workflow)); var deletedTimeStamp = DateTime.UtcNow; diff --git a/src/WorkflowManager/Database/packages.lock.json b/src/WorkflowManager/Database/packages.lock.json index a9245b157..f8fc9073e 100755 --- a/src/WorkflowManager/Database/packages.lock.json +++ b/src/WorkflowManager/Database/packages.lock.json @@ -38,11 +38,8 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -65,11 +62,6 @@ "Microsoft.Win32.Registry": "5.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -155,19 +147,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.14", - "contentHash": "Gl5I5/zL2MUzg5S4FzrkfpEBh/xSZGJbBrJHS5KDiwrWIKw+yfxYCjmjq7hZN+OJrKZrjWbhRVJcXiqwN9FsNg==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.14", - "contentHash": "5QAO6QADZLRKFBDwMR34LtxPxTLmxEwG4OLFGgncvvIiTx8OjezILov4RFStCyzrqUvtlq6VJ88y9DnfgjAjNw==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -201,8 +193,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -280,12 +272,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -706,7 +698,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/Logging/packages.lock.json b/src/WorkflowManager/Logging/packages.lock.json index 9d9ca7771..c899bccd2 100755 --- a/src/WorkflowManager/Logging/packages.lock.json +++ b/src/WorkflowManager/Logging/packages.lock.json @@ -4,22 +4,14 @@ "net6.0": { "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "DnsClient": { "type": "Transitive", "resolved": "1.4.0", "contentHash": "CO1NG1zQdV0nEAXmr/KppLZ0S1qkaPwV0kPX5YPgmYBtrBVh1XMYHM54IXy3RBJu1k4thFtpzwo4HNHqxiuFYw==" }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -105,19 +97,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.14", - "contentHash": "Gl5I5/zL2MUzg5S4FzrkfpEBh/xSZGJbBrJHS5KDiwrWIKw+yfxYCjmjq7hZN+OJrKZrjWbhRVJcXiqwN9FsNg==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.14", - "contentHash": "5QAO6QADZLRKFBDwMR34LtxPxTLmxEwG4OLFGgncvvIiTx8OjezILov4RFStCyzrqUvtlq6VJ88y9DnfgjAjNw==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -151,8 +143,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -221,12 +213,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -662,7 +654,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json b/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json index 352f69541..438885894 100644 --- a/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json +++ b/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json @@ -15,11 +15,8 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -42,11 +39,6 @@ "Microsoft.Win32.Registry": "5.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -132,19 +124,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -178,8 +170,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -257,12 +249,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -746,14 +738,14 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs b/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs index 4b0130229..e1e7bfd83 100644 --- a/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs +++ b/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs @@ -96,65 +96,57 @@ public Task StopAsync(CancellationToken cancellationToken) private void SetupPolling() { - _messageSubscriber.Subscribe(WorkflowRequestRoutingKey, WorkflowRequestRoutingKey, OnWorkflowRequestReceivedCallback); + _messageSubscriber.SubscribeAsync(WorkflowRequestRoutingKey, WorkflowRequestRoutingKey, OnWorkflowRequestReceivedCallbackAsync); _logger.EventSubscription(ServiceName, WorkflowRequestRoutingKey); - _messageSubscriber.Subscribe(TaskStatusUpdateRoutingKey, TaskStatusUpdateRoutingKey, OnTaskUpdateStatusReceivedCallback); + _messageSubscriber.SubscribeAsync(TaskStatusUpdateRoutingKey, TaskStatusUpdateRoutingKey, OnTaskUpdateStatusReceivedCallback); _logger.EventSubscription(ServiceName, TaskStatusUpdateRoutingKey); - _messageSubscriber.Subscribe(ExportCompleteRoutingKey, ExportCompleteRoutingKey, OnExportCompleteReceivedCallback); + _messageSubscriber.SubscribeAsync(ExportCompleteRoutingKey, ExportCompleteRoutingKey, OnExportCompleteReceivedCallback); _logger.EventSubscription(ServiceName, ExportCompleteRoutingKey); } - - private void OnWorkflowRequestReceivedCallback(MessageReceivedEventArgs eventArgs) + private async Task OnWorkflowRequestReceivedCallbackAsync(MessageReceivedEventArgs eventArgs) { - Task.Run(async () => + + using var loggerScope = _logger.BeginScope(new Dictionary { - using var loggerScope = _logger.BeginScope(new Dictionary - { - ["correlationId"] = eventArgs.Message.CorrelationId, - ["source"] = eventArgs.Message.ApplicationId, - ["messageId"] = eventArgs.Message.MessageId, - ["messageDescription"] = eventArgs.Message.MessageDescription, - }); - - _logger.WorkflowRequestReceived(); - await _eventPayloadListenerService.ReceiveWorkflowPayload(eventArgs); - }).ConfigureAwait(false); + ["correlationId"] = eventArgs.Message.CorrelationId, + ["source"] = eventArgs.Message.ApplicationId, + ["messageId"] = eventArgs.Message.MessageId, + ["messageDescription"] = eventArgs.Message.MessageDescription, + }); + + _logger.WorkflowRequestReceived(); + await _eventPayloadListenerService.ReceiveWorkflowPayload(eventArgs); } - private void OnTaskUpdateStatusReceivedCallback(MessageReceivedEventArgs eventArgs) + private async Task OnTaskUpdateStatusReceivedCallback(MessageReceivedEventArgs eventArgs) { - Task.Run(async () => + using var loggerScope = _logger.BeginScope(new Dictionary { - using var loggerScope = _logger.BeginScope(new Dictionary - { - ["correlationId"] = eventArgs.Message.CorrelationId, - ["source"] = eventArgs.Message.ApplicationId, - ["messageId"] = eventArgs.Message.MessageId, - ["messageDescription"] = eventArgs.Message.MessageDescription, - }); - - _logger.TaskUpdateReceived(); - await _eventPayloadListenerService.TaskUpdatePayload(eventArgs); - }).ConfigureAwait(false); + ["correlationId"] = eventArgs.Message.CorrelationId, + ["source"] = eventArgs.Message.ApplicationId, + ["messageId"] = eventArgs.Message.MessageId, + ["messageDescription"] = eventArgs.Message.MessageDescription, + }); + + _logger.TaskUpdateReceived(); + await _eventPayloadListenerService.TaskUpdatePayload(eventArgs); } - private void OnExportCompleteReceivedCallback(MessageReceivedEventArgs eventArgs) + private async Task OnExportCompleteReceivedCallback(MessageReceivedEventArgs eventArgs) { - Task.Run(async () => + using var loggerScope = _logger.BeginScope(new Dictionary { - using var loggerScope = _logger.BeginScope(new Dictionary - { - ["correlationId"] = eventArgs.Message.CorrelationId, - ["source"] = eventArgs.Message.ApplicationId, - ["messageId"] = eventArgs.Message.MessageId, - ["messageDescription"] = eventArgs.Message.MessageDescription, - }); - - _logger.ExportCompleteReceived(); - await _eventPayloadListenerService.ExportCompletePayload(eventArgs); - }).ConfigureAwait(false); + ["correlationId"] = eventArgs.Message.CorrelationId, + ["source"] = eventArgs.Message.ApplicationId, + ["messageId"] = eventArgs.Message.MessageId, + ["messageDescription"] = eventArgs.Message.MessageDescription, + }); + + _logger.ExportCompleteReceived(); + await _eventPayloadListenerService.ExportCompletePayload(eventArgs); + } protected virtual void Dispose(bool disposing) diff --git a/src/WorkflowManager/PayloadListener/packages.lock.json b/src/WorkflowManager/PayloadListener/packages.lock.json index 2f7d4fd5f..123578c3d 100644 --- a/src/WorkflowManager/PayloadListener/packages.lock.json +++ b/src/WorkflowManager/PayloadListener/packages.lock.json @@ -4,11 +4,8 @@ "net6.0": { "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -47,11 +44,6 @@ "System.Threading.Channels": "6.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -142,19 +134,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -188,8 +180,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -272,12 +264,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -788,14 +780,14 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } @@ -818,8 +810,8 @@ "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "[4.0.1, )", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Ardalis.GuardClauses": "[4.1.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.20, )", "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", "fo-dicom": "[5.0.3, )" } diff --git a/src/WorkflowManager/Storage/Services/DicomService.cs b/src/WorkflowManager/Storage/Services/DicomService.cs index c47c2fc65..0c0f7c919 100644 --- a/src/WorkflowManager/Storage/Services/DicomService.cs +++ b/src/WorkflowManager/Storage/Services/DicomService.cs @@ -66,8 +66,8 @@ public DicomService(IStorageService storageService, ILogger logger public async Task GetPayloadPatientDetailsAsync(string payloadId, string bucketName) { - Guard.Against.NullOrWhiteSpace(bucketName); - Guard.Against.NullOrWhiteSpace(payloadId); + Guard.Against.NullOrWhiteSpace(bucketName, nameof(bucketName)); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); var items = await _storageService.ListObjectsAsync(bucketName, $"{payloadId}/dcm", true); @@ -92,9 +92,9 @@ public async Task GetPayloadPatientDetailsAsync(string payloadId public async Task GetFirstValueAsync(IList items, string payloadId, string bucketId, string keyId) { - Guard.Against.NullOrWhiteSpace(bucketId); - Guard.Against.NullOrWhiteSpace(payloadId); - Guard.Against.NullOrWhiteSpace(keyId); + Guard.Against.NullOrWhiteSpace(bucketId, nameof(bucketId)); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); + Guard.Against.NullOrWhiteSpace(keyId, nameof(keyId)); try { @@ -134,8 +134,8 @@ public async Task GetPayloadPatientDetailsAsync(string payloadId public async Task> GetDicomPathsForTaskAsync(string outputDirectory, string bucketName) { - Guard.Against.NullOrWhiteSpace(outputDirectory); - Guard.Against.NullOrWhiteSpace(bucketName); + Guard.Against.NullOrWhiteSpace(outputDirectory, nameof(outputDirectory)); + Guard.Against.NullOrWhiteSpace(bucketName, nameof(bucketName)); var files = await _storageService.ListObjectsAsync(bucketName, outputDirectory, true); @@ -146,9 +146,9 @@ public async Task> GetDicomPathsForTaskAsync(string outputDi public async Task GetAnyValueAsync(string keyId, string payloadId, string bucketId) { - Guard.Against.NullOrWhiteSpace(keyId); - Guard.Against.NullOrWhiteSpace(payloadId); - Guard.Against.NullOrWhiteSpace(bucketId); + Guard.Against.NullOrWhiteSpace(keyId, nameof(keyId)); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); + Guard.Against.NullOrWhiteSpace(bucketId, nameof(bucketId)); var path = $"{payloadId}/dcm"; var listOfFiles = await _storageService.ListObjectsAsync(bucketId, path, true); @@ -170,9 +170,9 @@ public async Task GetAnyValueAsync(string keyId, string payloadId, strin public async Task GetAllValueAsync(string keyId, string payloadId, string bucketId) { - Guard.Against.NullOrWhiteSpace(keyId); - Guard.Against.NullOrWhiteSpace(payloadId); - Guard.Against.NullOrWhiteSpace(bucketId); + Guard.Against.NullOrWhiteSpace(keyId, nameof(keyId)); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); + Guard.Against.NullOrWhiteSpace(bucketId, nameof(bucketId)); var path = $"{payloadId}/dcm"; var listOfFiles = await _storageService.ListObjectsAsync(bucketId, path, true); @@ -209,10 +209,10 @@ public async Task GetDcmJsonFileValueAtIndexAsync(int index, string keyId, List items) { - Guard.Against.NullOrWhiteSpace(bucketId); - Guard.Against.NullOrWhiteSpace(path); - Guard.Against.NullOrWhiteSpace(keyId); - Guard.Against.Null(items); + Guard.Against.NullOrWhiteSpace(bucketId, nameof(bucketId)); + Guard.Against.NullOrWhiteSpace(path, nameof(path)); + Guard.Against.NullOrWhiteSpace(keyId, nameof(keyId)); + Guard.Against.Null(items, nameof(items)); if (index > items.Count) { diff --git a/src/WorkflowManager/Storage/packages.lock.json b/src/WorkflowManager/Storage/packages.lock.json index 44c1ebd17..99e2ed38a 100755 --- a/src/WorkflowManager/Storage/packages.lock.json +++ b/src/WorkflowManager/Storage/packages.lock.json @@ -19,11 +19,8 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -43,11 +40,6 @@ "resolved": "1.4.0", "contentHash": "CO1NG1zQdV0nEAXmr/KppLZ0S1qkaPwV0kPX5YPgmYBtrBVh1XMYHM54IXy3RBJu1k4thFtpzwo4HNHqxiuFYw==" }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -133,19 +125,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -179,8 +171,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -249,12 +241,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -699,7 +691,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } diff --git a/src/WorkflowManager/WorkflowExecuter/Common/ArtifactMapper.cs b/src/WorkflowManager/WorkflowExecuter/Common/ArtifactMapper.cs index 70e08e3e0..96ae835c9 100755 --- a/src/WorkflowManager/WorkflowExecuter/Common/ArtifactMapper.cs +++ b/src/WorkflowManager/WorkflowExecuter/Common/ArtifactMapper.cs @@ -75,16 +75,16 @@ public bool TryConvertArtifactVariablesToPath(Artifact[] artifacts, string paylo public async Task> ConvertArtifactVariablesToPath(Artifact[] artifacts, string payloadId, string workflowInstanceId, string bucketId, bool shouldExistYet = true) { - Guard.Against.Null(artifacts); - Guard.Against.NullOrWhiteSpace(payloadId); - Guard.Against.NullOrWhiteSpace(workflowInstanceId); + Guard.Against.Null(artifacts, nameof(artifacts)); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); + Guard.Against.NullOrWhiteSpace(workflowInstanceId, nameof(workflowInstanceId)); var artifactPathDictionary = new Dictionary(); foreach (var artifact in artifacts) { - Guard.Against.NullOrWhiteSpace(artifact.Value); - Guard.Against.NullOrWhiteSpace(artifact.Name); + Guard.Against.NullOrWhiteSpace(artifact.Value, nameof(artifact.Value)); + Guard.Against.NullOrWhiteSpace(artifact.Name, nameof(artifact.Name)); if (!TrimArtifactVariable(artifact.Value, out var variableString)) { diff --git a/src/WorkflowManager/WorkflowExecuter/Common/EventMapper.cs b/src/WorkflowManager/WorkflowExecuter/Common/EventMapper.cs index 9e5f73be2..0e3c2d5e4 100644 --- a/src/WorkflowManager/WorkflowExecuter/Common/EventMapper.cs +++ b/src/WorkflowManager/WorkflowExecuter/Common/EventMapper.cs @@ -15,7 +15,6 @@ */ using Ardalis.GuardClauses; -using Monai.Deploy.Messaging.Common; using Monai.Deploy.Messaging.Events; using Monai.Deploy.Messaging.Messages; using Monai.Deploy.Storage.Configuration; @@ -177,23 +176,26 @@ public static ExportRequestEvent ToExportRequestEvent( string taskId, string workflowInstanceId, string correlationId, - ExportRequestType exportRequestType = ExportRequestType.None) + List? plugins = null) { + plugins ??= new List(); + Guard.Against.NullOrWhiteSpace(taskId, nameof(taskId)); Guard.Against.NullOrWhiteSpace(workflowInstanceId, nameof(workflowInstanceId)); Guard.Against.NullOrWhiteSpace(correlationId, nameof(correlationId)); Guard.Against.NullOrEmpty(dicomImages, nameof(dicomImages)); Guard.Against.NullOrEmpty(exportDestinations, nameof(exportDestinations)); - return new ExportRequestEvent + var request = new ExportRequestEvent { WorkflowInstanceId = workflowInstanceId, ExportTaskId = taskId, CorrelationId = correlationId, Files = dicomImages, - Destinations = exportDestinations, - ExportRequest = exportRequestType + Destinations = exportDestinations }; + request.PluginAssemblies.AddRange(plugins); + return request; } } } diff --git a/src/WorkflowManager/WorkflowExecuter/Common/TaskExecutionStatusExtensions.cs b/src/WorkflowManager/WorkflowExecuter/Common/TaskExecutionStatusExtensions.cs index b50d95e41..28dcd5273 100644 --- a/src/WorkflowManager/WorkflowExecuter/Common/TaskExecutionStatusExtensions.cs +++ b/src/WorkflowManager/WorkflowExecuter/Common/TaskExecutionStatusExtensions.cs @@ -23,8 +23,8 @@ public static class TaskExecutionStatusExtensions { public static bool IsTaskExecutionStatusUpdateValid(this TaskExecutionStatus newStatus, TaskExecutionStatus oldStatus) { - Guard.Against.Null(newStatus); - Guard.Against.Null(oldStatus); + Guard.Against.Null(newStatus, nameof(newStatus)); + Guard.Against.Null(oldStatus, nameof(oldStatus)); return newStatus switch { diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index 2cb32e2be..29d067cf3 100755 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -19,7 +19,6 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Monai.Deploy.Messaging.API; -using Monai.Deploy.Messaging.Common; using Monai.Deploy.Messaging.Events; using Monai.Deploy.Messaging.Messages; using Monai.Deploy.Storage.API; @@ -49,6 +48,7 @@ public class WorkflowExecuterService : IWorkflowExecuterService private readonly IMessageBrokerPublisherService _messageBrokerPublisherService; private readonly IConditionalParameterParser _conditionalParameterParser; private readonly ITaskExecutionStatsRepository _taskExecutionStatsRepository; + private readonly List _migExternalAppPlugins; private readonly IArtifactMapper _artifactMapper; private readonly IStorageService _storageService; private readonly IPayloadService _payloadService; @@ -89,6 +89,7 @@ public WorkflowExecuterService( _defaultPerTaskTypeTimeoutMinutes = configuration.Value.PerTaskTypeTimeoutMinutes; TaskDispatchRoutingKey = configuration.Value.Messaging.Topics.TaskDispatchRequest; TaskTimeoutRoutingKey = configuration.Value.Messaging.Topics.AideClinicalReviewCancelation; + _migExternalAppPlugins = configuration.Value.MigExternalAppPlugins; ExportRequestRoutingKey = $"{configuration.Value.Messaging.Topics.ExportRequestPrefix}.{configuration.Value.Messaging.DicomAgents.ScuAgentName}"; _logger = logger ?? throw new ArgumentNullException(nameof(logger)); @@ -253,8 +254,8 @@ public void AttachPatientMetaData(TaskExecution task, PatientDetails patientDeta public async Task ProcessTaskUpdate(TaskUpdateEvent message) { - Guard.Against.Null(message); - Guard.Against.Null(message.WorkflowInstanceId); + Guard.Against.Null(message, nameof(message)); + Guard.Against.Null(message.WorkflowInstanceId, nameof(message.WorkflowInstanceId)); var workflowInstance = await _workflowInstanceRepository.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId); @@ -401,7 +402,7 @@ public async Task ProcessExportComplete(ExportCompleteEvent message, strin return false; } - if (message.ExportRequest == ExportRequestType.None) + // if (message.ExportRequest == ExportRequestType.None) { return await HandleTaskDestinations(workflowInstance, workflow, task, correlationId); } @@ -467,11 +468,13 @@ private async Task UpdateWorkflowInstanceStatus(WorkflowInstance workflowI } private async Task HandleExternalAppAsync(WorkflowRevision workflow, WorkflowInstance workflowInstance, TaskExecution task, string correlationId) { - await HandleDicomExportAsync(workflow, workflowInstance, task, correlationId, ExportRequestType.ExternalProcessing).ConfigureAwait(false); + var plugins = _migExternalAppPlugins; + await HandleDicomExportAsync(workflow, workflowInstance, task, correlationId, plugins).ConfigureAwait(false); } - private async Task HandleDicomExportAsync(WorkflowRevision workflow, WorkflowInstance workflowInstance, TaskExecution task, string correlationId, ExportRequestType exportRequestType = ExportRequestType.None) + private async Task HandleDicomExportAsync(WorkflowRevision workflow, WorkflowInstance workflowInstance, TaskExecution task, string correlationId, List? plugins = null) { + plugins ??= new List(); var exportList = workflow.Workflow?.Tasks?.FirstOrDefault(t => t.Id == task.TaskId)?.ExportDestinations.Select(e => e.Name).ToArray(); var artifactValues = GetDicomExports(workflow, task, exportList); @@ -506,7 +509,7 @@ private async Task HandleDicomExportAsync(WorkflowRevision workflow, WorkflowIns return; } - await DispatchDicomExport(workflowInstance, task, exportList, artifactValues, correlationId, exportRequestType); + await DispatchDicomExport(workflowInstance, task, exportList, artifactValues, correlationId, plugins); } private string[] GetDicomExports(WorkflowRevision workflow, TaskExecution task, string[]? exportDestinations) @@ -537,14 +540,14 @@ private string[] GetDicomExports(WorkflowRevision workflow, TaskExecution task, return new List(task.InputArtifacts.Values).ToArray(); } - private async Task DispatchDicomExport(WorkflowInstance workflowInstance, TaskExecution task, string[]? exportDestinations, string[] artifactValues, string correlationId, ExportRequestType exportRequestType = ExportRequestType.None) + private async Task DispatchDicomExport(WorkflowInstance workflowInstance, TaskExecution task, string[]? exportDestinations, string[] artifactValues, string correlationId, List plugins) { if (exportDestinations is null || !exportDestinations.Any()) { return false; } - await ExportRequest(workflowInstance, task, exportDestinations, artifactValues, correlationId, exportRequestType); + await ExportRequest(workflowInstance, task, exportDestinations, artifactValues, correlationId, plugins); return await _workflowInstanceRepository.UpdateTaskStatusAsync(workflowInstance.Id, task.TaskId, TaskExecutionStatus.Dispatched); } @@ -772,9 +775,9 @@ private async Task DispatchTask(WorkflowInstance workflowInstance, Workflo } } - private async Task ExportRequest(WorkflowInstance workflowInstance, TaskExecution taskExec, string[] exportDestinations, IList dicomImages, string correlationId, ExportRequestType exportRequestType = ExportRequestType.None) + private async Task ExportRequest(WorkflowInstance workflowInstance, TaskExecution taskExec, string[] exportDestinations, IList dicomImages, string correlationId, List plugins) { - var exportRequestEvent = EventMapper.ToExportRequestEvent(dicomImages, exportDestinations, taskExec.TaskId, workflowInstance.Id, correlationId, exportRequestType); + var exportRequestEvent = EventMapper.ToExportRequestEvent(dicomImages, exportDestinations, taskExec.TaskId, workflowInstance.Id, correlationId, plugins); var jsonMesssage = new JsonMessage(exportRequestEvent, MessageBrokerConfiguration.WorkflowManagerApplicationId, exportRequestEvent.CorrelationId, Guid.NewGuid().ToString()); await _messageBrokerPublisherService.Publish(ExportRequestRoutingKey, jsonMesssage.ToMessage()); @@ -841,7 +844,7 @@ public async Task CreateTaskExecutionAsync(TaskObject task, string? payloadId = null, string? previousTaskId = null) { - Guard.Against.Null(workflowInstance); + Guard.Against.Null(workflowInstance, nameof(workflowInstance)); var workflowInstanceId = workflowInstance.Id; @@ -849,12 +852,12 @@ public async Task CreateTaskExecutionAsync(TaskObject task, payloadId ??= workflowInstance.PayloadId; - Guard.Against.Null(task); - Guard.Against.NullOrWhiteSpace(task.Type); - Guard.Against.NullOrWhiteSpace(task.Id); - Guard.Against.NullOrWhiteSpace(workflowInstanceId); - Guard.Against.NullOrWhiteSpace(bucketName); - Guard.Against.NullOrWhiteSpace(payloadId); + Guard.Against.Null(task, nameof(task)); + Guard.Against.NullOrWhiteSpace(task.Type, nameof(task.Type)); + Guard.Against.NullOrWhiteSpace(task.Id, nameof(task.Id)); + Guard.Against.NullOrWhiteSpace(workflowInstanceId, nameof(workflowInstanceId)); + Guard.Against.NullOrWhiteSpace(bucketName, nameof(bucketName)); + Guard.Against.NullOrWhiteSpace(payloadId, nameof(payloadId)); var executionId = Guid.NewGuid().ToString(); var newTaskArgs = GetTaskArgs(task, workflowInstance); diff --git a/src/WorkflowManager/WorkflowExecuter/packages.lock.json b/src/WorkflowManager/WorkflowExecuter/packages.lock.json index 92b216cee..121f45d26 100644 --- a/src/WorkflowManager/WorkflowExecuter/packages.lock.json +++ b/src/WorkflowManager/WorkflowExecuter/packages.lock.json @@ -4,11 +4,8 @@ "net6.0": { "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -47,11 +44,6 @@ "System.Threading.Channels": "6.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -142,19 +134,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -188,8 +180,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -272,12 +264,12 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -788,14 +780,14 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } @@ -818,8 +810,8 @@ "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "[4.0.1, )", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Ardalis.GuardClauses": "[4.1.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.20, )", "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", "fo-dicom": "[5.0.3, )" } diff --git a/src/WorkflowManager/WorkflowManager/Monai.Deploy.WorkflowManager.csproj b/src/WorkflowManager/WorkflowManager/Monai.Deploy.WorkflowManager.csproj index c46b9570d..117971445 100755 --- a/src/WorkflowManager/WorkflowManager/Monai.Deploy.WorkflowManager.csproj +++ b/src/WorkflowManager/WorkflowManager/Monai.Deploy.WorkflowManager.csproj @@ -45,11 +45,11 @@ - + - + diff --git a/src/WorkflowManager/WorkflowManager/appsettings.json b/src/WorkflowManager/WorkflowManager/appsettings.json index 1dfe8f86d..8346de9be 100755 --- a/src/WorkflowManager/WorkflowManager/appsettings.json +++ b/src/WorkflowManager/WorkflowManager/appsettings.json @@ -101,7 +101,8 @@ "serviceName": "test" } }, - "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" + "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", + "migExternalAppPlugins": "Monai.Deploy.InformaticsGateway.ExecutionPlugins.ExternalAppOutgoing, Monai.Deploy.InformaticsGateway, Version=0.0.0.0" }, "InformaticsGateway": { "apiHost": "http://localhost:5010", diff --git a/src/WorkflowManager/WorkflowManager/packages.lock.json b/src/WorkflowManager/WorkflowManager/packages.lock.json index 1e904e319..149b78910 100755 --- a/src/WorkflowManager/WorkflowManager/packages.lock.json +++ b/src/WorkflowManager/WorkflowManager/packages.lock.json @@ -70,13 +70,13 @@ }, "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[0.1.24-rc0005, )", - "resolved": "0.1.24-rc0005", - "contentHash": "zLq7nUP70H+QG2MWDB4Z8egpGWeU2RBlP/h26htfunCA4SUzeFSFU9rautKpM38RFhI7zud+eL0ftTjZf8mAyg==", + "requested": "[0.1.24, )", + "resolved": "0.1.24", + "contentHash": "UMo/v9XBEvtiB6AvmW7QXS0DimlACajDyqX04QjIDOEs2B/NirRaXQ1ny+Ru/baw/G//lK4N8uGLUkYb4MF05Q==", "dependencies": { - "Ardalis.GuardClauses": "4.0.1", + "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Configuration": "6.0.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.14", + "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.20", "Microsoft.Extensions.Logging": "6.0.0", "Newtonsoft.Json": "13.0.3", "System.ComponentModel.Annotations": "5.0.0", @@ -85,13 +85,13 @@ }, "Monai.Deploy.Messaging.RabbitMQ": { "type": "Direct", - "requested": "[0.1.24-rc0005, )", - "resolved": "0.1.24-rc0005", - "contentHash": "esuZvQZntA1UX6cXvp38gGfTulOCo3HecaOgw/IAcW9Q6qJHwUHKzCCzYJLJ1TfvInkSWVGFu+YDb5NQ6mwX1A==", + "requested": "[0.1.24, )", + "resolved": "0.1.24", + "contentHash": "qxPcI/h8YD9beEaLwbHetF4af7sEOpgmf8ojKuaB9B4U13MaInzw7JB0vS51AQ9fNZMtT0MaEnQRl28pkRzB/Q==", "dependencies": { - "Monai.Deploy.Messaging": "0.1.24-rc0005", - "Polly": "7.2.3", - "RabbitMQ.Client": "6.4.0", + "Monai.Deploy.Messaging": "0.1.24", + "Polly": "7.2.4", + "RabbitMQ.Client": "6.5.0", "System.Collections.Concurrent": "4.3.0" } }, @@ -203,11 +203,8 @@ }, "Ardalis.GuardClauses": { "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "RemnImQf/BWR8oYqFpdw+hn+b4Q1w+pGujkRiSfjQhMPuiERwGn4UMmQv+6UDE4qbPlnIN+e3e40JkvBhzgfzg==", - "dependencies": { - "JetBrains.Annotations": "2021.3.0" - } + "resolved": "4.1.1", + "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" }, "AWSSDK.Core": { "type": "Transitive", @@ -254,11 +251,6 @@ "System.Threading.Channels": "6.0.0" } }, - "JetBrains.Annotations": { - "type": "Transitive", - "resolved": "2021.3.0", - "contentHash": "Ddxjs5RRjf+c8m9m++WvhW1lz1bqNhsTjWvCLbQN9bvKbkJeR9MhtfNwKgBRRdG2yLHcXFr5Lf7fsvvkiPaDRg==" - }, "LightInject": { "type": "Transitive", "resolved": "5.4.0", @@ -424,19 +416,19 @@ }, "Microsoft.Extensions.Diagnostics.HealthChecks": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "crR/15PKDgVIQmH9uGJuQVg4RGbaxwG3cseRRMisPG/2LkiQV71EkNRGPV4cI61Waywc1Wn5sYXE8bo2qCf+/Q==", + "resolved": "6.0.20", + "contentHash": "/uw/4EXx+tOWiqTVNbO0ooaFrrp06h68hI7XhOKyHRp7rdUi7SNmIsj0CCNE6PyZanfnQDwhNyaxG25u2HWpjg==", "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.20", "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.3", + "Microsoft.Extensions.Logging.Abstractions": "6.0.4", "Microsoft.Extensions.Options": "6.0.0" } }, "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { "type": "Transitive", - "resolved": "6.0.15", - "contentHash": "LmB5kbbc0Sr+XvnYj8tReZzubS50h1g463zpbnnjqT/k6fM8/od9hFCBj52dorXfp/DDfm5+rUdKaPRUsX70Jg==" + "resolved": "6.0.20", + "contentHash": "qWT4ldcOylWZa+GXFePyAJSQ9d/gWzKIL2KdFCkudZpzMjeTUPpqMhIwZdJNvCupi/ercnUT3Ru1RI/rWwX8aA==" }, "Microsoft.Extensions.FileProviders.Abstractions": { "type": "Transitive", @@ -495,8 +487,8 @@ }, "Microsoft.Extensions.Logging.Abstractions": { "type": "Transitive", - "resolved": "6.0.3", - "contentHash": "SUpStcdjeBbdKjPKe53hVVLkFjylX0yIXY8K+xWa47+o1d+REDyOMZjHZa+chsQI1K9qZeiHWk9jos0TFU7vGg==" + "resolved": "6.0.4", + "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" }, "Microsoft.Extensions.Logging.Configuration": { "type": "Transitive", @@ -743,16 +735,16 @@ }, "Polly": { "type": "Transitive", - "resolved": "7.2.3", - "contentHash": "DeCY0OFbNdNxsjntr1gTXHJ5pKUwYzp04Er2LLeN3g6pWhffsGuKVfMBLe1lw7x76HrPkLxKEFxBlpRxS2nDEQ==" + "resolved": "7.2.4", + "contentHash": "bw00Ck5sh6ekduDE3mnCo1ohzuad946uslCDEENu3091+6UKnBuKLo4e+yaNcCzXxOZCXWY2gV4a35+K1d4LDA==" }, "RabbitMQ.Client": { "type": "Transitive", - "resolved": "6.4.0", - "contentHash": "1znR1gGU+xYVSpO5z8nQolcUKA/yydnxQn7Ug9+RUXxTSLMm/eE58VKGwahPBjELXvDnX0k/kBrAitFLRjx9LA==", + "resolved": "6.5.0", + "contentHash": "9hY5HiWPtCla1/l0WmXmLnqoX7iKE3neBQUWnetIJrRpOvTbO//XQfQDh++xgHCshL40Kv/6bR0HDkmJz46twg==", "dependencies": { - "System.Memory": "4.5.4", - "System.Threading.Channels": "4.7.1" + "System.Memory": "4.5.5", + "System.Threading.Channels": "7.0.0" } }, "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": { @@ -1138,8 +1130,8 @@ }, "System.Memory": { "type": "Transitive", - "resolved": "4.5.4", - "contentHash": "1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==" + "resolved": "4.5.5", + "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" }, "System.Net.Http": { "type": "Transitive", @@ -1493,8 +1485,8 @@ }, "System.Threading.Channels": { "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q==" + "resolved": "7.0.0", + "contentHash": "qmeeYNROMsONF6ndEZcIQ+VxR4Q/TX/7uIVLJqtwIWL7dDWeh0l1UIqgo4wYyjG//5lUNhwkLDSFl+pAWO6oiA==" }, "System.Threading.Tasks": { "type": "Transitive", @@ -1551,14 +1543,14 @@ "monai.deploy.workflowmanager.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Monai.Deploy.Storage": "[0.2.15, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[0.1.24-rc0005, )", + "Monai.Deploy.Messaging": "[0.1.24, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.19.0, )" } @@ -1607,8 +1599,8 @@ "monai.deploy.workflowmanager.shared": { "type": "Project", "dependencies": { - "Ardalis.GuardClauses": "[4.0.1, )", - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )", + "Ardalis.GuardClauses": "[4.1.1, )", + "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.20, )", "Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )", "fo-dicom": "[5.0.3, )" } diff --git a/tests/IntegrationTests/TaskManager.IntegrationTests/Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj b/tests/IntegrationTests/TaskManager.IntegrationTests/Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj index 38911a2ce..0dbb7de27 100755 --- a/tests/IntegrationTests/TaskManager.IntegrationTests/Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj +++ b/tests/IntegrationTests/TaskManager.IntegrationTests/Monai.Deploy.WorkflowManager.TaskManager.IntegrationTests.csproj @@ -1,4 +1,4 @@ -