Skip to content

Commit e589dc2

Browse files
authored
Merge branch 'develop' into AC-1810
2 parents d8c9415 + c97df30 commit e589dc2

File tree

74 files changed

+1511
-1418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1511
-1418
lines changed

src/Shared/Shared/ApiControllerBase.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
using Monai.Deploy.WorkflowManager.Shared.Filter;
2323
using Monai.Deploy.WorkflowManager.Shared.Wrappers;
2424
using Monai.Deploy.WorkflowManager.Shared.Services;
25-
using Microsoft.AspNetCore.Routing;
2625

2726
namespace Monai.Deploy.WorkflowManager.ControllersShared
2827
{
@@ -85,7 +84,7 @@ public PagedResponse<IEnumerable<T>> CreatePagedReponse<T>(IEnumerable<T> pagedD
8584

8685
public StatsPagedResponse<IEnumerable<T>> CreateStatsPagedReponse<T>(IEnumerable<T> pagedData, PaginationFilter validFilter, long totalRecords, IUriService uriService, string route)
8786
{
88-
var response = new StatsPagedResponse<IEnumerable<T>>(pagedData, validFilter.PageNumber, validFilter.PageSize.Value);
87+
var response = new StatsPagedResponse<IEnumerable<T>>(pagedData, validFilter.PageNumber, validFilter.PageSize ?? 10);
8988
response.SetUp(validFilter, totalRecords, uriService, route);
9089
return response;
9190
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright 2023 MONAI Consortium
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
namespace Monai.Deploy.WorkflowManager.Shared.Filter
18+
{
19+
public class TimeFilter : PaginationFilter
20+
{
21+
public DateTime StartTime { get; set; }
22+
23+
public DateTime EndTime { get; set; }
24+
}
25+
}

src/Shared/Shared/MonaiServiceLocator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public Dictionary<string, ServiceStatus> GetServiceStatus()
4141
return _runningServices.ToDictionary(k => k.ServiceName, v => v.Status);
4242
}
4343

44-
private IMonaiService GetService(Type type)
44+
private IMonaiService? GetService(Type type)
4545
{
4646
Guard.Against.Null(type, nameof(type));
4747

@@ -58,7 +58,7 @@ private static List<Type> LocateTypes()
5858
serviceType.IsAssignableFrom(p) &&
5959
p != serviceType &&
6060
!p.IsAbstract &&
61-
p.FullName.StartsWith("Monai", StringComparison.InvariantCulture));
61+
p.FullName is not null && p.FullName.StartsWith("Monai", StringComparison.InvariantCulture));
6262
return services.Distinct().ToList();
6363
}
6464

src/Shared/Shared/Wrappers/PagedResponse.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ public PagedResponse(T data, int pageNumber, int pageSize)
5454
/// <summary>
5555
/// Gets or sets FirstPage.
5656
/// </summary>
57-
public string FirstPage { get; set; }
57+
public string? FirstPage { get; set; }
5858

5959
/// <summary>
6060
/// Gets or sets LastPage.
6161
/// </summary>
62-
public string LastPage { get; set; }
62+
public string? LastPage { get; set; }
6363

6464
/// <summary>
6565
/// Gets or sets TotalPages.
@@ -74,12 +74,12 @@ public PagedResponse(T data, int pageNumber, int pageSize)
7474
/// <summary>
7575
/// Gets or sets NextPage.
7676
/// </summary>
77-
public string NextPage { get; set; }
77+
public string? NextPage { get; set; }
7878

7979
/// <summary>
8080
/// Gets or sets previousPage.
8181
/// </summary>
82-
public string PreviousPage { get; set; }
82+
public string? PreviousPage { get; set; }
8383

8484
public void SetUp(PaginationFilter validFilter, long totalRecords, IUriService uriService, string route)
8585
{
@@ -94,7 +94,7 @@ public void SetUp(PaginationFilter validFilter, long totalRecords, IUriService u
9494
PreviousPage =
9595
validFilter.PageNumber - 1 >= 1 && validFilter.PageNumber <= roundedTotalPages
9696
? uriService.GetPageUriString(new PaginationFilter(validFilter.PageNumber - 1, PageSize), route)
97-
: null;
97+
: null;
9898

9999
FirstPage = uriService.GetPageUriString(new PaginationFilter(1, PageSize), route);
100100
LastPage = uriService.GetPageUriString(new PaginationFilter(roundedTotalPages, PageSize), route);

src/Shared/Shared/Wrappers/Response.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ public Response(T data)
5454
/// <summary>
5555
/// Gets or sets errors.
5656
/// </summary>
57-
public string[] Errors { get; set; }
57+
public string?[] Errors { get; set; }
5858

5959
/// <summary>
6060
/// Gets or sets message.
6161
/// </summary>
62-
public string Message { get; set; }
62+
public string? Message { get; set; }
6363
}
6464
}

src/TaskManager/API/Migrations/DocumentVersionConvert.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class DocumentVersionConvert : JsonConverter
2929
var minor = 0;
3030
var revision = 0;
3131

32-
var res = (reader.Value as string)?.Split(new char[] { ',' });
32+
var res = (reader.Value as string)?.Split(new char[] { ',', '.' });
3333

3434
if (res?.Length == 3)
3535
{

src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ private void AddLimit(Template2 template, ResourcesKey key)
467467
value = bool.TryParse(value, out bool gpuRequired) && gpuRequired ? "1" : "0";
468468
}
469469

470-
template.Container.Resources.Limits.Add(key.ArgoKey, value);
470+
template.Container.Resources.Limits[key.ArgoKey] = value;
471471
}
472472

473473
private async Task AddMainWorkflowTemplate(Workflow workflow, CancellationToken cancellationToken)

src/TaskManager/Plug-ins/Argo/Logging/Log.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
using Argo;
1817
using Microsoft.Extensions.Logging;
1918

2019
namespace Monai.Deploy.WorkflowManager.TaskManager.Argo.Logging
@@ -78,7 +77,7 @@ public static partial class Log
7877
[LoggerMessage(EventId = 1018, Level = LogLevel.Error, Message = "Error deserializing WorkflowTemplateCreateRequest. {message}")]
7978
public static partial void ErrorDeserializingWorkflowTemplateCreateRequest(this ILogger logger, string message, Exception ex);
8079

81-
[LoggerMessage(EventId = 1017, Level = LogLevel.Error, Message = "Error deleting Template in Argo.")]
80+
[LoggerMessage(EventId = 1019, Level = LogLevel.Error, Message = "Error deleting Template in Argo.")]
8281
public static partial void ErrorDeletingWorkflowTemplate(this ILogger logger, Exception ex);
8382

8483
}

src/TaskManager/Plug-ins/Argo/StaticValues/ResourcesKeys.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,10 @@ namespace Monai.Deploy.WorkflowManager.TaskManager.Argo.StaticValues
1818
{
1919
public static class ResourcesKeys
2020
{
21-
public static readonly ResourcesKey MemoryReservation = new() { TaskKey = "memory_reservation", ArgoKey = "requests.memory" };
22-
23-
public static readonly ResourcesKey CpuReservation = new() { TaskKey = "cpu_reservation", ArgoKey = "requests.cpu" };
24-
2521
public static readonly ResourcesKey GpuLimit = new() { TaskKey = "gpu_required", ArgoKey = "nvidia.com/gpu" };
2622

27-
public static readonly ResourcesKey MemoryLimit = new() { TaskKey = "memory_gb", ArgoKey = "limits.memory" };
23+
public static readonly ResourcesKey MemoryLimit = new() { TaskKey = "memory_gb", ArgoKey = "memory" };
2824

29-
public static readonly ResourcesKey CpuLimit = new() { TaskKey = "cpu", ArgoKey = "limits.cpu" };
25+
public static readonly ResourcesKey CpuLimit = new() { TaskKey = "cpu", ArgoKey = "cpu" };
3026
}
3127
}

0 commit comments

Comments
 (0)