Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to version 1.0.0 of the messaging lib #869

Merged
merged 3 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions doc/dependency_decisions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2364,22 +2364,24 @@
:when: 2022-10-21 05:32:02.785856125 Z
- - :approve
- Monai.Deploy.Messaging
- :who: samrooke
- :who: neildsouth
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
:versions:
- 0.1.21
- 0.1.23
- 0.1.25
:when: 2022-12-15 21:43:10.781625468 Z
- 1.0.0
:when: 2023-29-08 21:43:10.781625468 Z
- - :approve
- Monai.Deploy.Messaging.RabbitMQ
- :who: samrooke
- :who: neildsouth
:why: Apache-2.0 (https://github.com/Project-MONAI/monai-deploy-messaging/raw/main/LICENSE)
:versions:
- 0.1.21
- 0.1.23
- 0.1.25
:when: 2022-12-15 21:43:20.975488411 Z
- 1.0.0
:when: 2023-29-08 21:43:20.975488411 Z
- - :approve
- Monai.Deploy.Storage
- :who: neildsouth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.25" />
<PackageReference Include="Monai.Deploy.Messaging" Version="1.0.0" />
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.18" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions src/Common/Configuration/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net6.0": {
"Monai.Deploy.Messaging": {
"type": "Direct",
"requested": "[0.1.25, )",
"resolved": "0.1.25",
"contentHash": "CllF1ANCwDV0ACbTU63SGxPPmgsivWP8dxgstAHvwo29w5TUs6PDCc8GcyVDTUO5Yl7/vsifdwcs3P/cYBe69w==",
"requested": "[1.0.0, )",
"resolved": "1.0.0",
"contentHash": "Xr1V3ZrSJByfUP4w+aiOAqC7Uzt1GqRXj35qSTQs9C1oI4gCiBN4wnre0SSvoA7vHQNZPGWNWXtiqbI7Cov3Mg==",
"dependencies": {
"Ardalis.GuardClauses": "4.1.1",
"Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21",
Expand Down
8 changes: 4 additions & 4 deletions src/Common/Miscellaneous/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
},
"Monai.Deploy.Messaging": {
"type": "Transitive",
"resolved": "0.1.25",
"contentHash": "CllF1ANCwDV0ACbTU63SGxPPmgsivWP8dxgstAHvwo29w5TUs6PDCc8GcyVDTUO5Yl7/vsifdwcs3P/cYBe69w==",
"resolved": "1.0.0",
"contentHash": "Xr1V3ZrSJByfUP4w+aiOAqC7Uzt1GqRXj35qSTQs9C1oI4gCiBN4wnre0SSvoA7vHQNZPGWNWXtiqbI7Cov3Mg==",
"dependencies": {
"Ardalis.GuardClauses": "4.1.1",
"Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21",
Expand Down Expand Up @@ -205,10 +205,10 @@
"resolved": "6.0.0",
"contentHash": "TY8/9+tI0mNaUMgntOxxaq2ndTkdXqLSxvPmas7XEqOlv9lQtB7wLjYGd756lOaO7Dvb5r/WXhluM+0Xe87v5Q=="
},
"Monai.Deploy.WorkflowManager.Common.configuration": {
"monai.deploy.workflowmanager.common.configuration": {
"type": "Project",
"dependencies": {
"Monai.Deploy.Messaging": "[0.1.25, )",
"Monai.Deploy.Messaging": "[1.0.0, )",
"Monai.Deploy.Storage": "[0.2.18, )"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@


<ItemGroup>
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.25" />
<PackageReference Include="Monai.Deploy.Messaging" Version="1.0.0" />
<PackageReference Include="Mongo.Migration" Version="3.1.4" />
<PackageReference Include="MongoDB.Bson" Version="2.19.0" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/TaskManager/API/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net6.0": {
"Monai.Deploy.Messaging": {
"type": "Direct",
"requested": "[0.1.25, )",
"resolved": "0.1.25",
"contentHash": "CllF1ANCwDV0ACbTU63SGxPPmgsivWP8dxgstAHvwo29w5TUs6PDCc8GcyVDTUO5Yl7/vsifdwcs3P/cYBe69w==",
"requested": "[1.0.0, )",
"resolved": "1.0.0",
"contentHash": "Xr1V3ZrSJByfUP4w+aiOAqC7Uzt1GqRXj35qSTQs9C1oI4gCiBN4wnre0SSvoA7vHQNZPGWNWXtiqbI7Cov3Mg==",
"dependencies": {
"Ardalis.GuardClauses": "4.1.1",
"Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21",
Expand Down
6 changes: 3 additions & 3 deletions src/TaskManager/Database/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@
},
"Monai.Deploy.Messaging": {
"type": "Transitive",
"resolved": "0.1.25",
"contentHash": "CllF1ANCwDV0ACbTU63SGxPPmgsivWP8dxgstAHvwo29w5TUs6PDCc8GcyVDTUO5Yl7/vsifdwcs3P/cYBe69w==",
"resolved": "1.0.0",
"contentHash": "Xr1V3ZrSJByfUP4w+aiOAqC7Uzt1GqRXj35qSTQs9C1oI4gCiBN4wnre0SSvoA7vHQNZPGWNWXtiqbI7Cov3Mg==",
"dependencies": {
"Ardalis.GuardClauses": "4.1.1",
"Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21",
Expand Down Expand Up @@ -678,7 +678,7 @@
"monai.deploy.workflowmanager.taskmanager.api": {
"type": "Project",
"dependencies": {
"Monai.Deploy.Messaging": "[0.1.25, )",
"Monai.Deploy.Messaging": "[1.0.0, )",
"Mongo.Migration": "[3.1.4, )",
"MongoDB.Bson": "[2.19.0, )"
}
Expand Down
12 changes: 6 additions & 6 deletions src/TaskManager/Plug-ins/AideClinicalReview/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@
},
"Monai.Deploy.Messaging": {
"type": "Transitive",
"resolved": "0.1.25",
"contentHash": "CllF1ANCwDV0ACbTU63SGxPPmgsivWP8dxgstAHvwo29w5TUs6PDCc8GcyVDTUO5Yl7/vsifdwcs3P/cYBe69w==",
"resolved": "1.0.0",
"contentHash": "Xr1V3ZrSJByfUP4w+aiOAqC7Uzt1GqRXj35qSTQs9C1oI4gCiBN4wnre0SSvoA7vHQNZPGWNWXtiqbI7Cov3Mg==",
"dependencies": {
"Ardalis.GuardClauses": "4.1.1",
"Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21",
Expand Down Expand Up @@ -700,14 +700,14 @@
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
},
"Monai.Deploy.WorkflowManager.Common.configuration": {
"monai.deploy.workflowmanager.common.configuration": {
"type": "Project",
"dependencies": {
"Monai.Deploy.Messaging": "[0.1.25, )",
"Monai.Deploy.Messaging": "[1.0.0, )",
"Monai.Deploy.Storage": "[0.2.18, )"
}
},
"Monai.Deploy.WorkflowManager.Common.miscellaneous": {
"monai.deploy.workflowmanager.common.miscellaneous": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.1.1, )",
Expand All @@ -719,7 +719,7 @@
"monai.deploy.workflowmanager.taskmanager.api": {
"type": "Project",
"dependencies": {
"Monai.Deploy.Messaging": "[0.1.25, )",
"Monai.Deploy.Messaging": "[1.0.0, )",
"Mongo.Migration": "[3.1.4, )",
"MongoDB.Bson": "[2.19.0, )"
}
Expand Down
12 changes: 6 additions & 6 deletions src/TaskManager/Plug-ins/Argo/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@
},
"Monai.Deploy.Messaging": {
"type": "Transitive",
"resolved": "0.1.25",
"contentHash": "CllF1ANCwDV0ACbTU63SGxPPmgsivWP8dxgstAHvwo29w5TUs6PDCc8GcyVDTUO5Yl7/vsifdwcs3P/cYBe69w==",
"resolved": "1.0.0",
"contentHash": "Xr1V3ZrSJByfUP4w+aiOAqC7Uzt1GqRXj35qSTQs9C1oI4gCiBN4wnre0SSvoA7vHQNZPGWNWXtiqbI7Cov3Mg==",
"dependencies": {
"Ardalis.GuardClauses": "4.1.1",
"Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21",
Expand Down Expand Up @@ -1180,14 +1180,14 @@
"resolved": "13.0.1",
"contentHash": "E1e/xFXB+Cbn7pLVlr+8E3nemEitIReVgmAMMMveADvZvXGuSGHP+1Cg6oA+SUfwXHfaXLQn4STCaPKtdIJkWA=="
},
"Monai.Deploy.WorkflowManager.Common.configuration": {
"monai.deploy.workflowmanager.common.configuration": {
"type": "Project",
"dependencies": {
"Monai.Deploy.Messaging": "[0.1.25, )",
"Monai.Deploy.Messaging": "[1.0.0, )",
"Monai.Deploy.Storage": "[0.2.18, )"
}
},
"Monai.Deploy.WorkflowManager.Common.miscellaneous": {
"monai.deploy.workflowmanager.common.miscellaneous": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.1.1, )",
Expand All @@ -1199,7 +1199,7 @@
"monai.deploy.workflowmanager.taskmanager.api": {
"type": "Project",
"dependencies": {
"Monai.Deploy.Messaging": "[0.1.25, )",
"Monai.Deploy.Messaging": "[1.0.0, )",
"Mongo.Migration": "[3.1.4, )",
"MongoDB.Bson": "[2.19.0, )"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Monai.Deploy.Storage" Version="0.2.18" />
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.25" />
<PackageReference Include="Monai.Deploy.Messaging" Version="1.0.0" />
<PackageReference Include="Monai.Deploy.Storage.MinIO" Version="0.2.18" />
<PackageReference Include="Monai.Deploy.Messaging.RabbitMQ" Version="0.1.25" />
<PackageReference Include="Monai.Deploy.Messaging.RabbitMQ" Version="1.0.0" />
<PackageReference Include="Monai.Deploy.Security" Version="0.1.3" />
<PackageReference Include="Mongo.Migration" Version="3.1.4" />
<PackageReference Include="NLog" Version="5.1.2" />
Expand Down
22 changes: 11 additions & 11 deletions src/TaskManager/TaskManager/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
},
"Monai.Deploy.Messaging": {
"type": "Direct",
"requested": "[0.1.25, )",
"resolved": "0.1.25",
"contentHash": "CllF1ANCwDV0ACbTU63SGxPPmgsivWP8dxgstAHvwo29w5TUs6PDCc8GcyVDTUO5Yl7/vsifdwcs3P/cYBe69w==",
"requested": "[1.0.0, )",
"resolved": "1.0.0",
"contentHash": "Xr1V3ZrSJByfUP4w+aiOAqC7Uzt1GqRXj35qSTQs9C1oI4gCiBN4wnre0SSvoA7vHQNZPGWNWXtiqbI7Cov3Mg==",
"dependencies": {
"Ardalis.GuardClauses": "4.1.1",
"Microsoft.Extensions.Diagnostics.HealthChecks": "6.0.21",
Expand All @@ -86,11 +86,11 @@
},
"Monai.Deploy.Messaging.RabbitMQ": {
"type": "Direct",
"requested": "[0.1.25, )",
"resolved": "0.1.25",
"contentHash": "p/Si1XzNUiTdN1gYFKxYy9w/bVzOYooK9DEW7JJs8D8Sghzkvh0GyWV3vUO9dVkEcU0oT5HmZ4x+nz8BzAkz6g==",
"requested": "[1.0.0, )",
"resolved": "1.0.0",
"contentHash": "1UiWYO+EjNZSFrL/SUElqmBo3TktG+XiCXm8oyXheEWz/CuZS2hhepYB4BDz7XAohUqt2/Hv7wpLiaauiaIFZg==",
"dependencies": {
"Monai.Deploy.Messaging": "0.1.25",
"Monai.Deploy.Messaging": "1.0.0",
"Polly": "7.2.4",
"RabbitMQ.Client": "6.5.0"
}
Expand Down Expand Up @@ -1589,14 +1589,14 @@
"resolved": "0.6.2",
"contentHash": "jPao/LdUNLUz8rn3H1D8W7wQbZsRZM0iayvWI4xGejJg3XJHT56gcmYdgmCGPdJF1UEBqUjucCRrFB+4HbJsbw=="
},
"Monai.Deploy.WorkflowManager.Common.configuration": {
"monai.deploy.workflowmanager.common.configuration": {
"type": "Project",
"dependencies": {
"Monai.Deploy.Messaging": "[0.1.25, )",
"Monai.Deploy.Messaging": "[1.0.0, )",
"Monai.Deploy.Storage": "[0.2.18, )"
}
},
"Monai.Deploy.WorkflowManager.Common.miscellaneous": {
"monai.deploy.workflowmanager.common.miscellaneous": {
"type": "Project",
"dependencies": {
"Ardalis.GuardClauses": "[4.1.1, )",
Expand All @@ -1616,7 +1616,7 @@
"monai.deploy.workflowmanager.taskmanager.api": {
"type": "Project",
"dependencies": {
"Monai.Deploy.Messaging": "[0.1.25, )",
"Monai.Deploy.Messaging": "[1.0.0, )",
"Mongo.Migration": "[3.1.4, )",
"MongoDB.Bson": "[2.19.0, )"
}
Expand Down
3 changes: 1 addition & 2 deletions src/WorkflowManager/Common/Services/PayloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
var _serviceScopeFactory = serviceScopeFactory ?? throw new ArgumentNullException(nameof(serviceScopeFactory));
var scope = _serviceScopeFactory.CreateScope();

_storageService = scope.ServiceProvider.GetService<IStorageService>() ?? throw new ArgumentNullException(nameof(IStorageService));

Check warning on line 58 in src/WorkflowManager/Common/Services/PayloadService.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

The parameter name 'IStorageService' is not declared in the argument list. (https://rules.sonarsource.com/csharp/RSPEC-3928)
}

public async Task<Payload?> CreateAsync(WorkflowRequestEvent eventPayload)
Expand All @@ -82,8 +82,7 @@
FileCount = eventPayload.FileCount,
CorrelationId = eventPayload.CorrelationId,
Bucket = eventPayload.Bucket,
CalledAeTitle = eventPayload.CalledAeTitle,
CallingAeTitle = eventPayload.CallingAeTitle,
DataTrigger = eventPayload.DataTrigger,
Timestamp = eventPayload.Timestamp,
PatientDetails = patientDetails,
PayloadDeleted = PayloadDeleted.No
Expand Down Expand Up @@ -142,7 +141,7 @@
{
var payloadDto = new PayloadDto(payload);
var wfs = workflowInstances?.Where(wf => wf.PayloadId == payload.PayloadId);
if (wfs == null || wfs.Any() is false)

Check warning on line 144 in src/WorkflowManager/Common/Services/PayloadService.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove the unnecessary Boolean literal(s). (https://rules.sonarsource.com/csharp/RSPEC-1125)
{
payloadDto.PayloadStatus = PayloadStatus.Complete;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// Copyright 2023 Guy’s and St Thomas’ NHS Foundation Trust
//
// 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 Monai.Deploy.Messaging.Events;
using Monai.Deploy.WorkflowManager.Common.Contracts.Models;
using Mongo.Migration.Migrations.Document;
using MongoDB.Bson;
using MongoDB.Bson.Serialization;

namespace Monai.Deploy.WorkflowManager.Common.Contracts.Migrations
{
public class M003_Payload_addDataTrigger : DocumentMigration<Payload>

Check warning on line 24 in src/WorkflowManager/Contracts/Migrations/M003_Payload_addDataTrigger.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Rename class 'M003_Payload_addDataTrigger' to match pascal case naming rules, consider using 'M003PayloadaddDataTrigger'. (https://rules.sonarsource.com/csharp/RSPEC-101)
{
public M003_Payload_addDataTrigger() : base("1.0.3") { }

public override void Up(BsonDocument document)
{
var calling = document.GetValue("CallingAeTitle").AsString;
var called = document.GetValue("CalledAeTitle").AsString;
document.Remove("CallingAeTitle");
document.Remove("CalledAeTitle");
var trigger = new DataOrigin { DataService = DataService.DIMSE, Source = calling, Destination = called };
document.Add("DataTrigger", trigger.ToJson(), true);
}

public override void Down(BsonDocument document)
{
try
{
var trigger = BsonSerializer.Deserialize<DataOrigin>(document.GetValue("DataTrigger").ToBson());
document.Remove("DataTrigger");
document.Add("CallingAeTitle", trigger.Source);
document.Add("CalledAeTitle", trigger.Destination);
}
catch
{ // can ignore we dont want failures stopping startup !
}
}
}
}
15 changes: 9 additions & 6 deletions src/WorkflowManager/Contracts/Models/Payload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System;
using System.Collections.Generic;
using Monai.Deploy.Messaging.Common;
using Monai.Deploy.Messaging.Events;
using Monai.Deploy.WorkflowManager.Common.Contracts.Migrations;
using Mongo.Migration.Documents;
using Mongo.Migration.Documents.Attributes;
Expand All @@ -26,11 +27,11 @@

namespace Monai.Deploy.WorkflowManager.Common.Contracts.Models
{
[CollectionLocation("Payloads"), RuntimeVersion("1.0.1")]
[CollectionLocation("Payloads"), RuntimeVersion("1.0.3")]
public class Payload : IDocument
{
[JsonConverter(typeof(DocumentVersionConvert)), BsonSerializer(typeof(DocumentVersionConverBson))]
public DocumentVersion Version { get; set; } = new DocumentVersion(1, 0, 1);
public DocumentVersion Version { get; set; } = new DocumentVersion(1, 0, 3);

[JsonProperty(PropertyName = "id")]
public string Id { get; set; } = string.Empty;
Expand All @@ -53,11 +54,11 @@
[JsonProperty(PropertyName = "bucket")]
public string Bucket { get; set; } = string.Empty;

[JsonProperty(PropertyName = "calling_aetitle")]
public string CallingAeTitle { get; set; } = string.Empty;
//[JsonProperty(PropertyName = "calling_aetitle")]
//public string CallingAeTitle { get; set; } = string.Empty;

Check warning on line 58 in src/WorkflowManager/Contracts/Models/Payload.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Remove this commented out code. (https://rules.sonarsource.com/csharp/RSPEC-125)

[JsonProperty(PropertyName = "called_aetitle")]
public string CalledAeTitle { get; set; } = string.Empty;
//[JsonProperty(PropertyName = "called_aetitle")]
//public string CalledAeTitle { get; set; } = string.Empty;

[JsonProperty(PropertyName = "timestamp")]
public DateTime Timestamp { get; set; }
Expand All @@ -70,6 +71,8 @@

[JsonProperty(PropertyName = "patient_details")]
public PatientDetails PatientDetails { get; set; } = new PatientDetails();

public DataOrigin DataTrigger { get; set; } = new DataOrigin { DataService = DataService.DIMSE };
}

public enum PayloadDeleted
Expand Down
3 changes: 1 addition & 2 deletions src/WorkflowManager/Contracts/Models/PayloadDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ public PayloadDto(Payload payload)
FileCount = payload.FileCount;
CorrelationId = payload.CorrelationId;
Bucket = payload.Bucket;
CallingAeTitle = payload.CallingAeTitle;
CalledAeTitle = payload.CalledAeTitle;
DataTrigger = payload.DataTrigger;
Timestamp = payload.Timestamp;
Files = payload.Files;
PatientDetails = payload.PatientDetails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@


<ItemGroup>
<PackageReference Include="Monai.Deploy.Messaging" Version="0.1.25" />
<PackageReference Include="Monai.Deploy.Messaging" Version="1.0.0" />
<PackageReference Include="Mongo.Migration" Version="3.1.4" />
<PackageReference Include="MongoDB.Bson" Version="2.19.0" />
</ItemGroup>
Expand Down
Loading
Loading