From 5d6ce1985c9a9c756e5b013ec7676156d700c7fc Mon Sep 17 00:00:00 2001 From: Neil South Date: Tue, 2 Aug 2022 10:52:37 +0100 Subject: [PATCH 1/2] couple of small fixs, including validation on exportTasks->continditions Signed-off-by: Neil South --- deploy/helm/Gateway.yaml | 18 +++++++++--------- src/Contracts/Models/TaskDestination.cs | 4 +++- src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/deploy/helm/Gateway.yaml b/deploy/helm/Gateway.yaml index 3f23e9cee..f1ae8f7cb 100644 --- a/deploy/helm/Gateway.yaml +++ b/deploy/helm/Gateway.yaml @@ -14,20 +14,20 @@ replicaCount: 1 image: - repository: 847264867502.dkr.ecr.eu-west-2.amazonaws.com/monai-deploy-informatics-gateway-dev + repository: registry.gitlab.com/answerdigital/londonai/aide/workflow-manager-images/infomatics-gateway pullPolicy: IfNotPresent - tag: latest + tag: 2022-08-01 enviromentVariables: InformaticsGateway__messaging__publisherSettings__endpoint: "rabbitmq-monai" - InformaticsGateway__messaging__publisherSettings__username: "admin" - InformaticsGateway__messaging__publisherSettings__password: "admin" + InformaticsGateway__messaging__publisherSettings__username: "monaideploy" + InformaticsGateway__messaging__publisherSettings__password: "monaideploy" InformaticsGateway__messaging__subscriberSettings__endpoint: "rabbitmq-monai" - InformaticsGateway__messaging__subscriberSettings__username: "admin" - InformaticsGateway__messaging__subscriberSettings__password: "admin" - InformaticsGateway__storage__settings__endpoint: "minio:9000" - InformaticsGateway__storage__settings__accessKey: "minioadmin" - InformaticsGateway__storage__settings__accessToken: "minioadmin" + InformaticsGateway__messaging__subscriberSettings__username: "monaideploy" + InformaticsGateway__messaging__subscriberSettings__password: "monaideploy" + InformaticsGateway__storage__settings__endpoint: "minio.monai:9000" + InformaticsGateway__storage__settings__accessKey: "rootminio" + InformaticsGateway__storage__settings__accessToken: "rootminio" service: type: ClusterIP diff --git a/src/Contracts/Models/TaskDestination.cs b/src/Contracts/Models/TaskDestination.cs index a2f229035..f38c154f7 100644 --- a/src/Contracts/Models/TaskDestination.cs +++ b/src/Contracts/Models/TaskDestination.cs @@ -21,9 +21,11 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models public class TaskDestination { [JsonProperty(PropertyName = "name")] +#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. public string Name { get; set; } +#pragma warning restore CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider declaring as nullable. [JsonProperty(PropertyName = "conditions")] - public string Conditions { get; set; } + public string Conditions { get; set; } = ""; } } diff --git a/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs b/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs index 0fd3fb890..a844da4d6 100644 --- a/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs +++ b/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs @@ -501,13 +501,13 @@ private async Task ConfigureInputArtifactStoreForTemplates(ICollection p.Arguments is not null).SelectMany(p => p.Arguments.Artifacts), true, cancellationToken).ConfigureAwait(false); + await ConfigureInputArtifactStore(template.Name, templates, template.Dag.Tasks.Where(p => p.Arguments is not null && p.Arguments.Artifacts is not null).SelectMany(p => p.Arguments.Artifacts), true, cancellationToken).ConfigureAwait(false); } else if (template.Steps is not null) { foreach (var step in template.Steps) { - await ConfigureInputArtifactStore(template.Name, templates, step.Where(p => p.Arguments is not null).SelectMany(p => p.Arguments.Artifacts), true, cancellationToken).ConfigureAwait(false); + await ConfigureInputArtifactStore(template.Name, templates, step.Where(p => p.Arguments is not null && p.Arguments.Artifacts is not null).SelectMany(p => p.Arguments.Artifacts), true, cancellationToken).ConfigureAwait(false); } } else if (template.Inputs is not null) From 2a4bd3306b6be3ba87ab6e78d5d6b8702af67841 Mon Sep 17 00:00:00 2001 From: Neil South Date: Tue, 2 Aug 2022 11:07:23 +0100 Subject: [PATCH 2/2] merge in develop Signed-off-by: Neil South --- src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs b/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs index a844da4d6..2924b226e 100644 --- a/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs +++ b/src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs @@ -215,10 +215,15 @@ private Dictionary GetExecutuionStats(Workflow workflow) { Guard.Against.Null(workflow); + TimeSpan? duration = null; + if (workflow.Status?.StartedAt is not null && workflow.Status?.FinishedAt is not null) + { + duration = workflow.Status?.FinishedAt - workflow.Status?.StartedAt; + } var stats = new Dictionary { { "workflowId", Event.WorkflowInstanceId }, - { "duration", workflow.Status?.EstimatedDuration.ToString() ?? string.Empty }, + { "duration", duration.HasValue ? duration.Value.TotalMilliseconds.ToString() : string.Empty }, { "startedAt", workflow.Status?.StartedAt.ToString() ?? string.Empty }, { "finishedAt", workflow.Status?.FinishedAt.ToString() ?? string.Empty } };