From 5eef0905116649934ad2f9c4ecb29da3e8bfc826 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 17 Dec 2023 09:53:50 -0500 Subject: [PATCH] Suppress OD build output in CI --- .../Components/Engine/OpenDreamInstaller.cs | 18 ++++++++++++++---- .../Configuration/GeneralConfiguration.cs | 5 +++++ src/Tgstation.Server.Host/appsettings.yml | 1 + .../Live/LiveTestingServer.cs | 1 + 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Tgstation.Server.Host/Components/Engine/OpenDreamInstaller.cs b/src/Tgstation.Server.Host/Components/Engine/OpenDreamInstaller.cs index 6b356ba539..b8ffc98334 100644 --- a/src/Tgstation.Server.Host/Components/Engine/OpenDreamInstaller.cs +++ b/src/Tgstation.Server.Host/Components/Engine/OpenDreamInstaller.cs @@ -230,18 +230,28 @@ namespace Tgstation.Server.Host.Components.Engine shortenedPath, $"run -c Release --project OpenDreamPackageTool -- --tgs -o {shortenedDeployPath}", null, - true, - true); + !GeneralConfiguration.OpenDreamSuppressInstallOutput, + !GeneralConfiguration.OpenDreamSuppressInstallOutput); using (cancellationToken.Register(() => buildProcess.Terminate())) buildExitCode = await buildProcess.Lifetime; - Logger.LogTrace("OD build complete, waiting for output..."); + string output; + + if (!GeneralConfiguration.OpenDreamSuppressInstallOutput) + { + var buildOutputTask = buildProcess.GetCombinedOutput(cancellationToken); + if (!buildOutputTask.IsCompleted) + Logger.LogTrace("OD build complete, waiting for output..."); + output = await buildOutputTask; + } + else + output = ""; Logger.LogDebug( "OpenDream build exited with code {exitCode}:{newLine}{output}", buildExitCode, Environment.NewLine, - await buildProcess.GetCombinedOutput(cancellationToken)); + output); }, sourcePath, cancellationToken); diff --git a/src/Tgstation.Server.Host/Configuration/GeneralConfiguration.cs b/src/Tgstation.Server.Host/Configuration/GeneralConfiguration.cs index f33ef79b11..8e2fe59579 100644 --- a/src/Tgstation.Server.Host/Configuration/GeneralConfiguration.cs +++ b/src/Tgstation.Server.Host/Configuration/GeneralConfiguration.cs @@ -145,6 +145,11 @@ namespace Tgstation.Server.Host.Configuration /// public string OpenDreamGitTagPrefix { get; set; } = DefaultOpenDreamGitTagPrefix; + /// + /// If the dotnet output of creating an OpenDream installation should be suppressed. Known to cause issues in CI. + /// + public bool OpenDreamSuppressInstallOutput { get; set; } + /// /// Initializes a new instance of the class. /// diff --git a/src/Tgstation.Server.Host/appsettings.yml b/src/Tgstation.Server.Host/appsettings.yml index 60624d3617..56f87f2169 100644 --- a/src/Tgstation.Server.Host/appsettings.yml +++ b/src/Tgstation.Server.Host/appsettings.yml @@ -18,6 +18,7 @@ General: DeploymentDirectoryCopyTasksPerCore: 100 # Maximum number of concurrent file copy operations PER available CPU core OpenDreamGitUrl: https://github.com/OpenDreamProject/OpenDream # The repository to retrieve OpenDream from OpenDreamGitTagPrefix: v # The prefix to the OpenDream semver as tags appear in the git repository + OpenDreamSuppressInstallOutput: false # Suppress the dotnet output of creating an OpenDream installation. Known to cause hangs in CI. Session: HighPriorityLiveDreamDaemon: false # If DreamDaemon instances should run as higher priority processes LowPriorityDeploymentProcesses: true # If TGS Deployments should run as lower priority processes diff --git a/tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs b/tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs index 61a7a36176..645edac147 100644 --- a/tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs +++ b/tests/Tgstation.Server.Tests/Live/LiveTestingServer.cs @@ -154,6 +154,7 @@ namespace Tgstation.Server.Tests.Live $"General:SkipAddingByondFirewallException={!TestingUtils.RunningInGitHubActions}", $"General:OpenDreamGitUrl={OpenDreamUrl}", $"Security:TokenExpiryMinutes=120", // timeouts are useless for us + $"General:OpenDreamSuppressInstallOutput={TestingUtils.RunningInGitHubActions}", }; swarmArgs = new List();