Another runner code cleanup round (#197)
* Remove remaining non-SDK references of capabilities/demands * Remove unused Runner.Common constants * Remove more variables * Clean up RU link, and named-pipe support * Remove NotificationSocketAddress * Re-add legacy OnPremises JobDispatcher code (commented out) * More misc cleanup
This commit is contained in:
@@ -874,33 +874,6 @@ namespace GitHub.Runner.Worker
|
||||
{
|
||||
this.Warning(string.Format("The job is currently being throttled by the server. You may experience delays in console line output, job status reporting, and action log uploads."));
|
||||
|
||||
if (!String.IsNullOrEmpty(this.Variables.System_TFCollectionUrl))
|
||||
{
|
||||
// Construct a URL to the resource utilization page, to aid the user debug throttling issues
|
||||
UriBuilder uriBuilder = new UriBuilder(Variables.System_TFCollectionUrl);
|
||||
NameValueCollection query = HttpUtility.ParseQueryString(uriBuilder.Query);
|
||||
DateTime endTime = DateTime.UtcNow;
|
||||
string queryDate = endTime.AddHours(-1).ToString("s") + "," + endTime.ToString("s");
|
||||
|
||||
uriBuilder.Path += (Variables.System_TFCollectionUrl.EndsWith("/") ? "" : "/") + "_usersSettings/usage";
|
||||
query["tab"] = "pipelines";
|
||||
query["queryDate"] = queryDate;
|
||||
|
||||
// Global RU link
|
||||
uriBuilder.Query = query.ToString();
|
||||
string global = $"Link to resource utilization page (global 1-hour view): {uriBuilder.ToString()}.";
|
||||
|
||||
if (!String.IsNullOrEmpty(this.Variables.Build_DefinitionName))
|
||||
{
|
||||
query["keywords"] = this.Variables.Build_Number;
|
||||
query["definition"] = this.Variables.Build_DefinitionName;
|
||||
}
|
||||
|
||||
// RU link scoped for the build/release
|
||||
uriBuilder.Query = query.ToString();
|
||||
this.Warning($"{global}\nLink to resource utilization page (1-hour view by pipeline): {uriBuilder.ToString()}.");
|
||||
}
|
||||
|
||||
_throttlingReported = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,10 +113,6 @@ namespace GitHub.Runner.Worker
|
||||
Directory.CreateDirectory(toolsDirectory);
|
||||
jobContext.SetRunnerContext("tool_cache", toolsDirectory);
|
||||
|
||||
// remove variable from env
|
||||
Environment.SetEnvironmentVariable("AGENT_TOOLSDIRECTORY", null);
|
||||
Environment.SetEnvironmentVariable(Constants.Variables.Agent.ToolsDirectory, null);
|
||||
|
||||
// Setup TEMP directories
|
||||
_tempDirectoryManager = HostContext.GetService<ITempDirectoryManager>();
|
||||
_tempDirectoryManager.InitializeTempDirectory(jobContext);
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
using GitHub.DistributedTask.WebApi;
|
||||
using GitHub.Runner.Common.Util;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using GitHub.Build.WebApi;
|
||||
using GitHub.DistributedTask.WebApi;
|
||||
using GitHub.DistributedTask.Logging;
|
||||
using GitHub.DistributedTask.Pipelines.ContextData;
|
||||
using GitHub.Runner.Common;
|
||||
using GitHub.Runner.Common.Util;
|
||||
using GitHub.Runner.Sdk;
|
||||
|
||||
namespace GitHub.Runner.Worker
|
||||
@@ -62,10 +63,7 @@ namespace GitHub.Runner.Worker
|
||||
|
||||
// DO NOT add file path variable to here.
|
||||
// All file path variables needs to be retrive and set through ExecutionContext, so it can handle container file path translation.
|
||||
|
||||
public string Build_DefinitionName => Get(Constants.Variables.Build.DefinitionName);
|
||||
|
||||
public string Build_Number => Get(Constants.Variables.Build.Number);
|
||||
public string Build_Number => Get(BuildVariables.BuildNumber);
|
||||
|
||||
#if OS_WINDOWS
|
||||
public bool Retain_Default_Encoding => false;
|
||||
@@ -73,12 +71,8 @@ namespace GitHub.Runner.Worker
|
||||
public bool Retain_Default_Encoding => true;
|
||||
#endif
|
||||
|
||||
public string System_CollectionId => Get(Constants.Variables.System.CollectionId);
|
||||
|
||||
public bool? Step_Debug => GetBoolean(Constants.Variables.Actions.StepDebug);
|
||||
|
||||
public string System_DefinitionId => Get(Constants.Variables.System.DefinitionId);
|
||||
|
||||
public string System_PhaseDisplayName => Get(Constants.Variables.System.PhaseDisplayName);
|
||||
|
||||
public string System_TFCollectionUrl => Get(WellKnownDistributedTaskVariables.TFCollectionUrl);
|
||||
|
||||
Reference in New Issue
Block a user