From 356a42731ba231679500674f604333f5c1cdb556 Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Thu, 4 Apr 2024 11:51:51 -0700 Subject: [PATCH 1/3] Ability to override shmsize with docker plug-in Signed-off-by: Victor Chang --- src/TaskManager/Plug-ins/Docker/DockerPlugin.cs | 12 ++++++++++++ src/TaskManager/Plug-ins/Docker/Keys.cs | 6 ++++++ src/TaskManager/Plug-ins/Docker/Logging/Log.cs | 3 +++ 3 files changed, 21 insertions(+) diff --git a/src/TaskManager/Plug-ins/Docker/DockerPlugin.cs b/src/TaskManager/Plug-ins/Docker/DockerPlugin.cs index 3065a91d8..7db7a0d1b 100644 --- a/src/TaskManager/Plug-ins/Docker/DockerPlugin.cs +++ b/src/TaskManager/Plug-ins/Docker/DockerPlugin.cs @@ -367,6 +367,18 @@ private CreateContainerParameters BuildContainerSpecification(IList public static readonly string EnvironmentVariableKeyPrefix = "env_"; + /// + /// Key for setting the shm size. + /// + public static readonly string ShmSize = "shm_size"; + /// /// Key to the intermediate volume map path. /// @@ -79,5 +84,6 @@ internal static class Keys ContainerImage, TemporaryStorageContainerPath }; + } } diff --git a/src/TaskManager/Plug-ins/Docker/Logging/Log.cs b/src/TaskManager/Plug-ins/Docker/Logging/Log.cs index c4e95a7ea..ea70a3ef5 100644 --- a/src/TaskManager/Plug-ins/Docker/Logging/Log.cs +++ b/src/TaskManager/Plug-ins/Docker/Logging/Log.cs @@ -115,5 +115,8 @@ public static partial class Log [LoggerMessage(EventId = 1031, Level = LogLevel.Error, Message = "Error setting directory {path} with permission {user}.")] public static partial void ErrorSettingDirectoryPermission(this ILogger logger, string path, string user); + + [LoggerMessage(EventId = 1032, Level = LogLevel.Error, Message = "Invalid size specified for /dev/shm: {size} Please use value between 1 and 9223372036854775807.")] + public static partial void InvalidShmSize(this ILogger logger, string size); } } From a101592d4d2e20518bd6be7ac0955aec0a124c2e Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Thu, 23 May 2024 09:28:39 -0700 Subject: [PATCH 2/3] Update sonar cloud parameters Signed-off-by: Victor Chang --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f2e1b5b89..14b00ac1e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -257,7 +257,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - 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,**/Migrations/M0*.cs" + run: dotnet sonarscanner begin /k:"Project-MONAI_monai-deploy-workflow-manager" /o:"project-monai" /d:sonar.token="${{ 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,**/Migrations/M0*.cs" working-directory: ./src - name: Restore Solution @@ -277,5 +277,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" + run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" working-directory: ./src From b80627c3b573514fd9ec9067012deabf83d4532f Mon Sep 17 00:00:00 2001 From: Victor Chang Date: Thu, 23 May 2024 09:58:05 -0700 Subject: [PATCH 3/3] Update test.yml Update sonarcloud integration Signed-off-by: Victor Chang --- .github/workflows/test.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14b00ac1e..ac33ea8b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -242,22 +242,39 @@ jobs: dotnet-version: ${{ env.DOTNET_VERSION }} - name: Enable NuGet cache - uses: actions/cache@v3.3.1 + uses: actions/cache@v3 with: path: ~/.nuget/packages key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} restore-keys: | ${{ runner.os }}-nuget - + + - name: Cache SonarCloud packages + uses: actions/cache@v3 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Cache SonarCloud scanner + id: cache-sonar-scanner + uses: actions/cache@v3 + with: + path: ./.sonar/scanner + key: ${{ runner.os }}-sonar-scanner + restore-keys: ${{ runner.os }}-sonar-scanner + - name: Install SonarCloud scanner if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' - run: dotnet tool install --global dotnet-sonarscanner - + run: | + mkdir -p ./.sonar/scanner + dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner + - name: Begin SonarScanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: dotnet sonarscanner begin /k:"Project-MONAI_monai-deploy-workflow-manager" /o:"project-monai" /d:sonar.token="${{ 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,**/Migrations/M0*.cs" + run: ./.sonar/scanner/dotnet-sonarscanner begin /k:"Project-MONAI_monai-deploy-workflow-manager" /o:"project-monai" /d:sonar.token="${{ 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,**/Migrations/M0*.cs" working-directory: ./src - name: Restore Solution @@ -277,5 +294,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + run: ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" working-directory: ./src