Skip to content

Commit d65a063

Browse files
committed
merge in from develop
Signed-off-by: Neil South <[email protected]>
2 parents 07f6d1e + 77fb6b8 commit d65a063

File tree

22 files changed

+485
-280
lines changed

22 files changed

+485
-280
lines changed

docs/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
# Changelog
1919

20+
Added a new Email plugin, this pulls together information and sends a Message (rabbitmq) to a queue for processing via an external application (for the actual sending)
21+
2022
Renamed the (Generated) Argo client to ArgoGeneratedClient, added a new ArgoClient using just the methods used by this codebase.
2123

2224
Enhanced the ArgoClient -> Argo_Get_WorkflowLogsAsync method to decode the json better and make the logs extracted from Argo more readable.

src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -733,27 +733,27 @@
733733
"monai.deploy.workflowmanager.configuration": {
734734
"type": "Project",
735735
"dependencies": {
736-
"Monai.Deploy.Messaging": "[0.1.23, )",
737-
"Monai.Deploy.Storage": "[0.2.15, )"
736+
"Monai.Deploy.Messaging": "0.1.23",
737+
"Monai.Deploy.Storage": "0.2.15"
738738
}
739739
},
740740
"monai.deploy.workflowmanager.shared": {
741741
"type": "Project",
742742
"dependencies": {
743-
"Ardalis.GuardClauses": "4.0.1",
744-
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15",
745-
"Monai.Deploy.WorkflowManager.Configuration": "1.0.0",
746-
"fo-dicom": "5.0.3"
743+
"Ardalis.GuardClauses": "[4.0.1, )",
744+
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )",
745+
"Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )",
746+
"fo-dicom": "[5.0.3, )"
747747
}
748748
},
749749
"monai.deploy.workflowmanager.taskmanager.api": {
750750
"type": "Project",
751751
"dependencies": {
752-
"Monai.Deploy.Messaging": "[0.1.22, )",
753-
"Mongo.Migration": "[3.1.4, )",
754-
"MongoDB.Bson": "[2.19.0, )"
752+
"Monai.Deploy.Messaging": "0.1.23",
753+
"Mongo.Migration": "3.1.4",
754+
"MongoDB.Bson": "2.19.0"
755755
}
756756
}
757757
}
758758
}
759-
}
759+
}

src/TaskManager/Plug-ins/Argo/packages.lock.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,27 +1203,27 @@
12031203
"monai.deploy.workflowmanager.configuration": {
12041204
"type": "Project",
12051205
"dependencies": {
1206-
"Monai.Deploy.Messaging": "[0.1.23, )",
1207-
"Monai.Deploy.Storage": "[0.2.15, )"
1206+
"Monai.Deploy.Messaging": "0.1.23",
1207+
"Monai.Deploy.Storage": "0.2.15"
12081208
}
12091209
},
12101210
"monai.deploy.workflowmanager.shared": {
12111211
"type": "Project",
12121212
"dependencies": {
1213-
"Ardalis.GuardClauses": "4.0.1",
1214-
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15",
1215-
"Monai.Deploy.WorkflowManager.Configuration": "1.0.0",
1216-
"fo-dicom": "5.0.3"
1213+
"Ardalis.GuardClauses": "[4.0.1, )",
1214+
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )",
1215+
"Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )",
1216+
"fo-dicom": "[5.0.3, )"
12171217
}
12181218
},
12191219
"monai.deploy.workflowmanager.taskmanager.api": {
12201220
"type": "Project",
12211221
"dependencies": {
1222-
"Monai.Deploy.Messaging": "[0.1.22, )",
1223-
"Mongo.Migration": "[3.1.4, )",
1224-
"MongoDB.Bson": "[2.19.0, )"
1222+
"Monai.Deploy.Messaging": "0.1.23",
1223+
"Mongo.Migration": "3.1.4",
1224+
"MongoDB.Bson": "2.19.0"
12251225
}
12261226
}
12271227
}
12281228
}
1229-
}
1229+
}

src/TaskManager/Plug-ins/Email/EmailPlugin.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616

1717

1818
using System.Net.Mail;
19-
using System.Text.Json;
2019
using Ardalis.GuardClauses;
21-
using FellowOakDicom.Serialization;
2220
using FellowOakDicom;
2321
using Microsoft.Extensions.Logging;
2422
using Microsoft.Extensions.Options;
@@ -113,8 +111,6 @@ private void ValidateEventAndInit()
113111
}
114112
}
115113

116-
117-
118114
public override async Task<ExecutionStatus> ExecuteTask(CancellationToken cancellationToken = default)
119115
{
120116
using var loggingScope = _logger.BeginScope(new Dictionary<string, object>
@@ -226,7 +222,11 @@ private async Task SendEmailRequestEvent(JsonMessage<EmailRequestEvent> message)
226222
_logger.SendEmailRequestMessageSent(_requestQueue);
227223
}
228224

229-
public override Task<ExecutionStatus> GetStatus(string identity, TaskCallbackEvent callbackEvent, CancellationToken cancellationToken = default) => throw new NotImplementedException();
230-
public override Task HandleTimeout(string identity) => Task.CompletedTask; // not implemented;
225+
public override Task<ExecutionStatus> GetStatus(string identity, TaskCallbackEvent callbackEvent, CancellationToken cancellationToken = default)
226+
{
227+
var result = new ExecutionStatus() { Status = TaskExecutionStatus.Succeeded };
228+
return Task.FromResult(result);
229+
}
230+
public override Task HandleTimeout(string identity) => Task.CompletedTask;
231231
}
232232
}

src/TaskManager/TaskManager/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
using Monai.Deploy.WorkflowManager.Shared.Services;
4242
using Microsoft.AspNetCore.Builder;
4343

44-
4544
namespace Monai.Deploy.WorkflowManager.TaskManager
4645
{
4746
public class Program

src/TaskManager/TaskManager/packages.lock.json

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,60 +1920,78 @@
19201920
"monai.deploy.workflowmanager.configuration": {
19211921
"type": "Project",
19221922
"dependencies": {
1923-
"Monai.Deploy.Messaging": "[0.1.23, )",
1924-
"Monai.Deploy.Storage": "[0.2.15, )"
1923+
"Monai.Deploy.Messaging": "0.1.23",
1924+
"Monai.Deploy.Storage": "0.2.15"
19251925
}
19261926
},
19271927
"monai.deploy.workflowmanager.shared": {
19281928
"type": "Project",
19291929
"dependencies": {
1930-
"Ardalis.GuardClauses": "4.0.1",
1931-
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "6.0.15",
1932-
"Monai.Deploy.WorkflowManager.Configuration": "1.0.0",
1933-
"fo-dicom": "5.0.3"
1930+
"Ardalis.GuardClauses": "[4.0.1, )",
1931+
"Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions": "[6.0.15, )",
1932+
"Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )",
1933+
"fo-dicom": "[5.0.3, )"
19341934
}
19351935
},
19361936
"monai.deploy.workflowmanager.taskmanager.aideclinicalreview": {
19371937
"type": "Project",
19381938
"dependencies": {
1939-
"Monai.Deploy.WorkflowManager.Configuration": "1.0.0",
1940-
"Monai.Deploy.WorkflowManager.Shared": "1.0.0",
1941-
"Monai.Deploy.WorkflowManager.TaskManager.API": "1.0.0"
1939+
"Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )",
1940+
"Monai.Deploy.WorkflowManager.Shared": "[1.0.0, )",
1941+
"Monai.Deploy.WorkflowManager.TaskManager.API": "[1.0.0, )"
19421942
}
19431943
},
19441944
"monai.deploy.workflowmanager.taskmanager.api": {
19451945
"type": "Project",
19461946
"dependencies": {
1947-
"Monai.Deploy.Messaging": "[0.1.22, )",
1947+
"Monai.Deploy.Messaging": "[0.1.23, )",
19481948
"Mongo.Migration": "[3.1.4, )",
19491949
"MongoDB.Bson": "[2.19.0, )"
19501950
}
19511951
},
19521952
"monai.deploy.workflowmanager.taskmanager.argo": {
19531953
"type": "Project",
19541954
"dependencies": {
1955-
"KubernetesClient": "10.1.4",
1956-
"Microsoft.AspNetCore.Mvc.Core": "2.2.5",
1955+
"KubernetesClient": "[10.1.4, )",
1956+
"Microsoft.AspNetCore.Mvc.Core": "[2.2.5, )",
1957+
"Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )",
1958+
"Monai.Deploy.WorkflowManager.Shared": "[1.0.0, )",
1959+
"Monai.Deploy.WorkflowManager.TaskManager.API": "[1.0.0, )"
1960+
}
1961+
},
1962+
"monai.deploy.workflowmanager.taskmanager.database": {
1963+
"type": "Project",
1964+
"dependencies": {
1965+
"Monai.Deploy.WorkflowManager.TaskManager.API": "[1.0.0, )",
1966+
"MongoDB.Driver": "[2.19.0, )"
1967+
}
1968+
},
1969+
"monai.deploy.workflowmanager.taskmanager.docker": {
1970+
"type": "Project",
1971+
"dependencies": {
1972+
"Docker.DotNet": "3.125.13",
19571973
"Monai.Deploy.WorkflowManager.Configuration": "1.0.0",
1958-
"Monai.Deploy.WorkflowManager.Shared": "1.0.0",
19591974
"Monai.Deploy.WorkflowManager.TaskManager.API": "1.0.0"
19601975
}
19611976
},
1962-
"monai.deploy.workflowmanager.taskmanager.database": {
1977+
"monai.deploy.workflowmanager.taskmanager.email": {
19631978
"type": "Project",
19641979
"dependencies": {
1980+
"Monai.Deploy.WorkflowManager.Configuration": "1.0.0",
1981+
"Monai.Deploy.WorkflowManager.Shared": "1.0.0",
19651982
"Monai.Deploy.WorkflowManager.TaskManager.API": "1.0.0",
1966-
"MongoDB.Driver": "2.19.0"
1983+
"fo-dicom": "5.0.3"
19671984
}
19681985
},
1969-
"monai.deploy.workflowmanager.taskmanager.docker": {
1986+
"monai.deploy.workflowmanager.taskmanager.email": {
19701987
"type": "Project",
19711988
"dependencies": {
1972-
"Docker.DotNet": "[3.125.13, )",
19731989
"Monai.Deploy.WorkflowManager.Configuration": "[1.0.0, )",
1974-
"Monai.Deploy.WorkflowManager.TaskManager.API": "[1.0.0, )"
1990+
"Monai.Deploy.WorkflowManager.Shared": "[1.0.0, )",
1991+
"Monai.Deploy.WorkflowManager.TaskManager.API": "[1.0.0, )",
1992+
"fo-dicom": "[5.0.3, )"
19751993
}
19761994
}
19771995
}
19781996
}
1979-
}
1997+
}

src/WorkflowManager/WorkflowManager/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace Monai.Deploy.WorkflowManager
5252
{
5353
#pragma warning disable SA1600 // Elements should be documented
5454

55-
internal class Program
55+
public class Program
5656
{
5757
protected Program()
5858
{

tests/IntegrationTests/TaskManager.IntegrationTests/Features/ClinicalReview.feature

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,80 +12,68 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
@IntergrationTests
15+
@IntegrationTests
1616
Feature: ClinicalReview
1717

1818
Integration tests for the clinical review plugin
1919

2020
@ClinicalReviewPlugin
2121
Scenario: Clincial review task dispatch event triggers a clinical review request event with all patient details
22-
Given I have a bucket in MinIO bucket1
2322
When A Task Dispatch event is published Task_Dispatch_Clinical_Review_Full_Patient_Details
2423
Then A Clincial Review Request event is published
2524

2625
@ClinicalReviewPlugin
2726
Scenario: Clincial review task dispatch event triggers a clinical review request event with partial patient details
28-
Given I have a bucket in MinIO bucket1
2927
When A Task Dispatch event is published Task_Dispatch_Clinical_Review_Partial_Patient_Details
3028
Then A Clincial Review Request event is published
3129

3230
@ClinicalReviewPlugin
3331
Scenario: Clincial review task dispatch event triggers a clinical review request event with no patient details
34-
Given I have a bucket in MinIO bucket1
3532
When A Task Dispatch event is published Task_Dispatch_Clinical_Review_No_Patient_Details
3633
Then A Clincial Review Request event is published
3734

3835
@ClinicalReviewPlugin
3936
Scenario: Clincial review task dispatch event triggers a clinical review request event with multiple files
40-
Given I have a bucket in MinIO bucket1
4137
When A Task Dispatch event is published Task_Dispatch_Clinical_Review_Multi_File
4238
Then A Clincial Review Request event is published
4339

4440
@ClinicalReviewPlugin
4541
Scenario: Clincial review task dispatch event triggers clincial review event with single reviewer role
46-
Given I have a bucket in MinIO bucket1
4742
When A Task Dispatch event is published Task_Dispatch_Clinical_Reviewer_Role_Single_Role
4843
Then A Clincial Review Request event is published
4944

5045
@ClinicalReviewPlugin
5146
Scenario: Clincial review task dispatch event triggers clincial review event with default reviewer role
52-
Given I have a bucket in MinIO bucket1
5347
When A Task Dispatch event is published Task_Dispatch_Clinical_Reviewer_Role_Mutiple_Roles
5448
Then A Clincial Review Request event is published
5549

5650
@ClinicalReviewPlugin
5751
Scenario: Clincial review task dispatch event triggers clincial review event with mutiple reviewer roles
58-
Given I have a bucket in MinIO bucket1
5952
When A Task Dispatch event is published Task_Dispatch_Clinical_Reviewer_Role_Default_Role
6053
Then A Clincial Review Request event is published
6154

6255
@ClinicalReviewPlugin
6356
Scenario: Clincial review task dispatch event triggers clincial review event with application name
64-
Given I have a bucket in MinIO bucket1
6557
When A Task Dispatch event is published Task_Dispatch_Clinical_Review_Application_Name
6658
Then A Clincial Review Request event is published
6759

6860
@ClinicalReviewPlugin
6961
Scenario: Clincial review task dispatch event triggers clincial review event with application version
70-
Given I have a bucket in MinIO bucket1
7162
When A Task Dispatch event is published Task_Dispatch_Clinical_Review_Application_Version
7263
Then A Clincial Review Request event is published
7364

7465
@ClinicalReviewPlugin
7566
Scenario: Clincial review task dispatch event triggers clincial review event with QA mode
76-
Given I have a bucket in MinIO bucket1
7767
When A Task Dispatch event is published Task_Dispatch_Clinical_Review_QA_Mode
7868
Then A Clincial Review Request event is published
7969

8070
@ClinicalReviewPlugin
8171
Scenario: Clincial review task dispatch event triggers clincial review event with reviewed execution Id
82-
Given I have a bucket in MinIO bucket1
8372
When A Task Dispatch event is published Task_Dispatch_Clinical_Review_Reviewed_Execution_Id
8473
Then A Clincial Review Request event is published
8574

8675
@ClinicalReviewPlugin
8776
Scenario Outline: Clincial review task dispatch event triggers clincial review event with notifications
88-
Given I have a bucket in MinIO bucket1
8977
When A Task Dispatch event is published <testData>
9078
Then A Clincial Review Request event is published
9179
Examples:
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2023 MONAI Consortium
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
@IntegrationTests
16+
Feature: EmialNotification
17+
18+
Integration tests for the email plugin
19+
20+
@EmailPlugin
21+
Scenario: Email task dispatch event triggers an email request event with all relevant args
22+
Given I have an input DICOM file saved in MinIO for TaskDispatch Task_Dispatch_Email_All
23+
When A Task Dispatch event is published Task_Dispatch_Email_All
24+
Then An email request event is published
25+
26+
@EmailPlugin
27+
Scenario: Email task dispatch event triggers an email request event with only emails arg
28+
Given I have an input DICOM file saved in MinIO for TaskDispatch Task_Dispatch_Email_Emails
29+
When A Task Dispatch event is published Task_Dispatch_Email_Emails
30+
Then An email request event is published
31+
32+
@EmailPlugin
33+
Scenario: Email task dispatch event triggers an email request event with only roles arg
34+
Given I have an input DICOM file saved in MinIO for TaskDispatch Task_Dispatch_Email_Roles
35+
When A Task Dispatch event is published Task_Dispatch_Email_Roles
36+
Then An email request event is published

tests/IntegrationTests/TaskManager.IntegrationTests/Features/TaskUpdate.feature

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ Integration tests for testing TaskUpdateEvents from TaskManager
1919

2020
@TaskDispatch_TaskUpdate
2121
Scenario: TaskUpdateEvent is published with status Accepted after receiving a valid TaskDispatchEvent
22-
Given I have a bucket in MinIO bucket1
2322
When A Task Dispatch event is published Task_Dispatch_Accepted
2423
Then A Task Update event with status Accepted is published with Task Dispatch details
2524

2625
@TaskDispatch_TaskUpdate
2726
Scenario Outline: TaskUpdateEvent is published with status Failed after receiving an invalid TaskDispatchEvent
28-
Given I have a bucket in MinIO bucket1
2927
When A Task Dispatch event is published <TaskDispatchEvent>
3028
Then A Task Update event with status Failed is published with Task Dispatch details
3129
Examples:
@@ -39,7 +37,6 @@ Scenario Outline: TaskUpdateEvent is published with status Failed after receivin
3937
@Ignore
4038
@TaskCallback_TaskUpdate
4139
Scenario Outline: TaskUpdateEvent is published with correct status upon receiving a valid TaskCallbackEvent
42-
Given I have a bucket in MinIO bucket1
4340
And I have Task Dispatch Info saved in Mongo Task_Dispatch_Basic_Clinical_Review
4441
When A Task Callback event is published <taskCallbackEvent>
4542
Then A Task Update event with status <status> is published with Task Callback details

0 commit comments

Comments
 (0)