Skip to content

Commit 683f503

Browse files
authored
Merge branch 'develop' into gitversion
2 parents 7075f1f + 7b223f1 commit 683f503

File tree

29 files changed

+759
-95
lines changed

29 files changed

+759
-95
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124

125125
- name: Anchore Container Scan
126126
id: anchore-scan
127-
uses: anchore/[email protected].1
127+
uses: anchore/[email protected].2
128128
continue-on-error: true
129129
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.head_ref, 'release/') }}
130130
with:

.github/workflows/nightly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Anchore Container Scan
8080
id: anchore-scan
81-
uses: anchore/[email protected].1
81+
uses: anchore/[email protected].2
8282
with:
8383
image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }}
8484
fail-build: true

.github/workflows/security.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
fetch-depth: 0
3232

3333
- name: TruffleHog OSS
34-
uses: trufflesecurity/trufflehog@main
34+
uses: trufflesecurity/trufflehog@v3.23.0
3535
with:
3636
path: ./
3737
base: ${{ github.event.repository.default_branch }}

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ jobs:
251251
env:
252252
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
253253
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
254-
run: dotnet sonarscanner begin /k:"Project-MONAI_monai-deploy-workflow-manager" /o:"project-monai" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="../**/coverage.opencover.xml" /d:sonar.coverage.exclusions="src/WorkflowManager/Database/Repositories/**/*"
254+
run: dotnet sonarscanner begin /k:"Project-MONAI_monai-deploy-workflow-manager" /o:"project-monai" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="../**/coverage.opencover.xml" /d:sonar.coverage.exclusions="src/WorkflowManager/Database/Repositories/**/*,src/TaskManager/Database/TaskDispatchEventRepository.cs"
255255
working-directory: ./src
256256

257257
- name: Restore Solution

docs/changelog.md

100644100755
+4
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@
1616

1717

1818
# Changelog
19+
20+
Renamed the (Generated) Argo client to ArgoGeneratedClient, added a new ArgoClient using just the methods used by this codebase.
21+
22+
Enhanced the ArgoClient -> Argo_Get_WorkflowLogsAsync method to decode the json better and make the logs extracted from Argo more readable.

guidelines/mwm-input.md

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The message is a JSON document with the following fields:
6666

6767
###### Dicom Metadata File
6868
To improve processing time, the MWM expects the DICOM metadata tags to be available in a structured JSON object.
69-
This object is used for [metadata evaluation](mwm-workflow-spec.md#dicom-tags).
69+
This object is used for [metadata evaluation](/docs/setup/mwm-workflow-spec.md#dicom-tags).
7070

7171
The format is as follows:
7272

guidelines/mwm-sadd.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The scope of this document is limited to the design of the MONAI Workflow Manage
4444
## Reference Documents
4545

4646
- [MONAI Workflow Manager Requirements](mwm-srs.md)
47-
- [Workflow Specification Language](mwm-workflow-spec.md)
47+
- [Workflow Specification Language](/docs/setup/mwm-workflow-spec.md)
4848
- [Input Payload Specification](mwm-input.md)
4949
- [Storage Specification](mwm-storage.md)
5050

@@ -112,7 +112,7 @@ The Workflows API allows clients to register Clinical Workflows. It will validat
112112
##### POST /workflows
113113
This endpoint saves the a workflow.
114114
###### Body
115-
A workflow definition as per the [workflow definition spec](mwm-workflow-spec.md).
115+
A workflow definition as per the [workflow definition spec](/docs/setup/mwm-workflow-spec.md).
116116
![register](static/mwm-workflows-register.png)
117117

118118
#### Responses
@@ -124,7 +124,7 @@ A workflow definition as per the [workflow definition spec](mwm-workflow-spec.md
124124
##### PUT /workflows/WORKFLOW_ID
125125
Updates a workflow with the workflow specification sent in the body. This will create a new version of the workflow.
126126
###### Body
127-
A workflow definition as per the [workflow definition spec](mwm-workflow-spec.md).
127+
A workflow definition as per the [workflow definition spec](/docs/setup/mwm-workflow-spec.md).
128128
May include a partial schema - the included attributes will be updated in the Workflow.
129129

130130
![update](static/mwm-workflows-update.png)
@@ -160,7 +160,7 @@ May include a partial schema - the included attributes will be updated in the Wo
160160
161161
- `200`
162162
- Description: The workflow definition.
163-
- Content: The [workflow spec](mwm-workflow-spec.md)
163+
- Content: The [workflow spec](/docs/setup/mwm-workflow-spec.md)
164164
165165
---
166166
#### Tasks API
@@ -193,7 +193,7 @@ For more details & the event schema see [input](mwm-input.md#notification-messag
193193
![payloadlistener](static/mwm-payload-listener.png)
194194
195195
#### Workflow Executer
196-
The workflow executer is responsible for running a workflow - scheduling tasks tasks, passing metadata from one task to the other, and evaluating [Evaluators](mwm-workflow-spec.md#evaluators). Finally, it will hand over responsibility to the Export Notification service when the workflow is complete.
196+
The workflow executer is responsible for running a workflow - scheduling tasks tasks, passing metadata from one task to the other, and evaluating [Evaluators](/docs/setup/mwm-workflow-spec.md#evaluators). Finally, it will hand over responsibility to the Export Notification service when the workflow is complete.
197197
198198
#### Task Executer
199199
The task executer is responsible for running tasks. It is invoked by the Event Broker Adapter whenever there is a new event in the task dispatch or task callback queues.
@@ -222,12 +222,12 @@ Responsibilities of plugins:
222222
* Adding task output files to the output directory
223223
224224
#### Export Service
225-
The export service is used when a Task has an [output destination](mwm-workflow-spec.md#destinations) external to the system (ie not another task). The export services publishes an output event to a Pub/Sub service. Once published, this export operation is considered complete.
225+
The export service is used when a Task has an [output destination](/docs/setup/mwm-workflow-spec.md#destinations) external to the system (ie not another task). The export services publishes an output event to a Pub/Sub service. Once published, this export operation is considered complete.
226226
227227
#### Data Retention Service
228228
229229
##### Retention Policies
230-
As part of the [Workflow definition](mwm-workflow-spec.md), _retention policies_ can be applied to data generated by workflows and tasks. The Data Retention service is responsible for enforcing those policies.
230+
As part of the [Workflow definition](/docs/setup/mwm-workflow-spec.md), _retention policies_ can be applied to data generated by workflows and tasks. The Data Retention service is responsible for enforcing those policies.
231231
232232
By default, data is retained for `15` days after the workflow execution has completed.
233233

guidelines/mwm-storage.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The MWM will be responsible for managing access to objects. It will have root le
3636
The informatics gateway will have write-only access to a specific storage bucket. This will be used to save the original input, and a reference will then be sent to the MWM.
3737

3838
#### Workflow Manager Task Plugins
39-
Task plugins, as executable code within the MWM process, will theoretically have access to the entire object store. In practice, when executed they will receive references to specific [artifacts](mwm-workflow-spec.md#artifacts).
39+
Task plugins, as executable code within the MWM process, will theoretically have access to the entire object store. In practice, when executed they will receive references to specific [artifacts](/docs/setup/mwm-workflow-spec.md#artifacts).
4040

4141
It is the plugins' responsibility to ensure Applications have access to the artifacts they need. How they do so depends on the plugin's architecture - they could send files as payloads in an HTTP call, or they could generate temporary access tokens and send these along with the object reference to app servers.
4242

src/TaskManager/API/ITaskDispatchEventService.cs

+8
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,13 @@ public interface ITaskDispatchEventService
3939
/// </summary>
4040
/// <param name="taskExecutionId">Task execution ID associated with the event</param>
4141
Task<TaskDispatchEventInfo?> GetByTaskExecutionIdAsync(string taskExecutionId);
42+
43+
/// <summary>
44+
/// Updates task plugin arguments of a task dispatch event in the database.
45+
/// </summary>
46+
/// <param name="taskDispatchEvent">A TaskDispatchEvent to update.</param>
47+
/// <param name="pluginArgs">The plugin arguments to update.</param>
48+
/// <returns>Returns the updated TaskDispatchEventInfo.</returns>
49+
Task<TaskDispatchEventInfo> UpdateTaskPluginArgsAsync(TaskDispatchEventInfo taskDispatchEvent, Dictionary<string, string> pluginArgs);
4250
}
4351
}

src/TaskManager/Database/ITaskDispatchEventRepository.cs

+8
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,13 @@ public interface ITaskDispatchEventRepository
4646
/// <param name="taskExecutionId">Task execution ID associated with the event</param>
4747
/// <returns></returns>
4848
Task<bool> RemoveAsync(string taskExecutionId);
49+
50+
/// <summary>
51+
/// Updates the plugin args of a task dispatch event in the database.
52+
/// </summary>
53+
/// <param name="taskDispatchEventInfo">A TaskDispatchEvent to update.</param>
54+
/// <param name="pluginArgs">The plugin arguments to update.</param>
55+
/// <returns>The updated TaskDispatchEventInfo.</returns>
56+
Task<TaskDispatchEventInfo> UpdateTaskPluginArgsAsync(TaskDispatchEventInfo taskDispatchEventInfo, Dictionary<string, string> pluginArgs);
4957
}
5058
}

src/TaskManager/Database/TaskDispatchEventRepository.cs

+17
Original file line numberDiff line numberDiff line change
@@ -109,5 +109,22 @@ await _taskDispatchEventCollection.DeleteOneAsync(
109109
return false;
110110
}
111111
}
112+
113+
public async Task<TaskDispatchEventInfo> UpdateTaskPluginArgsAsync(TaskDispatchEventInfo taskDispatchEventInfo, Dictionary<string, string> pluginArgs)
114+
{
115+
Guard.Against.Null(taskDispatchEventInfo);
116+
Guard.Against.Null(pluginArgs);
117+
118+
try
119+
{
120+
await _taskDispatchEventCollection.FindOneAndUpdateAsync(i => i.Id == taskDispatchEventInfo.Id, Builders<TaskDispatchEventInfo>.Update.Set(p => p.Event.TaskPluginArguments, pluginArgs)).ConfigureAwait(false);
121+
return await GetByTaskExecutionIdAsync(taskDispatchEventInfo.Event.ExecutionId).ConfigureAwait(false);
122+
}
123+
catch (Exception e)
124+
{
125+
_logger.DatabaseException(nameof(UpdateTaskPluginArgsAsync), e);
126+
return default;
127+
}
128+
}
112129
}
113130
}

0 commit comments

Comments
 (0)