From 7786e8fa677808a11921821e31a25e2fb2f260cc Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Fri, 13 Oct 2023 11:11:10 +0100 Subject: [PATCH 01/21] changes to add output artifact and validation Signed-off-by: Lillie Dae --- ...orkflowManager.Common.Configuration.csproj | 2 +- src/Common/Configuration/packages.lock.json | 6 +- src/Common/Miscellaneous/ApiControllerBase.cs | 47 +-- .../Miscellaneous/ValidationConstants.cs | 17 +- src/Common/Miscellaneous/packages.lock.json | 6 +- ...nai.Deploy.WorkflowManager.sln.DotSettings | 82 +++++ ...loy.WorkflowManager.TaskManager.API.csproj | 2 +- src/TaskManager/API/packages.lock.json | 6 +- src/TaskManager/Database/packages.lock.json | 6 +- .../AideClinicalReview/packages.lock.json | 8 +- .../Plug-ins/Argo/packages.lock.json | 8 +- .../TaskManager/packages.lock.json | 8 +- .../Contracts/Models/Artifact.cs | 10 + .../Contracts/Models/ArtifactMap.cs | 2 +- .../Contracts/Models/ExportDestination.cs | 2 +- .../Contracts/Models/TaskExecution.cs | 2 + ...ai.Deploy.WorkflowManager.Contracts.csproj | 2 +- .../Database/packages.lock.json | 6 +- .../Logging/packages.lock.json | 6 +- .../PayloadListener/packages.lock.json | 8 +- .../Services/packages.lock.json | 8 +- .../Storage/packages.lock.json | 6 +- .../Extensions/TaskExecutionExtension.cs | 51 +++ .../Services/IWorkflowExecuterService.cs | 7 - .../Services/WorkflowExecuterService.cs | 92 ++---- .../WorkflowExecuter/packages.lock.json | 8 +- .../Controllers/ArtifactsController.cs | 36 ++ .../AuthenticatedApiControllerBase.cs | 4 +- .../PaginationApiControllerBase.cs | 95 ++++++ .../Controllers/TaskStatsController.cs | 4 +- .../Controllers/WFMApiControllerBase.cs | 42 --- .../Controllers/WorkflowsController.cs | 6 +- .../Validators/WorkflowValidator.cs | 111 ++++--- .../WorkflowManager/packages.lock.json | 8 +- ...anager.TaskManager.IntegrationTests.csproj | 4 +- .../Features/WorkflowApi.feature | 15 +- ...r.WorkflowExecutor.IntegrationTests.csproj | 4 +- .../CommonApiStepDefinitions.cs | 2 + .../TestData/WorkflowObjectTestData.cs | 309 +++++++++++++++--- .../TestData/WorkflowRevisionTestData.cs | 4 +- .../PayloadListener.Tests/packages.lock.json | 8 +- .../Services/WorkflowExecuterServiceTests.cs | 11 +- .../Controllers/ArtifactsControllerTests.cs | 30 ++ .../Controllers/PayloadControllerTests.cs | 2 +- .../Controllers/WorkflowsControllerTests.cs | 20 +- .../Validators/WorkflowValidatorTests.cs | 115 +++++-- .../WorkflowManager.Tests/packages.lock.json | 8 +- 47 files changed, 865 insertions(+), 381 deletions(-) create mode 100644 src/Monai.Deploy.WorkflowManager.sln.DotSettings create mode 100644 src/WorkflowManager/WorkflowExecuter/Extensions/TaskExecutionExtension.cs create mode 100644 src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs create mode 100644 src/WorkflowManager/WorkflowManager/Controllers/PaginationApiControllerBase.cs delete mode 100644 src/WorkflowManager/WorkflowManager/Controllers/WFMApiControllerBase.cs create mode 100644 tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs diff --git a/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj b/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj index c659b7fde..00aebf1cc 100644 --- a/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj +++ b/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/Common/Configuration/packages.lock.json b/src/Common/Configuration/packages.lock.json index ca58581e4..e95d10bee 100644 --- a/src/Common/Configuration/packages.lock.json +++ b/src/Common/Configuration/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[1.0.1, )", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "requested": "[1.1.0-list-of-modaliti0015, )", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/Common/Miscellaneous/ApiControllerBase.cs b/src/Common/Miscellaneous/ApiControllerBase.cs index 931495994..70979cbe7 100644 --- a/src/Common/Miscellaneous/ApiControllerBase.cs +++ b/src/Common/Miscellaneous/ApiControllerBase.cs @@ -15,11 +15,8 @@ */ using System.Net; -using Ardalis.GuardClauses; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Wrappers; -using Monai.Deploy.WorkflowManager.Common.Configuration; using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Filter; using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Services; @@ -31,62 +28,26 @@ namespace Monai.Deploy.WorkflowManager.Common.ControllersShared [ApiController] public class ApiControllerBase : ControllerBase { - public IOptions Options { get; set; } - /// /// Initializes a new instance of the class. /// - /// Workflow manager options. - public ApiControllerBase(IOptions options) + public ApiControllerBase() { - Options = options ?? throw new ArgumentNullException(nameof(options)); } /// /// Gets internal Server Error 500. /// - public static int InternalServerError => (int)HttpStatusCode.InternalServerError; + protected static int InternalServerError => (int)HttpStatusCode.InternalServerError; /// /// Gets bad Request 400. /// - public new static int BadRequest => (int)HttpStatusCode.BadRequest; + protected static new int BadRequest => (int)HttpStatusCode.BadRequest; /// /// Gets notFound 404. /// - public new static int NotFound => (int)HttpStatusCode.NotFound; - - /// - /// Creates a pagination paged response. - /// - /// Data set type. - /// Data set. - /// Filters. - /// Total records. - /// Uri service. - /// Route. - /// Returns . - public PagedResponse> CreatePagedResponse(IEnumerable pagedData, PaginationFilter validFilter, long totalRecords, IUriService uriService, string route) - { - 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); - - response.SetUp(validFilter, totalRecords, uriService, route); - return response; - } - - - public StatsPagedResponse> CreateStatsPagedReponse(IEnumerable pagedData, PaginationFilter validFilter, long totalRecords, IUriService uriService, string route) - { - var response = new StatsPagedResponse>(pagedData, validFilter.PageNumber, validFilter.PageSize ?? 10); - response.SetUp(validFilter, totalRecords, uriService, route); - return response; - } + protected static new int NotFound => (int)HttpStatusCode.NotFound; } } diff --git a/src/Common/Miscellaneous/ValidationConstants.cs b/src/Common/Miscellaneous/ValidationConstants.cs index 727ab8b56..44e323d13 100644 --- a/src/Common/Miscellaneous/ValidationConstants.cs +++ b/src/Common/Miscellaneous/ValidationConstants.cs @@ -93,41 +93,42 @@ public enum NotificationValues }; - /// /// Key for the argo task type. /// - public static readonly string ArgoTaskType = "argo"; + public const string ArgoTaskType = "argo"; /// /// Key for the clinical review task type. /// - public static readonly string ClinicalReviewTaskType = "aide_clinical_review"; + public const string ClinicalReviewTaskType = "aide_clinical_review"; /// /// Key for the router task type. /// - public static readonly string RouterTaskType = "router"; + public const string RouterTaskType = "router"; /// /// Key for the export task type. /// - public static readonly string ExportTaskType = "export"; + public const string ExportTaskType = "export"; /// /// Key for the export task type. /// - public static readonly string ExternalAppTaskType = "remote_app_execution"; + public const string ExternalAppTaskType = "remote_app_execution"; /// /// Key for the export task type. /// - public static readonly string DockerTaskType = "docker"; + public const string DockerTaskType = "docker"; /// /// Key for the email task type. /// - public static readonly string Email = "email"; + public const string Email = "email"; + + public static readonly string[] AcceptableTasksToReview = { ArgoTaskType, ExternalAppTaskType }; /// /// Valid task types. diff --git a/src/Common/Miscellaneous/packages.lock.json b/src/Common/Miscellaneous/packages.lock.json index 6695daa2b..ddc73c6c9 100644 --- a/src/Common/Miscellaneous/packages.lock.json +++ b/src/Common/Miscellaneous/packages.lock.json @@ -146,8 +146,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -236,7 +236,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } } diff --git a/src/Monai.Deploy.WorkflowManager.sln.DotSettings b/src/Monai.Deploy.WorkflowManager.sln.DotSettings new file mode 100644 index 000000000..850fb5e55 --- /dev/null +++ b/src/Monai.Deploy.WorkflowManager.sln.DotSettings @@ -0,0 +1,82 @@ + + AR + AS + ASMT + AU + BDUS + BI + BMD + CD + CF + CP + CR + CS + CT + DD + DF + DG + DM + DOC + DS + DX + EC + ECG + EPS + ES + FA + FID + FS + GM + HC + HD + IO + IOL + IVOCT + IVUS + KER + KO + LEN + LP + LS + MA + MG + MR + MS + NM + OAM + OCT + OP + OPM + OPR + OPT + OPV + OSS + OT + PLAN + PR + PT + PX + REG + RESP + RF + RG + RTDOSE + RTIMAGE + RTPLAN + RTRECORD + RTSTRUCT + RWV + SEG + SM + SMR + SR + SRF + ST + STAIN + TG + US + VA + VF + XA + XC + diff --git a/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj b/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj index 009d2c07c..c911c3b5b 100644 --- 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 b12c6603a..d25849609 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": "[1.0.1, )", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "requested": "[1.1.0-list-of-modaliti0015, )", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/Database/packages.lock.json b/src/TaskManager/Database/packages.lock.json index b7b31c480..6316992b3 100755 --- a/src/TaskManager/Database/packages.lock.json +++ b/src/TaskManager/Database/packages.lock.json @@ -247,8 +247,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -684,7 +684,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json index 3cc15455a..4968d04fb 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json +++ b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json @@ -258,8 +258,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -733,7 +733,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -747,7 +747,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/Plug-ins/Argo/packages.lock.json b/src/TaskManager/Plug-ins/Argo/packages.lock.json index 5abc68421..124131c01 100644 --- a/src/TaskManager/Plug-ins/Argo/packages.lock.json +++ b/src/TaskManager/Plug-ins/Argo/packages.lock.json @@ -368,8 +368,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -871,7 +871,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -885,7 +885,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/TaskManager/packages.lock.json b/src/TaskManager/TaskManager/packages.lock.json index 5112a7570..55ff2c8b5 100644 --- a/src/TaskManager/TaskManager/packages.lock.json +++ b/src/TaskManager/TaskManager/packages.lock.json @@ -537,8 +537,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1138,7 +1138,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1160,7 +1160,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Contracts/Models/Artifact.cs b/src/WorkflowManager/Contracts/Models/Artifact.cs index 13b784538..e948fb278 100644 --- a/src/WorkflowManager/Contracts/Models/Artifact.cs +++ b/src/WorkflowManager/Contracts/Models/Artifact.cs @@ -14,10 +14,20 @@ * limitations under the License. */ +using System; +using System.Collections.Generic; +using System.Linq; +using Monai.Deploy.Messaging.Common; using Newtonsoft.Json; namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models { + public class OutputArtifact : Artifact + { + [JsonProperty(PropertyName = "type", DefaultValueHandling = DefaultValueHandling.Ignore)] + public ArtifactType Type { get; set; } = ArtifactType.Unset; + } + public class Artifact { [JsonProperty(PropertyName = "name")] diff --git a/src/WorkflowManager/Contracts/Models/ArtifactMap.cs b/src/WorkflowManager/Contracts/Models/ArtifactMap.cs index e58634594..ba78c7559 100644 --- a/src/WorkflowManager/Contracts/Models/ArtifactMap.cs +++ b/src/WorkflowManager/Contracts/Models/ArtifactMap.cs @@ -24,6 +24,6 @@ public class ArtifactMap public Artifact[] Input { get; set; } = System.Array.Empty(); [JsonProperty(PropertyName = "output")] - public Artifact[] Output { get; set; } = System.Array.Empty(); + public OutputArtifact[] Output { get; set; } = System.Array.Empty(); } } diff --git a/src/WorkflowManager/Contracts/Models/ExportDestination.cs b/src/WorkflowManager/Contracts/Models/ExportDestination.cs index 1b9bed245..7f2d5a76a 100644 --- a/src/WorkflowManager/Contracts/Models/ExportDestination.cs +++ b/src/WorkflowManager/Contracts/Models/ExportDestination.cs @@ -21,6 +21,6 @@ namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models public class ExportDestination { [JsonProperty(PropertyName = "name")] - public string Name { get; set; } = ""; + public string Name { get; set; } = string.Empty; } } diff --git a/src/WorkflowManager/Contracts/Models/TaskExecution.cs b/src/WorkflowManager/Contracts/Models/TaskExecution.cs index a76865bca..8ae53d40a 100644 --- a/src/WorkflowManager/Contracts/Models/TaskExecution.cs +++ b/src/WorkflowManager/Contracts/Models/TaskExecution.cs @@ -16,7 +16,9 @@ using System; using System.Collections.Generic; +using System.Threading.Tasks; using Monai.Deploy.Messaging.Events; +using Monai.Deploy.WorkflowManager.Common.Contracts.Constants; using Newtonsoft.Json; namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models diff --git a/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj b/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj index 13f9f6f22..ff08cf81c 100644 --- 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 64d67d767..42648fe48 100755 --- a/src/WorkflowManager/Database/packages.lock.json +++ b/src/WorkflowManager/Database/packages.lock.json @@ -269,8 +269,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -685,7 +685,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Logging/packages.lock.json b/src/WorkflowManager/Logging/packages.lock.json index 344b27cc6..6be21f126 100755 --- a/src/WorkflowManager/Logging/packages.lock.json +++ b/src/WorkflowManager/Logging/packages.lock.json @@ -210,8 +210,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -641,7 +641,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/PayloadListener/packages.lock.json b/src/WorkflowManager/PayloadListener/packages.lock.json index 3c23c98f8..c47cc767c 100644 --- a/src/WorkflowManager/PayloadListener/packages.lock.json +++ b/src/WorkflowManager/PayloadListener/packages.lock.json @@ -270,8 +270,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -779,7 +779,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -802,7 +802,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Services/packages.lock.json b/src/WorkflowManager/Services/packages.lock.json index d0b4599f1..34242a023 100644 --- a/src/WorkflowManager/Services/packages.lock.json +++ b/src/WorkflowManager/Services/packages.lock.json @@ -249,8 +249,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -733,14 +733,14 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Storage/packages.lock.json b/src/WorkflowManager/Storage/packages.lock.json index 6d5c5f0ec..0aff3a8f7 100755 --- a/src/WorkflowManager/Storage/packages.lock.json +++ b/src/WorkflowManager/Storage/packages.lock.json @@ -235,8 +235,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -675,7 +675,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/WorkflowExecuter/Extensions/TaskExecutionExtension.cs b/src/WorkflowManager/WorkflowExecuter/Extensions/TaskExecutionExtension.cs new file mode 100644 index 000000000..12f6bc3ba --- /dev/null +++ b/src/WorkflowManager/WorkflowExecuter/Extensions/TaskExecutionExtension.cs @@ -0,0 +1,51 @@ +using System.Globalization; +using Microsoft.Extensions.Logging; +using Monai.Deploy.WorkflowManager.Common.Contracts.Models; +using Monai.Deploy.WorkflowManager.Common.Miscellaneous; +using Newtonsoft.Json; + +namespace Monai.Deploy.WorkloadManager.WorkfowExecuter.Extensions +{ + public static class TaskExecutionExtension + { + /// + /// Attaches patient metadata to task execution plugin arguments. + /// + /// + /// + /// Logging Method to log details. + public static void AttachPatientMetaData(this TaskExecution task, PatientDetails patientDetails, Action? logger) + { + var attachedData = false; + if (string.IsNullOrWhiteSpace(patientDetails.PatientId) is false) + { + attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientId, patientDetails.PatientId); + } + if (string.IsNullOrWhiteSpace(patientDetails.PatientAge) is false) + { + attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientAge, patientDetails.PatientAge); + } + if (string.IsNullOrWhiteSpace(patientDetails.PatientSex) is false) + { + attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientSex, patientDetails.PatientSex); + } + var patientDob = patientDetails.PatientDob; + if (patientDob.HasValue) + { + attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientDob, patientDob.Value.ToString("o", CultureInfo.InvariantCulture)); + } + if (string.IsNullOrWhiteSpace(patientDetails.PatientHospitalId) is false) + { + attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientHospitalId, patientDetails.PatientHospitalId); + } + if (string.IsNullOrWhiteSpace(patientDetails.PatientName) is false) + { + attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientName, patientDetails.PatientName); + } + if (attachedData && logger is not null) + { + logger(JsonConvert.SerializeObject(task.TaskPluginArguments)); + } + } + } +} diff --git a/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs index ace4e0244..465979f1d 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs @@ -49,12 +49,5 @@ public interface IWorkflowExecuterService /// Previous Tasks Id. /// Task CreateTaskExecutionAsync(TaskObject task, WorkflowInstance workflowInstance, string? bucketName = null, string? payloadId = null, string? previousTaskId = null); - - /// - /// Attaches patient metadata to task execution plugin arguments. - /// - /// - /// - void AttachPatientMetaData(TaskExecution task, PatientDetails patientDetails); } } diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index bd6c1fab1..0adabdd06 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -35,6 +35,7 @@ using Monai.Deploy.WorkflowManager.Common.Database.Interfaces; using Monai.Deploy.WorkflowManager.Common.Logging; using Monai.Deploy.WorkflowManager.Common.WorkfowExecuter.Common; +using Monai.Deploy.WorkloadManager.WorkfowExecuter.Extensions; using Newtonsoft.Json; namespace Monai.Deploy.WorkflowManager.Common.WorkfowExecuter.Services @@ -204,70 +205,33 @@ public async Task ProcessFirstWorkflowTask(WorkflowInstance workflowInstance, st ["executionId"] = task.ExecutionId }); - if (string.Equals(task.TaskType, TaskTypeConstants.RouterTask, StringComparison.InvariantCultureIgnoreCase)) - { - await HandleTaskDestinations(workflowInstance, workflow, task, correlationId); - - return; - } - - if (string.Equals(task.TaskType, TaskTypeConstants.ExportTask, StringComparison.InvariantCultureIgnoreCase)) - { - await HandleDicomExportAsync(workflow, workflowInstance, task, correlationId); - - 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); - - return; - } - - await DispatchTask(workflowInstance, workflow, task, correlationId, payload); + await SwitchTasksAsync(task, + routerFunc: () => HandleTaskDestinations(workflowInstance, workflow, task, correlationId), + exportFunc: () => HandleDicomExportAsync(workflow, workflowInstance, task, correlationId), + externalFunc: () => HandleExternalAppAsync(workflow, workflowInstance, task, correlationId), + notCreatedStatusFunc: () => + { + _logger.TaskPreviouslyDispatched(workflowInstance.PayloadId, task.TaskId); + return Task.CompletedTask; + }, + defaultFunc: () => DispatchTask(workflowInstance, workflow, task, correlationId, payload) + ).ConfigureAwait(false); } - public void AttachPatientMetaData(TaskExecution task, PatientDetails patientDetails) - { - var attachedData = false; - if (string.IsNullOrWhiteSpace(patientDetails.PatientId) is false) - { - attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientId, patientDetails.PatientId); - } - if (string.IsNullOrWhiteSpace(patientDetails.PatientAge) is false) - { - attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientAge, patientDetails.PatientAge); - } - if (string.IsNullOrWhiteSpace(patientDetails.PatientSex) is false) - { - attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientSex, patientDetails.PatientSex); - } - var patientDob = patientDetails.PatientDob; - if (patientDob.HasValue) - { - attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientDob, patientDob.Value.ToString("o", CultureInfo.InvariantCulture)); - } - if (string.IsNullOrWhiteSpace(patientDetails.PatientHospitalId) is false) - { - attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientHospitalId, patientDetails.PatientHospitalId); - } - if (string.IsNullOrWhiteSpace(patientDetails.PatientName) is false) - { - attachedData = task.TaskPluginArguments.TryAdd(PatientKeys.PatientName, patientDetails.PatientName); - } - if (attachedData) - { - _logger.AttachedPatientMetadataToTaskExec(JsonConvert.SerializeObject(task.TaskPluginArguments)); - } - } + private static Task SwitchTasksAsync(TaskExecution task, + Func routerFunc, + Func exportFunc, + Func externalFunc, + Func notCreatedStatusFunc, + Func defaultFunc) => + task switch + { + { TaskType: TaskTypeConstants.RouterTask } => routerFunc(), + { TaskType: TaskTypeConstants.ExportTask } => exportFunc(), + { TaskType: TaskTypeConstants.ExternalAppTask } => externalFunc(), + { Status: var s } when s != TaskExecutionStatus.Created => notCreatedStatusFunc(), + _ => defaultFunc() + }; public async Task ProcessTaskUpdate(TaskUpdateEvent message) { @@ -568,6 +532,8 @@ private async Task DispatchDicomExport(WorkflowInstance workflowInstance, return await _workflowInstanceRepository.UpdateTaskStatusAsync(workflowInstance.Id, task.TaskId, TaskExecutionStatus.Dispatched); } + + // UPTO HERE TODO private async Task HandleOutputArtifacts(WorkflowInstance workflowInstance, List outputs, TaskExecution task, WorkflowRevision workflowRevision) { var artifactDict = outputs.ToArtifactDictionary(); @@ -783,7 +749,7 @@ private async Task DispatchTask(WorkflowInstance workflowInstance, Workflo payload ??= await _payloadService.GetByIdAsync(workflowInstance.PayloadId); if (payload is not null) { - AttachPatientMetaData(taskExec, payload.PatientDetails); + taskExec.AttachPatientMetaData(payload.PatientDetails, _logger.AttachedPatientMetadataToTaskExec); } taskExec.TaskPluginArguments["workflow_name"] = workflow!.Workflow!.Name; diff --git a/src/WorkflowManager/WorkflowExecuter/packages.lock.json b/src/WorkflowManager/WorkflowExecuter/packages.lock.json index 3b2510d1b..fada21cb3 100644 --- a/src/WorkflowManager/WorkflowExecuter/packages.lock.json +++ b/src/WorkflowManager/WorkflowExecuter/packages.lock.json @@ -270,8 +270,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -779,7 +779,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -802,7 +802,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs b/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs new file mode 100644 index 000000000..43a726996 --- /dev/null +++ b/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; +using System.Linq; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Monai.Deploy.Messaging.Common; +using Monai.Deploy.WorkflowManager.Common.Contracts.Models; + +namespace Monai.Deploy.WorkflowManager.Common.ControllersShared +{ + /// + /// Artifacts Controller + /// + [ApiController] + [Route("artifacts/")] + public class ArtifactsController : ApiControllerBase + { + /// + /// Initializes a new instance of the class. + /// + public ArtifactsController() + { + } + + /// + /// Get Artifact Types + /// + /// List of supported artifact types. + [HttpGet] + [Route("types")] + [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] + public IActionResult GetArtifactTypes() + { + return Ok(ArtifactTypes.ListOfModularity); + } + } +} diff --git a/src/WorkflowManager/WorkflowManager/Controllers/AuthenticatedApiControllerBase.cs b/src/WorkflowManager/WorkflowManager/Controllers/AuthenticatedApiControllerBase.cs index 5cafe261b..01559a8be 100644 --- a/src/WorkflowManager/WorkflowManager/Controllers/AuthenticatedApiControllerBase.cs +++ b/src/WorkflowManager/WorkflowManager/Controllers/AuthenticatedApiControllerBase.cs @@ -24,12 +24,12 @@ namespace Monai.Deploy.WorkflowManager.Common.ControllersShared /// Base authenticated api controller base. /// [Authorize] - public class AuthenticatedApiControllerBase : WFMApiControllerBase + public class AuthenticatedApiControllerBase : PaginationApiControllerBase { /// /// Initializes a new instance of the class. /// - /// Options + /// Options. public AuthenticatedApiControllerBase(IOptions options) : base(options) { diff --git a/src/WorkflowManager/WorkflowManager/Controllers/PaginationApiControllerBase.cs b/src/WorkflowManager/WorkflowManager/Controllers/PaginationApiControllerBase.cs new file mode 100644 index 000000000..2ec99ec33 --- /dev/null +++ b/src/WorkflowManager/WorkflowManager/Controllers/PaginationApiControllerBase.cs @@ -0,0 +1,95 @@ +/* + * Copyright 2023 MONAI Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections.Generic; +using Ardalis.GuardClauses; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Monai.Deploy.WorkflowManager.Common.Configuration; +using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Filter; +using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Services; +using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Wrappers; + +namespace Monai.Deploy.WorkflowManager.Common.ControllersShared +{ + /// + /// Base Api Controller. + /// + [ApiController] + public class PaginationApiControllerBase : ApiControllerBase + { + /// + /// Initializes a new instance of the class. + /// + /// Workflow manager options. + public PaginationApiControllerBase(IOptions options) + { + Options = options ?? throw new ArgumentNullException(nameof(options)); + } + + /// + /// Gets Workflow Manager Options + /// + protected IOptions Options { get; } + + /// + /// CreateStatsPagedResponse + /// + /// Generic. + /// IEnumerable of Generic Data. + /// Pagination Filter. + /// Total number of records for given validation filter in dataset. + /// UriService. + /// Route being called. + /// StatsPagedResponse with data type of T. + protected static StatsPagedResponse> CreateStatsPagedResponse( + IEnumerable pagedData, + PaginationFilter validFilter, + long totalRecords, + IUriService uriService, + string route) + { + var response = new StatsPagedResponse>(pagedData, validFilter.PageNumber, validFilter.PageSize ?? 10); + response.SetUp(validFilter, totalRecords, uriService, route); + return response; + } + + /// + /// Creates a pagination paged response. + /// + /// Data set type. + /// Data set. + /// Filters. + /// Total records. + /// Uri service. + /// Route. + /// Returns . + protected PagedResponse> CreatePagedResponse(IEnumerable pagedData, PaginationFilter validFilter, long totalRecords, IUriService uriService, string route) + { + 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); + + response.SetUp(validFilter, totalRecords, uriService, route); + return response; + } + } +} diff --git a/src/WorkflowManager/WorkflowManager/Controllers/TaskStatsController.cs b/src/WorkflowManager/WorkflowManager/Controllers/TaskStatsController.cs index abf3a9116..7a4fa2bc4 100644 --- a/src/WorkflowManager/WorkflowManager/Controllers/TaskStatsController.cs +++ b/src/WorkflowManager/WorkflowManager/Controllers/TaskStatsController.cs @@ -38,7 +38,7 @@ namespace Monai.Deploy.WorkflowManager.Common.ControllersShared /// [ApiController] [Route("tasks")] - public class TaskStatsController : ApiControllerBase + public class TaskStatsController : PaginationApiControllerBase { private readonly ILogger _logger; private readonly IUriService _uriService; @@ -173,7 +173,7 @@ public async Task GetStatsAsync([FromQuery] TimeFilter filter, st .Select(s => new ExecutionStatDTO(s)) .ToArray(); - var res = CreateStatsPagedReponse(statsDto, validFilter, rangeCount.Result, _uriService, route); + var res = CreateStatsPagedResponse(statsDto, validFilter, rangeCount.Result, _uriService, route); res.PeriodStart = filter.StartTime; res.PeriodEnd = filter.EndTime; diff --git a/src/WorkflowManager/WorkflowManager/Controllers/WFMApiControllerBase.cs b/src/WorkflowManager/WorkflowManager/Controllers/WFMApiControllerBase.cs deleted file mode 100644 index b297a0294..000000000 --- a/src/WorkflowManager/WorkflowManager/Controllers/WFMApiControllerBase.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2023 MONAI Consortium - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -using System; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Options; -using Monai.Deploy.WorkflowManager.Common.Configuration; - -namespace Monai.Deploy.WorkflowManager.Common.ControllersShared -{ - /// - /// Base Api Controller. - /// - [ApiController] - public class WFMApiControllerBase : ApiControllerBase - { - private readonly IOptions _options; - - /// - /// Initializes a new instance of the class. - /// - /// Workflow manager options. - public WFMApiControllerBase(IOptions options) - : base(options) - { - _options = options ?? throw new ArgumentNullException(nameof(options)); - } - } -} diff --git a/src/WorkflowManager/WorkflowManager/Controllers/WorkflowsController.cs b/src/WorkflowManager/WorkflowManager/Controllers/WorkflowsController.cs index 0f51bd3a5..4354006c4 100644 --- a/src/WorkflowManager/WorkflowManager/Controllers/WorkflowsController.cs +++ b/src/WorkflowManager/WorkflowManager/Controllers/WorkflowsController.cs @@ -156,7 +156,7 @@ public async Task ValidateAsync([FromBody] WorkflowUpdateRequest try { - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); if (errors.Count > 0) { @@ -188,7 +188,7 @@ public async Task CreateAsync([FromBody] Workflow workflow) { try { - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); if (errors.Count > 0) { @@ -243,7 +243,7 @@ public async Task UpdateAsync([FromBody] WorkflowUpdateRequest re try { - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); if (errors.Count > 0) { diff --git a/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs b/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs index 335828560..54df765d2 100644 --- a/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs +++ b/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs @@ -119,12 +119,12 @@ public void Reset() /// /// Workflow to validate. /// if any validation errors are produced while validating workflow. - public async Task> ValidateWorkflow(Workflow workflow) + public async Task> ValidateWorkflowAsync(Workflow workflow) { var tasks = workflow.Tasks; var firstTask = tasks.FirstOrDefault(); - await ValidateWorkflowSpec(workflow); + await ValidateWorkflowSpecAsync(workflow).ConfigureAwait(false); if (tasks.Any()) { ValidateTasks(workflow, firstTask!.Id); @@ -233,7 +233,7 @@ private void DetectUnreferencedTasks(TaskObject[] tasks, TaskObject firstTask) } } - private async Task ValidateWorkflowSpec(Workflow workflow) + private async Task ValidateWorkflowSpecAsync(Workflow workflow) { if (string.IsNullOrWhiteSpace(workflow.Name) is true) { @@ -257,7 +257,7 @@ private async Task ValidateWorkflowSpec(Workflow workflow) Errors.Add("Missing Workflow Version."); } - await ValidateInformaticsGateaway(workflow.InformaticsGateway); + await ValidateInformaticsGateawayAsync(workflow.InformaticsGateway); if (workflow.Tasks is null || workflow.Tasks.Any() is false) { @@ -275,7 +275,7 @@ private async Task ValidateWorkflowSpec(Workflow workflow) } } - private async Task ValidateInformaticsGateaway(InformaticsGateway informaticsGateway) + private async Task ValidateInformaticsGateawayAsync(InformaticsGateway informaticsGateway) { if (informaticsGateway is null) { @@ -303,15 +303,18 @@ private async Task ValidateInformaticsGateaway(InformaticsGateway informaticsGat private void ValidateTaskOutputArtifacts(TaskObject currentTask) { - if (currentTask.Artifacts != null && currentTask.Artifacts.Output.IsNullOrEmpty() is false) + var taskArtifacts = currentTask.Artifacts; + if (taskArtifacts == null || taskArtifacts.Output.IsNullOrEmpty()) { - var uniqueOutputNames = new HashSet(); - var allOutputsUnique = currentTask.Artifacts.Output.All(x => uniqueOutputNames.Add(x.Name)); + return; + } - if (allOutputsUnique is false) - { - Errors.Add($"Task: '{currentTask.Id}' has multiple output names with the same value."); - } + var uniqueOutputNames = new HashSet(); + var allOutputsUnique = taskArtifacts.Output.All(x => uniqueOutputNames.Add(x.Name)); + + if (allOutputsUnique is false) + { + Errors.Add($"Task: '{currentTask.Id}' has multiple output names with the same value."); } } @@ -326,29 +329,23 @@ private void TaskTypeSpecificValidation(Workflow workflow, TaskObject currentTas 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); - } - - if (currentTask.Type.Equals(ClinicalReviewTaskType, StringComparison.OrdinalIgnoreCase) is true) - { - ValidateClinicalReviewTask(tasks, currentTask); - } - - if (currentTask.Type.Equals(Email, StringComparison.OrdinalIgnoreCase) is true) - { - ValidateEmailTask(currentTask); + switch (currentTask.Type.ToLowerInvariant()) + { + case ExportTaskType: + ValidateExportTask(workflow, currentTask); + break; + case ExternalAppTaskType: + ValidateExternalAppTask(workflow, currentTask); + break; + case ArgoTaskType: + ValidateArgoTask(currentTask); + break; + case ClinicalReviewTaskType: + ValidateClinicalReviewTask(tasks, currentTask); + break; + case Email: + ValidateEmailTask(currentTask); + break; } } @@ -541,7 +538,7 @@ private void ValidateEmailTask(TaskObject currentTask) } var disallowedTags = _options.Value.DicomTagsDisallowed.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries); - var intersect = formattedMetadataValues.Intersect(disallowedTags); + var intersect = formattedMetadataValues.Intersect(disallowedTags).ToList(); if (intersect.Any()) { @@ -577,30 +574,29 @@ private void ValidateClinicalReviewRequiredFields(TaskObject[] tasks, TaskObject if (!currentTask.Args.ContainsKey(ReviewedTaskId)) { Errors.Add($"Task: '{currentTask.Id}' reviewed_task_id must be specified."); - return; } - else if (tasks.Any(t => t.Id.ToLower() == currentTask.Args[ReviewedTaskId].ToLower()) is false) + else { - Errors.Add($"Task: '{currentTask.Id}' reviewed_task_id: '{currentTask.Args[ReviewedTaskId]}' could not be found in the workflow."); - return; + if (tasks.Any(t => t.Id.ToLower() == currentTask.Args[ReviewedTaskId].ToLower()) is false) + { + Errors.Add($"Task: '{currentTask.Id}' reviewed_task_id: '{currentTask.Args[ReviewedTaskId]}' could not be found in the workflow."); + } + + var reviewedTask = tasks.FirstOrDefault(t => t.Id.ToLower() == currentTask.Args[ReviewedTaskId].ToLower()); + if (reviewedTask is null || AcceptableTasksToReview.Contains(reviewedTask.Type.ToLowerInvariant()) is false) + { + Errors.Add($"Task: '{currentTask.Id}' reviewed_task_id: '{currentTask.Args[ReviewedTaskId]}' does not reference an accepted reviewable task type. ({string.Join(Comma, AcceptableTasksToReview)})"); + } } if (!currentTask.Args.ContainsKey(Notifications)) { Errors.Add($"Task: '{currentTask.Id}' notifications must be specified."); - return; } else if (!Enum.TryParse(typeof(NotificationValues), currentTask.Args[Notifications], true, out var _)) { Errors.Add($"Task: '{currentTask.Id}' notifications is incorrectly specified{Comma}please specify 'true' or 'false'"); } - - var reviewedTask = tasks.First(t => t.Id.ToLower() == currentTask.Args[ReviewedTaskId].ToLower()); - - if (reviewedTask.Type.Equals(ArgoTaskType, StringComparison.OrdinalIgnoreCase) is false) - { - Errors.Add($"Task: '{currentTask.Id}' reviewed_task_id: '{currentTask.Args[ReviewedTaskId]}' does not reference an Argo task."); - } } private void ValidateExportTask(Workflow workflow, TaskObject currentTask) @@ -612,7 +608,7 @@ private void ValidateExportTask(Workflow workflow, TaskObject currentTask) CheckDestinationInMigDestinations(currentTask, workflow.InformaticsGateway); - if (currentTask.ExportDestinations.Count() != currentTask.ExportDestinations.Select(t => t.Name).Distinct().Count()) + if (currentTask.ExportDestinations.Length != currentTask.ExportDestinations.Select(t => t.Name).Distinct().Count()) { Errors.Add($"Task: '{currentTask.Id}' contains duplicate destinations."); } @@ -629,19 +625,28 @@ private void ValidateExternalAppTask(Workflow workflow, TaskObject currentTask) CheckDestinationInMigDestinations(currentTask, workflow.InformaticsGateway); - if (currentTask.ExportDestinations.Count() != currentTask.ExportDestinations.Select(t => t.Name).Distinct().Count()) + if (currentTask.ExportDestinations.Length != currentTask.ExportDestinations.Select(t => t.Name).Distinct().Count()) { Errors.Add($"Task: '{currentTask.Id}' contains duplicate destinations."); } ValidateTaskOutputArtifacts(currentTask); + var taskArtifacts = currentTask.Artifacts; - if (currentTask.Artifacts == null - || currentTask.Artifacts.Output.IsNullOrEmpty() - || (currentTask.Artifacts.Output.Select(a => a.Name).Any() is false)) + if (taskArtifacts == null + || taskArtifacts.Output.IsNullOrEmpty() + || (taskArtifacts.Output.Select(a => a.Name).Any() is false)) { Errors.Add($"Task: '{currentTask.Id}' must contain at lease a single output."); } + + var invalidOutputTypes = taskArtifacts.Output.Where(x => + ArtifactTypes.Validate(x.Type.ToString()) is false || x.Type == ArtifactType.Unset).ToList(); + if (invalidOutputTypes.Any()) + { + var incorrectOutputs = string.Join(Comma, invalidOutputTypes.Select(x => x.Name)); + Errors.Add($"Task: '{currentTask.Id}' has incorrect artifact output types set on artifacts with following name. {incorrectOutputs}"); + } } } } diff --git a/src/WorkflowManager/WorkflowManager/packages.lock.json b/src/WorkflowManager/WorkflowManager/packages.lock.json index 47527521e..21dca3bfb 100755 --- a/src/WorkflowManager/WorkflowManager/packages.lock.json +++ b/src/WorkflowManager/WorkflowManager/packages.lock.json @@ -485,8 +485,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1059,7 +1059,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1082,7 +1082,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } 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 f00b8978f..a034a49a8 100644 --- 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/Features/WorkflowApi.feature b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowApi.feature index 03d41a0f1..4fc86306e 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowApi.feature +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/WorkflowApi.feature @@ -122,7 +122,7 @@ Scenario Outline: Update workflow with invalid details | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' | | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' | | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks | - | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. | + | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an accepted reviewable task type. (argo, remote_app_execution) | | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' | | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Missing_Notifications | notifications must be specified | | /workflows/c86a437d-d026-4bdf-b1df-c7a6372b89e3 | Invalid_Clinical_Review_Invalid_Notifications | notifications is incorrectly specified | @@ -168,6 +168,13 @@ Scenario: Add workflow with valid details with clinical review task When I send a POST request Then I will get a 201 response +@AddWorkflows +Scenario: Add workflow with valid details with remote app task + Given I have an endpoint /workflows + And I have a workflow body Valid_remote_task + When I send a POST request + Then I will get a 201 response + @AddWorkflows Scenario: Add workflow with valid empty details Given I have an endpoint /workflows @@ -205,10 +212,12 @@ Scenario Outline: Add workflow with invalid details | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' | | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' | | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks | - | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. | + | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an accepted reviewable task type. (argo, remote_app_execution) | | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' | | Invalid_Clinical_Review_Missing_Notifications | notifications must be specified | | Invalid_Clinical_Review_Invalid_Notifications | notifications is incorrectly specified | + | invalid_remote_task_without_outputs | Task: 'invalid_remote_task_step2_remote_app' must contain at lease a single output | + | Invalid_remote_task_without_outputs_type_set | Task: 'invalid_remote_task_step2_remote_app' has incorrect artifact output types set on artifacts with following name. | @AddWorkflows Scenario Outline: Add workflow with duplicate workflow name @@ -254,7 +263,7 @@ Scenario Outline: Validate workflow with invalid details | Invalid_Workflow_Incorrect_Clinical_Review_Artifact | Invalid input artifact 'test' in task 'Clinical_Review_Task': No matching task for ID 'mean-pixel-calc' | | Invalid_Workflow_Dup_Task_Id | Found duplicate task id 'liver-seg' | | Invalid_Workflow_Coverging_Task_Dest | Converging Tasks Destinations in tasks | - | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an Argo task. | + | Invalid_Clinical_Review_Task_Id | 'clinical-review' reviewed_task_id: 'router' does not reference an accepted reviewable task type. (argo, remote_app_execution) | | Invalid_Clinical_Review_Multiple_Argo_Inputs | Invalid input artifact 'Argo2' in task 'clinical-review': Task cannot reference a non-reviewed task artifacts 'argo-task-2' | | Invalid_Clinical_Review_Missing_Notifications | notifications must be specified | | Invalid_Clinical_Review_Invalid_Notifications | notifications is incorrectly specified | 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 34d69e1e6..60a212d39 100644 --- 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/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/CommonApiStepDefinitions.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/CommonApiStepDefinitions.cs index f39f8cb83..9bf5df4d6 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/CommonApiStepDefinitions.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/CommonApiStepDefinitions.cs @@ -62,6 +62,8 @@ public void WhenISendARequest(string verb) [Then(@"I will get a (.*) response")] public void ThenIWillGetAResponse(string expectedCode) { + var result = ApiHelper.Response.Content.ReadAsStringAsync().Result; + ApiHelper.Response.StatusCode.Should().Be((HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), expectedCode)); } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs index ad16a6f69..530fa01de 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs @@ -48,7 +48,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -106,7 +106,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Args = new Dictionary { { "test", "test" } } } @@ -136,7 +136,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Args = new Dictionary { { "test", "test" } } } @@ -166,7 +166,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Args = new Dictionary { { "test", "test" } } } @@ -196,7 +196,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Args = new Dictionary { { "test", "test" } } } @@ -226,7 +226,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Args = new Dictionary { { "test", "test" } } } @@ -257,7 +257,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Args = new Dictionary { { "test", "test" } } } @@ -287,7 +287,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Args = new Dictionary { { "test", "test" } } } @@ -316,7 +316,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Description = "Basic Workflow 1 Task 1", Args = new Dictionary { { "test", "test" } } @@ -347,7 +347,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, } }, @@ -375,7 +375,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Description = "Basic Workflow 1 Task 1", Args = new Dictionary { { "test", "test" } } @@ -405,7 +405,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, Description = "Basic Workflow 1 Task 1", Args = new Dictionary { { "test", "test" } } @@ -672,15 +672,15 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact + new OutputArtifact { Name = "non_unique_name", Value = "{{ context.executions.artifact_task_1.output_dir }}", Mandatory = true }, - new Artifact + new OutputArtifact { Name = "non_unique_name", Value = "{{ context.executions.artifact_task_1.output_dir }}", @@ -735,7 +735,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -769,7 +769,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -804,7 +804,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -835,7 +835,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -868,7 +868,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -901,7 +901,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -934,7 +934,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -969,7 +969,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { new TaskDestination @@ -987,7 +987,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] { new Artifact { Name = "test", Value = "{{ context.executions.mean-pixel-calc.artifacts.report }}" } }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -1018,7 +1018,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -1049,7 +1049,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { @@ -1079,7 +1079,7 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { } } @@ -1115,9 +1115,9 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { Name = "Argo1" } + new OutputArtifact { Name = "Argo1" } } }, TaskDestinations = new TaskDestination[] @@ -1146,9 +1146,9 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { Name = "Argo2" } + new OutputArtifact { Name = "Argo2" } } }, TaskDestinations = new TaskDestination[] { @@ -1179,7 +1179,7 @@ public static class WorkflowObjectsTestData new Artifact { Name = "Argo1", Value = "{{ context.executions.argo-task-1.artifacts.Argo1 }}" }, new Artifact { Name = "Argo2", Value = "{{ context.executions.argo-task-2.artifacts.Argo2 }}" }, }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -1216,7 +1216,7 @@ public static class WorkflowObjectsTestData Name = "Dicom", Value = "{{ context.input.dicom }}" } }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} }, @@ -1235,7 +1235,7 @@ public static class WorkflowObjectsTestData Name = "Dicom", Value = "{{ context.input.dicom }}" } }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -1272,7 +1272,7 @@ public static class WorkflowObjectsTestData Name = "Dicom", Value = "{{ context.input.dicom }}" } }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { @@ -1295,7 +1295,7 @@ public static class WorkflowObjectsTestData Name = "Dicom", Value = "{{ context.input.dicom }}" } }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { @@ -1317,7 +1317,7 @@ public static class WorkflowObjectsTestData Name = "Dicom", Value = "{{ context.input.dicom }}" } }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { @@ -1339,7 +1339,7 @@ public static class WorkflowObjectsTestData Name = "Dicom", Value = "{{ context.input.dicom }}" } }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { } } @@ -1375,9 +1375,9 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { Name = "Argo2" } + new OutputArtifact { Name = "Argo2" } } }, TaskDestinations = new TaskDestination[] { @@ -1406,7 +1406,7 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { } } @@ -1442,9 +1442,9 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { Name = "Argo2" } + new OutputArtifact { Name = "Argo2" } } }, TaskDestinations = new TaskDestination[] { @@ -1474,7 +1474,7 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { } } @@ -1510,9 +1510,9 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { Name = "Argo2" } + new OutputArtifact { Name = "Argo2" } } }, TaskDestinations = new TaskDestination[] { @@ -1542,7 +1542,7 @@ public static class WorkflowObjectsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { } } @@ -1573,7 +1573,7 @@ public static class WorkflowObjectsTestData Artifacts = new ArtifactMap() { Input = new Artifact[] {}, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] {} } @@ -1586,6 +1586,219 @@ public static class WorkflowObjectsTestData } } }, + new WorkflowObjectTestData() + { + Name = "Valid_remote_task", + Workflow = new Workflow() + { + Name = "Valid_remote_task", + Description = "Valid remote task", + Version = "1", + Tasks = new TaskObject[] + { + new TaskObject + { + Id = "Valid_remote_task_step1_router", + Type = "router", + Description = "Valid remote Workflow Basic Workflow update Task update", + Args = new Dictionary { { "test", "test" } }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] {}, + Output = new OutputArtifact[] {} + }, + TaskDestinations = new TaskDestination[] + { + new TaskDestination() + { + Name = "Valid_remote_task_step2_remote_app" + } + } + }, + new TaskObject + { + Id = "Valid_remote_task_step2_remote_app", + Type = "remote_app_execution", + Description = "Valid remote Workflow Basic remote app execution task", + Args = new Dictionary { { "test", "test" } }, + ExportDestinations = new ExportDestination[] { new ExportDestination { Name = "test" } }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] + { + new Artifact() + { + Name = "input.dcm", + Mandatory = true, + Value = "input.dcm" + } + }, + Output = new OutputArtifact[] + { + new OutputArtifact() + { + Type = ArtifactType.AU, + Mandatory = true, + Name = "output.pdf", + } + } + }, + TaskDestinations = new TaskDestination[] + { + new TaskDestination() + { + Name = "valid_clinical_review", + } + } + }, + new TaskObject + { + Id = "valid_clinical_review", + Type = "aide_clinical_review", + Description = "Valid remote Workflow Clinical Review", + Args = new Dictionary { + { "mode", "qa" }, + { "application_name", "Name" }, + { "application_version", "Version" }, + { "reviewed_task_id", "Valid_remote_task_step2_remote_app"}, + { "notifications", "false" } + }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] + { + new Artifact() + { + Name = "input.dcm", + Mandatory = true, + Value = "{{ context.executions.Valid_remote_task_step2_remote_app.artifacts.report }}" + } + }, + }, + TaskDestinations = new TaskDestination[] {} + } + }, + InformaticsGateway = new InformaticsGateway() + { + AeTitle = "Update", + ExportDestinations = new string[]{"test"} + } + } + }, + new WorkflowObjectTestData() + { + Name = "Invalid_remote_task_without_outputs_type_set", + Workflow = new Workflow() + { + Name = "Invalid_remote_task_without_outputs_type_set", + Description = "Invalid remote task without outputs type set", + Version = "1", + Tasks = new TaskObject[] + { + new TaskObject + { + Id = "remote_task_without_outputs_type_set_step1_router", + Type = "router", + Description = "Basic Workflow update Task update", + Args = new Dictionary { { "test", "test" } }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] {}, + Output = new OutputArtifact[] {} + }, + TaskDestinations = new TaskDestination[] {} + }, + new TaskObject + { + Id = "invalid_remote_task_step2_remote_app", + Type = "remote_app_execution", + Description = "Basic remote app execution task", + Args = new Dictionary { { "test", "test" } }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] {}, + Output = new OutputArtifact[] + { + new OutputArtifact() + } + }, + } + }, + InformaticsGateway = new InformaticsGateway() + { + AeTitle = "Update", + ExportDestinations = new string[]{"test"} + } + } + }, + new WorkflowObjectTestData() + { + Name = "invalid_remote_task_without_outputs", + Workflow = new Workflow() + { + Name = "invalid_remote_task_without_outputs", + Description = "invalid remote task without outputs", + Version = "1", + Tasks = new TaskObject[] + { + new TaskObject + { + Id = "step1_router", + Type = "router", + Description = "Basic Workflow update Task update", + Args = new Dictionary { { "test", "test" } }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] {}, + Output = new OutputArtifact[] {} + }, + TaskDestinations = new TaskDestination[] {} + }, + new TaskObject + { + Id = "invalid_remote_task_step2_remote_app", + Type = "remote_app_execution", + Description = "Basic remote app execution task", + Args = new Dictionary { { "test", "test" } }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] {}, + Output = new OutputArtifact[] {} + }, + TaskDestinations = new TaskDestination[] + { + new TaskDestination() + { + Name = "clinical_review", + } + } + }, + new TaskObject + { + Id = "clinical_review", + Type = "aide_clinical_review", + Description = "Clinical Review task missing ReviewedTaskId", + Args = new Dictionary { + { "mode", "qa" }, + { "application_name", "Name" }, + { "application_version", "Version" }, + { "reviewed_task_id", "Task ID" } + }, + Artifacts = new ArtifactMap() + { + Input = new Artifact[] {}, + Output = new OutputArtifact[] {} + }, + TaskDestinations = new TaskDestination[] {} + } + }, + InformaticsGateway = new InformaticsGateway() + { + AeTitle = "Update", + ExportDestinations = new string[]{"test"} + } + } + }, }; } } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs index 834bfd113..ca7279a09 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs @@ -2842,9 +2842,9 @@ public static class WorkflowRevisionsTestData { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { + new OutputArtifact { Name = "output", Mandatory = true }, diff --git a/tests/UnitTests/PayloadListener.Tests/packages.lock.json b/tests/UnitTests/PayloadListener.Tests/packages.lock.json index 09b937847..43213bcd3 100644 --- a/tests/UnitTests/PayloadListener.Tests/packages.lock.json +++ b/tests/UnitTests/PayloadListener.Tests/packages.lock.json @@ -341,8 +341,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -873,7 +873,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -896,7 +896,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index 6d318ff17..052b4bf40 100644 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -43,6 +43,7 @@ using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Extensions; using Monai.Deploy.WorkflowManager.Common.ConditionsResolver.Parser; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; +using Monai.Deploy.WorkloadManager.WorkfowExecuter.Extensions; namespace Monai.Deploy.WorkflowManager.Common.WorkflowExecuter.Tests.Services { @@ -373,9 +374,9 @@ public async Task ProcessPayload_ValidWorkflowIdRequestWithArtifacts_ReturnesTru Description = "taskdesc", Artifacts = new ArtifactMap { - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact + new OutputArtifact { Name = "output.pdf" } @@ -1818,9 +1819,9 @@ public async Task ProcessTaskUpdate_ValidTaskUpdateEventWithOutputArtifactsMissi }, Artifacts = new ArtifactMap { - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact + new OutputArtifact { Name = "Artifact Name", Value = "Artifact Value", @@ -2388,7 +2389,7 @@ public void AttachPatientMetaData_AtachesDataToTaskExec_TaskExecShouldHavePatien PatientSex = "Unknown", }; - WorkflowExecuterService.AttachPatientMetaData(taskExec, patientDetails); + taskExec.AttachPatientMetaData(patientDetails, null); taskExec.TaskPluginArguments.Should().NotBeNull(); taskExec.TaskPluginArguments[PatientKeys.PatientId].Should().BeSameAs(patientDetails.PatientId); diff --git a/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs b/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs new file mode 100644 index 000000000..7799f980b --- /dev/null +++ b/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs @@ -0,0 +1,30 @@ +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Monai.Deploy.WorkflowManager.Common.Contracts.Models; +using Monai.Deploy.WorkflowManager.Common.ControllersShared; +using Newtonsoft.Json; +using Xunit; + +namespace Monai.Deploy.WorkflowManager.Common.Test.Controllers +{ + public class ArtifactsControllerTests + { + private ArtifactsController ArtifactsController { get; } + + public ArtifactsControllerTests() + { + ArtifactsController = new ArtifactsController(); + } + + [Fact] + public void GetArtifactTypesTest() + { + var result = ArtifactsController.GetArtifactTypes(); + Assert.NotNull(result); + var ok = Assert.IsType(result); + var json = JsonConvert.SerializeObject(ok.Value); + + ok.Value.Should().BeEquivalentTo(ArtifactTypes.ListOfModularity); + } + } +} diff --git a/tests/UnitTests/WorkflowManager.Tests/Controllers/PayloadControllerTests.cs b/tests/UnitTests/WorkflowManager.Tests/Controllers/PayloadControllerTests.cs index fef8195b2..b907cc4e0 100644 --- a/tests/UnitTests/WorkflowManager.Tests/Controllers/PayloadControllerTests.cs +++ b/tests/UnitTests/WorkflowManager.Tests/Controllers/PayloadControllerTests.cs @@ -134,7 +134,7 @@ public async Task GetByIdAsync_PayloadDoesNotExist_ReturnsNotFound() var objectResult = Assert.IsType(result); var responseValue = (ProblemDetails)objectResult.Value; - string expectedErrorMessage = $"Failed to find payload with payload id: {payloadId}"; + var expectedErrorMessage = $"Failed to find payload with payload id: {payloadId}"; responseValue.Detail.Should().BeEquivalentTo(expectedErrorMessage); Assert.Equal((int)HttpStatusCode.NotFound, responseValue.Status); diff --git a/tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs b/tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs index 1b71b8075..486127160 100644 --- a/tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs +++ b/tests/UnitTests/WorkflowManager.Tests/Controllers/WorkflowsControllerTests.cs @@ -175,7 +175,7 @@ public async Task CreateAsync_ValidWorkflow_ReturnsWorkflowId() Name = "test", Value = "{{ context.input.dicom }}" } - } + }, }, ExportDestinations = new ExportDestination[] { new ExportDestination @@ -419,9 +419,9 @@ public async Task ValidateAsync_ValidWorkflowWithClinicalReview_Returns204() { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { Name = "Argo2" } + new OutputArtifact { Name = "Argo2" } } }, TaskDestinations = new TaskDestination[] { @@ -451,7 +451,7 @@ public async Task ValidateAsync_ValidWorkflowWithClinicalReview_Returns204() { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { } } @@ -498,9 +498,9 @@ public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewMissingNotifica { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { Name = "Argo2" } + new OutputArtifact { Name = "Argo2" } } }, TaskDestinations = new TaskDestination[] { @@ -529,7 +529,7 @@ public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewMissingNotifica { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { } } @@ -580,9 +580,9 @@ public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewInvalidNotifica { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact { Name = "Argo2" } + new OutputArtifact { Name = "Argo2" } } }, TaskDestinations = new TaskDestination[] { @@ -612,7 +612,7 @@ public async Task ValidateAsync_InvalidWorkflowWithClinicalReviewInvalidNotifica { new Artifact { Name = "Dicom", Value = "{{ context.input.dicom }}" }, }, - Output = new Artifact[] {} + Output = new OutputArtifact[] {} }, TaskDestinations = new TaskDestination[] { } } diff --git a/tests/UnitTests/WorkflowManager.Tests/Validators/WorkflowValidatorTests.cs b/tests/UnitTests/WorkflowManager.Tests/Validators/WorkflowValidatorTests.cs index 422a52ce3..a32fc1937 100644 --- a/tests/UnitTests/WorkflowManager.Tests/Validators/WorkflowValidatorTests.cs +++ b/tests/UnitTests/WorkflowManager.Tests/Validators/WorkflowValidatorTests.cs @@ -18,6 +18,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using FluentAssertions; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces; @@ -98,15 +99,15 @@ public async Task ValidateWorkflow_ValidatesAWorkflow_ReturnsErrorsAndHasCorrect }, Artifacts = new ArtifactMap { - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact + new OutputArtifact { Name = "non_unique_artifact", Mandatory = true, Value = "Example Value" }, - new Artifact + new OutputArtifact { Name = "non_unique_artifact", Mandatory = true, @@ -604,11 +605,11 @@ public async Task ValidateWorkflow_ValidatesAWorkflow_ReturnsErrorsAndHasCorrect _informaticsGatewayService.Setup(w => w.OriginExists(It.IsAny())) .ReturnsAsync(false); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.True(errors.Count > 0); - Assert.Equal(53, errors.Count); + Assert.Equal(56, errors.Count); var convergingTasksDestinations = "Converging Tasks Destinations in tasks: (test-clinical-review-2, example-task) on task: example-task"; Assert.Contains(convergingTasksDestinations, errors); @@ -707,7 +708,7 @@ public async Task ValidateWorkflow_ValidatesEmptyWorkflow_ReturnsErrorsAndHasCor .ReturnsAsync(new WorkflowRevision()); _workflowValidator.OrignalName = "pizza"; - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.True(errors.Count > 0); @@ -761,9 +762,9 @@ public async Task ValidateWorkflow_ValidateWorkflow_WithPluginArgs_ReturnsNoErro }, Artifacts = new ArtifactMap { - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact + new OutputArtifact { Name = "non_unique_artifact", Mandatory = true, @@ -815,7 +816,7 @@ public async Task ValidateWorkflow_ValidateWorkflow_WithPluginArgs_ReturnsNoErro _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.True(errors.Count == 0); @@ -859,9 +860,9 @@ public async Task ValidateWorkflow_ValidateWorkflow_ReturnsNoErrors() }, Artifacts = new ArtifactMap { - Output = new Artifact[] + Output = new OutputArtifact[] { - new Artifact + new OutputArtifact { Name = "non_unique_artifact", Mandatory = true, @@ -923,7 +924,7 @@ public async Task ValidateWorkflow_ValidateWorkflow_ReturnsNoErrors() for (var i = 0; i < 15; i++) { - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.True(errors.Count == 0); } @@ -970,7 +971,7 @@ public async Task ValidateWorkflow_Incorrect_podPriorityClassName_ReturnsErrors( _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.Single(errors); } @@ -1016,7 +1017,7 @@ public async Task ValidateWorkflow_correct_podPriorityClassName_ReturnsNoErrors( _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.Empty(errors); } @@ -1078,9 +1079,77 @@ public async Task ValidateWorkflow_ExportAppWithoutDestination_ReturnsErrors() _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); + + Assert.NotEmpty(errors); + } + + [Fact] + public async Task ValidateWorkflow_RemoteAppTaskWithoutTypeSet_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 }}" }, + }, + Output = new OutputArtifact[] + { + new OutputArtifact { Name = "report.pdf" }, + }, + } + } + } + }; + + _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) + .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); + + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.NotEmpty(errors); + const string expectedError = "Task: 'externalTask' has incorrect artifact output types set on artifacts with following name. report.pdf"; + errors.Contains(expectedError).Should().BeTrue(); } [Fact] @@ -1141,7 +1210,7 @@ public async Task ValidateWorkflow_ExportAppWithSameDestinationTwice_ReturnsErro _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.NotEmpty(errors); } @@ -1199,7 +1268,7 @@ public async Task ValidateWorkflow_ExportAppWithInputs_ReturnsErrors() _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.NotEmpty(errors); } @@ -1260,7 +1329,7 @@ public async Task ValidateWorkflow_ExportAppWithOutputs_ReturnsErrors() _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.Single(errors); } @@ -1339,7 +1408,7 @@ public async Task ValidateWorkflow_Converging_Tasks_ReturnsErrors() _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.NotEmpty(errors.Where(e => e.Contains("Converging Tasks"))); } @@ -1396,7 +1465,7 @@ public async Task ValidateWorkflow_Duplicate_TaskIds_ReturnsErrors() _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.NotEmpty(errors.Where(e => e.Contains("Found duplicate task"))); } @@ -1440,7 +1509,7 @@ public async Task ValidateWorkflow_No_InformaticsGateway_On_export_Task_ReturnsE _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.NotEmpty(errors.Where(e => e.Contains("InformaticsGateway ExportDestinations destinations can not be null"))); } @@ -1463,7 +1532,7 @@ public async Task ValidateWorkflow_InformaticsGateway_No_AETitle_ReturnsErrors() _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.NotEmpty(errors.Where(e => e.Contains("AeTitle is required in the InformaticsGateaway section"))); } @@ -1507,7 +1576,7 @@ public async Task ValidateWorkflow_No_name_Or_Values_On_Inputs_ReturnsErrors() _workflowService.Setup(w => w.GetByNameAsync(It.IsAny())) .ReturnsAsync(null, TimeSpan.FromSeconds(.1)); - var errors = await _workflowValidator.ValidateWorkflow(workflow); + var errors = await _workflowValidator.ValidateWorkflowAsync(workflow); Assert.NotEmpty(errors.Where(e => e.Contains("Input Artifacts must have a Name"))); Assert.NotEmpty(errors.Where(e => e.Contains("Input Artifacts must have a Value"))); diff --git a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json index 067ca159c..371f50338 100755 --- a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json +++ b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json @@ -510,8 +510,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.1", - "contentHash": "w0+37sCMzhZg4vhYFG+9TKmDW+Dks5DOiTrJzdnT8xJCfH1MK6xkRnIf+dBfxes0wFwPiKueaUWDcUsg1RnadQ==", + "resolved": "1.1.0-list-of-modaliti0015", + "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1892,7 +1892,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1915,7 +1915,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.1, )", + "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } From b97b6d554c69730f582c7fafff849ccb2e039aa0 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Fri, 13 Oct 2023 11:16:22 +0100 Subject: [PATCH 02/21] minor change to using statements Signed-off-by: Lillie Dae --- .../WorkflowManager/Controllers/ArtifactsController.cs | 1 - .../WorkflowManager/Validators/WorkflowValidator.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs b/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs index 43a726996..7a9885a64 100644 --- a/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs +++ b/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Linq; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Monai.Deploy.Messaging.Common; diff --git a/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs b/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs index 54df765d2..0eef472ec 100644 --- a/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs +++ b/src/WorkflowManager/WorkflowManager/Validators/WorkflowValidator.cs @@ -22,6 +22,7 @@ using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; +using Monai.Deploy.Messaging.Common; using Monai.Deploy.WorkflowManager.Common.Configuration; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; using Monai.Deploy.WorkflowManager.Common.Logging; @@ -29,7 +30,6 @@ using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces; using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Utilities; using Monai.Deploy.WorkflowManager.Common.Services.InformaticsGateway; -using MongoDB.Driver.Linq; using static Monai.Deploy.WorkflowManager.Common.Miscellaneous.ValidationConstants; namespace Monai.Deploy.WorkflowManager.Common.Validators From b7d06adc8c298cabcb9444c06c2bf4519af9b0f9 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Fri, 13 Oct 2023 11:21:14 +0100 Subject: [PATCH 03/21] remove comment Signed-off-by: Lillie Dae --- .../WorkflowExecuter/Services/WorkflowExecuterService.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index 0adabdd06..9a7266e14 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -531,9 +531,7 @@ private async Task DispatchDicomExport(WorkflowInstance workflowInstance, await ExportRequest(workflowInstance, task, exportDestinations, artifactValues, correlationId, plugins); return await _workflowInstanceRepository.UpdateTaskStatusAsync(workflowInstance.Id, task.TaskId, TaskExecutionStatus.Dispatched); } - - - // UPTO HERE TODO + private async Task HandleOutputArtifacts(WorkflowInstance workflowInstance, List outputs, TaskExecution task, WorkflowRevision workflowRevision) { var artifactDict = outputs.ToArtifactDictionary(); From 1584e5690dbb461dd276ab4298e72098b85e2a10 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Fri, 13 Oct 2023 11:31:56 +0100 Subject: [PATCH 04/21] add header files Signed-off-by: Lillie Dae --- .licenserc.yaml | 1 + .../Extensions/TaskExecutionExtension.cs | 16 ++++++++++++++++ .../Services/WorkflowExecuterService.cs | 2 +- .../Controllers/ArtifactsController.cs | 16 ++++++++++++++++ .../Controllers/ArtifactsControllerTests.cs | 18 +++++++++++++++++- 5 files changed, 51 insertions(+), 2 deletions(-) diff --git a/.licenserc.yaml b/.licenserc.yaml index deb6740a3..a3a8f82d0 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -34,6 +34,7 @@ header: - 'src/.vs' - 'doc/dependency_decisions.yml' - 'docs/templates/**' + - 'src/Monai.Deploy.WorkflowManager.sln.DotSettings' comment: never diff --git a/src/WorkflowManager/WorkflowExecuter/Extensions/TaskExecutionExtension.cs b/src/WorkflowManager/WorkflowExecuter/Extensions/TaskExecutionExtension.cs index 12f6bc3ba..647178416 100644 --- a/src/WorkflowManager/WorkflowExecuter/Extensions/TaskExecutionExtension.cs +++ b/src/WorkflowManager/WorkflowExecuter/Extensions/TaskExecutionExtension.cs @@ -1,3 +1,19 @@ +/* + * Copyright 2022 MONAI Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System.Globalization; using Microsoft.Extensions.Logging; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index 9a7266e14..2926cc8a8 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -531,7 +531,7 @@ private async Task DispatchDicomExport(WorkflowInstance workflowInstance, await ExportRequest(workflowInstance, task, exportDestinations, artifactValues, correlationId, plugins); return await _workflowInstanceRepository.UpdateTaskStatusAsync(workflowInstance.Id, task.TaskId, TaskExecutionStatus.Dispatched); } - + private async Task HandleOutputArtifacts(WorkflowInstance workflowInstance, List outputs, TaskExecution task, WorkflowRevision workflowRevision) { var artifactDict = outputs.ToArtifactDictionary(); diff --git a/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs b/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs index 7a9885a64..7b2b8efd5 100644 --- a/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs +++ b/src/WorkflowManager/WorkflowManager/Controllers/ArtifactsController.cs @@ -1,3 +1,19 @@ +/* + * Copyright 2022 MONAI Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + using System.Collections.Generic; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; diff --git a/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs b/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs index 7799f980b..9935f2e1a 100644 --- a/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs +++ b/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs @@ -1,6 +1,22 @@ +/* + * Copyright 2022 MONAI Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + using FluentAssertions; using Microsoft.AspNetCore.Mvc; -using Monai.Deploy.WorkflowManager.Common.Contracts.Models; using Monai.Deploy.WorkflowManager.Common.ControllersShared; using Newtonsoft.Json; using Xunit; From 7a2e1048da2e199ff431a48255f9f4a0a45f0f68 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Fri, 13 Oct 2023 11:35:05 +0100 Subject: [PATCH 05/21] import missing references Signed-off-by: Lillie Dae --- .../TestData/WorkflowObjectTestData.cs | 2 ++ .../Controllers/ArtifactsControllerTests.cs | 1 + 2 files changed, 3 insertions(+) diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs index 530fa01de..9661003eb 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowObjectTestData.cs @@ -14,7 +14,9 @@ * limitations under the License. */ +using Monai.Deploy.Messaging.Common; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; +using Artifact = Monai.Deploy.WorkflowManager.Common.Contracts.Models.Artifact; namespace Monai.Deploy.WorkflowManager.Common.WorkflowExecutor.IntegrationTests.TestData { diff --git a/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs b/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs index 9935f2e1a..d71009b7a 100644 --- a/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs +++ b/tests/UnitTests/WorkflowManager.Tests/Controllers/ArtifactsControllerTests.cs @@ -17,6 +17,7 @@ using FluentAssertions; using Microsoft.AspNetCore.Mvc; +using Monai.Deploy.Messaging.Common; using Monai.Deploy.WorkflowManager.Common.ControllersShared; using Newtonsoft.Json; using Xunit; From ca2fa88651b8cd2f04ce7aa3a6c5ba0ff996bb67 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Mon, 16 Oct 2023 09:27:03 +0100 Subject: [PATCH 06/21] updated packages Signed-off-by: Lillie Dae --- ...nai.Deploy.WorkflowManager.Common.Configuration.csproj | 2 +- src/Common/Configuration/packages.lock.json | 6 +++--- src/Common/Miscellaneous/packages.lock.json | 6 +++--- .../Monai.Deploy.WorkflowManager.TaskManager.API.csproj | 2 +- src/TaskManager/API/packages.lock.json | 6 +++--- src/TaskManager/Database/packages.lock.json | 6 +++--- .../Plug-ins/AideClinicalReview/packages.lock.json | 8 ++++---- src/TaskManager/Plug-ins/Argo/packages.lock.json | 8 ++++---- src/TaskManager/TaskManager/packages.lock.json | 8 ++++---- .../Monai.Deploy.WorkflowManager.Contracts.csproj | 2 +- src/WorkflowManager/Database/packages.lock.json | 6 +++--- src/WorkflowManager/Logging/packages.lock.json | 6 +++--- src/WorkflowManager/PayloadListener/packages.lock.json | 8 ++++---- src/WorkflowManager/Services/packages.lock.json | 8 ++++---- src/WorkflowManager/Storage/packages.lock.json | 6 +++--- src/WorkflowManager/WorkflowExecuter/packages.lock.json | 8 ++++---- src/WorkflowManager/WorkflowManager/packages.lock.json | 8 ++++---- ...oy.WorkflowManager.TaskManager.IntegrationTests.csproj | 4 ++-- ...rkflowManager.WorkflowExecutor.IntegrationTests.csproj | 4 ++-- tests/UnitTests/PayloadListener.Tests/packages.lock.json | 8 ++++---- tests/UnitTests/WorkflowManager.Tests/packages.lock.json | 8 ++++---- 21 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj b/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj index 00aebf1cc..fc873f3f3 100644 --- a/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj +++ b/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/Common/Configuration/packages.lock.json b/src/Common/Configuration/packages.lock.json index e95d10bee..6fd5af855 100644 --- a/src/Common/Configuration/packages.lock.json +++ b/src/Common/Configuration/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[1.1.0-list-of-modaliti0015, )", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/Common/Miscellaneous/packages.lock.json b/src/Common/Miscellaneous/packages.lock.json index ddc73c6c9..795cff82f 100644 --- a/src/Common/Miscellaneous/packages.lock.json +++ b/src/Common/Miscellaneous/packages.lock.json @@ -146,8 +146,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -236,7 +236,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } } diff --git a/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj b/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj index c911c3b5b..80f27b78f 100644 --- 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 d25849609..f1e91e3e3 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": "[1.1.0-list-of-modaliti0015, )", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/Database/packages.lock.json b/src/TaskManager/Database/packages.lock.json index 6316992b3..a3a29255e 100755 --- a/src/TaskManager/Database/packages.lock.json +++ b/src/TaskManager/Database/packages.lock.json @@ -247,8 +247,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -684,7 +684,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json index 4968d04fb..68e70ba1e 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json +++ b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json @@ -258,8 +258,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -733,7 +733,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -747,7 +747,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/Plug-ins/Argo/packages.lock.json b/src/TaskManager/Plug-ins/Argo/packages.lock.json index 124131c01..f546e16e1 100644 --- a/src/TaskManager/Plug-ins/Argo/packages.lock.json +++ b/src/TaskManager/Plug-ins/Argo/packages.lock.json @@ -368,8 +368,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -871,7 +871,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -885,7 +885,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/TaskManager/packages.lock.json b/src/TaskManager/TaskManager/packages.lock.json index 55ff2c8b5..ca99565bf 100644 --- a/src/TaskManager/TaskManager/packages.lock.json +++ b/src/TaskManager/TaskManager/packages.lock.json @@ -537,8 +537,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1138,7 +1138,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1160,7 +1160,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj b/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj index ff08cf81c..3bafa6ceb 100644 --- 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 42648fe48..93757843f 100755 --- a/src/WorkflowManager/Database/packages.lock.json +++ b/src/WorkflowManager/Database/packages.lock.json @@ -269,8 +269,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -685,7 +685,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Logging/packages.lock.json b/src/WorkflowManager/Logging/packages.lock.json index 6be21f126..846a2e363 100755 --- a/src/WorkflowManager/Logging/packages.lock.json +++ b/src/WorkflowManager/Logging/packages.lock.json @@ -210,8 +210,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -641,7 +641,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/PayloadListener/packages.lock.json b/src/WorkflowManager/PayloadListener/packages.lock.json index c47cc767c..388d42be2 100644 --- a/src/WorkflowManager/PayloadListener/packages.lock.json +++ b/src/WorkflowManager/PayloadListener/packages.lock.json @@ -270,8 +270,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -779,7 +779,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -802,7 +802,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Services/packages.lock.json b/src/WorkflowManager/Services/packages.lock.json index 34242a023..8474e1adf 100644 --- a/src/WorkflowManager/Services/packages.lock.json +++ b/src/WorkflowManager/Services/packages.lock.json @@ -249,8 +249,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -733,14 +733,14 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Storage/packages.lock.json b/src/WorkflowManager/Storage/packages.lock.json index 0aff3a8f7..fc7cb4f0a 100755 --- a/src/WorkflowManager/Storage/packages.lock.json +++ b/src/WorkflowManager/Storage/packages.lock.json @@ -235,8 +235,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -675,7 +675,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/WorkflowExecuter/packages.lock.json b/src/WorkflowManager/WorkflowExecuter/packages.lock.json index fada21cb3..cb6c432b6 100644 --- a/src/WorkflowManager/WorkflowExecuter/packages.lock.json +++ b/src/WorkflowManager/WorkflowExecuter/packages.lock.json @@ -270,8 +270,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -779,7 +779,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -802,7 +802,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/WorkflowManager/packages.lock.json b/src/WorkflowManager/WorkflowManager/packages.lock.json index 21dca3bfb..f79accb10 100755 --- a/src/WorkflowManager/WorkflowManager/packages.lock.json +++ b/src/WorkflowManager/WorkflowManager/packages.lock.json @@ -485,8 +485,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1059,7 +1059,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1082,7 +1082,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } 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 a034a49a8..d605f7556 100644 --- 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 60a212d39..28b700d71 100644 --- 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 43213bcd3..2078ad96c 100644 --- a/tests/UnitTests/PayloadListener.Tests/packages.lock.json +++ b/tests/UnitTests/PayloadListener.Tests/packages.lock.json @@ -341,8 +341,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -873,7 +873,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -896,7 +896,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json index 371f50338..b2f0fc6cd 100755 --- a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json +++ b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json @@ -510,8 +510,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.1.0-list-of-modaliti0015", - "contentHash": "LCfQ3JcZTyxXTEUXHBogyqL13dEB8u+GBYQh3J86GtJMNrcGmvb0QQPsToDP8C/r1b2GCHAn+KTgvDARSWqMyQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1892,7 +1892,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1915,7 +1915,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.1.0-list-of-modaliti0015, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } From 84d7db09c25896fd21cabfd58335c48621b80fdc Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Mon, 16 Oct 2023 10:14:07 +0100 Subject: [PATCH 07/21] bump package Signed-off-by: Lillie Dae --- ...nai.Deploy.WorkflowManager.Common.Configuration.csproj | 2 +- src/Common/Configuration/packages.lock.json | 6 +++--- src/Common/Miscellaneous/packages.lock.json | 6 +++--- .../Monai.Deploy.WorkflowManager.TaskManager.API.csproj | 2 +- src/TaskManager/API/packages.lock.json | 6 +++--- src/TaskManager/Database/packages.lock.json | 6 +++--- .../Plug-ins/AideClinicalReview/packages.lock.json | 8 ++++---- src/TaskManager/Plug-ins/Argo/packages.lock.json | 8 ++++---- src/TaskManager/TaskManager/packages.lock.json | 8 ++++---- .../Monai.Deploy.WorkflowManager.Contracts.csproj | 2 +- src/WorkflowManager/Database/packages.lock.json | 6 +++--- src/WorkflowManager/Logging/packages.lock.json | 6 +++--- src/WorkflowManager/PayloadListener/packages.lock.json | 8 ++++---- src/WorkflowManager/Services/packages.lock.json | 8 ++++---- src/WorkflowManager/Storage/packages.lock.json | 6 +++--- src/WorkflowManager/WorkflowExecuter/packages.lock.json | 8 ++++---- src/WorkflowManager/WorkflowManager/packages.lock.json | 8 ++++---- ...oy.WorkflowManager.TaskManager.IntegrationTests.csproj | 4 ++-- ...rkflowManager.WorkflowExecutor.IntegrationTests.csproj | 4 ++-- tests/UnitTests/PayloadListener.Tests/packages.lock.json | 8 ++++---- tests/UnitTests/WorkflowManager.Tests/packages.lock.json | 8 ++++---- 21 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj b/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj index fc873f3f3..3f65f4bb9 100644 --- a/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj +++ b/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/Common/Configuration/packages.lock.json b/src/Common/Configuration/packages.lock.json index 6fd5af855..f8ce6820f 100644 --- a/src/Common/Configuration/packages.lock.json +++ b/src/Common/Configuration/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[1.0.3, )", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "requested": "[1.0.3-rc0012, )", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/Common/Miscellaneous/packages.lock.json b/src/Common/Miscellaneous/packages.lock.json index 795cff82f..9d285a624 100644 --- a/src/Common/Miscellaneous/packages.lock.json +++ b/src/Common/Miscellaneous/packages.lock.json @@ -146,8 +146,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -236,7 +236,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } } diff --git a/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj b/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj index 80f27b78f..01a9698ae 100644 --- 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 f1e91e3e3..c32568199 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": "[1.0.3, )", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "requested": "[1.0.3-rc0012, )", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/Database/packages.lock.json b/src/TaskManager/Database/packages.lock.json index a3a29255e..eeeb1e6d3 100755 --- a/src/TaskManager/Database/packages.lock.json +++ b/src/TaskManager/Database/packages.lock.json @@ -247,8 +247,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -684,7 +684,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json index 68e70ba1e..1ddf2a014 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json +++ b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json @@ -258,8 +258,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -733,7 +733,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -747,7 +747,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/Plug-ins/Argo/packages.lock.json b/src/TaskManager/Plug-ins/Argo/packages.lock.json index f546e16e1..46396cf40 100644 --- a/src/TaskManager/Plug-ins/Argo/packages.lock.json +++ b/src/TaskManager/Plug-ins/Argo/packages.lock.json @@ -368,8 +368,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -871,7 +871,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -885,7 +885,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/TaskManager/packages.lock.json b/src/TaskManager/TaskManager/packages.lock.json index ca99565bf..a37885452 100644 --- a/src/TaskManager/TaskManager/packages.lock.json +++ b/src/TaskManager/TaskManager/packages.lock.json @@ -537,8 +537,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1138,7 +1138,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1160,7 +1160,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj b/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj index 3bafa6ceb..c5bdebf65 100644 --- 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 93757843f..55581e180 100755 --- a/src/WorkflowManager/Database/packages.lock.json +++ b/src/WorkflowManager/Database/packages.lock.json @@ -269,8 +269,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -685,7 +685,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Logging/packages.lock.json b/src/WorkflowManager/Logging/packages.lock.json index 846a2e363..f27fcdeaa 100755 --- a/src/WorkflowManager/Logging/packages.lock.json +++ b/src/WorkflowManager/Logging/packages.lock.json @@ -210,8 +210,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -641,7 +641,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/PayloadListener/packages.lock.json b/src/WorkflowManager/PayloadListener/packages.lock.json index 388d42be2..c6a3f14f5 100644 --- a/src/WorkflowManager/PayloadListener/packages.lock.json +++ b/src/WorkflowManager/PayloadListener/packages.lock.json @@ -270,8 +270,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -779,7 +779,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -802,7 +802,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Services/packages.lock.json b/src/WorkflowManager/Services/packages.lock.json index 8474e1adf..90767bf9f 100644 --- a/src/WorkflowManager/Services/packages.lock.json +++ b/src/WorkflowManager/Services/packages.lock.json @@ -249,8 +249,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -733,14 +733,14 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Storage/packages.lock.json b/src/WorkflowManager/Storage/packages.lock.json index fc7cb4f0a..4569cdfaf 100755 --- a/src/WorkflowManager/Storage/packages.lock.json +++ b/src/WorkflowManager/Storage/packages.lock.json @@ -235,8 +235,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -675,7 +675,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/WorkflowExecuter/packages.lock.json b/src/WorkflowManager/WorkflowExecuter/packages.lock.json index cb6c432b6..e5006edca 100644 --- a/src/WorkflowManager/WorkflowExecuter/packages.lock.json +++ b/src/WorkflowManager/WorkflowExecuter/packages.lock.json @@ -270,8 +270,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -779,7 +779,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -802,7 +802,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/WorkflowManager/packages.lock.json b/src/WorkflowManager/WorkflowManager/packages.lock.json index f79accb10..c7fc9ac02 100755 --- a/src/WorkflowManager/WorkflowManager/packages.lock.json +++ b/src/WorkflowManager/WorkflowManager/packages.lock.json @@ -485,8 +485,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1059,7 +1059,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1082,7 +1082,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } 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 d605f7556..faebeb5c1 100644 --- 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 28b700d71..e7a36b85c 100644 --- 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 2078ad96c..cbf773e91 100644 --- a/tests/UnitTests/PayloadListener.Tests/packages.lock.json +++ b/tests/UnitTests/PayloadListener.Tests/packages.lock.json @@ -341,8 +341,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -873,7 +873,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -896,7 +896,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json index b2f0fc6cd..689f162f5 100755 --- a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json +++ b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json @@ -510,8 +510,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "resolved": "1.0.3-rc0012", + "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1892,7 +1892,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1915,7 +1915,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", + "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } From ab793e14bf4248e8b3b95f7b093d36a29ac47a2e Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Mon, 16 Oct 2023 10:21:29 +0100 Subject: [PATCH 08/21] bump package to release version Signed-off-by: Lillie Dae --- ...nai.Deploy.WorkflowManager.Common.Configuration.csproj | 2 +- src/Common/Configuration/packages.lock.json | 6 +++--- src/Common/Miscellaneous/packages.lock.json | 6 +++--- .../Monai.Deploy.WorkflowManager.TaskManager.API.csproj | 2 +- src/TaskManager/API/packages.lock.json | 6 +++--- src/TaskManager/Database/packages.lock.json | 6 +++--- .../Plug-ins/AideClinicalReview/packages.lock.json | 8 ++++---- src/TaskManager/Plug-ins/Argo/packages.lock.json | 8 ++++---- src/TaskManager/TaskManager/packages.lock.json | 8 ++++---- .../Monai.Deploy.WorkflowManager.Contracts.csproj | 2 +- src/WorkflowManager/Database/packages.lock.json | 6 +++--- src/WorkflowManager/Logging/packages.lock.json | 6 +++--- src/WorkflowManager/PayloadListener/packages.lock.json | 8 ++++---- src/WorkflowManager/Services/packages.lock.json | 8 ++++---- src/WorkflowManager/Storage/packages.lock.json | 6 +++--- src/WorkflowManager/WorkflowExecuter/packages.lock.json | 8 ++++---- src/WorkflowManager/WorkflowManager/packages.lock.json | 8 ++++---- ...oy.WorkflowManager.TaskManager.IntegrationTests.csproj | 4 ++-- ...rkflowManager.WorkflowExecutor.IntegrationTests.csproj | 4 ++-- tests/UnitTests/PayloadListener.Tests/packages.lock.json | 8 ++++---- tests/UnitTests/WorkflowManager.Tests/packages.lock.json | 8 ++++---- 21 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj b/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj index 3f65f4bb9..fc873f3f3 100644 --- a/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj +++ b/src/Common/Configuration/Monai.Deploy.WorkflowManager.Common.Configuration.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/Common/Configuration/packages.lock.json b/src/Common/Configuration/packages.lock.json index f8ce6820f..6fd5af855 100644 --- a/src/Common/Configuration/packages.lock.json +++ b/src/Common/Configuration/packages.lock.json @@ -4,9 +4,9 @@ "net6.0": { "Monai.Deploy.Messaging": { "type": "Direct", - "requested": "[1.0.3-rc0012, )", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/Common/Miscellaneous/packages.lock.json b/src/Common/Miscellaneous/packages.lock.json index 9d285a624..795cff82f 100644 --- a/src/Common/Miscellaneous/packages.lock.json +++ b/src/Common/Miscellaneous/packages.lock.json @@ -146,8 +146,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -236,7 +236,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } } diff --git a/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj b/src/TaskManager/API/Monai.Deploy.WorkflowManager.TaskManager.API.csproj index 01a9698ae..80f27b78f 100644 --- 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 c32568199..f1e91e3e3 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": "[1.0.3-rc0012, )", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "requested": "[1.0.3, )", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/Database/packages.lock.json b/src/TaskManager/Database/packages.lock.json index eeeb1e6d3..a3a29255e 100755 --- a/src/TaskManager/Database/packages.lock.json +++ b/src/TaskManager/Database/packages.lock.json @@ -247,8 +247,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -684,7 +684,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json index 1ddf2a014..68e70ba1e 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json +++ b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json @@ -258,8 +258,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -733,7 +733,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -747,7 +747,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/Plug-ins/Argo/packages.lock.json b/src/TaskManager/Plug-ins/Argo/packages.lock.json index 46396cf40..f546e16e1 100644 --- a/src/TaskManager/Plug-ins/Argo/packages.lock.json +++ b/src/TaskManager/Plug-ins/Argo/packages.lock.json @@ -368,8 +368,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -871,7 +871,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -885,7 +885,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/TaskManager/TaskManager/packages.lock.json b/src/TaskManager/TaskManager/packages.lock.json index a37885452..ca99565bf 100644 --- a/src/TaskManager/TaskManager/packages.lock.json +++ b/src/TaskManager/TaskManager/packages.lock.json @@ -537,8 +537,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1138,7 +1138,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1160,7 +1160,7 @@ "monai.deploy.workflowmanager.taskmanager.api": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj b/src/WorkflowManager/Contracts/Monai.Deploy.WorkflowManager.Contracts.csproj index c5bdebf65..3bafa6ceb 100644 --- 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 55581e180..93757843f 100755 --- a/src/WorkflowManager/Database/packages.lock.json +++ b/src/WorkflowManager/Database/packages.lock.json @@ -269,8 +269,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -685,7 +685,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Logging/packages.lock.json b/src/WorkflowManager/Logging/packages.lock.json index f27fcdeaa..846a2e363 100755 --- a/src/WorkflowManager/Logging/packages.lock.json +++ b/src/WorkflowManager/Logging/packages.lock.json @@ -210,8 +210,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -641,7 +641,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/PayloadListener/packages.lock.json b/src/WorkflowManager/PayloadListener/packages.lock.json index c6a3f14f5..388d42be2 100644 --- a/src/WorkflowManager/PayloadListener/packages.lock.json +++ b/src/WorkflowManager/PayloadListener/packages.lock.json @@ -270,8 +270,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -779,7 +779,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -802,7 +802,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Services/packages.lock.json b/src/WorkflowManager/Services/packages.lock.json index 90767bf9f..8474e1adf 100644 --- a/src/WorkflowManager/Services/packages.lock.json +++ b/src/WorkflowManager/Services/packages.lock.json @@ -249,8 +249,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -733,14 +733,14 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/Storage/packages.lock.json b/src/WorkflowManager/Storage/packages.lock.json index 4569cdfaf..fc7cb4f0a 100755 --- a/src/WorkflowManager/Storage/packages.lock.json +++ b/src/WorkflowManager/Storage/packages.lock.json @@ -235,8 +235,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -675,7 +675,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/WorkflowExecuter/packages.lock.json b/src/WorkflowManager/WorkflowExecuter/packages.lock.json index e5006edca..cb6c432b6 100644 --- a/src/WorkflowManager/WorkflowExecuter/packages.lock.json +++ b/src/WorkflowManager/WorkflowExecuter/packages.lock.json @@ -270,8 +270,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -779,7 +779,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -802,7 +802,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/src/WorkflowManager/WorkflowManager/packages.lock.json b/src/WorkflowManager/WorkflowManager/packages.lock.json index c7fc9ac02..f79accb10 100755 --- a/src/WorkflowManager/WorkflowManager/packages.lock.json +++ b/src/WorkflowManager/WorkflowManager/packages.lock.json @@ -485,8 +485,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1059,7 +1059,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1082,7 +1082,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } 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 faebeb5c1..d605f7556 100644 --- 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 e7a36b85c..28b700d71 100644 --- 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 cbf773e91..2078ad96c 100644 --- a/tests/UnitTests/PayloadListener.Tests/packages.lock.json +++ b/tests/UnitTests/PayloadListener.Tests/packages.lock.json @@ -341,8 +341,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -873,7 +873,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -896,7 +896,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } diff --git a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json index 689f162f5..b2f0fc6cd 100755 --- a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json +++ b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json @@ -510,8 +510,8 @@ }, "Monai.Deploy.Messaging": { "type": "Transitive", - "resolved": "1.0.3-rc0012", - "contentHash": "pUb4wP9UVow3wjD1IIoUdNJlwwBDHV2DHqHKj+e51SebM8uZvAyN6LxV6RpxjRbZIUVBqtL4HeL0yCsG2zwfmQ==", + "resolved": "1.0.3", + "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", @@ -1892,7 +1892,7 @@ "monai.deploy.workflowmanager.common.configuration": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Monai.Deploy.Storage": "[0.2.18, )" } }, @@ -1915,7 +1915,7 @@ "monai.deploy.workflowmanager.contracts": { "type": "Project", "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3-rc0012, )", + "Monai.Deploy.Messaging": "[1.0.3, )", "Mongo.Migration": "[3.1.4, )", "MongoDB.Bson": "[2.21.0, )" } From d5d1abcb9c6a6d0da108b3ab683217f94c58d4ef Mon Sep 17 00:00:00 2001 From: Neil South Date: Mon, 16 Oct 2023 14:59:08 +0100 Subject: [PATCH 09/21] adding lisener for artifact received Signed-off-by: Neil South --- .../MessageBrokerConfigurationKeys.cs | 3 + src/Common/Configuration/packages.lock.json | 2 +- src/Common/Miscellaneous/packages.lock.json | 2 +- src/TaskManager/API/packages.lock.json | 2 +- src/TaskManager/Database/packages.lock.json | 2 +- .../AideClinicalReview/packages.lock.json | 2 +- .../Plug-ins/Argo/packages.lock.json | 2 +- .../TaskManager/packages.lock.json | 2 +- .../Database/packages.lock.json | 2 +- .../Logging/Log.200000.Workflow.cs | 3 + .../Logging/Log.500000.Messaging.cs | 15 +- .../Logging/packages.lock.json | 2 +- .../packages.lock.json | 756 -------------- .../Extensions/ValidationExtensions.cs | 18 + .../Services/EventPayloadRecieverService.cs | 42 + .../Services/IEventPayloadRecieverService.cs | 7 + .../Services/PayloadListenerService.cs | 20 + .../Validators/EventPayloadValidator.cs | 35 + .../Validators/IEventPayloadValidator.cs | 6 + .../PayloadListener/packages.lock.json | 2 +- .../Services/packages.lock.json | 2 +- .../Storage/packages.lock.json | 2 +- .../Services/IWorkflowExecuterService.cs | 6 + .../Services/WorkflowExecuterService.cs | 45 +- .../WorkflowExecuter/packages.lock.json | 2 +- .../WorkflowManager/packages.lock.json | 2 +- .../EventPayloadRecieverServiceTests.cs | 37 + .../PayloadListener.Tests/packages.lock.json | 952 ------------------ .../Services/WorkflowExecuterServiceTests.cs | 79 ++ .../WorkflowManager.Tests/packages.lock.json | 2 +- 30 files changed, 312 insertions(+), 1742 deletions(-) delete mode 100644 src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json delete mode 100644 tests/UnitTests/PayloadListener.Tests/packages.lock.json diff --git a/src/Common/Configuration/MessageBrokerConfigurationKeys.cs b/src/Common/Configuration/MessageBrokerConfigurationKeys.cs index 96e7e0c2e..886497f27 100644 --- a/src/Common/Configuration/MessageBrokerConfigurationKeys.cs +++ b/src/Common/Configuration/MessageBrokerConfigurationKeys.cs @@ -88,5 +88,8 @@ public class MessageBrokerConfigurationKeys [ConfigurationKeyName("notificationEmailCancelation")] public string NotificationEmailCancelation { get; set; } = "aide.notification_email.cancellation"; + + [ConfigurationKeyName("artifactrecieved")] + public string ArtifactRecieved { get; set; } = "md.workflow.artifactrecieved"; } } diff --git a/src/Common/Configuration/packages.lock.json b/src/Common/Configuration/packages.lock.json index 6fd5af855..dbb1fbf67 100644 --- a/src/Common/Configuration/packages.lock.json +++ b/src/Common/Configuration/packages.lock.json @@ -6,7 +6,7 @@ "type": "Direct", "requested": "[1.0.3, )", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/Common/Miscellaneous/packages.lock.json b/src/Common/Miscellaneous/packages.lock.json index 795cff82f..da4a0f6d4 100644 --- a/src/Common/Miscellaneous/packages.lock.json +++ b/src/Common/Miscellaneous/packages.lock.json @@ -147,7 +147,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/API/packages.lock.json b/src/TaskManager/API/packages.lock.json index f1e91e3e3..84b3026f5 100755 --- a/src/TaskManager/API/packages.lock.json +++ b/src/TaskManager/API/packages.lock.json @@ -6,7 +6,7 @@ "type": "Direct", "requested": "[1.0.3, )", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/Database/packages.lock.json b/src/TaskManager/Database/packages.lock.json index a3a29255e..cb614df2e 100755 --- a/src/TaskManager/Database/packages.lock.json +++ b/src/TaskManager/Database/packages.lock.json @@ -248,7 +248,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json index 68e70ba1e..4ac7874b0 100644 --- a/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json +++ b/src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json @@ -259,7 +259,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/Plug-ins/Argo/packages.lock.json b/src/TaskManager/Plug-ins/Argo/packages.lock.json index f546e16e1..fb671ea54 100644 --- a/src/TaskManager/Plug-ins/Argo/packages.lock.json +++ b/src/TaskManager/Plug-ins/Argo/packages.lock.json @@ -369,7 +369,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/TaskManager/TaskManager/packages.lock.json b/src/TaskManager/TaskManager/packages.lock.json index ca99565bf..6ed57946e 100644 --- a/src/TaskManager/TaskManager/packages.lock.json +++ b/src/TaskManager/TaskManager/packages.lock.json @@ -538,7 +538,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/WorkflowManager/Database/packages.lock.json b/src/WorkflowManager/Database/packages.lock.json index 93757843f..7be6e4fd3 100755 --- a/src/WorkflowManager/Database/packages.lock.json +++ b/src/WorkflowManager/Database/packages.lock.json @@ -270,7 +270,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/WorkflowManager/Logging/Log.200000.Workflow.cs b/src/WorkflowManager/Logging/Log.200000.Workflow.cs index b93da4732..98e85cbee 100644 --- a/src/WorkflowManager/Logging/Log.200000.Workflow.cs +++ b/src/WorkflowManager/Logging/Log.200000.Workflow.cs @@ -81,6 +81,9 @@ public static partial class Log [LoggerMessage(EventId = 200019, Level = LogLevel.Debug, Message = "Task destination condition for task {taskId} with resolved condition: {resolvedConditional} resolved to false. initial conditional: {conditions}")] public static partial void TaskDestinationConditionFalse(this ILogger logger, string resolvedConditional, string conditions, string taskId); + [LoggerMessage(EventId = 200020, Level = LogLevel.Warning, Message = "Use new ArtifactReceived Queue for continuation messages.")] + public static partial void DontUseWorkflowReceivedForPayload(this ILogger logger); + // Conditions Resolver [LoggerMessage(EventId = 210000, Level = LogLevel.Warning, Message = "Failed to parse condition: {condition}. resolvedConditional: {resolvedConditional}")] public static partial void FailedToParseCondition(this ILogger logger, string resolvedConditional, string condition, Exception ex); diff --git a/src/WorkflowManager/Logging/Log.500000.Messaging.cs b/src/WorkflowManager/Logging/Log.500000.Messaging.cs index c2b086bc2..2926fa903 100644 --- a/src/WorkflowManager/Logging/Log.500000.Messaging.cs +++ b/src/WorkflowManager/Logging/Log.500000.Messaging.cs @@ -71,7 +71,20 @@ public static partial class Log [LoggerMessage(EventId = 500016, Level = LogLevel.Debug, Message = "Export complete message received.")] public static partial void ExportCompleteReceived(this ILogger logger); - [LoggerMessage(EventId = 200017, Level = LogLevel.Debug, Message = "Workflow continuation event so not creating payload.")] + [LoggerMessage(EventId = 500017, Level = LogLevel.Debug, Message = "ArtifactReceived message so not creating payload.")] public static partial void WorkflowContinuation(this ILogger logger); + + [LoggerMessage(EventId = 500018, Level = LogLevel.Debug, Message = "ArtifactReceived message received.")] + public static partial void ArtifactReceivedReceived(this ILogger logger); + + [LoggerMessage(EventId = 500019, Level = LogLevel.Error, Message = "ArtifactReceived message {messageId} failed unexpectedly (no workflowId or TaskId ?) and has been requeued.")] + public static partial void ArtifactReceivedRequeuePayloadCreateError(this ILogger logger, string messageId); + + [LoggerMessage(EventId = 500020, Level = LogLevel.Error, Message = "ArtifactReveived message {messageId} failed unexpectedly and has been requeued.")] + public static partial void ArtifactReceivedRequeueUnknownError(this ILogger logger, string messageId, Exception ex); + + [LoggerMessage(EventId = 500021, Level = LogLevel.Error, Message = "ArtifactReveived message {messageId} is invalid and has been rejected without being requeued.")] + public static partial void ArtifactReceivedRejectValidationError(this ILogger logger, string messageId); + } } diff --git a/src/WorkflowManager/Logging/packages.lock.json b/src/WorkflowManager/Logging/packages.lock.json index 846a2e363..ccb0e5dd3 100755 --- a/src/WorkflowManager/Logging/packages.lock.json +++ b/src/WorkflowManager/Logging/packages.lock.json @@ -211,7 +211,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json b/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json deleted file mode 100644 index bf40ee3d4..000000000 --- a/src/WorkflowManager/Monai.Deploy.WorkflowManager.Services/packages.lock.json +++ /dev/null @@ -1,756 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "Microsoft.Extensions.Http": { - "type": "Direct", - "requested": "[3.1.0, )", - "resolved": "3.1.0", - "contentHash": "DLigdcV0nYaT6/ly0rnfP80BnXq8NNd/h8/SkfY39uio7Bd9LauVntp6RcRh1Kj23N+uf80GgL7Win6P3BCtoQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0", - "Microsoft.Extensions.Logging": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" - } - }, - "Ardalis.GuardClauses": { - "type": "Transitive", - "resolved": "4.1.1", - "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" - }, - "AWSSDK.Core": { - "type": "Transitive", - "resolved": "3.7.200.13", - "contentHash": "yiUuhTI8w183euRqhXym1DyhnD/1ccxceRoruCfkIoqY3PAaFgFL8pE4iDLDZa7SUW4M4qZnQ5PMlFr1rrl6zw==" - }, - "AWSSDK.SecurityToken": { - "type": "Transitive", - "resolved": "3.7.201.9", - "contentHash": "yKlTPrvNeDdzkOX82Ydf7MD09Gk3dK74JWZPRWJ3QIxskWVoNTAyLvfVBzbi+/fGnjf8/qKsSzxT7GHLqds37A==", - "dependencies": { - "AWSSDK.Core": "[3.7.200.13, 4.0.0)" - } - }, - "DnsClient": { - "type": "Transitive", - "resolved": "1.6.1", - "contentHash": "4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", - "dependencies": { - "Microsoft.Win32.Registry": "5.0.0" - } - }, - "LightInject": { - "type": "Transitive", - "resolved": "5.4.0", - "contentHash": "w4EjEhNqtzFb0qlScmpjA84Nuv4+OITNGfYCjDhJoLYyw+uagkrrth+e9Hgidv4bMzuNSlJpHPGTHx6DtE4Ixg==", - "dependencies": { - "System.ValueTuple": "4.5.0" - } - }, - "Microsoft.AspNetCore.Hosting.Abstractions": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "ubycklv+ZY7Kutdwuy1W4upWcZ6VFR8WUXU7l7B2+mvbDBBPAcfpi+E+Y5GFe+Q157YfA3C49D2GCjAZc7Mobw==", - "dependencies": { - "Microsoft.AspNetCore.Hosting.Server.Abstractions": "2.2.0", - "Microsoft.AspNetCore.Http.Abstractions": "2.2.0", - "Microsoft.Extensions.Hosting.Abstractions": "2.2.0" - } - }, - "Microsoft.AspNetCore.Hosting.Server.Abstractions": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "1PMijw8RMtuQF60SsD/JlKtVfvh4NORAhF4wjysdABhlhTrYmtgssqyncR0Stq5vqtjplZcj6kbT4LRTglt9IQ==", - "dependencies": { - "Microsoft.AspNetCore.Http.Features": "2.2.0", - "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" - } - }, - "Microsoft.AspNetCore.Http.Abstractions": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "Nxs7Z1q3f1STfLYKJSVXCs1iBl+Ya6E8o4Oy1bCxJ/rNI44E/0f6tbsrVqAWfB7jlnJfyaAtIalBVxPKUPQb4Q==", - "dependencies": { - "Microsoft.AspNetCore.Http.Features": "2.2.0", - "System.Text.Encodings.Web": "4.5.0" - } - }, - "Microsoft.AspNetCore.Http.Features": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "ziFz5zH8f33En4dX81LW84I6XrYXKf9jg6aM39cM+LffN9KJahViKZ61dGMSO2gd3e+qe5yBRwsesvyqlZaSMg==", - "dependencies": { - "Microsoft.Extensions.Primitives": "2.2.0" - } - }, - "Microsoft.Extensions.Configuration": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "Lu41BWNmwhKr6LgyQvcYBOge0pPvmiaK8R5UHXX4//wBhonJyWcT2OK1mqYfEM5G7pTf31fPrpIHOT6sN7EGOA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "3.1.0" - } - }, - "Microsoft.Extensions.Configuration.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "qWzV9o+ZRWq+pGm+1dF+R7qTgTYoXvbyowRoBxQJGfqTpqDun2eteerjRQhq5PQ/14S+lqto3Ft4gYaRyl4rdQ==", - "dependencies": { - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Configuration.Binder": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "o9eELDBfNkR7sUtYysFZ1Q7BQ1mYt27DMkups/3vu7xgPyOpMD+iAfrBZFzUXT2iw0fmFb8s1gfNBZS+IgjKdQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "KVkv3aF2MQpmGFRh4xRx2CNbc2sjDFk+lH4ySrjWSOS+XoY1Xc+sJphw3N0iYOpoeCCq8976ceVYDH8sdx2qIQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==" - }, - "Microsoft.Extensions.Diagnostics.HealthChecks": { - "type": "Transitive", - "resolved": "6.0.21", - "contentHash": "1Qf/tEg6IlzbvCxrc+pZE+ZGrajBdB/+V2+abeAu6lg8wXGHmO8JtnrNqwc5svSbcz3udxinUPyH3vw6ZujKbg==", - "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.21", - "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.4", - "Microsoft.Extensions.Options": "6.0.0" - } - }, - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { - "type": "Transitive", - "resolved": "6.0.21", - "contentHash": "5FSA1euCRtbRqVgTn2ahgCG9Cy29UQXAZMCJLUlrQQaC5rko0+d/aq9SiFGIDP7cvoWUsatrlNdfc6UyOMV5aA==" - }, - "Microsoft.Extensions.FileProviders.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "0pd4/fho0gC12rQswaGQxbU34jOS1TPS8lZPpkFCH68ppQjHNHYle9iRuHeev1LhrJ94YPvzcRd8UmIuFk23Qw==", - "dependencies": { - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Hosting.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "GcT5l2CYXL6Sa27KCSh0TixsRfADUgth+ojQSD5EkzisZxmGFh7CwzkcYuGwvmXLjr27uWRNrJ2vuuEjMhU05Q==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0" - } - }, - "Microsoft.Extensions.Logging": { - "type": "Transitive", - "resolved": "3.1.0", - "contentHash": "P+8sKQ8L4ooL79sxxqwFPxGGC3aBrUDLB/dZqhs4J0XjTyrkeeyJQ4D4nzJB6OnAhy78HIIgQ/RbD6upOXLynw==", - "dependencies": { - "Microsoft.Extensions.Configuration.Binder": "3.1.0", - "Microsoft.Extensions.DependencyInjection": "3.1.0", - "Microsoft.Extensions.Logging.Abstractions": "3.1.0", - "Microsoft.Extensions.Options": "3.1.0" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "6.0.4", - "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" - }, - "Microsoft.Extensions.Logging.Configuration": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "ukU1mQGX9+xBsEzpNd13yl4deFVYI+fxxnmKpOhvNZsF+/trCrAUQh+9QM5pPGHbfYkz3lLQ4BXfKCP0502dLw==", - "dependencies": { - "Microsoft.Extensions.Logging": "2.2.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "2.2.0" - } - }, - "Microsoft.Extensions.Logging.Console": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "1eGgcOJ++PMxW6sn++j6U7wsWvhEBm/5ScqBUUBGLRE8M7AHahi9tsxivDMqEXVM3F0/pshHl3kEpMXtw4BeFg==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.2.0", - "Microsoft.Extensions.Logging": "2.2.0", - "Microsoft.Extensions.Logging.Configuration": "2.2.0" - } - }, - "Microsoft.Extensions.Logging.Debug": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "JjqWtshxUujSnxslFccCRAaH8uFOciqXkYdRw+h5MwpC4sUc+ju9yZzvVi6PA5vW09ckv26EkasEvXrofGiaJg==", - "dependencies": { - "Microsoft.Extensions.Logging": "2.2.0" - } - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Options.ConfigurationExtensions": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "d4WS6yVXaw43ffiUnHj8oG1t2B6RbDDiQcgdA+Eq//NlPa3Wd+GTJFKj4OM4eDF3GjVumGr/CEVRS/jcYoF5LA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.2.0", - "Microsoft.Extensions.Configuration.Binder": "2.2.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", - "Microsoft.Extensions.Options": "2.2.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" - }, - "Microsoft.NETCore.Targets": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "Monai.Deploy.Messaging": { - "type": "Transitive", - "resolved": "0.1.25", - "contentHash": "CllF1ANCwDV0ACbTU63SGxPPmgsivWP8dxgstAHvwo29w5TUs6PDCc8GcyVDTUO5Yl7/vsifdwcs3P/cYBe69w==", - "dependencies": { - "Ardalis.GuardClauses": "4.1.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", - "Newtonsoft.Json": "13.0.3", - "System.IO.Abstractions": "17.2.3" - } - }, - "Monai.Deploy.Storage": { - "type": "Transitive", - "resolved": "0.2.18", - "contentHash": "+1JX7QDgVEMqYA0/M1QMr1gtXRC6lEuhBtLfJXWi6cEgh9kOPE0KiHd1AWI7PxBgBbsEBZaNQSvWqShlwcu6bA==", - "dependencies": { - "AWSSDK.SecurityToken": "3.7.201.9", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", - "Monai.Deploy.Storage.S3Policy": "0.2.18", - "System.IO.Abstractions": "17.2.3" - } - }, - "Monai.Deploy.Storage.S3Policy": { - "type": "Transitive", - "resolved": "0.2.18", - "contentHash": "+b0nDnf4OoajdH2hB02elRC6G+GjlYnxJC+F3dGbUUXGMtPApzs8c8s/EG4fKzihxsVovJtqnJl7atcaPyl12Q==", - "dependencies": { - "Ardalis.GuardClauses": "4.1.1", - "Newtonsoft.Json": "13.0.3" - } - }, - "Mongo.Migration": { - "type": "Transitive", - "resolved": "3.1.4", - "contentHash": "iA13H1tFH7x3eeKhBAYdgFxzK4gj78hY2pc5yiB08zX3kmhxGT/hp5k+iTDlSlCCyl+pMNpitTUiKiqOI6L6Gg==", - "dependencies": { - "LightInject": "5.4.0", - "Microsoft.AspNetCore.Hosting.Abstractions": "2.2.0", - "Microsoft.AspNetCore.Http.Abstractions": "2.2.0", - "Microsoft.Extensions.DependencyInjection": "2.2.0", - "Microsoft.Extensions.Logging.Abstractions": "2.2.0", - "Microsoft.Extensions.Logging.Console": "2.2.0", - "Microsoft.Extensions.Logging.Debug": "2.2.0", - "Microsoft.Extensions.Options": "2.2.0", - "MongoDB.Driver": "2.13.1", - "NLog": "4.7.11", - "Serilog": "2.8.0", - "Serilog.Extensions.Logging": "2.0.4", - "Serilog.Extensions.Logging.File": "2.0.0", - "System.ValueTuple": "4.5.0" - } - }, - "MongoDB.Bson": { - "type": "Transitive", - "resolved": "2.19.0", - "contentHash": "pGp9F2PWU3Dj54PiXKibuaQ5rphWkfp8/Nsy5jLp2dWZGRGlr3r/Lfwnr0PvfihFfxieUcJZ2z3VeO8RctXcvA==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "MongoDB.Driver": { - "type": "Transitive", - "resolved": "2.19.0", - "contentHash": "W/1YByn5gNGfHBe8AyDURXWKn1Z9xJ9IUjplFcvk8B/jlTlDOkmXgmwjlToIdqr0l8rX594kksjGx3a9if3dsg==", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "2.0.0", - "MongoDB.Bson": "2.19.0", - "MongoDB.Driver.Core": "2.19.0", - "MongoDB.Libmongocrypt": "1.7.0" - } - }, - "MongoDB.Driver.Core": { - "type": "Transitive", - "resolved": "2.19.0", - "contentHash": "KbzJJJc4EsUZ+YQoe7zZL1OxHVC9RjgQMso2LjhZWnlP+IHSON63vKNt7jGarXrOVXK0DqIUrRwQyXMgmqTX5g==", - "dependencies": { - "AWSSDK.SecurityToken": "3.7.100.14", - "DnsClient": "1.6.1", - "Microsoft.Extensions.Logging.Abstractions": "2.0.0", - "MongoDB.Bson": "2.19.0", - "MongoDB.Libmongocrypt": "1.7.0", - "SharpCompress": "0.30.1", - "Snappier": "1.0.0", - "System.Buffers": "4.5.1", - "ZstdSharp.Port": "0.6.2" - } - }, - "MongoDB.Libmongocrypt": { - "type": "Transitive", - "resolved": "1.7.0", - "contentHash": "p9+peTZX63nGHskOLhvhfBtrknxNg1RzXepE07rPozuCGz27bMjCcQyvn2YByg0L3YEcNWdTmI4BlnG/5RF+5Q==" - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.3", - "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" - }, - "NLog": { - "type": "Transitive", - "resolved": "4.7.11", - "contentHash": "A7EpoOjWesV5BPx1cOiBndazZq1VGdagIs6oK8ttcRDl5adCMtHiTqnsD5yYaOrMxOQeCjHBf/w3nKzCmhGbgw==" - }, - "Serilog": { - "type": "Transitive", - "resolved": "2.8.0", - "contentHash": "zjuKXW5IQws43IHX7VY9nURsaCiBYh2kyJCWLJRSWrTsx/syBKHV8MibWe2A+QH3Er0AiwA+OJmO3DhFJDY1+A==", - "dependencies": { - "System.Collections.NonGeneric": "4.3.0" - } - }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "2.0.4", - "contentHash": "C8Vf9Wj1M+wGilChTV+OhE4v5ZCDzQfHjLKj2yNDMkXf/zgUKeAUZfbrVrt/c+flXP8M7/SHWBOXTkuPgubFsA==", - "dependencies": { - "Microsoft.Extensions.Logging": "2.0.0", - "Serilog": "2.3.0" - } - }, - "Serilog.Extensions.Logging.File": { - "type": "Transitive", - "resolved": "2.0.0", - "contentHash": "usO0qr4v9VCMBWiTJ1nQmAbPNCt40FrkDol6CpfCXbsxGZS/hH+YCueF7vvPQ32ATI0GWcMWiKRdjXEE7/HxTQ==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.0.0", - "Microsoft.Extensions.Configuration.Binder": "2.0.0", - "Serilog": "2.5.0", - "Serilog.Extensions.Logging": "2.0.2", - "Serilog.Formatting.Compact": "1.0.0", - "Serilog.Sinks.Async": "1.1.0", - "Serilog.Sinks.RollingFile": "3.3.0" - } - }, - "Serilog.Formatting.Compact": { - "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "r3QYz02y7+B7Ng30hyJM929OJhem7SsJ4XDUE0Zfptj2MRiQfpPUb5f58juAFjp/TnNeSX2QNzZEnHwLeoJfHQ==", - "dependencies": { - "Serilog": "2.0.0" - } - }, - "Serilog.Sinks.Async": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "xll0Kanz2BkCxuv+F3p1WXr47jdsVM0GU1n1LZvK+18QiRZ/WGFNxSNw9EMKFV5ED5gr7MUpAe6PCMNL1HGUMA==", - "dependencies": { - "Serilog": "2.1.0", - "System.Collections.Concurrent": "4.0.12" - } - }, - "Serilog.Sinks.File": { - "type": "Transitive", - "resolved": "3.2.0", - "contentHash": "VHbo68pMg5hwSWrzLEdZv5b/rYmIgHIRhd4d5rl8GnC5/a8Fr+RShT5kWyeJOXax1el6mNJ+dmHDOVgnNUQxaw==", - "dependencies": { - "Serilog": "2.3.0", - "System.IO": "4.1.0", - "System.IO.FileSystem": "4.0.1", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Text.Encoding.Extensions": "4.0.11", - "System.Threading": "4.0.11", - "System.Threading.Timer": "4.0.1" - } - }, - "Serilog.Sinks.RollingFile": { - "type": "Transitive", - "resolved": "3.3.0", - "contentHash": "2lT5X1r3GH4P0bRWJfhA7etGl8Q2Ipw9AACvtAHWRUSpYZ42NGVyHoVs2ALBZ/cAkkS+tA4jl80Zie144eLQPg==", - "dependencies": { - "Serilog.Sinks.File": "3.2.0", - "System.IO": "4.1.0", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Text.Encoding.Extensions": "4.0.11" - } - }, - "SharpCompress": { - "type": "Transitive", - "resolved": "0.30.1", - "contentHash": "XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==" - }, - "Snappier": { - "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==" - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Collections": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Collections.Concurrent": { - "type": "Transitive", - "resolved": "4.0.12", - "contentHash": "2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Diagnostics.Tracing": "4.1.0", - "System.Globalization": "4.0.11", - "System.Reflection": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.Collections.NonGeneric": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.Diagnostics.Debug": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Diagnostics.Tracing": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Globalization": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.IO": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.IO.Abstractions": { - "type": "Transitive", - "resolved": "17.2.3", - "contentHash": "VcozGeE4SxIo0cnXrDHhbrh/Gb8KQnZ3BvMelvh+iw0PrIKtuuA46U2Xm4e4pgnaWFgT4RdZfTpWl/WPRdw0WQ==" - }, - "System.IO.FileSystem": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.IO": "4.1.0", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Text.Encoding": "4.0.11", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.IO.FileSystem.Primitives": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==", - "dependencies": { - "System.Runtime": "4.1.0" - } - }, - "System.Reflection": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Resources.ResourceManager": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Runtime.Extensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.Handles": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Runtime.InteropServices": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Reflection": "4.1.0", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Handles": "4.0.1" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "System.Text.Encoding": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Text.Encoding.Extensions": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0", - "System.Text.Encoding": "4.0.11" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "Xg4G4Indi4dqP1iuAiMSwpiWS54ZghzR644OtsRCm/m/lBMG8dUBhLVN7hLm8NNrNTR+iGbshCPTwrvxZPlm4g==" - }, - "System.Threading": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", - "dependencies": { - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.Threading.Tasks": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Threading.Timer": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "saGfUV8uqVW6LeURiqxcGhZ24PzuRNaUBtbhVeuUAvky1naH395A/1nY0P2bWvrw/BreRtIB/EzTDkGBpqCwEw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.ValueTuple": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==" - }, - "ZstdSharp.Port": { - "type": "Transitive", - "resolved": "0.6.2", - "contentHash": "jPao/LdUNLUz8rn3H1D8W7wQbZsRZM0iayvWI4xGejJg3XJHT56gcmYdgmCGPdJF1UEBqUjucCRrFB+4HbJsbw==" - }, - "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.configuration": { - "type": "Project", - "dependencies": { - "Monai.Deploy.Messaging": "[0.1.23, )", - "Monai.Deploy.Storage": "[0.2.15, )" - } - }, - "monai.deploy.workflowmanager.contracts": { - "type": "Project", - "dependencies": { - "Monai.Deploy.Messaging": "[0.1.25, )", - "Mongo.Migration": "[3.1.4, )", - "MongoDB.Bson": "[2.19.0, )" - } - }, - "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.logging": { - "type": "Project", - "dependencies": { - "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )" - } - }, - "monai.deploy.workflowmanager.storage": { - "type": "Project", - "dependencies": { - "Monai.Deploy.Storage": "[0.2.18, )", - "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", - "Monai.Deploy.WorkflowManager.Logging": "[1.0.0, )" - } - } - } - } -} \ No newline at end of file diff --git a/src/WorkflowManager/PayloadListener/Extensions/ValidationExtensions.cs b/src/WorkflowManager/PayloadListener/Extensions/ValidationExtensions.cs index 2745d712c..34b2ba5ab 100644 --- a/src/WorkflowManager/PayloadListener/Extensions/ValidationExtensions.cs +++ b/src/WorkflowManager/PayloadListener/Extensions/ValidationExtensions.cs @@ -39,6 +39,24 @@ public static bool IsValid(this WorkflowRequestEvent workflowRequestMessage, out return valid; } + public static bool IsValid(this ArtifactsReceivedEvent artifactReceivedMessage, out IList validationErrors) + { + Guard.Against.Null(artifactReceivedMessage, nameof(artifactReceivedMessage)); + + validationErrors = new List(); + + var valid = true; + + valid &= IsAeTitleValid(artifactReceivedMessage.GetType().Name, artifactReceivedMessage.DataTrigger.Source, validationErrors); + valid &= IsAeTitleValid(artifactReceivedMessage.GetType().Name, artifactReceivedMessage.DataTrigger.Destination, validationErrors); + valid &= IsBucketValid(artifactReceivedMessage.GetType().Name, artifactReceivedMessage.Bucket, validationErrors); + valid &= IsCorrelationIdValid(artifactReceivedMessage.GetType().Name, artifactReceivedMessage.CorrelationId, validationErrors); + valid &= IsPayloadIdValid(artifactReceivedMessage.GetType().Name, artifactReceivedMessage.PayloadId.ToString(), validationErrors); + valid &= string.IsNullOrEmpty(artifactReceivedMessage.WorkflowInstanceId) is false && string.IsNullOrEmpty(artifactReceivedMessage.TaskId) is false; + + return valid; + } + public static bool IsInformaticsGatewayNotNull(string source, InformaticsGateway informaticsGateway, IList validationErrors) { Guard.Against.NullOrWhiteSpace(source, nameof(source)); diff --git a/src/WorkflowManager/PayloadListener/Services/EventPayloadRecieverService.cs b/src/WorkflowManager/PayloadListener/Services/EventPayloadRecieverService.cs index 94f69366d..4085bc4ff 100644 --- a/src/WorkflowManager/PayloadListener/Services/EventPayloadRecieverService.cs +++ b/src/WorkflowManager/PayloadListener/Services/EventPayloadRecieverService.cs @@ -178,5 +178,47 @@ public async Task ExportCompletePayload(MessageReceivedEventArgs message) await _messageSubscriber.RequeueWithDelay(message.Message); } } + + public async Task ArtifactReceivePayload(MessageReceivedEventArgs message) + { + try + { + var requestEvent = message.Message.ConvertTo(); + + using var loggingScope = Logger.BeginScope(new LoggingDataDictionary + { + ["correlationId"] = requestEvent.CorrelationId, + ["workflowId"] = requestEvent.Workflows.FirstOrDefault(), + ["workflowInstanceId"] = requestEvent.WorkflowInstanceId, + ["taskId"] = requestEvent.TaskId + }); + + Logger.WorkflowContinuation(); + + var validation = PayloadValidator.ValidateArtifactReceived(requestEvent); + + if (!validation) + { + Logger.ArtifactReceivedRejectValidationError(message.Message.MessageId); + _messageSubscriber.Reject(message.Message, false); + + return; + } + + if (!await WorkflowExecuterService.ProcessArtifactReceived(requestEvent)) + { + Logger.ArtifactReceivedRequeuePayloadCreateError(message.Message.MessageId); + await _messageSubscriber.RequeueWithDelay(message.Message); + + return; + } + _messageSubscriber.Acknowledge(message.Message); + } + catch (Exception e) + { + Logger.ArtifactReceivedRequeueUnknownError(message.Message.MessageId, e); + await _messageSubscriber.RequeueWithDelay(message.Message); + } + } } } diff --git a/src/WorkflowManager/PayloadListener/Services/IEventPayloadRecieverService.cs b/src/WorkflowManager/PayloadListener/Services/IEventPayloadRecieverService.cs index cd30ec036..afbed8878 100644 --- a/src/WorkflowManager/PayloadListener/Services/IEventPayloadRecieverService.cs +++ b/src/WorkflowManager/PayloadListener/Services/IEventPayloadRecieverService.cs @@ -40,5 +40,12 @@ public interface IEventPayloadReceiverService /// /// The export complete event. Task ExportCompletePayload(MessageReceivedEventArgs message); + + /// + /// Receives a artifactReceived payload and validates it, + /// either passing it on to the workflow executor or handling the message accordingly. + /// + /// The artifactReceived event. + Task ArtifactReceivePayload(MessageReceivedEventArgs message); } } diff --git a/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs b/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs index 119f0b386..73d0d1aa1 100644 --- a/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs +++ b/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs @@ -42,6 +42,7 @@ public class PayloadListenerService : IHostedService, IMonaiService, IDisposable public string WorkflowRequestRoutingKey { get; set; } public string TaskStatusUpdateRoutingKey { get; set; } public string ExportCompleteRoutingKey { get; set; } + public string ArtifactRecievedRoutingKey { get; set; } protected int Concurrency { get; set; } public ServiceStatus Status { get; set; } = ServiceStatus.Unknown; public string ServiceName => "Payload Listener Service"; @@ -65,6 +66,7 @@ public PayloadListenerService( TaskStatusUpdateRoutingKey = configuration.Value.Messaging.Topics.TaskUpdateRequest; WorkflowRequestRoutingKey = configuration.Value.Messaging.Topics.WorkflowRequest; ExportCompleteRoutingKey = configuration.Value.Messaging.Topics.ExportComplete; + ArtifactRecievedRoutingKey = configuration.Value.Messaging.Topics.ArtifactRecieved; Concurrency = 2; @@ -105,7 +107,11 @@ private void SetupPolling() _messageSubscriber.SubscribeAsync(ExportCompleteRoutingKey, ExportCompleteRoutingKey, OnExportCompleteReceivedCallback); _logger.EventSubscription(ServiceName, ExportCompleteRoutingKey); + + _messageSubscriber.SubscribeAsync(ExportCompleteRoutingKey, ArtifactRecievedRoutingKey, OnArtifactReceivedtReceivedCallbackAsync); + _logger.EventSubscription(ServiceName, ArtifactRecievedRoutingKey); } + private async Task OnWorkflowRequestReceivedCallbackAsync(MessageReceivedEventArgs eventArgs) { @@ -150,6 +156,20 @@ private async Task OnExportCompleteReceivedCallback(MessageReceivedEventArgs eve } + private async Task OnArtifactReceivedtReceivedCallbackAsync(MessageReceivedEventArgs eventArgs) + { + + using var loggerScope = _logger.BeginScope(new Common.Miscellaneous.LoggingDataDictionary + { + ["correlationId"] = eventArgs.Message.CorrelationId, + ["source"] = eventArgs.Message.ApplicationId, + ["messageId"] = eventArgs.Message.MessageId, + ["messageDescription"] = eventArgs.Message.MessageDescription, + }); + + _logger.ArtifactReceivedReceived(); + await _eventPayloadListenerService.ReceiveWorkflowPayload(eventArgs); + } protected virtual void Dispose(bool disposing) { diff --git a/src/WorkflowManager/PayloadListener/Validators/EventPayloadValidator.cs b/src/WorkflowManager/PayloadListener/Validators/EventPayloadValidator.cs index 38a4471c9..b46ce1772 100644 --- a/src/WorkflowManager/PayloadListener/Validators/EventPayloadValidator.cs +++ b/src/WorkflowManager/PayloadListener/Validators/EventPayloadValidator.cs @@ -67,6 +67,41 @@ public bool ValidateWorkflowRequest(WorkflowRequestEvent payload) return valid; } + public bool ValidateArtifactReceived(ArtifactsReceivedEvent payload) + { + Guard.Against.Null(payload, nameof(payload)); + + using var loggingScope = Logger.BeginScope(new LoggingDataDictionary + { + ["correlationId"] = payload.CorrelationId, + ["payloadId"] = payload.PayloadId, + }); + + var valid = true; + var payloadValid = payload.IsValid(out var validationErrors); + + if (!payloadValid) + { + Log.FailedToValidateWorkflowRequestEvent(Logger, string.Join(Environment.NewLine, validationErrors)); + } + + valid &= payloadValid; + + foreach (var workflow in payload.Workflows) + { + var workflowValid = !string.IsNullOrEmpty(workflow); + + if (!workflowValid) + { + Log.FailedToValidateWorkflowRequestEvent(Logger, "Workflow id is empty string"); + } + + valid &= workflowValid; + } + + return valid; + } + public bool ValidateTaskUpdate(TaskUpdateEvent payload) { Guard.Against.Null(payload, nameof(payload)); diff --git a/src/WorkflowManager/PayloadListener/Validators/IEventPayloadValidator.cs b/src/WorkflowManager/PayloadListener/Validators/IEventPayloadValidator.cs index 77e4f7856..e7e16c9b5 100644 --- a/src/WorkflowManager/PayloadListener/Validators/IEventPayloadValidator.cs +++ b/src/WorkflowManager/PayloadListener/Validators/IEventPayloadValidator.cs @@ -37,5 +37,11 @@ public interface IEventPayloadValidator /// /// The workflow message event. bool ValidateExportComplete(ExportCompleteEvent payload); + + /// + /// Validates the artifactReceived payload from the RabbitMQ queue. + /// + /// The artifactReceived event. + bool ValidateArtifactReceived(ArtifactsReceivedEvent payload); } } diff --git a/src/WorkflowManager/PayloadListener/packages.lock.json b/src/WorkflowManager/PayloadListener/packages.lock.json index 388d42be2..d7a0d44f8 100644 --- a/src/WorkflowManager/PayloadListener/packages.lock.json +++ b/src/WorkflowManager/PayloadListener/packages.lock.json @@ -271,7 +271,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/WorkflowManager/Services/packages.lock.json b/src/WorkflowManager/Services/packages.lock.json index 8474e1adf..5a6b2cf09 100644 --- a/src/WorkflowManager/Services/packages.lock.json +++ b/src/WorkflowManager/Services/packages.lock.json @@ -250,7 +250,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/WorkflowManager/Storage/packages.lock.json b/src/WorkflowManager/Storage/packages.lock.json index fc7cb4f0a..73027d62d 100755 --- a/src/WorkflowManager/Storage/packages.lock.json +++ b/src/WorkflowManager/Storage/packages.lock.json @@ -236,7 +236,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs index 465979f1d..485aa9ca2 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs @@ -49,5 +49,11 @@ public interface IWorkflowExecuterService /// Previous Tasks Id. /// Task CreateTaskExecutionAsync(TaskObject task, WorkflowInstance workflowInstance, string? bucketName = null, string? payloadId = null, string? previousTaskId = null); + + /// + /// Processes the artifactReceived payload and continue workflow instance. + /// + /// The workflow request message event. + Task ProcessArtifactReceived(ArtifactsReceivedEvent message); } } diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index 7ef2adcfc..c68a3e097 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -14,7 +14,6 @@ * limitations under the License. */ -using System.Globalization; using Ardalis.GuardClauses; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -111,20 +110,11 @@ public async Task ProcessPayload(WorkflowRequestEvent message, Payload pay using var loggerScope = _logger.BeginScope($"correlationId={message.CorrelationId}, payloadId={payload.PayloadId}"); - // for external App executions then workflowInstanceId will be supplied and we can continue the workflow from that task. - if (string.IsNullOrWhiteSpace(message.WorkflowInstanceId) is false) + // for external App executions use the ArtifactReceived queue. + if (string.IsNullOrWhiteSpace(message.WorkflowInstanceId) is false && string.IsNullOrEmpty(message.TaskId) is false) { - var instance = await _workflowInstanceRepository.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId); - if (instance is not null) - { - var task = instance.Tasks.First(t => t.TaskId == message.TaskId); - if (task is not null) - { - var workflow = await _workflowRepository.GetByWorkflowIdAsync(instance.WorkflowId); - await HandleTaskDestinations(instance, workflow, task, message.CorrelationId); - return true; - } - } + _logger.DontUseWorkflowReceivedForPayload(); + return false; } var processed = true; @@ -181,6 +171,25 @@ public async Task ProcessPayload(WorkflowRequestEvent message, Payload pay return true; } + public async Task ProcessArtifactReceived(ArtifactsReceivedEvent message) + { + Guard.Against.Null(message, nameof(message)); + + var instance = await _workflowInstanceRepository.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId!); + if (instance is not null) + { + var task = instance.Tasks.First(t => t.TaskId == message.TaskId!); + if (task is not null) + { + var workflow = await _workflowRepository.GetByWorkflowIdAsync(instance.WorkflowId); + await HandleTaskDestinations(instance, workflow, task, message.CorrelationId); + return true; + } + } + + return false; + } + public async Task ProcessFirstWorkflowTask(WorkflowInstance workflowInstance, string correlationId, Payload payload) { if (workflowInstance.Status == Status.Failed) @@ -226,10 +235,10 @@ private static Task SwitchTasksAsync(TaskExecution task, Func defaultFunc) => task switch { - { TaskType: TaskTypeConstants.RouterTask } => routerFunc(), - { TaskType: TaskTypeConstants.ExportTask } => exportFunc(), - { TaskType: TaskTypeConstants.ExternalAppTask } => externalFunc(), - { Status: var s } when s != TaskExecutionStatus.Created => notCreatedStatusFunc(), + { TaskType: TaskTypeConstants.RouterTask } => routerFunc(), + { TaskType: TaskTypeConstants.ExportTask } => exportFunc(), + { TaskType: TaskTypeConstants.ExternalAppTask } => externalFunc(), + { Status: var s } when s != TaskExecutionStatus.Created => notCreatedStatusFunc(), _ => defaultFunc() }; diff --git a/src/WorkflowManager/WorkflowExecuter/packages.lock.json b/src/WorkflowManager/WorkflowExecuter/packages.lock.json index cb6c432b6..ce5c56316 100644 --- a/src/WorkflowManager/WorkflowExecuter/packages.lock.json +++ b/src/WorkflowManager/WorkflowExecuter/packages.lock.json @@ -271,7 +271,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/src/WorkflowManager/WorkflowManager/packages.lock.json b/src/WorkflowManager/WorkflowManager/packages.lock.json index f79accb10..4f9aa46de 100755 --- a/src/WorkflowManager/WorkflowManager/packages.lock.json +++ b/src/WorkflowManager/WorkflowManager/packages.lock.json @@ -486,7 +486,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", diff --git a/tests/UnitTests/PayloadListener.Tests/Services/EventPayloadRecieverServiceTests.cs b/tests/UnitTests/PayloadListener.Tests/Services/EventPayloadRecieverServiceTests.cs index 3ee331405..3d0c385a6 100644 --- a/tests/UnitTests/PayloadListener.Tests/Services/EventPayloadRecieverServiceTests.cs +++ b/tests/UnitTests/PayloadListener.Tests/Services/EventPayloadRecieverServiceTests.cs @@ -298,6 +298,43 @@ public void ReceiveWorkflowPayload_With_WorkflowId_And_TaskID() _payloadService.Verify(p => p.CreateAsync(It.IsAny()), Times.Never()); } + + [Test] + public void ArtifactReceivedPayload_ValidateWorkFlowRequest() + { + var message = CreateMessageReceivedEventArgs(new string[] { "destination" }); + _eventPayloadReceiverService.ArtifactReceivePayload(message); + + _mockEventPayloadValidator.Verify(p => p.ValidateArtifactReceived(It.IsAny()), Times.Once()); + } + + + [Test] + public void ArtifactReceivedPayload_WorkFlowRequestIsNotValid_MessageSubscriberRejectsTheMessage() + { + var message = CreateMessageReceivedEventArgs(new string[] { "destination" }); + + _mockEventPayloadValidator.Setup(p => p.ValidateArtifactReceived(It.IsAny())).Returns(false); + + _eventPayloadReceiverService.ArtifactReceivePayload(message); + + _mockMessageBrokerSubscriberService.Verify(p => p.Reject(It.IsAny(), false), Times.Once()); + } + + [Test] + public void ArtifactReceivedPayload_WorkFlowRequestIsValid_MessageSubscriberAcknowledgeTheMessage() + { + var message = CreateMessageReceivedEventArgs(new string[] { "destination" }); + + _mockEventPayloadValidator.Setup(p => p.ValidateArtifactReceived(It.IsAny())).Returns(true); + + _workflowExecuterService.Setup(p => p.ProcessArtifactReceived(It.IsAny())).ReturnsAsync(true); + + _eventPayloadReceiverService.ArtifactReceivePayload(message); + + _mockMessageBrokerSubscriberService.Verify(p => p.Acknowledge(It.IsAny()), Times.Once()); + } + private static MessageReceivedEventArgs CreateMessageReceivedEventArgs(string[] destinations) { var exportRequestMessage = new ExportRequestEvent diff --git a/tests/UnitTests/PayloadListener.Tests/packages.lock.json b/tests/UnitTests/PayloadListener.Tests/packages.lock.json deleted file mode 100644 index 2078ad96c..000000000 --- a/tests/UnitTests/PayloadListener.Tests/packages.lock.json +++ /dev/null @@ -1,952 +0,0 @@ -{ - "version": 1, - "dependencies": { - "net6.0": { - "coverlet.collector": { - "type": "Direct", - "requested": "[6.0.0, )", - "resolved": "6.0.0", - "contentHash": "tW3lsNS+dAEII6YGUX/VMoJjBS1QvsxqJeqLaJXub08y1FSjasFPtQ4UBUsudE9PNrzLjooClMsPtY2cZLdXpQ==" - }, - "Microsoft.NET.Test.Sdk": { - "type": "Direct", - "requested": "[17.7.2, )", - "resolved": "17.7.2", - "contentHash": "WOSF/GUYcnrLGkdvCbXDRig2rShtBwfQc5l7IxQE6PZI3CeXAqF1SpyzwlGA5vw+MdEAXs3niy+ZkGBBWna6tw==", - "dependencies": { - "Microsoft.CodeCoverage": "17.7.2", - "Microsoft.TestPlatform.TestHost": "17.7.2" - } - }, - "Moq": { - "type": "Direct", - "requested": "[4.20.69, )", - "resolved": "4.20.69", - "contentHash": "8P/oAUOL8ZVyXnzBBcgdhTsOD1kQbAWfOcMI7KDQO3HqQtzB/0WYLdnMa4Jefv8nu/MQYiiG0IuoJdvG0v0Nig==", - "dependencies": { - "Castle.Core": "5.1.1" - } - }, - "NUnit": { - "type": "Direct", - "requested": "[3.13.3, )", - "resolved": "3.13.3", - "contentHash": "KNPDpls6EfHwC3+nnA67fh5wpxeLb3VLFAfLxrug6JMYDLHH6InaQIWR7Sc3y75d/9IKzMksH/gi08W7XWbmnQ==", - "dependencies": { - "NETStandard.Library": "2.0.0" - } - }, - "NUnit3TestAdapter": { - "type": "Direct", - "requested": "[4.5.0, )", - "resolved": "4.5.0", - "contentHash": "s8JpqTe9bI2f49Pfr3dFRfoVSuFQyraTj68c3XXjIS/MRGvvkLnrg6RLqnTjdShX+AdFUCCU/4Xex58AdUfs6A==" - }, - "Ardalis.GuardClauses": { - "type": "Transitive", - "resolved": "4.1.1", - "contentHash": "+UcJ2s+gf2wMNrwadCaHZV2DMcGgBU1t22A+jm40P4MHQRLy9hcleGy5xdVWd4dXZPa5Vlp4TG5xU2rhoDYrBA==" - }, - "AWSSDK.Core": { - "type": "Transitive", - "resolved": "3.7.200.13", - "contentHash": "yiUuhTI8w183euRqhXym1DyhnD/1ccxceRoruCfkIoqY3PAaFgFL8pE4iDLDZa7SUW4M4qZnQ5PMlFr1rrl6zw==" - }, - "AWSSDK.SecurityToken": { - "type": "Transitive", - "resolved": "3.7.201.9", - "contentHash": "yKlTPrvNeDdzkOX82Ydf7MD09Gk3dK74JWZPRWJ3QIxskWVoNTAyLvfVBzbi+/fGnjf8/qKsSzxT7GHLqds37A==", - "dependencies": { - "AWSSDK.Core": "[3.7.200.13, 4.0.0)" - } - }, - "Castle.Core": { - "type": "Transitive", - "resolved": "5.1.1", - "contentHash": "rpYtIczkzGpf+EkZgDr9CClTdemhsrwA/W5hMoPjLkRFnXzH44zDLoovXeKtmxb1ykXK9aJVODSpiJml8CTw2g==", - "dependencies": { - "System.Diagnostics.EventLog": "6.0.0" - } - }, - "CommunityToolkit.HighPerformance": { - "type": "Transitive", - "resolved": "8.2.0", - "contentHash": "iKzsPiSnXoQUN5AoApYmdfnLn9osNb+YCLWRr5PFmrDEQVIu7OeOyf4DPvNBvbqbYLZCfvHozPkulyv6zBQsFw==" - }, - "DnsClient": { - "type": "Transitive", - "resolved": "1.6.1", - "contentHash": "4H/f2uYJOZ+YObZjpY9ABrKZI+JNw3uizp6oMzTXwDw6F+2qIPhpRl/1t68O/6e98+vqNiYGu+lswmwdYUy3gg==", - "dependencies": { - "Microsoft.Win32.Registry": "5.0.0" - } - }, - "fo-dicom": { - "type": "Transitive", - "resolved": "5.1.1", - "contentHash": "YraR81u9XuTN7l+pt6HzT0KvuhgWVZ9LCuHMH3zgFfAtv4peT1y+nYMSGwF9YqNP+oZnzh0s0PJ+vJMsTDpGIw==", - "dependencies": { - "CommunityToolkit.HighPerformance": "8.2.0", - "Microsoft.Bcl.AsyncInterfaces": "6.0.0", - "Microsoft.Bcl.HashCode": "1.1.1", - "Microsoft.Extensions.DependencyInjection": "6.0.1", - "Microsoft.Extensions.Logging": "6.0.0", - "Microsoft.Extensions.Options": "6.0.0", - "System.Buffers": "4.5.1", - "System.Text.Encoding.CodePages": "6.0.0", - "System.Text.Encodings.Web": "6.0.0", - "System.Text.Json": "6.0.7", - "System.Threading.Channels": "6.0.0" - } - }, - "LightInject": { - "type": "Transitive", - "resolved": "5.4.0", - "contentHash": "w4EjEhNqtzFb0qlScmpjA84Nuv4+OITNGfYCjDhJoLYyw+uagkrrth+e9Hgidv4bMzuNSlJpHPGTHx6DtE4Ixg==", - "dependencies": { - "System.ValueTuple": "4.5.0" - } - }, - "Microsoft.AspNetCore.Hosting.Abstractions": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "ubycklv+ZY7Kutdwuy1W4upWcZ6VFR8WUXU7l7B2+mvbDBBPAcfpi+E+Y5GFe+Q157YfA3C49D2GCjAZc7Mobw==", - "dependencies": { - "Microsoft.AspNetCore.Hosting.Server.Abstractions": "2.2.0", - "Microsoft.AspNetCore.Http.Abstractions": "2.2.0", - "Microsoft.Extensions.Hosting.Abstractions": "2.2.0" - } - }, - "Microsoft.AspNetCore.Hosting.Server.Abstractions": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "1PMijw8RMtuQF60SsD/JlKtVfvh4NORAhF4wjysdABhlhTrYmtgssqyncR0Stq5vqtjplZcj6kbT4LRTglt9IQ==", - "dependencies": { - "Microsoft.AspNetCore.Http.Features": "2.2.0", - "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" - } - }, - "Microsoft.AspNetCore.Http.Abstractions": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "Nxs7Z1q3f1STfLYKJSVXCs1iBl+Ya6E8o4Oy1bCxJ/rNI44E/0f6tbsrVqAWfB7jlnJfyaAtIalBVxPKUPQb4Q==", - "dependencies": { - "Microsoft.AspNetCore.Http.Features": "2.2.0", - "System.Text.Encodings.Web": "4.5.0" - } - }, - "Microsoft.AspNetCore.Http.Features": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "ziFz5zH8f33En4dX81LW84I6XrYXKf9jg6aM39cM+LffN9KJahViKZ61dGMSO2gd3e+qe5yBRwsesvyqlZaSMg==", - "dependencies": { - "Microsoft.Extensions.Primitives": "2.2.0" - } - }, - "Microsoft.Bcl.AsyncInterfaces": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "UcSjPsst+DfAdJGVDsu346FX0ci0ah+lw3WRtn18NUwEqRt70HaOQ7lI72vy3+1LxtqI3T5GWwV39rQSrCzAeg==" - }, - "Microsoft.Bcl.HashCode": { - "type": "Transitive", - "resolved": "1.1.1", - "contentHash": "MalY0Y/uM/LjXtHfX/26l2VtN4LDNZ2OE3aumNOHDLsT4fNYy2hiHXI4CXCqKpNUNm7iJ2brrc4J89UdaL56FA==" - }, - "Microsoft.CodeCoverage": { - "type": "Transitive", - "resolved": "17.7.2", - "contentHash": "ntbkwIqwszkfCRjxVZOyEQiHauiYsY9NtYjw9ASsoxDSiG8YtV6AGcOAwrAk3TZv2UOq4MrpX+3MYEeMHSb03w==" - }, - "Microsoft.Extensions.Configuration": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "nOP8R1mVb/6mZtm2qgAJXn/LFm/2kMjHDAg/QJLFG6CuWYJtaD3p1BwQhufBVvRzL9ceJ/xF0SQ0qsI2GkDQAA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.2.0" - } - }, - "Microsoft.Extensions.Configuration.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "qWzV9o+ZRWq+pGm+1dF+R7qTgTYoXvbyowRoBxQJGfqTpqDun2eteerjRQhq5PQ/14S+lqto3Ft4gYaRyl4rdQ==", - "dependencies": { - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Configuration.Binder": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "vJ9xvOZCnUAIHcGC3SU35r3HKmHTVIeHzo6u/qzlHAqD8m6xv92MLin4oJntTvkpKxVX3vI1GFFkIQtU3AdlsQ==", - "dependencies": { - "Microsoft.Extensions.Configuration": "2.2.0" - } - }, - "Microsoft.Extensions.DependencyInjection": { - "type": "Transitive", - "resolved": "6.0.1", - "contentHash": "vWXPg3HJQIpZkENn1KWq8SfbqVujVD7S7vIAyFXXqK5xkf1Vho+vG0bLBCHxU36lD1cLLtmGpfYf0B3MYFi9tQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.Extensions.DependencyInjection.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "xlzi2IYREJH3/m6+lUrQlujzX8wDitm4QGnUu6kUXTQAWPuZY8i+ticFJbzfqaetLA6KR/rO6Ew/HuYD+bxifg==" - }, - "Microsoft.Extensions.Diagnostics.HealthChecks": { - "type": "Transitive", - "resolved": "6.0.21", - "contentHash": "1Qf/tEg6IlzbvCxrc+pZE+ZGrajBdB/+V2+abeAu6lg8wXGHmO8JtnrNqwc5svSbcz3udxinUPyH3vw6ZujKbg==", - "dependencies": { - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.21", - "Microsoft.Extensions.Hosting.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.4", - "Microsoft.Extensions.Options": "6.0.0" - } - }, - "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": { - "type": "Transitive", - "resolved": "6.0.21", - "contentHash": "5FSA1euCRtbRqVgTn2ahgCG9Cy29UQXAZMCJLUlrQQaC5rko0+d/aq9SiFGIDP7cvoWUsatrlNdfc6UyOMV5aA==" - }, - "Microsoft.Extensions.FileProviders.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "0pd4/fho0gC12rQswaGQxbU34jOS1TPS8lZPpkFCH68ppQjHNHYle9iRuHeev1LhrJ94YPvzcRd8UmIuFk23Qw==", - "dependencies": { - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Hosting.Abstractions": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "GcT5l2CYXL6Sa27KCSh0TixsRfADUgth+ojQSD5EkzisZxmGFh7CwzkcYuGwvmXLjr27uWRNrJ2vuuEjMhU05Q==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "6.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.FileProviders.Abstractions": "6.0.0" - } - }, - "Microsoft.Extensions.Logging": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "eIbyj40QDg1NDz0HBW0S5f3wrLVnKWnDJ/JtZ+yJDFnDj90VoPuoPmFkeaXrtu+0cKm5GRAwoDf+dBWXK0TUdg==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection": "6.0.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Logging.Abstractions": "6.0.0", - "Microsoft.Extensions.Options": "6.0.0", - "System.Diagnostics.DiagnosticSource": "6.0.0" - } - }, - "Microsoft.Extensions.Logging.Abstractions": { - "type": "Transitive", - "resolved": "6.0.4", - "contentHash": "K14wYgwOfKVELrUh5eBqlC8Wvo9vvhS3ZhIvcswV2uS/ubkTRPSQsN557EZiYUSSoZNxizG+alN4wjtdyLdcyw==" - }, - "Microsoft.Extensions.Logging.Configuration": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "ukU1mQGX9+xBsEzpNd13yl4deFVYI+fxxnmKpOhvNZsF+/trCrAUQh+9QM5pPGHbfYkz3lLQ4BXfKCP0502dLw==", - "dependencies": { - "Microsoft.Extensions.Logging": "2.2.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "2.2.0" - } - }, - "Microsoft.Extensions.Logging.Console": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "1eGgcOJ++PMxW6sn++j6U7wsWvhEBm/5ScqBUUBGLRE8M7AHahi9tsxivDMqEXVM3F0/pshHl3kEpMXtw4BeFg==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.2.0", - "Microsoft.Extensions.Logging": "2.2.0", - "Microsoft.Extensions.Logging.Configuration": "2.2.0" - } - }, - "Microsoft.Extensions.Logging.Debug": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "JjqWtshxUujSnxslFccCRAaH8uFOciqXkYdRw+h5MwpC4sUc+ju9yZzvVi6PA5vW09ckv26EkasEvXrofGiaJg==", - "dependencies": { - "Microsoft.Extensions.Logging": "2.2.0" - } - }, - "Microsoft.Extensions.Options": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "dzXN0+V1AyjOe2xcJ86Qbo233KHuLEY0njf/P2Kw8SfJU+d45HNS2ctJdnEnrWbM9Ye2eFgaC5Mj9otRMU6IsQ==", - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "6.0.0", - "Microsoft.Extensions.Primitives": "6.0.0" - } - }, - "Microsoft.Extensions.Options.ConfigurationExtensions": { - "type": "Transitive", - "resolved": "2.2.0", - "contentHash": "d4WS6yVXaw43ffiUnHj8oG1t2B6RbDDiQcgdA+Eq//NlPa3Wd+GTJFKj4OM4eDF3GjVumGr/CEVRS/jcYoF5LA==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.2.0", - "Microsoft.Extensions.Configuration.Binder": "2.2.0", - "Microsoft.Extensions.DependencyInjection.Abstractions": "2.2.0", - "Microsoft.Extensions.Options": "2.2.0" - } - }, - "Microsoft.Extensions.Primitives": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "9+PnzmQFfEFNR9J2aDTfJGGupShHjOuGw4VUv+JB044biSHrnmCIMD+mJHmb2H7YryrfBEXDurxQ47gJZdCKNQ==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "Microsoft.NETCore.Platforms": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "VyPlqzH2wavqquTcYpkIIAQ6WdenuKoFN0BdYBbCWsclXacSOHNQn66Gt4z5NBqEYW0FAPm5rlvki9ZiCij5xQ==" - }, - "Microsoft.NETCore.Targets": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "aOZA3BWfz9RXjpzt0sRJJMjAscAUm3Hoa4UWAfceV9UTYxgwZ1lZt5nO2myFf+/jetYQo4uTP7zS8sJY67BBxg==" - }, - "Microsoft.TestPlatform.ObjectModel": { - "type": "Transitive", - "resolved": "17.7.2", - "contentHash": "aHzQWgDMVBnk39HhQVmn06w+YxzF1h2V5/M4WgrNQAn7q97GR4Si3vLRTDlmJo9nK/Nknce+H4tXx4gqOKyLeg==", - "dependencies": { - "NuGet.Frameworks": "6.5.0", - "System.Reflection.Metadata": "1.6.0" - } - }, - "Microsoft.TestPlatform.TestHost": { - "type": "Transitive", - "resolved": "17.7.2", - "contentHash": "pv9yVD7IKPLJV28zYjLsWFiM3j506I2ye+6NquG8vsbm/gR7lgyig8IgY6Vo57VMvGaAKwtUECzcj+C5tH271Q==", - "dependencies": { - "Microsoft.TestPlatform.ObjectModel": "17.7.2", - "Newtonsoft.Json": "13.0.1" - } - }, - "Microsoft.Win32.Registry": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", - "dependencies": { - "System.Security.AccessControl": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "Monai.Deploy.Messaging": { - "type": "Transitive", - "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", - "dependencies": { - "Ardalis.GuardClauses": "4.1.1", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", - "Newtonsoft.Json": "13.0.3", - "System.IO.Abstractions": "17.2.3" - } - }, - "Monai.Deploy.Storage": { - "type": "Transitive", - "resolved": "0.2.18", - "contentHash": "+1JX7QDgVEMqYA0/M1QMr1gtXRC6lEuhBtLfJXWi6cEgh9kOPE0KiHd1AWI7PxBgBbsEBZaNQSvWqShlwcu6bA==", - "dependencies": { - "AWSSDK.SecurityToken": "3.7.201.9", - "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", - "Monai.Deploy.Storage.S3Policy": "0.2.18", - "System.IO.Abstractions": "17.2.3" - } - }, - "Monai.Deploy.Storage.S3Policy": { - "type": "Transitive", - "resolved": "0.2.18", - "contentHash": "+b0nDnf4OoajdH2hB02elRC6G+GjlYnxJC+F3dGbUUXGMtPApzs8c8s/EG4fKzihxsVovJtqnJl7atcaPyl12Q==", - "dependencies": { - "Ardalis.GuardClauses": "4.1.1", - "Newtonsoft.Json": "13.0.3" - } - }, - "Mongo.Migration": { - "type": "Transitive", - "resolved": "3.1.4", - "contentHash": "iA13H1tFH7x3eeKhBAYdgFxzK4gj78hY2pc5yiB08zX3kmhxGT/hp5k+iTDlSlCCyl+pMNpitTUiKiqOI6L6Gg==", - "dependencies": { - "LightInject": "5.4.0", - "Microsoft.AspNetCore.Hosting.Abstractions": "2.2.0", - "Microsoft.AspNetCore.Http.Abstractions": "2.2.0", - "Microsoft.Extensions.DependencyInjection": "2.2.0", - "Microsoft.Extensions.Logging.Abstractions": "2.2.0", - "Microsoft.Extensions.Logging.Console": "2.2.0", - "Microsoft.Extensions.Logging.Debug": "2.2.0", - "Microsoft.Extensions.Options": "2.2.0", - "MongoDB.Driver": "2.13.1", - "NLog": "4.7.11", - "Serilog": "2.8.0", - "Serilog.Extensions.Logging": "2.0.4", - "Serilog.Extensions.Logging.File": "2.0.0", - "System.ValueTuple": "4.5.0" - } - }, - "MongoDB.Bson": { - "type": "Transitive", - "resolved": "2.21.0", - "contentHash": "QT+D1I3Jz6r6S6kCgJD1L9dRCLVJCKlkGRkA+tJ7uLpHRmjDNcNKy4D1T+L9gQrjl95lDN9PHdwEytdvCW/jzA==", - "dependencies": { - "System.Memory": "4.5.5", - "System.Runtime.CompilerServices.Unsafe": "5.0.0" - } - }, - "MongoDB.Driver": { - "type": "Transitive", - "resolved": "2.21.0", - "contentHash": "VxKj1wuhadiXhaXkykCWRgsYOysdaOYJ202hJFz25UjkrqC/tHA8RS4hdS5HYfGWoI//fypBXnxZCkEjXLXdfw==", - "dependencies": { - "Microsoft.Extensions.Logging.Abstractions": "2.0.0", - "MongoDB.Bson": "2.21.0", - "MongoDB.Driver.Core": "2.21.0", - "MongoDB.Libmongocrypt": "1.8.0" - } - }, - "MongoDB.Driver.Core": { - "type": "Transitive", - "resolved": "2.21.0", - "contentHash": "Ac44U3bQfinmdH5KNFjTidJe9LKW87SxkXJ3YuIUJQMITEc4083YF1yvjJxaSeYF9er0YgHSmwhHpsZv0Fwplg==", - "dependencies": { - "AWSSDK.SecurityToken": "3.7.100.14", - "DnsClient": "1.6.1", - "Microsoft.Extensions.Logging.Abstractions": "2.0.0", - "MongoDB.Bson": "2.21.0", - "MongoDB.Libmongocrypt": "1.8.0", - "SharpCompress": "0.30.1", - "Snappier": "1.0.0", - "System.Buffers": "4.5.1", - "ZstdSharp.Port": "0.6.2" - } - }, - "MongoDB.Libmongocrypt": { - "type": "Transitive", - "resolved": "1.8.0", - "contentHash": "fgNw8Dxpkq7mpoaAYes8cfnPRzvFIoB8oL9GPXwi3op/rONftl0WAeg4akRLcxfoVuUvuUO2wGoVBr3JzJ7Svw==" - }, - "NETStandard.Library": { - "type": "Transitive", - "resolved": "2.0.0", - "contentHash": "7jnbRU+L08FXKMxqUflxEXtVymWvNOrS8yHgu9s6EM8Anr6T/wIX4nZ08j/u3Asz+tCufp3YVwFSEvFTPYmBPA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0" - } - }, - "Newtonsoft.Json": { - "type": "Transitive", - "resolved": "13.0.3", - "contentHash": "HrC5BXdl00IP9zeV+0Z848QWPAoCr9P3bDEZguI+gkLcBKAOxix/tLEAAHC+UvDNPv4a2d18lOReHMOagPa+zQ==" - }, - "NLog": { - "type": "Transitive", - "resolved": "4.7.11", - "contentHash": "A7EpoOjWesV5BPx1cOiBndazZq1VGdagIs6oK8ttcRDl5adCMtHiTqnsD5yYaOrMxOQeCjHBf/w3nKzCmhGbgw==" - }, - "NuGet.Frameworks": { - "type": "Transitive", - "resolved": "6.5.0", - "contentHash": "QWINE2x3MbTODsWT1Gh71GaGb5icBz4chS8VYvTgsBnsi8esgN6wtHhydd7fvToWECYGq7T4cgBBDiKD/363fg==" - }, - "Serilog": { - "type": "Transitive", - "resolved": "2.8.0", - "contentHash": "zjuKXW5IQws43IHX7VY9nURsaCiBYh2kyJCWLJRSWrTsx/syBKHV8MibWe2A+QH3Er0AiwA+OJmO3DhFJDY1+A==", - "dependencies": { - "System.Collections.NonGeneric": "4.3.0" - } - }, - "Serilog.Extensions.Logging": { - "type": "Transitive", - "resolved": "2.0.4", - "contentHash": "C8Vf9Wj1M+wGilChTV+OhE4v5ZCDzQfHjLKj2yNDMkXf/zgUKeAUZfbrVrt/c+flXP8M7/SHWBOXTkuPgubFsA==", - "dependencies": { - "Microsoft.Extensions.Logging": "2.0.0", - "Serilog": "2.3.0" - } - }, - "Serilog.Extensions.Logging.File": { - "type": "Transitive", - "resolved": "2.0.0", - "contentHash": "usO0qr4v9VCMBWiTJ1nQmAbPNCt40FrkDol6CpfCXbsxGZS/hH+YCueF7vvPQ32ATI0GWcMWiKRdjXEE7/HxTQ==", - "dependencies": { - "Microsoft.Extensions.Configuration.Abstractions": "2.0.0", - "Microsoft.Extensions.Configuration.Binder": "2.0.0", - "Serilog": "2.5.0", - "Serilog.Extensions.Logging": "2.0.2", - "Serilog.Formatting.Compact": "1.0.0", - "Serilog.Sinks.Async": "1.1.0", - "Serilog.Sinks.RollingFile": "3.3.0" - } - }, - "Serilog.Formatting.Compact": { - "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "r3QYz02y7+B7Ng30hyJM929OJhem7SsJ4XDUE0Zfptj2MRiQfpPUb5f58juAFjp/TnNeSX2QNzZEnHwLeoJfHQ==", - "dependencies": { - "Serilog": "2.0.0" - } - }, - "Serilog.Sinks.Async": { - "type": "Transitive", - "resolved": "1.1.0", - "contentHash": "xll0Kanz2BkCxuv+F3p1WXr47jdsVM0GU1n1LZvK+18QiRZ/WGFNxSNw9EMKFV5ED5gr7MUpAe6PCMNL1HGUMA==", - "dependencies": { - "Serilog": "2.1.0", - "System.Collections.Concurrent": "4.0.12" - } - }, - "Serilog.Sinks.File": { - "type": "Transitive", - "resolved": "3.2.0", - "contentHash": "VHbo68pMg5hwSWrzLEdZv5b/rYmIgHIRhd4d5rl8GnC5/a8Fr+RShT5kWyeJOXax1el6mNJ+dmHDOVgnNUQxaw==", - "dependencies": { - "Serilog": "2.3.0", - "System.IO": "4.1.0", - "System.IO.FileSystem": "4.0.1", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Text.Encoding.Extensions": "4.0.11", - "System.Threading": "4.0.11", - "System.Threading.Timer": "4.0.1" - } - }, - "Serilog.Sinks.RollingFile": { - "type": "Transitive", - "resolved": "3.3.0", - "contentHash": "2lT5X1r3GH4P0bRWJfhA7etGl8Q2Ipw9AACvtAHWRUSpYZ42NGVyHoVs2ALBZ/cAkkS+tA4jl80Zie144eLQPg==", - "dependencies": { - "Serilog.Sinks.File": "3.2.0", - "System.IO": "4.1.0", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Runtime.InteropServices": "4.1.0", - "System.Text.Encoding.Extensions": "4.0.11" - } - }, - "SharpCompress": { - "type": "Transitive", - "resolved": "0.30.1", - "contentHash": "XqD4TpfyYGa7QTPzaGlMVbcecKnXy4YmYLDWrU+JIj7IuRNl7DH2END+Ll7ekWIY8o3dAMWLFDE1xdhfIWD1nw==" - }, - "Snappier": { - "type": "Transitive", - "resolved": "1.0.0", - "contentHash": "rFtK2KEI9hIe8gtx3a0YDXdHOpedIf9wYCEYtBEmtlyiWVX3XlCNV03JrmmAi/Cdfn7dxK+k0sjjcLv4fpHnqA==" - }, - "System.Buffers": { - "type": "Transitive", - "resolved": "4.5.1", - "contentHash": "Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==" - }, - "System.Collections": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Collections.Concurrent": { - "type": "Transitive", - "resolved": "4.0.12", - "contentHash": "2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==", - "dependencies": { - "System.Collections": "4.0.11", - "System.Diagnostics.Debug": "4.0.11", - "System.Diagnostics.Tracing": "4.1.0", - "System.Globalization": "4.0.11", - "System.Reflection": "4.1.0", - "System.Resources.ResourceManager": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Extensions": "4.1.0", - "System.Threading": "4.0.11", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.Collections.NonGeneric": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", - "dependencies": { - "System.Diagnostics.Debug": "4.3.0", - "System.Globalization": "4.3.0", - "System.Resources.ResourceManager": "4.3.0", - "System.Runtime": "4.3.0", - "System.Runtime.Extensions": "4.3.0", - "System.Threading": "4.3.0" - } - }, - "System.Diagnostics.Debug": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Diagnostics.DiagnosticSource": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "frQDfv0rl209cKm1lnwTgFPzNigy2EKk1BS3uAvHvlBVKe5cymGyHO+Sj+NLv5VF/AhHsqPIUUwya5oV4CHMUw==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Diagnostics.EventLog": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "lcyUiXTsETK2ALsZrX+nWuHSIQeazhqPphLfaRxzdGaG93+0kELqpgEHtwWOlQe7+jSFnKwaCAgL4kjeZCQJnw==" - }, - "System.Diagnostics.Tracing": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Globalization": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.IO": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0", - "System.Text.Encoding": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.IO.Abstractions": { - "type": "Transitive", - "resolved": "17.2.3", - "contentHash": "VcozGeE4SxIo0cnXrDHhbrh/Gb8KQnZ3BvMelvh+iw0PrIKtuuA46U2Xm4e4pgnaWFgT4RdZfTpWl/WPRdw0WQ==" - }, - "System.IO.FileSystem": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.IO": "4.1.0", - "System.IO.FileSystem.Primitives": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Handles": "4.0.1", - "System.Text.Encoding": "4.0.11", - "System.Threading.Tasks": "4.0.11" - } - }, - "System.IO.FileSystem.Primitives": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==", - "dependencies": { - "System.Runtime": "4.1.0" - } - }, - "System.Memory": { - "type": "Transitive", - "resolved": "4.5.5", - "contentHash": "XIWiDvKPXaTveaB7HVganDlOCRoj03l+jrwNvcge/t8vhGYKvqV+dMv6G4SAX2NoNmN0wZfVPTAlFwZcZvVOUw==" - }, - "System.Reflection": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.IO": "4.3.0", - "System.Reflection.Primitives": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Reflection.Metadata": { - "type": "Transitive", - "resolved": "1.6.0", - "contentHash": "COC1aiAJjCoA5GBF+QKL2uLqEBew4JsCkQmoHKbN3TlOZKa2fKLz5CpiRQKDz0RsAOEGsVKqOD5bomsXq/4STQ==" - }, - "System.Reflection.Primitives": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Resources.ResourceManager": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Globalization": "4.3.0", - "System.Reflection": "4.3.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0" - } - }, - "System.Runtime.CompilerServices.Unsafe": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "/iUeP3tq1S0XdNNoMz5C9twLSrM/TH+qElHkXWaPvuNOt+99G75NrV0OS2EqHx5wMN7popYjpc8oTjC1y16DLg==" - }, - "System.Runtime.Extensions": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Runtime.Handles": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.Runtime.InteropServices": { - "type": "Transitive", - "resolved": "4.1.0", - "contentHash": "16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Reflection": "4.1.0", - "System.Reflection.Primitives": "4.0.1", - "System.Runtime": "4.1.0", - "System.Runtime.Handles": "4.0.1" - } - }, - "System.Security.AccessControl": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "5.0.0", - "System.Security.Principal.Windows": "5.0.0" - } - }, - "System.Security.Principal.Windows": { - "type": "Transitive", - "resolved": "5.0.0", - "contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" - }, - "System.Text.Encoding": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Text.Encoding.CodePages": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "ZFCILZuOvtKPauZ/j/swhvw68ZRi9ATCfvGbk1QfydmcXBkIWecWKn/250UH7rahZ5OoDBaiAudJtPvLwzw85A==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Encoding.Extensions": { - "type": "Transitive", - "resolved": "4.0.11", - "contentHash": "jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0", - "System.Text.Encoding": "4.0.11" - } - }, - "System.Text.Encodings.Web": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "Vg8eB5Tawm1IFqj4TVK1czJX89rhFxJo9ELqc/Eiq0eXy13RK00eubyU6TJE6y+GQXjyV5gSfiewDUZjQgSE0w==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0" - } - }, - "System.Text.Json": { - "type": "Transitive", - "resolved": "6.0.7", - "contentHash": "/Tf/9XjprpHolbcDOrxsKVYy/mUG/FS7aGd9YUgBVEiHeQH4kAE0T1sMbde7q6B5xcrNUsJ5iW7D1RvHudQNqA==", - "dependencies": { - "System.Runtime.CompilerServices.Unsafe": "6.0.0", - "System.Text.Encodings.Web": "6.0.0" - } - }, - "System.Threading": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", - "dependencies": { - "System.Runtime": "4.3.0", - "System.Threading.Tasks": "4.3.0" - } - }, - "System.Threading.Channels": { - "type": "Transitive", - "resolved": "6.0.0", - "contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q==" - }, - "System.Threading.Tasks": { - "type": "Transitive", - "resolved": "4.3.0", - "contentHash": "LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.1.0", - "Microsoft.NETCore.Targets": "1.1.0", - "System.Runtime": "4.3.0" - } - }, - "System.Threading.Timer": { - "type": "Transitive", - "resolved": "4.0.1", - "contentHash": "saGfUV8uqVW6LeURiqxcGhZ24PzuRNaUBtbhVeuUAvky1naH395A/1nY0P2bWvrw/BreRtIB/EzTDkGBpqCwEw==", - "dependencies": { - "Microsoft.NETCore.Platforms": "1.0.1", - "Microsoft.NETCore.Targets": "1.0.1", - "System.Runtime": "4.1.0" - } - }, - "System.ValueTuple": { - "type": "Transitive", - "resolved": "4.5.0", - "contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ==" - }, - "ZstdSharp.Port": { - "type": "Transitive", - "resolved": "0.6.2", - "contentHash": "jPao/LdUNLUz8rn3H1D8W7wQbZsRZM0iayvWI4xGejJg3XJHT56gcmYdgmCGPdJF1UEBqUjucCRrFB+4HbJsbw==" - }, - "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.common.configuration": { - "type": "Project", - "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", - "Monai.Deploy.Storage": "[0.2.18, )" - } - }, - "monai.deploy.workflowmanager.common.miscellaneous": { - "type": "Project", - "dependencies": { - "Monai.Deploy.WorkflowManager.Common.Configuration": "[1.0.0, )", - "fo-dicom": "[5.1.1, )" - } - }, - "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.contracts": { - "type": "Project", - "dependencies": { - "Monai.Deploy.Messaging": "[1.0.3, )", - "Mongo.Migration": "[3.1.4, )", - "MongoDB.Bson": "[2.21.0, )" - } - }, - "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.21.0, )" - } - }, - "monai.deploy.workflowmanager.logging": { - "type": "Project", - "dependencies": { - "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )" - } - }, - "monai.deploy.workflowmanager.payloadlistener": { - "type": "Project", - "dependencies": { - "Monai.Deploy.WorkflowManager.Common.Configuration": "[1.0.0, )", - "Monai.Deploy.WorkflowManager.Common.Miscellaneous": "[1.0.0, )", - "Monai.Deploy.WorkflowManager.Contracts": "[1.0.0, )", - "Monai.Deploy.WorkflowManager.Logging": "[1.0.0, )", - "Monai.Deploy.WorkloadManager.WorkfowExecuter": "[1.0.0, )" - } - }, - "monai.deploy.workflowmanager.storage": { - "type": "Project", - "dependencies": { - "Monai.Deploy.Storage": "[0.2.18, )", - "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.Common.Configuration": "[1.0.0, )", - "Monai.Deploy.WorkflowManager.Common.Miscellaneous": "[1.0.0, )", - "Monai.Deploy.WorkflowManager.ConditionsResolver": "[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.Storage": "[1.0.0, )" - } - } - } - } -} \ No newline at end of file diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index b1426b85c..a1072c10f 100644 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -2955,6 +2955,85 @@ public async Task ProcessTaskUpdate_Timout_Sends_Sets_Task_Status() var response = await WorkflowExecuterService.ProcessTaskUpdate(updateEvent); _workflowInstanceRepository.Verify(r => r.UpdateTaskStatusAsync(workflowInstance.Id, "pizza", TaskExecutionStatus.Failed), Times.Once); } + [Fact] + public async Task ArtifactReceveid_Valid_ReturnesTrue() + { + var TaskId = Guid.NewGuid().ToString(); + var WorkflowId = Guid.NewGuid().ToString(); + var workflowInstanceId = Guid.NewGuid().ToString(); + var artifactEvent = new ArtifactsReceivedEvent + { + Bucket = "testbucket", + DataTrigger = new DataOrigin { Source = "aetitle", Destination = "aetitle" }, + CorrelationId = Guid.NewGuid().ToString(), + Timestamp = DateTime.UtcNow, + WorkflowInstanceId = workflowInstanceId, + TaskId = TaskId + }; + + + + var workflows = new List + { + new WorkflowRevision + { + Id = Guid.NewGuid().ToString(), + WorkflowId = WorkflowId, + Revision = 1, + Workflow = new Workflow + { + Name = "Workflowname", + Description = "Workflowdesc", + Version = "1", + InformaticsGateway = new InformaticsGateway + { + AeTitle = "aetitle" + }, + Tasks = new TaskObject[] + { + new TaskObject { + Id = TaskId, + Type = "type", + Description = "outgoing", + TaskDestinations = new TaskDestination[] { new TaskDestination { Name = "task2" } } + }, + new TaskObject { + Id = "task2", + Type = "type", + Description = "returning", + } + } + } + } + }; + var workflowInstance = new WorkflowInstance + { + Id = workflowInstanceId, + BucketId = "BucketId", + PayloadId = "PayloadId", + WorkflowId = WorkflowId, + Tasks = new List + { + new TaskExecution{ + TaskId = TaskId, + } + } + }; + + //_workflowRepository.Setup(w => w.GetWorkflowsByAeTitleAsync(It.IsAny>())).ReturnsAsync(workflows); + //_workflowRepository.Setup(w => w.GetWorkflowsForWorkflowRequestAsync(It.IsAny(), It.IsAny())).ReturnsAsync(workflows); + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync(workflows[0].WorkflowId)).ReturnsAsync(workflows[0]); + //_workflowInstanceRepository.Setup(w => w.CreateAsync(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); + _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(workflowInstanceId)).ReturnsAsync(workflowInstance); + _workflowInstanceRepository.Setup(w => w.UpdateTasksAsync(It.IsAny(), It.IsAny>())).ReturnsAsync(true); + var result = await WorkflowExecuterService.ProcessArtifactReceived(artifactEvent); + + _messageBrokerPublisherService.Verify(w => w.Publish(_configuration.Value.Messaging.Topics.TaskDispatchRequest, It.IsAny()), Times.Once()); + + Assert.True(result); + } } #pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type. } diff --git a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json index b2f0fc6cd..4221e8991 100755 --- a/tests/UnitTests/WorkflowManager.Tests/packages.lock.json +++ b/tests/UnitTests/WorkflowManager.Tests/packages.lock.json @@ -511,7 +511,7 @@ "Monai.Deploy.Messaging": { "type": "Transitive", "resolved": "1.0.3", - "contentHash": "PwlkTi6UIc2EEZhw/+3/0Y9/1AkFR+SKf78f0SGtrqMIlOBgM8qIMCtf5l8qs8QKXkcETexfjVQD21oxQC8Ung==", + "contentHash": "DoQrTyztAGmOafiPNhxZ44D50Qcbqv4W94N9LxofyhW2NgSqMOKMbS+6FcomMsCKlLC1E3dyoYdZF8GFunwKUw==", "dependencies": { "Ardalis.GuardClauses": "4.1.1", "Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21", From ffe1282eda2f350212e550521e84644af0b66315 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Mon, 16 Oct 2023 15:34:13 +0100 Subject: [PATCH 10/21] updated ProcessArtifactReceived Signed-off-by: Lillie Dae --- .../Logging/Log.700000.Artifact.cs | 7 ++ .../Services/WorkflowExecuterService.cs | 99 +++++++++++++++++-- 2 files changed, 96 insertions(+), 10 deletions(-) diff --git a/src/WorkflowManager/Logging/Log.700000.Artifact.cs b/src/WorkflowManager/Logging/Log.700000.Artifact.cs index 0eceb1e9e..dec3ec24e 100644 --- a/src/WorkflowManager/Logging/Log.700000.Artifact.cs +++ b/src/WorkflowManager/Logging/Log.700000.Artifact.cs @@ -44,5 +44,12 @@ public static partial class Log [LoggerMessage(EventId = 700007, Level = LogLevel.Information, Message = "Task Dispatch resolved successfully output artifacts: PayloadId: {payloadId}, TaskId: {taskId}, WorkflowInstanceId: {workflowInstanceId}, WorkflowRevisionId: {workflowRevisionId}, output artifact object: {pathOutputArtifacts}")] public static partial void LogGeneralTaskDispatchInformation(this ILogger logger, string payloadId, string taskId, string workflowInstanceId, string workflowRevisionId, string pathOutputArtifacts); + + [LoggerMessage(EventId = 700008, Level = LogLevel.Warning, Message = "Unexpected Artifacts output artifacts: PayloadId: {payloadId}, TaskId: {taskId}, WorkflowInstanceId: {workflowInstanceId}, WorkflowRevisionId: {workflowRevisionId}, output artifact object: {pathOutputArtifacts}")] + public static partial void UnexpectedArtifactsReceived(this ILogger logger, string taskId, string workflowInstanceId, string unexpectedArtifacts); + + [LoggerMessage(EventId = 700009, Level = LogLevel.Debug, Message = "Mandatory output artifacts for task {taskId} are missing. waiting for remaining artifacts... {missingArtifacts}")] + public static partial void MandatoryOutputArtifactsMissingForTask(this ILogger logger, string taskId, string missingArtifacts); + } } diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index c68a3e097..c7fb8f19f 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -175,19 +175,98 @@ public async Task ProcessArtifactReceived(ArtifactsReceivedEvent message) { Guard.Against.Null(message, nameof(message)); - var instance = await _workflowInstanceRepository.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId!); - if (instance is not null) + var workflowInstanceId = message.WorkflowInstanceId; + var taskId = message.TaskId; + // As Workflow Manager receives ArtifactsReceivedEvent, it will need logic to determine whether to dispatch the next task. + // The logic will need to match the OutputArtifacts (Expected Outputs) against the Results dictionary (TBC). + // Upon consuming an ArtifactsReceivedEvent: + // Add the artifact to the Results dict + // Match the type on the ArtifactsReceivedEvent to the expected output by type to get the name + // Compare the Results dict with the OutputArtifacts + // If all mandatory artifacts have been received then dispatch next task and mark task as Passed + // If not all mandatory artifacts have been received, wait for remaining artifacts + // If task times out without receiving all mandatory artifacts then mark task as Failed + + if (string.IsNullOrWhiteSpace(workflowInstanceId) || string.IsNullOrWhiteSpace(taskId)) { - var task = instance.Tasks.First(t => t.TaskId == message.TaskId!); - if (task is not null) - { - var workflow = await _workflowRepository.GetByWorkflowIdAsync(instance.WorkflowId); - await HandleTaskDestinations(instance, workflow, task, message.CorrelationId); - return true; - } + return false; + } + + var workflowInstance = await _workflowInstanceRepository.GetByWorkflowInstanceIdAsync(workflowInstanceId).ConfigureAwait(false); + if (workflowInstance is null) + { + _logger.WorkflowInstanceNotFound(workflowInstanceId); + return false; + } + + var workflowTemplate = await _workflowRepository.GetByWorkflowIdAsync(workflowInstance.WorkflowId) + .ConfigureAwait(false); + + if (workflowTemplate is null) + { + _logger.WorkflowNotFound(workflowInstanceId); + return false; + } + + var taskTemplate = workflowTemplate.Workflow?.Tasks.FirstOrDefault(t => t.Id == taskId); + if (taskTemplate is null) + { + _logger.TaskNotFoundInWorkfow(message.PayloadId.ToString(), taskId, workflowTemplate.Id); + return false; + } + // Create artifactsRepository + // { + // recievedArtifacts: { taskTemplate.Artifacts.Output.Where(a => a.Type), recieved: DateTime, path: string } + // //WorkflowInstance + // //TaskId + // } + // Get all artifacts from repo. + // Save it straight away + var requiredArtifacts = taskTemplate.Artifacts.Output.Where(a => a.Mandatory).Select(a => a.Type); + var receivedArtifacts = message.Artifacts.Select(a => a.Type).ToList(); + var missingArtifacts = requiredArtifacts.Except(receivedArtifacts).ToList(); + var allArtifacts = taskTemplate.Artifacts.Output.Select(a => a.Type); + var unexpectedArtifacts = receivedArtifacts.Except(allArtifacts).ToList(); + + if (unexpectedArtifacts.Any()) + { + _logger.UnexpectedArtifactsReceived(taskId, workflowInstanceId, string.Join(',', unexpectedArtifacts)); } - return false; + if (!missingArtifacts.Any()) + { + return await AllRequiredArtifactsReceivedAsync(message, workflowInstance, taskId, workflowInstanceId, workflowTemplate).ConfigureAwait(false); + } + + _logger.MandatoryOutputArtifactsMissingForTask(taskId, string.Join(',', missingArtifacts)); + return true; + } + + private async Task AllRequiredArtifactsReceivedAsync(ArtifactsReceivedEvent message, WorkflowInstance workflowInstance, + string taskId, string workflowInstanceId, WorkflowRevision workflowTemplate) + { + var taskExecution = workflowInstance.Tasks.FirstOrDefault(t => t.TaskId == taskId); + + if (taskExecution is null) + { + _logger.TaskNotFoundInWorkfowInstance(taskId, workflowInstanceId); + return false; + } + + await _workflowInstanceRepository.UpdateTaskStatusAsync(workflowInstanceId, taskId, + TaskExecutionStatus.Succeeded).ConfigureAwait(false); + + // Dispatch Task + var taskDispatchedResult = + await HandleTaskDestinations(workflowInstance, workflowTemplate, taskExecution, message.CorrelationId).ConfigureAwait(false); + + if (taskDispatchedResult is false) + { + _logger.LogTaskDispatchFailure(message.PayloadId.ToString(), taskId, workflowInstanceId, workflowTemplate.WorkflowId, JsonConvert.SerializeObject(message.Artifacts)); + return false; + } + + return true; } public async Task ProcessFirstWorkflowTask(WorkflowInstance workflowInstance, string correlationId, Payload payload) From 7c9554f9be5637db1aa56f22c71a784b18ae4bac Mon Sep 17 00:00:00 2001 From: Neil South Date: Mon, 16 Oct 2023 16:08:05 +0100 Subject: [PATCH 11/21] small fixups Signed-off-by: Neil South --- src/WorkflowManager/Logging/Log.700000.Artifact.cs | 2 +- .../Services/WorkflowExecuterServiceTests.cs | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/WorkflowManager/Logging/Log.700000.Artifact.cs b/src/WorkflowManager/Logging/Log.700000.Artifact.cs index dec3ec24e..215a043be 100644 --- a/src/WorkflowManager/Logging/Log.700000.Artifact.cs +++ b/src/WorkflowManager/Logging/Log.700000.Artifact.cs @@ -45,7 +45,7 @@ public static partial class Log [LoggerMessage(EventId = 700007, Level = LogLevel.Information, Message = "Task Dispatch resolved successfully output artifacts: PayloadId: {payloadId}, TaskId: {taskId}, WorkflowInstanceId: {workflowInstanceId}, WorkflowRevisionId: {workflowRevisionId}, output artifact object: {pathOutputArtifacts}")] public static partial void LogGeneralTaskDispatchInformation(this ILogger logger, string payloadId, string taskId, string workflowInstanceId, string workflowRevisionId, string pathOutputArtifacts); - [LoggerMessage(EventId = 700008, Level = LogLevel.Warning, Message = "Unexpected Artifacts output artifacts: PayloadId: {payloadId}, TaskId: {taskId}, WorkflowInstanceId: {workflowInstanceId}, WorkflowRevisionId: {workflowRevisionId}, output artifact object: {pathOutputArtifacts}")] + [LoggerMessage(EventId = 700008, Level = LogLevel.Warning, Message = "Unexpected Artifacts output artifacts: TaskId: {taskId}, WorkflowInstanceId: {workflowInstanceId}, output artifact object: {unexpectedArtifacts}")] public static partial void UnexpectedArtifactsReceived(this ILogger logger, string taskId, string workflowInstanceId, string unexpectedArtifacts); [LoggerMessage(EventId = 700009, Level = LogLevel.Debug, Message = "Mandatory output artifacts for task {taskId} are missing. waiting for remaining artifacts... {missingArtifacts}")] diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index a1072c10f..19ef12e09 100644 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -89,7 +89,7 @@ public WorkflowExecuterServiceTests() DicomAgents = new DicomAgentConfiguration { DicomWebAgentName = "monaidicomweb" } }, MigExternalAppPlugins = new List { { "examplePlugin" } }.ToArray() - }) ; + }); _storageConfiguration = Options.Create(new StorageServiceConfiguration() { Settings = new Dictionary { { "bucket", "testbucket" }, { "endpoint", "localhost" }, { "securedConnection", "False" } } }); @@ -3019,13 +3019,8 @@ public async Task ArtifactReceveid_Valid_ReturnesTrue() } } }; - - //_workflowRepository.Setup(w => w.GetWorkflowsByAeTitleAsync(It.IsAny>())).ReturnsAsync(workflows); - //_workflowRepository.Setup(w => w.GetWorkflowsForWorkflowRequestAsync(It.IsAny(), It.IsAny())).ReturnsAsync(workflows); - _workflowRepository.Setup(w => w.GetByWorkflowIdAsync(workflows[0].WorkflowId)).ReturnsAsync(workflows[0]); - //_workflowInstanceRepository.Setup(w => w.CreateAsync(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); + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync(workflows[0].WorkflowId)).ReturnsAsync(workflows[0]); _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(workflowInstanceId)).ReturnsAsync(workflowInstance); _workflowInstanceRepository.Setup(w => w.UpdateTasksAsync(It.IsAny(), It.IsAny>())).ReturnsAsync(true); var result = await WorkflowExecuterService.ProcessArtifactReceived(artifactEvent); From f7dfdaf6d0e7f3a10b3508e3f6843a356de53d17 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Mon, 16 Oct 2023 17:00:12 +0100 Subject: [PATCH 12/21] added artifact repo Signed-off-by: Lillie Dae --- .../Interfaces/IArtifactsRepository.cs | 52 +++++++ .../Repositories/ArtifactsRepository.cs | 144 ++++++++++++++++++ .../Database/Repositories/RepositoryBase.cs | 8 +- .../Services/WorkflowExecuterService.cs | 26 ++-- .../Extentions/WorkflowExecutorExtensions.cs | 2 + .../Services/WorkflowExecuterServiceTests.cs | 2 - 6 files changed, 217 insertions(+), 17 deletions(-) create mode 100644 src/WorkflowManager/Database/Interfaces/IArtifactsRepository.cs create mode 100644 src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs diff --git a/src/WorkflowManager/Database/Interfaces/IArtifactsRepository.cs b/src/WorkflowManager/Database/Interfaces/IArtifactsRepository.cs new file mode 100644 index 000000000..f3217ef64 --- /dev/null +++ b/src/WorkflowManager/Database/Interfaces/IArtifactsRepository.cs @@ -0,0 +1,52 @@ +/* + * Copyright 2022 MONAI Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System.Collections.Generic; +using System.Threading.Tasks; +using Artifact = Monai.Deploy.Messaging.Common.Artifact; + +namespace Monai.Deploy.WorkflowManager.Common.Database.Repositories +{ + public interface IArtifactsRepository + { + /// + /// Gets All ArtifactsReceivedItems by workflowInstance and taskId. + /// + /// + /// + /// + Task> GetAllAsync(string workflowInstance, string taskId); + + /// + /// Adds an item to the ArtifactsReceivedItems collection. + /// + /// + /// + Task AddItemAsync(ArtifactReceivedItems item); + + /// + /// Adds an item to the ArtifactsReceivedItems collection. + /// + /// + /// + /// + /// + Task AddItemAsync(string workflowInstanceId, string taskId, List artifactsOutputs); + + Task AddOrUpdateItemAsync(string workflowInstanceId, string taskId, + IEnumerable artifactsOutputs); + } +} diff --git a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs new file mode 100644 index 000000000..f5e3588f0 --- /dev/null +++ b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs @@ -0,0 +1,144 @@ +/* + * Copyright 2022 MONAI Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using Monai.Deploy.WorkflowManager.Common.Database.Options; +using MongoDB.Driver; +using Artifact = Monai.Deploy.Messaging.Common.Artifact; + +namespace Monai.Deploy.WorkflowManager.Common.Database.Repositories +{ + public class ArtifactReceivedDetails : Artifact + { + /// + /// Gets or Sets LastReceived. + /// + public DateTime? Received { get; set; } = null; + } + + public class ArtifactReceivedItems + { + /// + /// Gets or Sets the Id. + /// + public double Id { get; set; } + + /// + /// Gets or Sets WorkflowInstanceId. + /// + public string WorkflowInstanceId { get; set; } = string.Empty; + + /// + /// Gets or Sets TaskId. + /// + public string TaskId { get; set; } = string.Empty; + + /// + /// Gets or Sets Artifacts. + /// + public List Artifacts { get; set; } = new(); + } + + public class ArtifactsRepository : IArtifactsRepository + { + private readonly ILogger _logger; + private readonly IMongoCollection _artifactReceivedItemsCollection; + + public ArtifactsRepository( + IMongoClient client, + IOptions bookStoreDatabaseSettings, + ILogger logger) + { + if (client == null) + { + throw new ArgumentNullException(nameof(client)); + } + + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); + var mongoDatabase = client.GetDatabase(bookStoreDatabaseSettings.Value.DatabaseName); + _artifactReceivedItemsCollection = mongoDatabase.GetCollection("ArtifactReceivedItems"); + } + + public async Task> GetAllAsync(string workflowInstance, string taskId) + { + var result = await _artifactReceivedItemsCollection.FindAsync(a => a.WorkflowInstanceId == workflowInstance && a.TaskId == taskId).ConfigureAwait(false); + return await result.ToListAsync().ConfigureAwait(false); + } + + public Task AddItemAsync(ArtifactReceivedItems item) + { + return _artifactReceivedItemsCollection.InsertOneAsync(item); + } + + public Task AddItemAsync(string workflowInstanceId, string taskId, List artifactsOutputs) + { + var artifacts = artifactsOutputs.Select(a => new ArtifactReceivedDetails() + { + Path = a.Path, + Type = a.Type, + Received = DateTime.UtcNow + }); + + var item = new ArtifactReceivedItems() + { + WorkflowInstanceId = workflowInstanceId, + TaskId = taskId, + Artifacts = artifacts.ToList() + }; + + return _artifactReceivedItemsCollection.InsertOneAsync(item); + } + + public async Task AddOrUpdateItemAsync(string workflowInstanceId, string taskId, + IEnumerable artifactsOutputs) + { + var artifacts = artifactsOutputs.Select(a => new ArtifactReceivedDetails() + { + Path = a.Path, + Type = a.Type, + Received = DateTime.UtcNow + }); + + var item = new ArtifactReceivedItems() + { + WorkflowInstanceId = workflowInstanceId, + TaskId = taskId, + Artifacts = artifacts.ToList() + }; + + var result = await _artifactReceivedItemsCollection + .FindAsync(a => a.WorkflowInstanceId == workflowInstanceId && a.TaskId == taskId).ConfigureAwait(false); + var existing = await result.FirstOrDefaultAsync().ConfigureAwait(false); + + if (existing == null) + { + await _artifactReceivedItemsCollection.InsertOneAsync(item).ConfigureAwait(false); + } + else + { + var update = Builders.Update.Set(a => a.Artifacts, item.Artifacts); + await _artifactReceivedItemsCollection + .UpdateOneAsync(a => a.WorkflowInstanceId == workflowInstanceId && a.TaskId == taskId, update) + .ConfigureAwait(false); + } + } + } +} diff --git a/src/WorkflowManager/Database/Repositories/RepositoryBase.cs b/src/WorkflowManager/Database/Repositories/RepositoryBase.cs index e4f120d55..e36f126fb 100644 --- a/src/WorkflowManager/Database/Repositories/RepositoryBase.cs +++ b/src/WorkflowManager/Database/Repositories/RepositoryBase.cs @@ -24,8 +24,8 @@ namespace Monai.Deploy.WorkflowManager.Common.Database.Repositories { public abstract class RepositoryBase { - public static async Task CountAsync(IMongoCollection collection, FilterDefinition? filter) - => await collection.CountDocumentsAsync(filter ?? Builders.Filter.Empty); + public static Task CountAsync(IMongoCollection collection, FilterDefinition? filter) + => collection.CountDocumentsAsync(filter ?? Builders.Filter.Empty); /// /// Get All T that match filters provided. @@ -44,7 +44,7 @@ public static async Task> GetAllAsync(IMongoCollection collection .Skip(skip) .Limit(limit) .Sort(sortFunction) - .ToListAsync(); + .ToListAsync().ConfigureAwait(false); } public static async Task> GetAllAsync(IMongoCollection collection, FilterDefinition filterFunction, SortDefinition sortFunction, int? skip = null, int? limit = null) @@ -54,7 +54,7 @@ public static async Task> GetAllAsync(IMongoCollection collection .Skip(skip) .Limit(limit) .Sort(sortFunction) - .ToListAsync(); + .ToListAsync().ConfigureAwait(false); } } } diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index c7fb8f19f..209b3abaf 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -32,6 +32,7 @@ using Monai.Deploy.WorkflowManager.Common.Contracts.Models; using Monai.Deploy.WorkflowManager.Common.Database; using Monai.Deploy.WorkflowManager.Common.Database.Interfaces; +using Monai.Deploy.WorkflowManager.Common.Database.Repositories; using Monai.Deploy.WorkflowManager.Common.Logging; using Monai.Deploy.WorkflowManager.Common.WorkfowExecuter.Common; using Monai.Deploy.WorkloadManager.WorkfowExecuter.Extensions; @@ -48,6 +49,7 @@ public class WorkflowExecuterService : IWorkflowExecuterService private readonly IMessageBrokerPublisherService _messageBrokerPublisherService; private readonly IConditionalParameterParser _conditionalParameterParser; private readonly ITaskExecutionStatsRepository _taskExecutionStatsRepository; + private readonly IArtifactsRepository _artifactsRepository; private readonly List _migExternalAppPlugins; private readonly IArtifactMapper _artifactMapper; private readonly IStorageService _storageService; @@ -72,7 +74,8 @@ public WorkflowExecuterService( ITaskExecutionStatsRepository taskExecutionStatsRepository, IArtifactMapper artifactMapper, IStorageService storageService, - IPayloadService payloadService) + IPayloadService payloadService, + IArtifactsRepository artifactsRepository) { if (configuration is null) { @@ -97,11 +100,12 @@ public WorkflowExecuterService( _workflowInstanceRepository = workflowInstanceRepository ?? throw new ArgumentNullException(nameof(workflowInstanceRepository)); _workflowInstanceService = workflowInstanceService ?? throw new ArgumentNullException(nameof(workflowInstanceService)); _messageBrokerPublisherService = messageBrokerPublisherService ?? throw new ArgumentNullException(nameof(messageBrokerPublisherService)); - _conditionalParameterParser = conditionalParser ?? throw new ArgumentNullException(nameof(artifactMapper)); + _conditionalParameterParser = conditionalParser ?? throw new ArgumentNullException(nameof(conditionalParser)); _taskExecutionStatsRepository = taskExecutionStatsRepository ?? throw new ArgumentNullException(nameof(taskExecutionStatsRepository)); _artifactMapper = artifactMapper ?? throw new ArgumentNullException(nameof(artifactMapper)); _storageService = storageService ?? throw new ArgumentNullException(nameof(storageService)); _payloadService = payloadService ?? throw new ArgumentNullException(nameof(payloadService)); + _artifactsRepository = artifactsRepository ?? throw new ArgumentNullException(nameof(artifactsRepository)); } public async Task ProcessPayload(WorkflowRequestEvent message, Payload payload) @@ -214,16 +218,16 @@ public async Task ProcessArtifactReceived(ArtifactsReceivedEvent message) _logger.TaskNotFoundInWorkfow(message.PayloadId.ToString(), taskId, workflowTemplate.Id); return false; } - // Create artifactsRepository - // { - // recievedArtifacts: { taskTemplate.Artifacts.Output.Where(a => a.Type), recieved: DateTime, path: string } - // //WorkflowInstance - // //TaskId - // } - // Get all artifacts from repo. - // Save it straight away + + var previouslyReceivedArtifactsFromRepo = await _artifactsRepository.GetAllAsync(workflowInstanceId, taskId).ConfigureAwait(false); + + await _artifactsRepository + .AddOrUpdateItemAsync(workflowInstanceId, taskId, message.Artifacts).ConfigureAwait(false); + + var previouslyReceivedArtifacts = previouslyReceivedArtifactsFromRepo.SelectMany(a => a.Artifacts).Select(a => a.Type).ToList(); + var requiredArtifacts = taskTemplate.Artifacts.Output.Where(a => a.Mandatory).Select(a => a.Type); - var receivedArtifacts = message.Artifacts.Select(a => a.Type).ToList(); + var receivedArtifacts = message.Artifacts.Select(a => a.Type).Concat(previouslyReceivedArtifacts).ToList(); var missingArtifacts = requiredArtifacts.Except(receivedArtifacts).ToList(); var allArtifacts = taskTemplate.Artifacts.Output.Select(a => a.Type); var unexpectedArtifacts = receivedArtifacts.Except(allArtifacts).ToList(); diff --git a/src/WorkflowManager/WorkflowManager/Extentions/WorkflowExecutorExtensions.cs b/src/WorkflowManager/WorkflowManager/Extentions/WorkflowExecutorExtensions.cs index 2d94ec7e5..30e685202 100644 --- a/src/WorkflowManager/WorkflowManager/Extentions/WorkflowExecutorExtensions.cs +++ b/src/WorkflowManager/WorkflowManager/Extentions/WorkflowExecutorExtensions.cs @@ -19,6 +19,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Monai.Deploy.WorkflowManager.Common.ConditionsResolver.Parser; +using Monai.Deploy.WorkflowManager.Common.Database.Repositories; using Monai.Deploy.WorkflowManager.Common.Miscellaneous; using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Interfaces; using Monai.Deploy.WorkflowManager.Common.Miscellaneous.Services; @@ -54,6 +55,7 @@ public static IServiceCollection AddWorkflowExecutor(this IServiceCollection ser services.AddTransient(); services.AddTransient(); + services.AddSingleton(); services.AddSingleton(); services.AddTransient(); services.AddSingleton(); diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index a1072c10f..6bd36018f 100644 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -2971,8 +2971,6 @@ public async Task ArtifactReceveid_Valid_ReturnesTrue() TaskId = TaskId }; - - var workflows = new List { new WorkflowRevision From 8f8781d23284d20fb5eee0b1ac5ca2706c0a9f5b Mon Sep 17 00:00:00 2001 From: Neil South Date: Tue, 17 Oct 2023 09:00:20 +0100 Subject: [PATCH 13/21] fix up tests Signed-off-by: Neil South --- .../Services/WorkflowExecuterServiceTests.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index 026ec1a82..3cd9f1090 100644 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -44,6 +44,7 @@ using Monai.Deploy.WorkflowManager.Common.ConditionsResolver.Parser; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; using Monai.Deploy.WorkloadManager.WorkfowExecuter.Extensions; +using Monai.Deploy.WorkflowManager.Common.Database.Repositories; namespace Monai.Deploy.WorkflowManager.Common.WorkflowExecuter.Tests.Services { @@ -56,6 +57,7 @@ public class WorkflowExecuterServiceTests private readonly Mock> _logger; private readonly Mock _workflowInstanceRepository; private readonly Mock _workflowInstanceService; + private readonly Mock _artifactReceivedRepository; private readonly Mock _messageBrokerPublisherService; private readonly Mock _storageService; private readonly Mock _payloadService; @@ -69,6 +71,7 @@ public class WorkflowExecuterServiceTests public WorkflowExecuterServiceTests() { _workflowRepository = new Mock(); + _artifactReceivedRepository = new Mock(); _artifactMapper = new Mock(); _logger = new Mock>(); _workflowInstanceRepository = new Mock(); @@ -113,7 +116,8 @@ public WorkflowExecuterServiceTests() _taskExecutionStatsRepository.Object, _artifactMapper.Object, _storageService.Object, - _payloadService.Object); + _payloadService.Object, + _artifactReceivedRepository.Object); } [Fact] @@ -140,7 +144,8 @@ public void WorkflowExecuterService_Throw_If_No_Config() _taskExecutionStatsRepository.Object, _artifactMapper.Object, _storageService.Object, - _payloadService.Object)); + _payloadService.Object, + _artifactReceivedRepository.Object)); } @@ -167,7 +172,8 @@ public void WorkflowExecuterService_Throw_If_No_Storage_Config() _taskExecutionStatsRepository.Object, _artifactMapper.Object, _storageService.Object, - _payloadService.Object)); + _payloadService.Object, + _artifactReceivedRepository.Object)); } [Fact] From 9c35e22ca8d56c89e6781c3240f1af79c79e021b Mon Sep 17 00:00:00 2001 From: Neil South Date: Tue, 17 Oct 2023 09:12:52 +0100 Subject: [PATCH 14/21] fix tests Signed-off-by: Neil South --- .../Services/WorkflowExecuterServiceTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index 3cd9f1090..ca7eabe4e 100644 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -2739,7 +2739,7 @@ public async Task ProcessPayload_WithExternalAppComplete_Pauses() } [Fact] - public async Task ProcessPayload_With_WorkflowInstanceId_Continues() + public async Task ArtifactReceived_With_Happy_Path_Continues() { var workflowInstanceId = Guid.NewGuid().ToString(); var correlationId = Guid.NewGuid().ToString(); @@ -2823,18 +2823,17 @@ public async Task ProcessPayload_With_WorkflowInstanceId_Continues() } }; - var payload = new Payload { PatientDetails = new PatientDetails { } }; - _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(payload); - var mess = new WorkflowRequestEvent { WorkflowInstanceId = workflowInstance.Id, TaskId = "coffee" }; + _artifactReceivedRepository.Setup(w => w.GetAllAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new List()); + + var mess = new ArtifactsReceivedEvent { WorkflowInstanceId = workflowInstance.Id, TaskId = "coffee" }; - var response = await WorkflowExecuterService.ProcessPayload(mess, payload); + var response = await WorkflowExecuterService.ProcessArtifactReceived(mess); _messageBrokerPublisherService.Verify(w => w.Publish(_configuration.Value.Messaging.Topics.TaskDispatchRequest, It.IsAny()), Times.Exactly(0)); _taskExecutionStatsRepository.Verify(w => w.UpdateExecutionStatsAsync(It.IsAny(), workflowId, TaskExecutionStatus.Succeeded)); @@ -3027,6 +3026,7 @@ public async Task ArtifactReceveid_Valid_ReturnesTrue() _workflowRepository.Setup(w => w.GetByWorkflowIdAsync(workflows[0].WorkflowId)).ReturnsAsync(workflows[0]); _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(workflowInstanceId)).ReturnsAsync(workflowInstance); _workflowInstanceRepository.Setup(w => w.UpdateTasksAsync(It.IsAny(), It.IsAny>())).ReturnsAsync(true); + _artifactReceivedRepository.Setup(w => w.GetAllAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new List()); var result = await WorkflowExecuterService.ProcessArtifactReceived(artifactEvent); _messageBrokerPublisherService.Verify(w => w.Publish(_configuration.Value.Messaging.Topics.TaskDispatchRequest, It.IsAny()), Times.Once()); From 9b5a5a93c5e6eb072d8b7716204d11d52528afa0 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Tue, 17 Oct 2023 16:06:00 +0100 Subject: [PATCH 15/21] added EventPayloadValidatorTests and WorkflowExecuterServiceTests and minor fixes Signed-off-by: Lillie Dae --- .../Interfaces/IArtifactsRepository.cs | 2 +- .../Repositories/ArtifactsRepository.cs | 8 + .../Extensions/ValidationExtensions.cs | 16 ++ .../Services/EventPayloadRecieverService.cs | 2 +- .../Services/IWorkflowExecuterService.cs | 2 +- .../Services/WorkflowExecuterService.cs | 21 ++- .../EventPayloadRecieverServiceTests.cs | 22 ++- .../Validators/EventPayloadValidatorTests.cs | 99 ++++++++++++ .../Services/WorkflowExecuterServiceTests.cs | 146 ++++++++++++++++-- 9 files changed, 294 insertions(+), 24 deletions(-) diff --git a/src/WorkflowManager/Database/Interfaces/IArtifactsRepository.cs b/src/WorkflowManager/Database/Interfaces/IArtifactsRepository.cs index f3217ef64..3bf7ee7e9 100644 --- a/src/WorkflowManager/Database/Interfaces/IArtifactsRepository.cs +++ b/src/WorkflowManager/Database/Interfaces/IArtifactsRepository.cs @@ -28,7 +28,7 @@ public interface IArtifactsRepository /// /// /// - Task> GetAllAsync(string workflowInstance, string taskId); + Task?> GetAllAsync(string workflowInstance, string taskId); /// /// Adds an item to the ArtifactsReceivedItems collection. diff --git a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs index f5e3588f0..a574aabd1 100644 --- a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs +++ b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs @@ -32,6 +32,14 @@ public class ArtifactReceivedDetails : Artifact /// Gets or Sets LastReceived. /// public DateTime? Received { get; set; } = null; + + public static ArtifactReceivedDetails FromArtifact(Artifact artifact) => + new() + { + Received = DateTime.UtcNow, + Type = artifact.Type, + Path = artifact.Path + }; } public class ArtifactReceivedItems diff --git a/src/WorkflowManager/PayloadListener/Extensions/ValidationExtensions.cs b/src/WorkflowManager/PayloadListener/Extensions/ValidationExtensions.cs index 34b2ba5ab..11a46ae29 100644 --- a/src/WorkflowManager/PayloadListener/Extensions/ValidationExtensions.cs +++ b/src/WorkflowManager/PayloadListener/Extensions/ValidationExtensions.cs @@ -15,6 +15,7 @@ */ using Ardalis.GuardClauses; +using Monai.Deploy.Messaging.Common; using Monai.Deploy.Messaging.Events; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; @@ -53,6 +54,21 @@ public static bool IsValid(this ArtifactsReceivedEvent artifactReceivedMessage, valid &= IsCorrelationIdValid(artifactReceivedMessage.GetType().Name, artifactReceivedMessage.CorrelationId, validationErrors); valid &= IsPayloadIdValid(artifactReceivedMessage.GetType().Name, artifactReceivedMessage.PayloadId.ToString(), validationErrors); valid &= string.IsNullOrEmpty(artifactReceivedMessage.WorkflowInstanceId) is false && string.IsNullOrEmpty(artifactReceivedMessage.TaskId) is false; + valid &= AllArtifactsAreValid(artifactReceivedMessage, validationErrors); + return valid; + } + + private static bool AllArtifactsAreValid(this ArtifactsReceivedEvent artifactReceivedMessage, IList validationErrors) + { + Guard.Against.Null(artifactReceivedMessage, nameof(artifactReceivedMessage)); + + var valid = artifactReceivedMessage.Artifacts.All(a => a.Type != ArtifactType.Unset); + + if (valid is false) + { + var unsetArtifacts = string.Join(',', artifactReceivedMessage.Artifacts.Where(a => a.Type == ArtifactType.Unset).Select(a => a.Path)); + validationErrors.Add($"The following artifacts are have unset artifact types: {unsetArtifacts}"); + } return valid; } diff --git a/src/WorkflowManager/PayloadListener/Services/EventPayloadRecieverService.cs b/src/WorkflowManager/PayloadListener/Services/EventPayloadRecieverService.cs index 4085bc4ff..2e2c49375 100644 --- a/src/WorkflowManager/PayloadListener/Services/EventPayloadRecieverService.cs +++ b/src/WorkflowManager/PayloadListener/Services/EventPayloadRecieverService.cs @@ -205,7 +205,7 @@ public async Task ArtifactReceivePayload(MessageReceivedEventArgs message) return; } - if (!await WorkflowExecuterService.ProcessArtifactReceived(requestEvent)) + if (!await WorkflowExecuterService.ProcessArtifactReceivedAsync(requestEvent)) { Logger.ArtifactReceivedRequeuePayloadCreateError(message.Message.MessageId); await _messageSubscriber.RequeueWithDelay(message.Message); diff --git a/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs index 485aa9ca2..186b7994f 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/IWorkflowExecuterService.cs @@ -54,6 +54,6 @@ public interface IWorkflowExecuterService /// Processes the artifactReceived payload and continue workflow instance. /// /// The workflow request message event. - Task ProcessArtifactReceived(ArtifactsReceivedEvent message); + Task ProcessArtifactReceivedAsync(ArtifactsReceivedEvent message); } } diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index 209b3abaf..c92a5c299 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -175,21 +175,12 @@ public async Task ProcessPayload(WorkflowRequestEvent message, Payload pay return true; } - public async Task ProcessArtifactReceived(ArtifactsReceivedEvent message) + public async Task ProcessArtifactReceivedAsync(ArtifactsReceivedEvent message) { Guard.Against.Null(message, nameof(message)); var workflowInstanceId = message.WorkflowInstanceId; var taskId = message.TaskId; - // As Workflow Manager receives ArtifactsReceivedEvent, it will need logic to determine whether to dispatch the next task. - // The logic will need to match the OutputArtifacts (Expected Outputs) against the Results dictionary (TBC). - // Upon consuming an ArtifactsReceivedEvent: - // Add the artifact to the Results dict - // Match the type on the ArtifactsReceivedEvent to the expected output by type to get the name - // Compare the Results dict with the OutputArtifacts - // If all mandatory artifacts have been received then dispatch next task and mark task as Passed - // If not all mandatory artifacts have been received, wait for remaining artifacts - // If task times out without receiving all mandatory artifacts then mark task as Failed if (string.IsNullOrWhiteSpace(workflowInstanceId) || string.IsNullOrWhiteSpace(taskId)) { @@ -220,7 +211,15 @@ public async Task ProcessArtifactReceived(ArtifactsReceivedEvent message) } var previouslyReceivedArtifactsFromRepo = await _artifactsRepository.GetAllAsync(workflowInstanceId, taskId).ConfigureAwait(false); - + if (previouslyReceivedArtifactsFromRepo is null || previouslyReceivedArtifactsFromRepo.Count == 0) + { + previouslyReceivedArtifactsFromRepo = new List() { new ArtifactReceivedItems() + { + TaskId = taskId, + WorkflowInstanceId = workflowInstanceId, + Artifacts = message.Artifacts.Select(ArtifactReceivedDetails.FromArtifact).ToList() + } }; + } await _artifactsRepository .AddOrUpdateItemAsync(workflowInstanceId, taskId, message.Artifacts).ConfigureAwait(false); diff --git a/tests/UnitTests/PayloadListener.Tests/Services/EventPayloadRecieverServiceTests.cs b/tests/UnitTests/PayloadListener.Tests/Services/EventPayloadRecieverServiceTests.cs index 3d0c385a6..07a21d24b 100644 --- a/tests/UnitTests/PayloadListener.Tests/Services/EventPayloadRecieverServiceTests.cs +++ b/tests/UnitTests/PayloadListener.Tests/Services/EventPayloadRecieverServiceTests.cs @@ -328,13 +328,33 @@ public void ArtifactReceivedPayload_WorkFlowRequestIsValid_MessageSubscriberAckn _mockEventPayloadValidator.Setup(p => p.ValidateArtifactReceived(It.IsAny())).Returns(true); - _workflowExecuterService.Setup(p => p.ProcessArtifactReceived(It.IsAny())).ReturnsAsync(true); + _workflowExecuterService.Setup(p => p.ProcessArtifactReceivedAsync(It.IsAny())).ReturnsAsync(true); _eventPayloadReceiverService.ArtifactReceivePayload(message); _mockMessageBrokerSubscriberService.Verify(p => p.Acknowledge(It.IsAny()), Times.Once()); } + [Test] + public void ArtifactReceivedPayload_FailsToProcessArtifactReceived_MessageIsRejectedAndRequeued() + { + // Arrange + var message = CreateMessageReceivedEventArgs(new string[] { "destination" }); + + _mockEventPayloadValidator.Setup(p => p.ValidateArtifactReceived(It.IsAny())).Returns(true); + _workflowExecuterService.Setup(p => p.ProcessArtifactReceivedAsync(It.IsAny())).ReturnsAsync(false); + + // Act + _eventPayloadReceiverService.ArtifactReceivePayload(message); + + // Assert + _mockEventPayloadValidator.Verify(x => x.ValidateArtifactReceived(It.IsAny()), Times.Once); + _mockEventPayloadValidator.VerifyNoOtherCalls(); + + _mockMessageBrokerSubscriberService.Verify(p => p.RequeueWithDelay(It.IsAny()), Times.Once()); + _mockMessageBrokerSubscriberService.VerifyNoOtherCalls(); + } + private static MessageReceivedEventArgs CreateMessageReceivedEventArgs(string[] destinations) { var exportRequestMessage = new ExportRequestEvent diff --git a/tests/UnitTests/PayloadListener.Tests/Validators/EventPayloadValidatorTests.cs b/tests/UnitTests/PayloadListener.Tests/Validators/EventPayloadValidatorTests.cs index 127c36d10..00c159356 100644 --- a/tests/UnitTests/PayloadListener.Tests/Validators/EventPayloadValidatorTests.cs +++ b/tests/UnitTests/PayloadListener.Tests/Validators/EventPayloadValidatorTests.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; using Microsoft.Extensions.Logging; +using Monai.Deploy.Messaging.Common; using Monai.Deploy.Messaging.Events; using Monai.Deploy.WorkflowManager.PayloadListener.Validators; using Moq; @@ -237,6 +238,104 @@ public void ValidateExportComplete_ExportCompleteEventIsNull_ThrowsArgumentNullE }); } + [Test] + public void ValidateArtifactsReceived_ArtifactsReceivedEventIsValid_ReturnsTrue() + { + var artifacts = new List + { + new Artifact() + { + Path = "testpath", + Type = ArtifactType.Folder + }, + new Artifact() + { + Path = "testdicompath", + Type = ArtifactType.CT + } + }; + var artifactsReceivedEvent = CreateTestArtifactsReceivedEvent(artifacts); + + var result = _eventPayloadValidator!.ValidateArtifactReceived(artifactsReceivedEvent); + + Assert.IsTrue(result); + } + + [Test] + public void ValidateArtifactsReceived_ArtifactsReceivedEventIsValidWithWorkflows_ReturnsTrue() + { + var artifacts = new List + { + new Artifact() + { + Path = "testpath", + Type = ArtifactType.Folder + }, + new Artifact() + { + Path = "testdicompath", + Type = ArtifactType.CT + } + }; + var workflows = new List { "123", "234", "345", "456" }; + var artifactsReceivedEvent = CreateTestArtifactsReceivedEvent(artifacts, workflows); + + var result = _eventPayloadValidator!.ValidateArtifactReceived(artifactsReceivedEvent); + + Assert.IsTrue(result); + } + + [Test] + public void ValidateArtifactsReceived_ArtifactsReceivedEventIsInvalid_ReturnsFalse() + { + var artifacts = new List + { + new Artifact() + { + Path = "testpath", + Type = ArtifactType.Folder + }, + new Artifact() + { + Path = "testdicompath", + Type = ArtifactType.Unset + } + }; + var artifactsReceivedEvent = CreateTestArtifactsReceivedEvent(artifacts); + + var result = _eventPayloadValidator!.ValidateArtifactReceived(artifactsReceivedEvent); + + Assert.IsFalse(result); + } + + private static ArtifactsReceivedEvent CreateTestArtifactsReceivedEvent(List artifacts, + IEnumerable? workflows = null) + { + var artifactsReceivedEvent = new ArtifactsReceivedEvent + { + DataTrigger = new DataOrigin() + { + Source = "source", + Destination = "destination", + ArtifactType = ArtifactType.CT + }, + Bucket = "Bucket", + PayloadId = Guid.NewGuid(), + CorrelationId = Guid.NewGuid().ToString(), + Timestamp = DateTime.UtcNow, + + WorkflowInstanceId = Guid.NewGuid().ToString(), + TaskId = Guid.NewGuid().ToString(), + Artifacts = artifacts + }; + + if (workflows is not null) + { + artifactsReceivedEvent.Workflows = workflows; + } + return artifactsReceivedEvent; + } + private static WorkflowRequestEvent CreateWorkflowRequestMessageWithNoWorkFlow() { return new WorkflowRequestEvent diff --git a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs index ca7eabe4e..ea1df2d5f 100644 --- a/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs +++ b/tests/UnitTests/WorkflowExecuter.Tests/Services/WorkflowExecuterServiceTests.cs @@ -25,6 +25,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.Storage.API; using Monai.Deploy.Storage.Configuration; @@ -45,6 +46,7 @@ using Monai.Deploy.WorkflowManager.Common.Contracts.Models; using Monai.Deploy.WorkloadManager.WorkfowExecuter.Extensions; using Monai.Deploy.WorkflowManager.Common.Database.Repositories; +using Artifact = Monai.Deploy.WorkflowManager.Common.Contracts.Models.Artifact; namespace Monai.Deploy.WorkflowManager.Common.WorkflowExecuter.Tests.Services { @@ -176,6 +178,131 @@ public void WorkflowExecuterService_Throw_If_No_Storage_Config() _artifactReceivedRepository.Object)); } + [Fact] + public async Task ProcessArtifactReceived_WhenMessageIsNull_ThrowsArgumentNullException() + { + await Assert.ThrowsAsync(() => WorkflowExecuterService.ProcessArtifactReceivedAsync(null)); + } + + [Fact] + public async Task ProcessArtifactReceived_WhenWorkflowInstanceIdIsNull_ReturnsFalse() + { + var message = new ArtifactsReceivedEvent { }; + var result = await WorkflowExecuterService.ProcessArtifactReceivedAsync(message); + Assert.False(result); + } + + [Fact] + public async Task ProcessArtifactReceived_WhenTaskIdIsNull_ReturnsFalse() + { + var message = new ArtifactsReceivedEvent { WorkflowInstanceId = "123" }; + var result = await WorkflowExecuterService.ProcessArtifactReceivedAsync(message); + Assert.False(result); + } + + [Fact] + public async Task ProcessArtifactReceived_WhenWorkflowInstanceRepositoryReturnsNull_ReturnsFalse() + { + var message = new ArtifactsReceivedEvent { WorkflowInstanceId = "123", TaskId = "456" }; + _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId))! + .ReturnsAsync((WorkflowInstance)null!); + var result = await WorkflowExecuterService.ProcessArtifactReceivedAsync(message); + Assert.False(result); + } + + [Fact] + public async Task ProcessArtifactReceived_WhenWorkflowRepositoryReturnsNull_ReturnsFalse() + { + var message = new ArtifactsReceivedEvent { WorkflowInstanceId = "123", TaskId = "456" }; + _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId))! + .ReturnsAsync(new WorkflowInstance { WorkflowId = "789" }); + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync("789"))! + .ReturnsAsync((WorkflowRevision)null!); + var result = await WorkflowExecuterService.ProcessArtifactReceivedAsync(message); + Assert.False(result); + } + + // ProcessArtifactReceived workflowTemplate.Workflow?.Tasks.FirstOrDefault returns null + [Fact] + public async Task ProcessArtifactReceived_WhenWorkflowTemplateReturnsNull_ReturnsFalse() + { + var message = new ArtifactsReceivedEvent { WorkflowInstanceId = "123", TaskId = "456" }; + _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId))! + .ReturnsAsync(new WorkflowInstance { WorkflowId = "789" }); + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync("789"))! + .ReturnsAsync(new WorkflowRevision { Workflow = new Workflow { Tasks = new [] + { new TaskObject() { Id = "not456" } }} }); + var result = await WorkflowExecuterService.ProcessArtifactReceivedAsync(message); + Assert.False(result); + } + + [Fact] + public async Task ProcessArtifactReceived_WhenStillHasMissingArtifacts_ReturnsTrue() + { + var message = new ArtifactsReceivedEvent { WorkflowInstanceId = "123", TaskId = "456", + Artifacts = new List() { new Messaging.Common.Artifact() { Type = ArtifactType.CT } } }; + var workflowInstance = new WorkflowInstance { WorkflowId = "789", Tasks = new List() + { new TaskExecution() { TaskId = "456" } } }; + _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId))! + .ReturnsAsync(workflowInstance); + var templateArtifacts = new OutputArtifact[] { new OutputArtifact() { Type = ArtifactType.CT }, new OutputArtifact() { Type = ArtifactType.DG } }; + var taskTemplate = new TaskObject() { Id = "456", Artifacts = new ArtifactMap { Output = templateArtifacts } }; + var workflowTemplate = new WorkflowRevision { Workflow = new Workflow { Tasks = new [] { taskTemplate }} }; + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync("789"))! + .ReturnsAsync(workflowTemplate); + _artifactReceivedRepository.Setup(r => r.GetAllAsync(workflowInstance.WorkflowId, taskTemplate.Id)) + .ReturnsAsync((List?)null); + + var result = await WorkflowExecuterService.ProcessArtifactReceivedAsync(message); + Assert.True(result); + } + + [Fact] + public async Task ProcessArtifactReceived_WhenAllArtifactsReceivedArtifactsButTaskExecNotFound_ReturnsFalse() + { + //incoming artifacts + var message = new ArtifactsReceivedEvent { WorkflowInstanceId = "123", TaskId = "456", + Artifacts = new List() { new Messaging.Common.Artifact() { Type = ArtifactType.CT } } }; + var workflowInstance = new WorkflowInstance { WorkflowId = "789", Tasks = new List() + { new TaskExecution() { TaskId = "not456" } } }; + _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId))! + .ReturnsAsync(workflowInstance); + //expected artifacts + var templateArtifacts = new OutputArtifact[] + { + new OutputArtifact() { Type = ArtifactType.CT }, + }; + var taskTemplate = new TaskObject() { Id = "456", Artifacts = new ArtifactMap { Output = templateArtifacts } }; + var workflowTemplate = new WorkflowRevision { Workflow = new Workflow { Tasks = new [] { taskTemplate }} }; + _workflowRepository.Setup(w => w.GetByWorkflowIdAsync("789"))! + .ReturnsAsync(workflowTemplate); + + //previously received artifacts + _artifactReceivedRepository.Setup(r => r.GetAllAsync(workflowInstance.WorkflowId, taskTemplate.Id)) + .ReturnsAsync((List?)null); + + var result = await WorkflowExecuterService.ProcessArtifactReceivedAsync(message); + Assert.False(result); + } + + [Fact] + public async Task ProcessPayload_WhenWorkflowInstanceAndTaskIdHaveAValue_ReturnsFalse() + { + var workflowRequest = new WorkflowRequestEvent + { + Bucket = "testbucket", + DataTrigger = new DataOrigin { Source = "aetitle", Destination = "aetitle" }, + CorrelationId = Guid.NewGuid().ToString(), + Timestamp = DateTime.UtcNow, + WorkflowInstanceId = "123", + TaskId = "345" + }; + + var result = await WorkflowExecuterService.ProcessPayload(workflowRequest, new Payload() { Id = Guid.NewGuid().ToString() }); + + Assert.False(result); + } + [Fact] public async Task ProcessPayload_ValidAeTitleWorkflowRequest_ReturnesTrue() { @@ -2833,7 +2960,7 @@ public async Task ArtifactReceived_With_Happy_Path_Continues() var mess = new ArtifactsReceivedEvent { WorkflowInstanceId = workflowInstance.Id, TaskId = "coffee" }; - var response = await WorkflowExecuterService.ProcessArtifactReceived(mess); + var response = await WorkflowExecuterService.ProcessArtifactReceivedAsync(mess); _messageBrokerPublisherService.Verify(w => w.Publish(_configuration.Value.Messaging.Topics.TaskDispatchRequest, It.IsAny()), Times.Exactly(0)); _taskExecutionStatsRepository.Verify(w => w.UpdateExecutionStatsAsync(It.IsAny(), workflowId, TaskExecutionStatus.Succeeded)); @@ -2960,11 +3087,12 @@ public async Task ProcessTaskUpdate_Timout_Sends_Sets_Task_Status() var response = await WorkflowExecuterService.ProcessTaskUpdate(updateEvent); _workflowInstanceRepository.Verify(r => r.UpdateTaskStatusAsync(workflowInstance.Id, "pizza", TaskExecutionStatus.Failed), Times.Once); } + [Fact] public async Task ArtifactReceveid_Valid_ReturnesTrue() { - var TaskId = Guid.NewGuid().ToString(); - var WorkflowId = Guid.NewGuid().ToString(); + var taskId = Guid.NewGuid().ToString(); + var workflowId = Guid.NewGuid().ToString(); var workflowInstanceId = Guid.NewGuid().ToString(); var artifactEvent = new ArtifactsReceivedEvent { @@ -2973,7 +3101,7 @@ public async Task ArtifactReceveid_Valid_ReturnesTrue() CorrelationId = Guid.NewGuid().ToString(), Timestamp = DateTime.UtcNow, WorkflowInstanceId = workflowInstanceId, - TaskId = TaskId + TaskId = taskId }; var workflows = new List @@ -2981,7 +3109,7 @@ public async Task ArtifactReceveid_Valid_ReturnesTrue() new WorkflowRevision { Id = Guid.NewGuid().ToString(), - WorkflowId = WorkflowId, + WorkflowId = workflowId, Revision = 1, Workflow = new Workflow { @@ -2995,7 +3123,7 @@ public async Task ArtifactReceveid_Valid_ReturnesTrue() Tasks = new TaskObject[] { new TaskObject { - Id = TaskId, + Id = taskId, Type = "type", Description = "outgoing", TaskDestinations = new TaskDestination[] { new TaskDestination { Name = "task2" } } @@ -3014,11 +3142,11 @@ public async Task ArtifactReceveid_Valid_ReturnesTrue() Id = workflowInstanceId, BucketId = "BucketId", PayloadId = "PayloadId", - WorkflowId = WorkflowId, + WorkflowId = workflowId, Tasks = new List { new TaskExecution{ - TaskId = TaskId, + TaskId = taskId, } } }; @@ -3027,7 +3155,7 @@ public async Task ArtifactReceveid_Valid_ReturnesTrue() _workflowInstanceRepository.Setup(w => w.GetByWorkflowInstanceIdAsync(workflowInstanceId)).ReturnsAsync(workflowInstance); _workflowInstanceRepository.Setup(w => w.UpdateTasksAsync(It.IsAny(), It.IsAny>())).ReturnsAsync(true); _artifactReceivedRepository.Setup(w => w.GetAllAsync(It.IsAny(), It.IsAny())).ReturnsAsync(new List()); - var result = await WorkflowExecuterService.ProcessArtifactReceived(artifactEvent); + var result = await WorkflowExecuterService.ProcessArtifactReceivedAsync(artifactEvent); _messageBrokerPublisherService.Verify(w => w.Publish(_configuration.Value.Messaging.Topics.TaskDispatchRequest, It.IsAny()), Times.Once()); From d0b61b2ca2c7a94210c6808c425c7a0f27c60ece Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Tue, 17 Oct 2023 17:01:54 +0100 Subject: [PATCH 16/21] reduced code duplication Signed-off-by: Lillie Dae --- ...nai.Deploy.WorkflowManager.sln.DotSettings | 1 + .../Validators/EventPayloadValidator.cs | 106 +++++++++--------- 2 files changed, 54 insertions(+), 53 deletions(-) diff --git a/src/Monai.Deploy.WorkflowManager.sln.DotSettings b/src/Monai.Deploy.WorkflowManager.sln.DotSettings index 850fb5e55..7878bfca9 100644 --- a/src/Monai.Deploy.WorkflowManager.sln.DotSettings +++ b/src/Monai.Deploy.WorkflowManager.sln.DotSettings @@ -1,4 +1,5 @@  + True AR AS ASMT diff --git a/src/WorkflowManager/PayloadListener/Validators/EventPayloadValidator.cs b/src/WorkflowManager/PayloadListener/Validators/EventPayloadValidator.cs index b46ce1772..d9f4ad924 100644 --- a/src/WorkflowManager/PayloadListener/Validators/EventPayloadValidator.cs +++ b/src/WorkflowManager/PayloadListener/Validators/EventPayloadValidator.cs @@ -32,76 +32,76 @@ public EventPayloadValidator(ILogger logger) Logger = logger ?? throw new ArgumentNullException(nameof(logger)); } - public bool ValidateWorkflowRequest(WorkflowRequestEvent payload) + public bool ValidateArtifactReceivedOrWorkflowRequestEvent(EventBase payload) { Guard.Against.Null(payload, nameof(payload)); - using var loggingScope = Logger.BeginScope(new LoggingDataDictionary - { - ["correlationId"] = payload.CorrelationId, - ["payloadId"] = payload.PayloadId, - }); - - var valid = true; - var payloadValid = payload.IsValid(out var validationErrors); - - if (!payloadValid) + if (payload is WorkflowRequestEvent or ArtifactsReceivedEvent) { - Log.FailedToValidateWorkflowRequestEvent(Logger, string.Join(Environment.NewLine, validationErrors)); - } + var correlationId = string.Empty; + Guid? payloadId = null; + IEnumerable workflows = Array.Empty(); - valid &= payloadValid; - - foreach (var workflow in payload.Workflows) - { - var workflowValid = !string.IsNullOrEmpty(workflow); - - if (!workflowValid) + switch (payload) { - Log.FailedToValidateWorkflowRequestEvent(Logger, "Workflow id is empty string"); + case WorkflowRequestEvent wre: + correlationId = wre.CorrelationId; + payloadId = wre.PayloadId; + workflows = wre.Workflows; + break; + case ArtifactsReceivedEvent are: + correlationId = are.CorrelationId; + payloadId = are.PayloadId; + workflows = are.Workflows; + break; } - valid &= workflowValid; - } - - return valid; - } - - public bool ValidateArtifactReceived(ArtifactsReceivedEvent payload) - { - Guard.Against.Null(payload, nameof(payload)); - - using var loggingScope = Logger.BeginScope(new LoggingDataDictionary - { - ["correlationId"] = payload.CorrelationId, - ["payloadId"] = payload.PayloadId, - }); + using var loggingScope = Logger.BeginScope(new LoggingDataDictionary + { + ["correlationId"] = correlationId, + ["payloadId"] = payloadId, + }); + + var valid = true; + var payloadValid = false; + IList validationErrors; + payloadValid = payload switch + { + ArtifactsReceivedEvent artifactsReceivedEvent => artifactsReceivedEvent.IsValid(out validationErrors), + WorkflowRequestEvent workflowRequestEvent => workflowRequestEvent.IsValid(out validationErrors), + _ => throw new ArgumentOutOfRangeException(nameof(payload), payload, null) + }; - var valid = true; - var payloadValid = payload.IsValid(out var validationErrors); + if (!payloadValid) + { + Log.FailedToValidateWorkflowRequestEvent(Logger, string.Join(Environment.NewLine, validationErrors)); + } - if (!payloadValid) - { - Log.FailedToValidateWorkflowRequestEvent(Logger, string.Join(Environment.NewLine, validationErrors)); - } + valid &= payloadValid; - valid &= payloadValid; + foreach (var workflow in workflows) + { + var workflowValid = !string.IsNullOrEmpty(workflow); - foreach (var workflow in payload.Workflows) - { - var workflowValid = !string.IsNullOrEmpty(workflow); + if (!workflowValid) + { + Log.FailedToValidateWorkflowRequestEvent(Logger, "Workflow id is empty string"); + } - if (!workflowValid) - { - Log.FailedToValidateWorkflowRequestEvent(Logger, "Workflow id is empty string"); + valid &= workflowValid; } - valid &= workflowValid; - } - - return valid; + return valid; + }; + return false; } + public bool ValidateWorkflowRequest(WorkflowRequestEvent payload) + => ValidateArtifactReceivedOrWorkflowRequestEvent(payload); + + public bool ValidateArtifactReceived(ArtifactsReceivedEvent payload) + => ValidateArtifactReceivedOrWorkflowRequestEvent(payload); + public bool ValidateTaskUpdate(TaskUpdateEvent payload) { Guard.Against.Null(payload, nameof(payload)); From 4d32c7041d44583a017e77139fa68fd3668ece6b Mon Sep 17 00:00:00 2001 From: Neil South Date: Wed, 18 Oct 2023 09:10:49 +0100 Subject: [PATCH 17/21] adding indexs Signed-off-by: Neil South --- .../Repositories/ArtifactsRepository.cs | 43 ++++++++++++++++++- .../Services/WorkflowExecuterService.cs | 4 +- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs index a574aabd1..f81057e3e 100644 --- a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs +++ b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs @@ -18,6 +18,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Ardalis.GuardClauses; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Monai.Deploy.WorkflowManager.Common.Database.Options; @@ -63,6 +64,11 @@ public class ArtifactReceivedItems /// Gets or Sets Artifacts. /// public List Artifacts { get; set; } = new(); + + /// + /// The date Time this was received + /// + public DateTime Received { get; set; } = DateTime.UtcNow; } public class ArtifactsRepository : IArtifactsRepository @@ -83,9 +89,44 @@ public ArtifactsRepository( _logger = logger ?? throw new ArgumentNullException(nameof(logger)); var mongoDatabase = client.GetDatabase(bookStoreDatabaseSettings.Value.DatabaseName); _artifactReceivedItemsCollection = mongoDatabase.GetCollection("ArtifactReceivedItems"); + EnsureIndex().GetAwaiter().GetResult(); + } + private async Task EnsureIndex() + { + var indexName = "ArtifactReceivedWorkflowInstanceIdTaskIdIndex"; + + var model = new CreateIndexModel( + Builders.IndexKeys.Ascending(s => s.WorkflowInstanceId).Ascending(s => s.TaskId), + new CreateIndexOptions { Name = indexName } + ); + + await MakeIndex(_artifactReceivedItemsCollection, indexName, model); + + indexName = "ReceivedTime"; + + model = new CreateIndexModel( + Builders.IndexKeys.Ascending(s => s.Received), + new CreateIndexOptions { ExpireAfter = TimeSpan.FromDays(7), Name = "ReceivedTime" } + ); + + await MakeIndex(_artifactReceivedItemsCollection, indexName, model); + } + private static async Task MakeIndex(IMongoCollection collection, string indexName, CreateIndexModel model) + { + Guard.Against.Null(collection, nameof(collection)); + + var asyncCursor = (await collection.Indexes.ListAsync()); + var bsonDocuments = (await asyncCursor.ToListAsync()); + var indexes = bsonDocuments.Select(_ => _.GetElement("name").Value.ToString()).ToList(); + + // If index not present create it else skip. + if (!indexes.Any(i => i is not null && i.Equals(indexName))) + { + await collection.Indexes.CreateOneAsync(model); + } } - public async Task> GetAllAsync(string workflowInstance, string taskId) + public async Task?> GetAllAsync(string workflowInstance, string taskId) { var result = await _artifactReceivedItemsCollection.FindAsync(a => a.WorkflowInstanceId == workflowInstance && a.TaskId == taskId).ConfigureAwait(false); return await result.ToListAsync().ConfigureAwait(false); diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index c92a5c299..6b1267a14 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -338,7 +338,7 @@ public async Task ProcessTaskUpdate(TaskUpdateEvent message) return false; } - var currentTask = workflowInstance.Tasks.FirstOrDefault(t => t.TaskId == message.TaskId); + var currentTask = workflowInstance.Tasks.Find(t => t.TaskId == message.TaskId); using var loggingScope = _logger.BeginScope(new LoggingDataDictionary { @@ -439,7 +439,7 @@ public async Task UpdateTaskDetails(TaskExecution currentTask, string workflowIn public async Task ProcessExportComplete(ExportCompleteEvent message, string correlationId) { var workflowInstance = await _workflowInstanceRepository.GetByWorkflowInstanceIdAsync(message.WorkflowInstanceId); - var task = workflowInstance.Tasks.FirstOrDefault(t => t.TaskId == message.ExportTaskId); + var task = workflowInstance.Tasks.Find(t => t.TaskId == message.ExportTaskId); if (task is null) { From a9898e449a0fe76a00a7ba102e04d05852e2fc49 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Thu, 19 Oct 2023 11:32:55 +0100 Subject: [PATCH 18/21] minor fixes Signed-off-by: Lillie Dae --- .../Repositories/ArtifactsRepository.cs | 5 - .../Services/PayloadListenerService.cs | 4 +- .../Features/ArtifactReceivedEvent.feature | 27 +++ .../Hooks.cs | 5 + .../POCO/TestExecutionConfig.cs | 4 + .../ArtifactReceivedEventStepDefinitions.cs | 128 +++++++++++++ .../WorkflowRequestStepDefinitions.cs | 2 +- .../Support/Assertions.cs | 10 + .../Support/DataHelper.cs | 178 ++++++++++++++---- .../Support/MinioDataSeeding.cs | 8 +- .../Support/MongoClientUtil.cs | 31 ++- .../Support/RabbitConnectionFactory.cs | 3 + .../TestData/WorkflowInstanceTestData.cs | 40 ++++ .../TestData/WorkflowRevisionTestData.cs | 68 +++++++ 14 files changed, 468 insertions(+), 45 deletions(-) create mode 100644 tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature create mode 100644 tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/ArtifactReceivedEventStepDefinitions.cs diff --git a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs index f81057e3e..f12d7f7bc 100644 --- a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs +++ b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs @@ -45,11 +45,6 @@ public static ArtifactReceivedDetails FromArtifact(Artifact artifact) => public class ArtifactReceivedItems { - /// - /// Gets or Sets the Id. - /// - public double Id { get; set; } - /// /// Gets or Sets WorkflowInstanceId. /// diff --git a/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs b/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs index 73d0d1aa1..02b4497c8 100644 --- a/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs +++ b/src/WorkflowManager/PayloadListener/Services/PayloadListenerService.cs @@ -108,7 +108,7 @@ private void SetupPolling() _messageSubscriber.SubscribeAsync(ExportCompleteRoutingKey, ExportCompleteRoutingKey, OnExportCompleteReceivedCallback); _logger.EventSubscription(ServiceName, ExportCompleteRoutingKey); - _messageSubscriber.SubscribeAsync(ExportCompleteRoutingKey, ArtifactRecievedRoutingKey, OnArtifactReceivedtReceivedCallbackAsync); + _messageSubscriber.SubscribeAsync(ArtifactRecievedRoutingKey, ArtifactRecievedRoutingKey, OnArtifactReceivedtReceivedCallbackAsync); _logger.EventSubscription(ServiceName, ArtifactRecievedRoutingKey); } @@ -168,7 +168,7 @@ private async Task OnArtifactReceivedtReceivedCallbackAsync(MessageReceivedEvent }); _logger.ArtifactReceivedReceived(); - await _eventPayloadListenerService.ReceiveWorkflowPayload(eventArgs); + await _eventPayloadListenerService.ArtifactReceivePayload(eventArgs); } protected virtual void Dispose(bool disposing) diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature new file mode 100644 index 000000000..7fa7481d0 --- /dev/null +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature @@ -0,0 +1,27 @@ +# Copyright 2022 MONAI Consortium +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +@IntergrationTests +Feature: ArtifactReceivedEvent + +Publishing a artifact received event is consumed by the Workflow Manager. + + @ArtifactReceivedEvent + Scenario Outline: Publish a valid Artifact Received Event which creates an entry. + Given I have a clinical workflow I have a Workflow Instance + When I publish a Artifact Received Event + Then I can see a Artifact Received Item is created + Examples: + | clinicalWorkflow | workflowInstance | artifactReceivedEvent | + | Workflow_Revision_For_Artifact_ReceivedEvent_1 | Workflow_Instance_For_Artifact_ReceivedEvent_1 | Test1 | diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs index effc431dc..136e096ff 100755 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs @@ -43,6 +43,7 @@ public Hooks(IObjectContainer objectContainer) private static HttpClient? HttpClient { get; set; } public static AsyncRetryPolicy? RetryPolicy { get; private set; } private static RabbitPublisher? WorkflowPublisher { get; set; } + public static RabbitPublisher? ArtifactsPublisher { get; set; } private static RabbitConsumer? TaskDispatchConsumer { get; set; } private static RabbitPublisher? TaskUpdatePublisher { get; set; } private static RabbitConsumer? ExportRequestConsumer { get; set; } @@ -76,6 +77,7 @@ public static void Init() TestExecutionConfig.RabbitConfig.TaskDispatchQueue = "md.tasks.dispatch"; TestExecutionConfig.RabbitConfig.TaskCallbackQueue = "md.tasks.callback"; TestExecutionConfig.RabbitConfig.TaskUpdateQueue = "md.tasks.update"; + TestExecutionConfig.RabbitConfig.ArtifactsRequestQueue = "md.workflow.artifactrecieved"; TestExecutionConfig.RabbitConfig.ExportCompleteQueue = config.GetValue("WorkflowManager:messaging:topics:exportComplete"); TestExecutionConfig.RabbitConfig.ExportRequestQueue = $"{config.GetValue("WorkflowManager:messaging:topics:exportRequestPrefix")}.{config.GetValue("WorkflowManager:messaging:dicomAgents:scuAgentName")}"; @@ -84,6 +86,7 @@ public static void Init() TestExecutionConfig.MongoConfig.WorkflowCollection = "Workflows"; TestExecutionConfig.MongoConfig.WorkflowInstanceCollection = "WorkflowInstances"; TestExecutionConfig.MongoConfig.PayloadCollection = "Payloads"; + TestExecutionConfig.MongoConfig.ArtifactsCollection = "Artifacts"; TestExecutionConfig.MongoConfig.ExecutionStatsCollection = "ExecutionStats"; TestExecutionConfig.MinioConfig.Endpoint = config.GetValue("WorkflowManager:storage:settings:endpoint"); @@ -126,6 +129,7 @@ await RetryPolicy.ExecuteAsync(async () => } }); + ArtifactsPublisher = new RabbitPublisher(RabbitConnectionFactory.GetRabbitConnection(), TestExecutionConfig.RabbitConfig.Exchange, TestExecutionConfig.RabbitConfig.ArtifactsRequestQueue); WorkflowPublisher = new RabbitPublisher(RabbitConnectionFactory.GetRabbitConnection(), TestExecutionConfig.RabbitConfig.Exchange, TestExecutionConfig.RabbitConfig.WorkflowRequestQueue); TaskDispatchConsumer = new RabbitConsumer(RabbitConnectionFactory.GetRabbitConnection(), TestExecutionConfig.RabbitConfig.Exchange, TestExecutionConfig.RabbitConfig.TaskDispatchQueue); TaskUpdatePublisher = new RabbitPublisher(RabbitConnectionFactory.GetRabbitConnection(), TestExecutionConfig.RabbitConfig.Exchange, TestExecutionConfig.RabbitConfig.TaskUpdateQueue); @@ -144,6 +148,7 @@ public void SetUp(ScenarioContext scenarioContext, ISpecFlowOutputHelper outputH ObjectContainer.RegisterInstanceAs(TaskUpdatePublisher, "TaskUpdatePublisher"); ObjectContainer.RegisterInstanceAs(ExportCompletePublisher, "ExportCompletePublisher"); ObjectContainer.RegisterInstanceAs(ExportRequestConsumer, "ExportRequestConsumer"); + ObjectContainer.RegisterInstanceAs(ArtifactsPublisher, "ArtifactsPublisher"); ObjectContainer.RegisterInstanceAs(MongoClient); ObjectContainer.RegisterInstanceAs(MinioClient); var dataHelper = new DataHelper(TaskDispatchConsumer, ExportRequestConsumer, MongoClient); diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/POCO/TestExecutionConfig.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/POCO/TestExecutionConfig.cs index a8a021653..2e70cefa9 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/POCO/TestExecutionConfig.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/POCO/TestExecutionConfig.cs @@ -36,6 +36,8 @@ public static class RabbitConfig public static string WorkflowRequestQueue { get; set; } = string.Empty; + public static string ArtifactsRequestQueue { get; set; } = string.Empty; + public static string TaskDispatchQueue { get; set; } = string.Empty; public static string TaskCallbackQueue { get; set; } = string.Empty; @@ -66,6 +68,8 @@ public static class MongoConfig public static string PayloadCollection { get; set; } = string.Empty; + public static string ArtifactsCollection { get; set; } = string.Empty; + public static string ExecutionStatsCollection { get; set; } = string.Empty; } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/ArtifactReceivedEventStepDefinitions.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/ArtifactReceivedEventStepDefinitions.cs new file mode 100644 index 000000000..db591f090 --- /dev/null +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/ArtifactReceivedEventStepDefinitions.cs @@ -0,0 +1,128 @@ +/* + * Copyright 2022 MONAI Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using BoDi; +using Monai.Deploy.Messaging.Events; +using Monai.Deploy.Messaging.Messages; +using Monai.Deploy.WorkflowManager.Common.IntegrationTests.Models; +using Monai.Deploy.WorkflowManager.Common.IntegrationTests.Support; +using Monai.Deploy.WorkflowManager.Common.WorkflowExecutor.IntegrationTests.Support; +using MongoDB.Driver; +using Polly; +using Polly.Retry; +using TechTalk.SpecFlow.Infrastructure; + +namespace Monai.Deploy.WorkflowManager.Common.IntegrationTests.StepDefinitions +{ + [Binding] + public class ArtifactReceivedEventStepDefinitions + { + private RabbitPublisher WorkflowPublisher { get; set; } + private RabbitPublisher ArtifactsPublisher { get; set; } + private RabbitConsumer TaskDispatchConsumer { get; set; } + private MongoClientUtil MongoClient { get; set; } + private Assertions Assertions { get; set; } + private DataHelper DataHelper { get; set; } + + private readonly ISpecFlowOutputHelper _outputHelper; + private RetryPolicy RetryPolicy { get; set; } + private MinioDataSeeding MinioDataSeeding { get; set; } + + public ArtifactReceivedEventStepDefinitions(ObjectContainer objectContainer, ISpecFlowOutputHelper outputHelper) + { + ArtifactsPublisher = objectContainer.Resolve("ArtifactsPublisher"); + TaskDispatchConsumer = objectContainer.Resolve("TaskDispatchConsumer"); + MongoClient = objectContainer.Resolve(); + Assertions = new Assertions(objectContainer, outputHelper); + DataHelper = objectContainer.Resolve(); + _outputHelper = outputHelper; + MinioDataSeeding = + new MinioDataSeeding(objectContainer.Resolve(), DataHelper, _outputHelper); + RetryPolicy = Policy.Handle() + .WaitAndRetry(retryCount: 20, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(500)); + } + + [When(@"I publish a Artifact Received Event (.*)")] + public async Task WhenIPublishAArtifactReceivedEvent(string name) + { + var message = new JsonMessage( + DataHelper.GetArtifactsReceivedEventTestData(name), + "16988a78-87b5-4168-a5c3-2cfc2bab8e54", + Guid.NewGuid().ToString(), + string.Empty); + + _outputHelper.WriteLine($"Publishing WorkflowRequestEvent with name={name}"); + ArtifactsPublisher.PublishMessage(message.ToMessage()); + _outputHelper.WriteLine($"Event published"); + } + + [Given(@"I have a clinical workflow (.*) I have a Workflow Instance (.*)")] + public async Task GivenIHaveAClinicalWorkflowIHaveAWorkflowInstance(string clinicalWorkflowName, string wfiName) + { + var (artifactReceivedItems, workflowInstance, workflowRevision) = + DataHelper.GetArtifactsEventTestData(clinicalWorkflowName, wfiName); + + _outputHelper.WriteLine("Seeding minio with workflow input artifacts"); + await MinioDataSeeding.SeedWorkflowInputArtifacts(workflowInstance.PayloadId); + + _outputHelper.WriteLine($"Retrieving workflow instance with name={wfiName}"); + await MongoClient.CreateWorkflowInstanceDocumentAsync(workflowInstance); + + _outputHelper.WriteLine($"Retrieving workflow revision with name={clinicalWorkflowName}"); + await MongoClient.CreateWorkflowRevisionDocumentAsync(workflowRevision); + + await MongoClient.CreateArtifactsEventsDocumentAsync(artifactReceivedItems); + + // await Task.WhenAll(task1, task2, task3, task4).ConfigureAwait(false); + _outputHelper.WriteLine("Seeding Data Tasks complete"); + } + + [Then(@"I can see a Artifact Received Item is created")] + public void ThenICanSeeAArtifactReceivedItemIsCreated() + { + ThenICanSeeAArtifactReceivedItemIsCreated(1); + } + + [Then(@"I can see ([1-9]*) Artifact Received Items are created")] + [Then(@"I can see ([0-9]*) Artifact Received Items is created")] + public void ThenICanSeeAArtifactReceivedItemIsCreated(int count) + { + _outputHelper.WriteLine($"Retrieving {count} workflow instance/s using the payloadid={DataHelper.WorkflowRequestMessage.PayloadId.ToString()}"); + RetryPolicy.Execute(() => + { + var artifactsReceivedItems = DataHelper.GetArtifactsReceivedItemsFromDB(count, DataHelper.ArtifactsReceivedEvent); + + foreach (var artifactsReceivedItem in artifactsReceivedItems) + { + var workflowInstance = DataHelper.WorkflowInstances.FirstOrDefault(x => x.Id.Equals(artifactsReceivedItem.WorkflowInstanceId)); + var workflowRevision = DataHelper.WorkflowRevisions + .FirstOrDefault(x => x.WorkflowId.Equals(workflowInstance!.WorkflowId)); + + if (workflowRevision != null) + { + Assertions.AssertArtifactsReceivedItemMatchesExpectedWorkflow(artifactsReceivedItem, workflowRevision); + } + else + { + throw new Exception($"Workflow not found for workflowId {artifactsReceivedItem.WorkflowInstanceId}"); + } + } + + }); + _outputHelper.WriteLine($"Retrieved {count} workflow instance/s"); + } + } +} diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowRequestStepDefinitions.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowRequestStepDefinitions.cs index 64d25e445..685161c8e 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowRequestStepDefinitions.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/WorkflowRequestStepDefinitions.cs @@ -50,7 +50,7 @@ public WorkflowRequestStepDefinitions(ObjectContainer objectContainer, ISpecFlow RetryPolicy = Policy.Handle().WaitAndRetry(retryCount: 20, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(500)); } - [Given(@"I have a clinical workflow (.*)")] + [Given(@"I have a clinical workflow (?!.* )(.*)")] public void GivenIHaveClinicalWorkflows(string name) { _outputHelper.WriteLine($"Retrieving workflow revision with name={name}"); diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/Assertions.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/Assertions.cs index 5e66fa743..0ecb3b613 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/Assertions.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/Assertions.cs @@ -18,6 +18,7 @@ using BoDi; using Monai.Deploy.Messaging.Events; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; +using Monai.Deploy.WorkflowManager.Common.Database.Repositories; using Monai.Deploy.WorkflowManager.Common.IntegrationTests.Models; using Monai.Deploy.WorkflowManager.Common.IntegrationTests.POCO; using TechTalk.SpecFlow.Infrastructure; @@ -550,6 +551,15 @@ public void AssertExecutionStats(ExecutionStats executionStats, TaskDispatchEven } Output.WriteLine("Details ExecutionStats are correct"); } + + public static void AssertArtifactsReceivedItemMatchesExpectedWorkflow(ArtifactReceivedItems artifactsReceivedItem, WorkflowRevision workflowRevision) + { + artifactsReceivedItem.WorkflowInstanceId.Should().Be(workflowRevision.WorkflowId); + artifactsReceivedItem.TaskId.Should().Be(workflowRevision.Workflow!.Tasks[0].Id); + artifactsReceivedItem.Artifacts.Count.Should().Be(workflowRevision.Workflow!.Tasks[0].Artifacts.Output.Length); + artifactsReceivedItem.Received.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(20)); + artifactsReceivedItem.Artifacts[0].Path.Should().Be(workflowRevision.Workflow.Tasks[0].Artifacts.Output[0].Value); + } } } #pragma warning restore CS8604 // Possible null reference argument. diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs index 446847381..52f9827a0 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs @@ -14,14 +14,17 @@ * limitations under the License. */ +using Monai.Deploy.Messaging.Common; using Monai.Deploy.Messaging.Events; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; +using Monai.Deploy.WorkflowManager.Common.Database.Repositories; using Monai.Deploy.WorkflowManager.Common.IntegrationTests.Models; using Monai.Deploy.WorkflowManager.Common.Models; using Monai.Deploy.WorkflowManager.Common.WorkflowExecutor.IntegrationTests.TestData; using Newtonsoft.Json; using Polly; using Polly.Retry; +using Artifact = Monai.Deploy.Messaging.Common.Artifact; #pragma warning disable CS8602 // Dereference of a possibly null reference. @@ -29,17 +32,19 @@ namespace Monai.Deploy.WorkflowManager.Common.IntegrationTests.Support { public class DataHelper { - public WorkflowRequestMessage WorkflowRequestMessage = new WorkflowRequestMessage(); - public List WorkflowInstances = new List(); - public PatientDetails PatientDetails { get; set; } = new PatientDetails(); - public TaskUpdateEvent TaskUpdateEvent = new TaskUpdateEvent(); - public ExportCompleteEvent ExportCompleteEvent = new ExportCompleteEvent(); - public List TaskDispatchEvents = new List(); - public List ExportRequestEvents = new List(); - public List WorkflowRevisions = new List(); - public List Workflows = new List(); - public List Payload = new List(); + public WorkflowRequestMessage WorkflowRequestMessage = new(); + public ArtifactsReceivedEvent ArtifactsReceivedEvent = new(); + public List WorkflowInstances = new(); + public PatientDetails PatientDetails { get; set; } = new(); + public TaskUpdateEvent TaskUpdateEvent = new(); + public ExportCompleteEvent ExportCompleteEvent = new(); + public List TaskDispatchEvents = new(); + public List ExportRequestEvents = new(); + public List WorkflowRevisions = new(); + public List Workflows = new(); + public List Payload = new(); private RetryPolicy> RetryWorkflowInstances { get; set; } + private RetryPolicy> RetryArtifactReceivedItems { get; set; } private RetryPolicy> RetryTaskDispatches { get; set; } private RetryPolicy> RetryExportRequests { get; set; } private RetryPolicy> RetryPayloadCollections { get; set; } @@ -51,6 +56,8 @@ public class DataHelper public List SeededWorkflowInstances { get; internal set; } public TaskDispatchEvent TaskDispatchEvent { get; set; } public TaskCallbackEvent TaskCallbackEvent { get; set; } + public List ArtifactsReceivedItems { get; set; } = new() { }; + #pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public DataHelper(RabbitConsumer taskDispatchConsumer, RabbitConsumer exportRequestConsumer, MongoClientUtil mongoClient) @@ -59,6 +66,7 @@ public DataHelper(RabbitConsumer taskDispatchConsumer, RabbitConsumer exportRequ ExportRequestConsumer = exportRequestConsumer; TaskDispatchConsumer = taskDispatchConsumer; MongoClient = mongoClient; + RetryArtifactReceivedItems = Policy>.Handle().WaitAndRetry(retryCount: 20, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(500)); RetryWorkflowInstances = Policy>.Handle().WaitAndRetry(retryCount: 20, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(500)); RetryTaskDispatches = Policy>.Handle().WaitAndRetry(retryCount: 20, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(500)); RetryExportRequests = Policy>.Handle().WaitAndRetry(retryCount: 20, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(500)); @@ -81,22 +89,21 @@ public WorkflowRevision GetWorkflowRevisionTestData(string name) { var workflowRevision = WorkflowRevisionsTestData.TestData.FirstOrDefault(c => c.Name.Equals(name)); - if (workflowRevision != null) + if (workflowRevision == null) { - if (workflowRevision.WorkflowRevision != null) - { - WorkflowRevisions.Add(workflowRevision.WorkflowRevision); - return workflowRevision.WorkflowRevision; - } - else - { - throw new Exception($"Workflow {name} does not have any applicable test data, please check and try again!"); - } + throw new Exception( + $"Workflow {name} does not have any applicable test data, please check and try again!"); } - else + + if (workflowRevision.WorkflowRevision == null) { - throw new Exception($"Workflow {name} does not have any applicable test data, please check and try again!"); + throw new Exception( + $"Workflow {name} does not have any applicable test data, please check and try again!"); } + + WorkflowRevisions.Add(workflowRevision.WorkflowRevision); + return workflowRevision.WorkflowRevision; + } public WorkflowRevision GetWorkflowRevisionTestDataByIndex(int index) @@ -147,23 +154,22 @@ public WorkflowInstance GetWorkflowInstanceTestData(string name) { var workflowInstance = WorkflowInstancesTestData.TestData.FirstOrDefault(c => c.Name.Contains(name)); - if (workflowInstance != null) + if (workflowInstance == null) { - if (workflowInstance.WorkflowInstance != null) - { - WorkflowInstances.Add(workflowInstance.WorkflowInstance); - - return workflowInstance.WorkflowInstance; - } - else - { - throw new Exception($"Workflow Intance {name} does not have any applicable test data, please check and try again!"); - } + throw new Exception( + $"Workflow Intance {name} does not have any applicable test data, please check and try again!"); } - else + + if (workflowInstance.WorkflowInstance == null) { - throw new Exception($"Workflow Intance {name} does not have any applicable test data, please check and try again!"); + throw new Exception( + $"Workflow Intance {name} does not have any applicable test data, please check and try again!"); } + + WorkflowInstances.Add(workflowInstance.WorkflowInstance); + + return workflowInstance.WorkflowInstance; + } public WorkflowInstance GetWorkflowInstanceTestDataByIndex(int index) @@ -210,6 +216,21 @@ public PatientDetails GetPatientDetailsTestData(string name) } } + public ArtifactsReceivedEvent GetArtifactsReceivedEventTestData(string name) + { + var artifactsReceivedEvent = ArtifactsReceivedEventTestData.TestData.FirstOrDefault(c => c != null && c.Value.Name.Equals(name)); + + if (artifactsReceivedEvent?.Event == null) + { + throw new Exception( + $"Workflow request {name} does not have any applicable test data, please check and try again!"); + } + + ArtifactsReceivedEvent = artifactsReceivedEvent.Value.Event; + return artifactsReceivedEvent.Value.Event; + } + + public WorkflowRequestMessage GetWorkflowRequestTestData(string name) { var workflowRequest = WorkflowRequestsTestData.TestData.FirstOrDefault(c => c.Name.Contains(name)); @@ -276,6 +297,23 @@ public ExportCompleteEvent GetExportCompleteTestData(string name) throw new Exception($"Export Complete message not found for {name}"); } + public List GetArtifactsReceivedItemsFromDB(int count, ArtifactsReceivedEvent artifactsReceivedEvent) + { + var res = RetryArtifactReceivedItems.Execute(() => + { + ArtifactsReceivedItems = MongoClient.GetArtifactsReceivedItems(artifactsReceivedEvent); + + if (ArtifactsReceivedItems.Count == count) + { + return ArtifactsReceivedItems; + } + + throw new Exception($"{count} RetryArtifactReceivedItems could not be found for Artifact {artifactsReceivedEvent.WorkflowInstanceId}. Actual count is {WorkflowInstances.Count}"); + }); + + return res; + } + public List GetWorkflowInstances(int count, string payloadId) { var res = RetryWorkflowInstances.Execute(() => @@ -505,5 +543,75 @@ public string FormatResponse(string json) var parsedJson = JsonConvert.DeserializeObject(json); return JsonConvert.SerializeObject(parsedJson, Formatting.Indented); } + + public (List ArtifactReceivedItems, WorkflowInstance WorkflowInstance, WorkflowRevision + WorkflowRevision) GetArtifactsEventTestData(string clinicalWorkflowName, string wfiName) + { + + var workflowInstance = GetWorkflowInstanceTestData(wfiName); + var workflow = GetWorkflowRevisionTestData(clinicalWorkflowName); + + var artifacts = ArtifactsEventTestData.TestData.Where(c => c.WorkflowInstanceId == workflowInstance.Id).ToList(); + + if (artifacts == null) + { + throw new Exception( + $"ArtifactsEvent for {wfiName} does not have any applicable test data, please check and try again!"); + } + + return (artifacts, workflowInstance, workflow); + } + } + + public class ArtifactsReceivedEventTestData + { + public static List<(string Name, ArtifactsReceivedEvent Event)?> TestData = new() + { + ( + Name: "Test1", + Event: new ArtifactsReceivedEvent() + { + Workflows = new[] { "C139946F-0FB9-452C-843A-A77F4BAACB8E" }, + Artifacts = new List() + { + new() + { + Type = ArtifactType.CT, + Path = "path", + } + }, + PayloadId = Guid.NewGuid(), + CorrelationId = Guid.NewGuid().ToString(), + WorkflowInstanceId = "d32d5769-4ecf-4639-a048-6ecf2cced04a", + TaskId = "d32d5769-4ecf-4639-a048-6ecf2cced04b", + Bucket = "bucket1", + Timestamp = DateTime.UtcNow, + DataOrigins = { new DataOrigin() { DataService = DataService.DIMSE, ArtifactType = ArtifactType.CT, Destination = "testAe", Source = "testAe" } }, + DataTrigger = new DataOrigin() { DataService = DataService.DIMSE, ArtifactType = ArtifactType.CT, Destination = "testAe", Source = "testAe" }, + FileCount = 1, + } + ), + }; + } + + public class ArtifactsEventTestData + { + public static List TestData = new List() + { + new ArtifactReceivedItems() + { + WorkflowInstanceId = "d32d5769-4ecf-4639-a048-6ecf2cced04a", + TaskId = "task1", + Received = DateTime.UtcNow, + Artifacts = new List() { + new ArtifactReceivedDetails() + { + Type = ArtifactType.CT, + Received = DateTime.UtcNow, + Path = "path", + } + }, + } + }; } } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MinioDataSeeding.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MinioDataSeeding.cs index 0cf44901c..8b84ef1e8 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MinioDataSeeding.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MinioDataSeeding.cs @@ -36,6 +36,12 @@ public MinioDataSeeding(MinioClientUtil minioClient, DataHelper dataHelper, ISpe OutputHelper = outputHelper; } + + public async Task SeedArtifactRepo(string payloadId, string? folderName = null) + { + + } + public async Task SeedWorkflowInputArtifacts(string payloadId, string? folderName = null) { string localPath; @@ -83,6 +89,6 @@ public async Task SeedTaskOutputArtifacts(string payloadId, string workflowInsta private string? GetDirectory() { return Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - } + } } } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MongoClientUtil.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MongoClientUtil.cs index f19c11a63..3fcf86d80 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MongoClientUtil.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MongoClientUtil.cs @@ -14,7 +14,9 @@ * limitations under the License. */ +using Monai.Deploy.Messaging.Events; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; +using Monai.Deploy.WorkflowManager.Common.Database.Repositories; using Monai.Deploy.WorkflowManager.Common.IntegrationTests.POCO; using MongoDB.Driver; using Polly; @@ -34,21 +36,34 @@ public class MongoClientUtil private RetryPolicy> RetryPayload { get; set; } private RetryPolicy> RetryExecutionStats { get; set; } private IMongoCollection ExecutionStatsCollection { get; set; } + private IMongoCollection ArtifactsCollection { get; set; } public MongoClientUtil() { Client = new MongoClient(TestExecutionConfig.MongoConfig.ConnectionString); Database = Client.GetDatabase($"{TestExecutionConfig.MongoConfig.Database}"); + WorkflowRevisionCollection = Database.GetCollection($"{TestExecutionConfig.MongoConfig.WorkflowCollection}"); WorkflowInstanceCollection = Database.GetCollection($"{TestExecutionConfig.MongoConfig.WorkflowInstanceCollection}"); PayloadCollection = Database.GetCollection($"{TestExecutionConfig.MongoConfig.PayloadCollection}"); + ArtifactsCollection = Database.GetCollection($"{TestExecutionConfig.MongoConfig.ArtifactsCollection}"); + ExecutionStatsCollection = Database.GetCollection($"{TestExecutionConfig.MongoConfig.ExecutionStatsCollection}"); + RetryMongo = Policy.Handle().WaitAndRetry(retryCount: 10, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(1000)); RetryPayload = Policy>.Handle().WaitAndRetry(retryCount: 10, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(1000)); CreateCollection("dummy"); - ExecutionStatsCollection = Database.GetCollection($"{TestExecutionConfig.MongoConfig.ExecutionStatsCollection}"); RetryExecutionStats = Policy>.Handle().WaitAndRetry(retryCount: 10, sleepDurationProvider: _ => TimeSpan.FromMilliseconds(1000)); } + + //CreateArtifactsEvents + public Task CreateArtifactsEventsDocumentAsync(List artifactReceivedItems) + { + return RetryMongo.Execute(() => + Database.GetCollection($"{TestExecutionConfig.MongoConfig.ArtifactsCollection}") + .InsertManyAsync(artifactReceivedItems)); + } + #region WorkflowRevision public void CreateWorkflowRevisionDocument(WorkflowRevision workflowRevision) @@ -59,6 +74,9 @@ public void CreateWorkflowRevisionDocument(WorkflowRevision workflowRevision) }); } + public Task CreateWorkflowRevisionDocumentAsync(WorkflowRevision workflowRevision) => + RetryMongo.Execute(() => WorkflowRevisionCollection.InsertOneAsync(workflowRevision)); + public void DeleteWorkflowRevisionDocument(string id) { RetryMongo.Execute(() => @@ -115,6 +133,9 @@ public void CreateWorkflowInstanceDocument(WorkflowInstance workflowInstance) }); } + public Task CreateWorkflowInstanceDocumentAsync(WorkflowInstance workflowInstance) => + RetryMongo.Execute(() => WorkflowInstanceCollection.InsertOneAsync(workflowInstance)); + public WorkflowInstance GetWorkflowInstance(string payloadId) { return WorkflowInstanceCollection.Find(x => x.PayloadId == payloadId).FirstOrDefault(); @@ -279,5 +300,13 @@ private void CreateCollection(string collectionName) } }); } + + public List GetArtifactsReceivedItems(ArtifactsReceivedEvent? artifactsReceivedEvent = null) + { + return artifactsReceivedEvent is null + ? ArtifactsCollection.Find(FilterDefinition.Empty).ToList() + : ArtifactsCollection.Find(x => x.WorkflowInstanceId == artifactsReceivedEvent.WorkflowInstanceId) + .ToList(); + } } } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/RabbitConnectionFactory.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/RabbitConnectionFactory.cs index b1391e7be..cec2021a1 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/RabbitConnectionFactory.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/RabbitConnectionFactory.cs @@ -67,12 +67,15 @@ public static void DeleteAllQueues() DeleteQueue(TestExecutionConfig.RabbitConfig.TaskUpdateQueue); DeleteQueue(TestExecutionConfig.RabbitConfig.ExportCompleteQueue); DeleteQueue(TestExecutionConfig.RabbitConfig.ExportRequestQueue); + DeleteQueue(TestExecutionConfig.RabbitConfig.ArtifactsRequestQueue); DeleteQueue($"{TestExecutionConfig.RabbitConfig.WorkflowRequestQueue}-dead-letter"); DeleteQueue($"{TestExecutionConfig.RabbitConfig.TaskDispatchQueue}-dead-letter"); DeleteQueue($"{TestExecutionConfig.RabbitConfig.TaskCallbackQueue}-dead-letter"); DeleteQueue($"{TestExecutionConfig.RabbitConfig.TaskUpdateQueue}-dead-letter"); DeleteQueue($"{TestExecutionConfig.RabbitConfig.ExportCompleteQueue}-dead-letter"); DeleteQueue($"{TestExecutionConfig.RabbitConfig.ExportRequestQueue}-dead-letter"); + DeleteQueue($"{TestExecutionConfig.RabbitConfig.ArtifactsRequestQueue}-dead-letter"); + DeleteQueue("-dead-letter"); } public static void PurgeAllQueues() diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs index 4836fd9ec..1b307dabb 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs @@ -2212,6 +2212,46 @@ public static WorkflowInstance CreateWorkflowInstance(string workflowName) } } }, + new WorkflowInstanceTestData() + { + Name = "Workflow_Instance_For_Artifact_ReceivedEvent_1", + WorkflowInstance = new WorkflowInstance() + { + Id = "d32d5769-4ecf-4639-a048-6ecf2cced04a", + AeTitle = "Multi_Req", + WorkflowId = Helper.GetWorkflowByName("Workflow_Revision_For_Artifact_ReceivedEvent_1")?.WorkflowRevision?.WorkflowId ?? "", + PayloadId = "c4c3633b-c1dd-c4c9-8a1a-71adec3d47c3", + BucketId = "bucket1", + StartTime = DateTime.UtcNow, + Status = Status.Created, + InputMetaData = new Dictionary() + { + }, + Tasks = new List + { + new TaskExecution() + { + ExecutionId = Guid.NewGuid().ToString(), + TaskId = "root_task", + OutputDirectory = "payloadId/workflows/workflowInstanceId/executionId/", + TaskType = "router_task", + Status = TaskExecutionStatus.Succeeded, + }, + new TaskExecution() + { + ExecutionId = Guid.NewGuid().ToString(), + WorkflowInstanceId = "d32d5769-4ecf-4639-a048-6ecf2cced04a", + TaskId = "d32d5769-4ecf-4639-a048-6ecf2cced04b", + Status = TaskExecutionStatus.Dispatched, + TaskType = "remote_task", + OutputArtifacts = new Dictionary() + { + { "key1", "value1" } + }, + }, + } + } + } }; } } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs index ca7279a09..121a79738 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs @@ -14,7 +14,11 @@ * limitations under the License. */ +using Monai.Deploy.Messaging.Common; using Monai.Deploy.WorkflowManager.Common.Contracts.Models; +using Artifact = Monai.Deploy.WorkflowManager.Common.Contracts.Models.Artifact; +// ReSharper disable ArrangeObjectCreationWhenTypeEvident +// ReSharper disable RedundantEmptyObjectCreationArgumentList namespace Monai.Deploy.WorkflowManager.Common.WorkflowExecutor.IntegrationTests.TestData { @@ -3128,6 +3132,70 @@ public static class WorkflowRevisionsTestData } } }, + new WorkflowRevisionTestData() + { + Name = "Workflow_Revision_For_Artifact_ReceivedEvent_1", + WorkflowRevision = new WorkflowRevision() + { + Id = "293C95D6-91AE-4417-95CA-D54FF9E592D6", + WorkflowId = "C139946F-0FB9-452C-843A-A77F4BAACB8E", + Revision = 1, + Workflow = new Workflow() + { + Name = "Basic workflow 1", + Description = "Basic workflow 1", + Version = "1", + Tasks = new TaskObject[] + { + new TaskObject + { + Id = Guid.NewGuid().ToString(), + Type = "root_task", + Description = "Basic Workflow 1 Task 1 - root task", + Artifacts = new ArtifactMap(), + }, + new TaskObject + { + Id = Guid.NewGuid().ToString(), + Type = "remote_task", + Description = "Basic Workflow 1 Task 2 - remote_task", + Artifacts = new ArtifactMap() + { + Output = new OutputArtifact[] + { + new OutputArtifact() + { + Name = "artifact1", + Type = ArtifactType.CT, + Value = "artifactPath1", + Mandatory = true, + }, + new OutputArtifact() + { + Name = "artifact2", + Type = ArtifactType.AR, + Value = "artifactPath2", + Mandatory = true, + }, + } + } + }, + new TaskObject + { + Id = Guid.NewGuid().ToString(), + Type = "clinical_review", + Description = "Basic Workflow 1 Task 3 - clinical_review", + Artifacts = new ArtifactMap(), + } + }, + InformaticsGateway = new InformaticsGateway() + { + AeTitle = "AIDE", + DataOrigins = new string[] { "PACS1", "PACS2" } + } + } + } + }, }; } } From 69d7137b627eb52adcb82ea352aa1e667a36fc28 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Thu, 19 Oct 2023 11:57:10 +0100 Subject: [PATCH 19/21] minor fixes Signed-off-by: Lillie Dae --- .../Database/Repositories/ArtifactsRepository.cs | 3 +++ .../WorkflowExecutor.IntegrationTests/Hooks.cs | 2 +- .../WorkflowExecutor.IntegrationTests/Support/DataHelper.cs | 6 +++--- .../TestData/WorkflowInstanceTestData.cs | 2 +- .../TestData/WorkflowRevisionTestData.cs | 6 +++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs index f12d7f7bc..f88ffbd0c 100644 --- a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs +++ b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs @@ -22,6 +22,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Monai.Deploy.WorkflowManager.Common.Database.Options; +using MongoDB.Bson; using MongoDB.Driver; using Artifact = Monai.Deploy.Messaging.Common.Artifact; @@ -45,6 +46,8 @@ public static ArtifactReceivedDetails FromArtifact(Artifact artifact) => public class ArtifactReceivedItems { + public BsonObjectId Id { get; set; } + /// /// Gets or Sets WorkflowInstanceId. /// diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs index 136e096ff..acc314fdd 100755 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs @@ -86,7 +86,7 @@ public static void Init() TestExecutionConfig.MongoConfig.WorkflowCollection = "Workflows"; TestExecutionConfig.MongoConfig.WorkflowInstanceCollection = "WorkflowInstances"; TestExecutionConfig.MongoConfig.PayloadCollection = "Payloads"; - TestExecutionConfig.MongoConfig.ArtifactsCollection = "Artifacts"; + TestExecutionConfig.MongoConfig.ArtifactsCollection = "ArtifactReceivedItems"; TestExecutionConfig.MongoConfig.ExecutionStatsCollection = "ExecutionStats"; TestExecutionConfig.MinioConfig.Endpoint = config.GetValue("WorkflowManager:storage:settings:endpoint"); diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs index 52f9827a0..98e41b2f8 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs @@ -576,14 +576,14 @@ public class ArtifactsReceivedEventTestData { new() { - Type = ArtifactType.CT, + Type = ArtifactType.AR, Path = "path", } }, PayloadId = Guid.NewGuid(), CorrelationId = Guid.NewGuid().ToString(), WorkflowInstanceId = "d32d5769-4ecf-4639-a048-6ecf2cced04a", - TaskId = "d32d5769-4ecf-4639-a048-6ecf2cced04b", + TaskId = "e545de90-c936-40ab-ad11-19ef07f49607", Bucket = "bucket1", Timestamp = DateTime.UtcNow, DataOrigins = { new DataOrigin() { DataService = DataService.DIMSE, ArtifactType = ArtifactType.CT, Destination = "testAe", Source = "testAe" } }, @@ -601,7 +601,7 @@ public class ArtifactsEventTestData new ArtifactReceivedItems() { WorkflowInstanceId = "d32d5769-4ecf-4639-a048-6ecf2cced04a", - TaskId = "task1", + TaskId = "e545de90-c936-40ab-ad11-19ef07f49607", Received = DateTime.UtcNow, Artifacts = new List() { new ArtifactReceivedDetails() diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs index 1b307dabb..3fbe55c9f 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowInstanceTestData.cs @@ -2241,7 +2241,7 @@ public static WorkflowInstance CreateWorkflowInstance(string workflowName) { ExecutionId = Guid.NewGuid().ToString(), WorkflowInstanceId = "d32d5769-4ecf-4639-a048-6ecf2cced04a", - TaskId = "d32d5769-4ecf-4639-a048-6ecf2cced04b", + TaskId = "e545de90-c936-40ab-ad11-19ef07f49607", Status = TaskExecutionStatus.Dispatched, TaskType = "remote_task", OutputArtifacts = new Dictionary() diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs index 121a79738..7b0749d07 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/TestData/WorkflowRevisionTestData.cs @@ -3149,14 +3149,14 @@ public static class WorkflowRevisionsTestData { new TaskObject { - Id = Guid.NewGuid().ToString(), + Id = "e545de90-c936-40ab-ad11-19ef07f4960a", Type = "root_task", Description = "Basic Workflow 1 Task 1 - root task", Artifacts = new ArtifactMap(), }, new TaskObject { - Id = Guid.NewGuid().ToString(), + Id = "e545de90-c936-40ab-ad11-19ef07f49607", Type = "remote_task", Description = "Basic Workflow 1 Task 2 - remote_task", Artifacts = new ArtifactMap() @@ -3182,7 +3182,7 @@ public static class WorkflowRevisionsTestData }, new TaskObject { - Id = Guid.NewGuid().ToString(), + Id = "e545de90-c936-40ab-ad11-19ef07f4960b", Type = "clinical_review", Description = "Basic Workflow 1 Task 3 - clinical_review", Artifacts = new ArtifactMap(), From ee61cf936237bac0ba8e5df4cf973b0c60653147 Mon Sep 17 00:00:00 2001 From: Lillie Dae Date: Thu, 19 Oct 2023 15:03:39 +0100 Subject: [PATCH 20/21] minor fixes Signed-off-by: Lillie Dae --- .../Repositories/ArtifactsRepository.cs | 3 +- .../Services/WorkflowExecuterService.cs | 1 + .../Features/ArtifactReceivedEvent.feature | 2 +- .../Hooks.cs | 1 + .../ArtifactReceivedEventStepDefinitions.cs | 36 ++++++++++--------- .../Support/Assertions.cs | 19 ++++++---- .../Support/DataHelper.cs | 3 +- .../Support/MongoClientUtil.cs | 15 ++++++++ 8 files changed, 54 insertions(+), 26 deletions(-) diff --git a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs index f88ffbd0c..9ed7c99b2 100644 --- a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs +++ b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs @@ -46,7 +46,7 @@ public static ArtifactReceivedDetails FromArtifact(Artifact artifact) => public class ArtifactReceivedItems { - public BsonObjectId Id { get; set; } + public string Id { get; set; } /// /// Gets or Sets WorkflowInstanceId. @@ -181,6 +181,7 @@ public async Task AddOrUpdateItemAsync(string workflowInstanceId, string taskId, } else { + item.Artifacts = item.Artifacts.Concat(existing.Artifacts).ToList(); var update = Builders.Update.Set(a => a.Artifacts, item.Artifacts); await _artifactReceivedItemsCollection .UpdateOneAsync(a => a.WorkflowInstanceId == workflowInstanceId && a.TaskId == taskId, update) diff --git a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs index 6b1267a14..137a62fcf 100644 --- a/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs +++ b/src/WorkflowManager/WorkflowExecuter/Services/WorkflowExecuterService.cs @@ -215,6 +215,7 @@ public async Task ProcessArtifactReceivedAsync(ArtifactsReceivedEvent mess { previouslyReceivedArtifactsFromRepo = new List() { new ArtifactReceivedItems() { + Id = workflowInstanceId + taskId, TaskId = taskId, WorkflowInstanceId = workflowInstanceId, Artifacts = message.Artifacts.Select(ArtifactReceivedDetails.FromArtifact).ToList() diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature index 7fa7481d0..a49b38c74 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Features/ArtifactReceivedEvent.feature @@ -21,7 +21,7 @@ Publishing a artifact received event is consumed by the Workflow Manager. Scenario Outline: Publish a valid Artifact Received Event which creates an entry. Given I have a clinical workflow I have a Workflow Instance When I publish a Artifact Received Event - Then I can see a Artifact Received Item is created + Then I can see 2 Artifact Received Items is created Examples: | clinicalWorkflow | workflowInstance | artifactReceivedEvent | | Workflow_Revision_For_Artifact_ReceivedEvent_1 | Workflow_Instance_For_Artifact_ReceivedEvent_1 | Test1 | diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs index acc314fdd..121e5d119 100755 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Hooks.cs @@ -168,6 +168,7 @@ public static void ClearTestData() MongoClient?.DeleteAllWorkflowRevisionDocuments(); MongoClient?.DeleteAllWorkflowInstances(); MongoClient?.DeleteAllPayloadDocuments(); + MongoClient?.DeleteAllArtifactDocuments(); } [BeforeTestRun(Order = 3)] diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/ArtifactReceivedEventStepDefinitions.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/ArtifactReceivedEventStepDefinitions.cs index db591f090..c5c77c0f4 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/ArtifactReceivedEventStepDefinitions.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/StepDefinitions/ArtifactReceivedEventStepDefinitions.cs @@ -84,43 +84,45 @@ public async Task GivenIHaveAClinicalWorkflowIHaveAWorkflowInstance(string clini _outputHelper.WriteLine($"Retrieving workflow revision with name={clinicalWorkflowName}"); await MongoClient.CreateWorkflowRevisionDocumentAsync(workflowRevision); - await MongoClient.CreateArtifactsEventsDocumentAsync(artifactReceivedItems); + try + { + await MongoClient.CreateArtifactsEventsDocumentAsync(artifactReceivedItems); + } + catch (Exception e) + { + } - // await Task.WhenAll(task1, task2, task3, task4).ConfigureAwait(false); _outputHelper.WriteLine("Seeding Data Tasks complete"); } [Then(@"I can see a Artifact Received Item is created")] public void ThenICanSeeAArtifactReceivedItemIsCreated() { - ThenICanSeeAArtifactReceivedItemIsCreated(1); + ThenICanSeeXArtifactReceivedItemIsCreated(1); } [Then(@"I can see ([1-9]*) Artifact Received Items are created")] [Then(@"I can see ([0-9]*) Artifact Received Items is created")] - public void ThenICanSeeAArtifactReceivedItemIsCreated(int count) + public void ThenICanSeeXArtifactReceivedItemIsCreated(int count) { _outputHelper.WriteLine($"Retrieving {count} workflow instance/s using the payloadid={DataHelper.WorkflowRequestMessage.PayloadId.ToString()}"); RetryPolicy.Execute(() => { var artifactsReceivedItems = DataHelper.GetArtifactsReceivedItemsFromDB(count, DataHelper.ArtifactsReceivedEvent); - - foreach (var artifactsReceivedItem in artifactsReceivedItems) + if (artifactsReceivedItems.Any()) { - var workflowInstance = DataHelper.WorkflowInstances.FirstOrDefault(x => x.Id.Equals(artifactsReceivedItem.WorkflowInstanceId)); - var workflowRevision = DataHelper.WorkflowRevisions - .FirstOrDefault(x => x.WorkflowId.Equals(workflowInstance!.WorkflowId)); - - if (workflowRevision != null) + foreach (var artifactsReceivedItem in artifactsReceivedItems) { - Assertions.AssertArtifactsReceivedItemMatchesExpectedWorkflow(artifactsReceivedItem, workflowRevision); - } - else - { - throw new Exception($"Workflow not found for workflowId {artifactsReceivedItem.WorkflowInstanceId}"); + var wfiId = artifactsReceivedItems.FirstOrDefault().WorkflowInstanceId; + var wfi = DataHelper.WorkflowInstances.FirstOrDefault(a => a.Id == wfiId); + var workflow = DataHelper.WorkflowRevisions.FirstOrDefault(w => w.WorkflowId == wfi.WorkflowId); + if (workflow is null) + { + throw new Exception("Failing Test"); + } + Assertions.AssertArtifactsReceivedItemMatchesExpectedWorkflow(artifactsReceivedItem, workflow, wfi); } } - }); _outputHelper.WriteLine($"Retrieved {count} workflow instance/s"); } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/Assertions.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/Assertions.cs index 0ecb3b613..92f8baaa5 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/Assertions.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/Assertions.cs @@ -552,13 +552,20 @@ public void AssertExecutionStats(ExecutionStats executionStats, TaskDispatchEven Output.WriteLine("Details ExecutionStats are correct"); } - public static void AssertArtifactsReceivedItemMatchesExpectedWorkflow(ArtifactReceivedItems artifactsReceivedItem, WorkflowRevision workflowRevision) - { - artifactsReceivedItem.WorkflowInstanceId.Should().Be(workflowRevision.WorkflowId); - artifactsReceivedItem.TaskId.Should().Be(workflowRevision.Workflow!.Tasks[0].Id); - artifactsReceivedItem.Artifacts.Count.Should().Be(workflowRevision.Workflow!.Tasks[0].Artifacts.Output.Length); + public static void AssertArtifactsReceivedItemMatchesExpectedWorkflow( + ArtifactReceivedItems artifactsReceivedItem, WorkflowRevision workflowRevision, + WorkflowInstance? workflowInstance) + { + artifactsReceivedItem.WorkflowInstanceId.Should().Be(workflowInstance?.Id); + var task = workflowRevision.Workflow!.Tasks.FirstOrDefault(t => t.Id == artifactsReceivedItem.TaskId); + task.Should().NotBeNull(); + artifactsReceivedItem.TaskId.Should().Be(task!.Id); + artifactsReceivedItem.Artifacts.Count.Should().Be(task.Artifacts.Output.Length); artifactsReceivedItem.Received.Should().BeCloseTo(DateTime.UtcNow, TimeSpan.FromSeconds(20)); - artifactsReceivedItem.Artifacts[0].Path.Should().Be(workflowRevision.Workflow.Tasks[0].Artifacts.Output[0].Value); + foreach (var artifact in task.Artifacts.Output) + { + artifactsReceivedItem.Artifacts.FirstOrDefault(t => t.Type == artifact.Type).Should().NotBeNull(); + } } } } diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs index 98e41b2f8..14d6ce30f 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/DataHelper.cs @@ -303,7 +303,7 @@ public List GetArtifactsReceivedItemsFromDB(int count, Ar { ArtifactsReceivedItems = MongoClient.GetArtifactsReceivedItems(artifactsReceivedEvent); - if (ArtifactsReceivedItems.Count == count) + if (ArtifactsReceivedItems.FirstOrDefault()?.Artifacts.Count == count) { return ArtifactsReceivedItems; } @@ -600,6 +600,7 @@ public class ArtifactsEventTestData { new ArtifactReceivedItems() { + Id = "e545de90-c936-40ab-ad11-19ef07f49607" + "d32d5769-4ecf-4639-a048-6ecf2cced04a", WorkflowInstanceId = "d32d5769-4ecf-4639-a048-6ecf2cced04a", TaskId = "e545de90-c936-40ab-ad11-19ef07f49607", Received = DateTime.UtcNow, diff --git a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MongoClientUtil.cs b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MongoClientUtil.cs index 3fcf86d80..3ccded927 100644 --- a/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MongoClientUtil.cs +++ b/tests/IntegrationTests/WorkflowExecutor.IntegrationTests/Support/MongoClientUtil.cs @@ -239,6 +239,21 @@ public void DeleteAllPayloadDocuments() }); } + public void DeleteAllArtifactDocuments() + { + RetryMongo.Execute(() => + { + ArtifactsCollection.DeleteMany("{ }"); + + var artifacts = ArtifactsCollection.Find("{ }").ToList(); + + if (artifacts.Count > 0) + { + throw new Exception("All payloads are not deleted!"); + } + }); + } + #endregion Payload #region ExecutionStats From 53888376a930145568d0a5e07364de1daa94b2e5 Mon Sep 17 00:00:00 2001 From: Neil South Date: Fri, 20 Oct 2023 14:25:35 +0100 Subject: [PATCH 21/21] final adjustments Signed-off-by: Neil South --- src/TaskManager/TaskManager/TaskManager.cs | 12 +++++---- .../Repositories/ArtifactsRepository.cs | 27 +++++++++++++------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/TaskManager/TaskManager/TaskManager.cs b/src/TaskManager/TaskManager/TaskManager.cs index a51fee4c7..80369aa62 100644 --- a/src/TaskManager/TaskManager/TaskManager.cs +++ b/src/TaskManager/TaskManager/TaskManager.cs @@ -241,15 +241,17 @@ private async Task HandleCancellationTask(JsonMessage mes } var pluginAssembly = string.Empty; - ITaskPlugin? taskRunner = null; + ITaskPlugin? taskRunner; try { var taskExecution = await _taskDispatchEventService.GetByTaskExecutionIdAsync(message.Body.ExecutionId).ConfigureAwait(false); - pluginAssembly = _options.Value.TaskManager.PluginAssemblyMappings[taskExecution?.Event.TaskPluginType] ?? string.Empty; - var taskExecEvent = taskExecution?.Event; - if (taskExecEvent == null) + + var taskExecEvent = taskExecution?.Event ?? throw new InvalidOperationException("Task Event data not found."); + + pluginAssembly = string.Empty; + if (_options.Value.TaskManager.PluginAssemblyMappings.ContainsKey(taskExecution?.Event.TaskPluginType)) { - throw new InvalidOperationException("Task Event data not found."); + pluginAssembly = _options.Value.TaskManager.PluginAssemblyMappings[taskExecution?.Event.TaskPluginType]; } taskRunner = typeof(ITaskPlugin).CreateInstance(serviceProvider: _scope.ServiceProvider, typeString: pluginAssembly, _serviceScopeFactory, taskExecEvent); diff --git a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs index 9ed7c99b2..ea2bd57ea 100644 --- a/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs +++ b/src/WorkflowManager/Database/Repositories/ArtifactsRepository.cs @@ -166,6 +166,7 @@ public async Task AddOrUpdateItemAsync(string workflowInstanceId, string taskId, var item = new ArtifactReceivedItems() { + Id = workflowInstanceId + taskId, WorkflowInstanceId = workflowInstanceId, TaskId = taskId, Artifacts = artifacts.ToList() @@ -175,18 +176,28 @@ public async Task AddOrUpdateItemAsync(string workflowInstanceId, string taskId, .FindAsync(a => a.WorkflowInstanceId == workflowInstanceId && a.TaskId == taskId).ConfigureAwait(false); var existing = await result.FirstOrDefaultAsync().ConfigureAwait(false); - if (existing == null) + try { - await _artifactReceivedItemsCollection.InsertOneAsync(item).ConfigureAwait(false); + if (existing == null) + { + await _artifactReceivedItemsCollection.InsertOneAsync(item).ConfigureAwait(false); + } + else + { + item.Artifacts = item.Artifacts.Concat(existing.Artifacts).ToList(); + var update = Builders.Update.Set(a => a.Artifacts, item.Artifacts); + await _artifactReceivedItemsCollection + .UpdateOneAsync(a => a.WorkflowInstanceId == workflowInstanceId && a.TaskId == taskId, update) + .ConfigureAwait(false); + } } - else + catch (Exception ex) { - item.Artifacts = item.Artifacts.Concat(existing.Artifacts).ToList(); - var update = Builders.Update.Set(a => a.Artifacts, item.Artifacts); - await _artifactReceivedItemsCollection - .UpdateOneAsync(a => a.WorkflowInstanceId == workflowInstanceId && a.TaskId == taskId, update) - .ConfigureAwait(false); + + throw; } + + } } }