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

Read TaskPriorityClass from config #872

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions src/Common/Configuration/TaskManagerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,8 @@ public class ArgoPluginArguments

[ConfigurationKeyName("messageSenderContainerMemoryLimit")]
public string MessageSenderContainerMemoryLimit { get; set; } = "500Mi";

[ConfigurationKeyName("taskPriorityClass")]
public string TaskPriorityClass { get; set; } = string.Empty;
}
}
2 changes: 1 addition & 1 deletion src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
}
}

private void Initialize()

Check warning on line 84 in src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Refactor this method to reduce its Cognitive Complexity from 16 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
using var loggingScope = _logger.BeginScope(new LoggingDataDictionary<string, object>
{
Expand Down Expand Up @@ -301,7 +301,7 @@
}
}

private Dictionary<string, string> GetExecutuionStats(Workflow workflow)

Check warning on line 304 in src/TaskManager/Plug-ins/Argo/ArgoPlugin.cs

View workflow job for this annotation

GitHub Actions / sonarscanner

Refactor this method to reduce its Cognitive Complexity from 18 to the 15 allowed. (https://rules.sonarsource.com/csharp/RSPEC-3776)
{
Guard.Against.Null(workflow, nameof(workflow));

Expand Down Expand Up @@ -432,7 +432,7 @@
private void ProcessTaskPluginArguments(Workflow workflow)
{
Guard.Against.Null(workflow, nameof(workflow));
var priorityClassName = Event.GetTaskPluginArgumentsParameter(ArgoParameters.TaskPriorityClassName) ?? "standard";
var priorityClassName = Event.GetTaskPluginArgumentsParameter(ArgoParameters.TaskPriorityClassName) ?? _options.Value.TaskManager.ArgoPluginArguments.TaskPriorityClass;

foreach (var template in workflow.Spec.Templates)
{
Expand Down
3 changes: 2 additions & 1 deletion src/TaskManager/TaskManager/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
"messageGeneratorContainerCpuLimit": "1",
"messageGeneratorContainerMemoryLimit": "500Mi",
"messageSenderContainerCpuLimit": "1",
"messageSenderContainerMemoryLimit": "500Mi"
"messageSenderContainerMemoryLimit": "500Mi",
"taskPriorityClass": ""
},
"argoExitHookSendMessageContainerImage": "ghcr.io/project-monai/monai-deploy-task-manager-callback:0.2.0-beta.211"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public ArgoPluginTestBase()
Options.Value.TaskManager.ArgoPluginArguments.MessageGeneratorContainerMemoryLimit = MessageGeneratorContainerMemoryLimit;
Options.Value.TaskManager.ArgoPluginArguments.MessageSenderContainerCpuLimit = MessageSenderContainerCpuLimit;
Options.Value.TaskManager.ArgoPluginArguments.MessageSenderContainerMemoryLimit = MessageSenderContainerMemoryLimit;
Options.Value.TaskManager.ArgoPluginArguments.TaskPriorityClass = "standard";
}
}
}
Loading