зеркало из https://github.com/microsoft/BuildXL.git
Merged PR 747091: Use full hostname for agents in ADO distributed builds
Hostname resolution stopped working when removing the private subnet we were using to run distributed builds. It turns out that DNS resolution in the "default network" needs the hostnames to be qualified with a domain (https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances). This PR adds an option (to be set by the AdoBuildRunner) so we can inject the correct hostnames in the build, without changing how this works for CloudBuild (where Dns.GetHostName works) Related work items: #2116072
This commit is contained in:
Родитель
1ef4409463
Коммит
7256583200
|
@ -139,7 +139,7 @@ jobs:
|
|||
# - we also disable early worker release to avoid releasing a worker before attachment, which tends to happen
|
||||
# when the build is highly cached: the intention is to have as much of a distributed build as possible for validation purposes
|
||||
# Set a 60m timeout so we can catch hangs *and* get logs collected at the same time. Otherwise the whole job will timeout (check 'timeoutInMinutes' above).
|
||||
timeout --signal 9 60m ./bxl.sh --use-dev --use-adobuildrunner ${{ parameters.BxlCommonArgs }} /logsDirectory:"Out/Logs/${{ parameters.validationName }}" ${{ parameters.bxlExtraArgs }} "/f:tag='test'" /earlyWorkerRelease- /p:BuildXLWorkerAttachTimeoutMin=10 /logToKusto /logToKustoBlobUri:https://adomessages.blob.core.windows.net/adomessages /logToKustoIdentityId:6e0959cf-a9ba-4988-bbf1-7facd9deda51 /logToKustoTenantId:975f013f-7f24-47e8-a7d3-abc4752bf346 /historicMetadataCache-
|
||||
timeout --signal 9 60m ./bxl.sh --use-dev --use-adobuildrunner ${{ parameters.BxlCommonArgs }} /logsDirectory:"Out/Logs/${{ parameters.validationName }}" ${{ parameters.bxlExtraArgs }} "/f:tag='test'" /earlyWorkerRelease- /p:BuildXLWorkerAttachTimeoutMin=5 /logToKusto /logToKustoBlobUri:https://adomessages.blob.core.windows.net/adomessages /logToKustoIdentityId:6e0959cf-a9ba-4988-bbf1-7facd9deda51 /logToKustoTenantId:975f013f-7f24-47e8-a7d3-abc4752bf346 /historicMetadataCache- /p:BuildXLGrpcVerbosityEnabled=1 /p:BuildXLGrpcVerbosityLevel=1 /dynamicBuildWorkerSlots:1
|
||||
displayName: Test (${{ parameters.validationName }})
|
||||
workingDirectory: /home/subst
|
||||
env:
|
||||
|
@ -147,7 +147,6 @@ jobs:
|
|||
PATCloudBuild: $(PAT-TseBuild-AzureDevOps-CloudBuild-Packaging-Read)
|
||||
VSTSPERSONALACCESSTOKEN: $(PAT-TseBuild-AzureDevOps-mseng-buildcache)
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
AdoBuildRunnerWaitForOrchestratorExit: true
|
||||
AdoBuildRunnerInvocationKey: LinuxSelfhostValidation_${{ parameters.validationName }}
|
||||
|
||||
- task: PublishTestResults@2
|
||||
|
|
|
@ -41,7 +41,7 @@ extends:
|
|||
# Build and test selfhost with BuildXL
|
||||
- template: /.azdo/linux/job-selfhost.yml@self
|
||||
parameters:
|
||||
Distributed: false
|
||||
Distributed: true
|
||||
ValidationName: InternalRelease
|
||||
BxlExtraArgs: --internal /q:ReleaseLinux /forceAddExecutionPermission-
|
||||
|
||||
|
|
|
@ -140,6 +140,7 @@ This page lists flags that can be used to configure BuildXL.
|
|||
| LogToConsole | Displays the specified messages in the console. |
|
||||
| LogToKusto | Whether to send log events to Kusto. If enabled, a valid authentication mechanism should be available with enough permissions to write into the blob storage account where logs are piped to Kusto. Use /logToKustoBlobUri:https://{storage-account-name}/{container-name} and /logToKustoIdentityId:{Identity guid} to specify the destination of the log messages. |
|
||||
| LowPriority | Runs the build engine and all tools at a lower priority in order to provide better responsiveness to interactive processes on the current machine. |
|
||||
| MachineHostName | Specifies the host name where the machine running the build can be reached. This value should only be overriden by build runners, never by a user. In particular, we need it to be overriddable because on ADO networks the machines are not reachable in the hostname that GetHostName returns, and we need a special suffix that is appended by the AdoBuildRunner. |
|
||||
| ManageMemoryMode | Specifies the mode to manage memory under pressure. Defaults to CancellationRam where {ShortProductName} attemps to cancel processes. EmptyWorkingSet mode will empty working set of processes instead of cancellation. Suspend mode will suspend processes to free memory. |
|
||||
| MaskUntrackedAccesses | When enabled, {ShortProductName} does not consider any access under untracked paths or scopes for sake of cache lookup. Defaults to on. |
|
||||
| MaxCacheLookup | Specifies the maximum number of cache lookups that {ShortProductName} will launch at one time. The default value is three times the number of processors in the current machine. |
|
||||
|
|
|
@ -790,6 +790,9 @@ namespace BuildXL
|
|||
OptionHandlerFactory.CreateBoolOption(
|
||||
"lowPriority",
|
||||
sign => schedulingConfiguration.LowPriority = sign),
|
||||
OptionHandlerFactory.CreateOption(
|
||||
"machineHostName",
|
||||
opt => distributionConfiguration.MachineHostName = opt.Value),
|
||||
OptionHandlerFactory.CreateOption(
|
||||
"manageMemoryMode",
|
||||
opt => schedulingConfiguration.ManageMemoryMode = CommandLineUtilities.ParseEnumOption<ManageMemoryMode>(opt)),
|
||||
|
|
|
@ -956,6 +956,11 @@ namespace BuildXL
|
|||
Strings.HelpText_DisplayHelp_DistributedBuildOrchestratorLocation,
|
||||
HelpLevel.Verbose);
|
||||
|
||||
hw.WriteOption(
|
||||
"/machineHostName:<host name>",
|
||||
Strings.HelpText_DisplayHelp_MachineHostName,
|
||||
HelpLevel.Verbose);
|
||||
|
||||
hw.WriteOption(
|
||||
"/enableWorkerSourceFileMaterialization[+|-]",
|
||||
Strings.HelpText_DisplayHelp_DistributedBuildWorkerSourceMaterialization,
|
||||
|
|
|
@ -504,10 +504,13 @@
|
|||
<data name="HelpText_DisplayHelp_DistributedBuildBanner" xml:space="preserve">
|
||||
<value>DISTRIBUTED BUILD</value>
|
||||
</data>
|
||||
<data name="HelpText_DisplayHelp_DistributedBuildOrchestratorLocation" xml:space="preserve">
|
||||
<data name="HelpText_DisplayHelp_DistributedBuildOrchestratorLocation" xml:space="preserve">
|
||||
<value>Specifies the IP address or host name and TCP port of the orchestrator machine to which a worker will connect to join a build session. This argument is redundant if the orchestratro is invoked with /distributedBuildWorker specified for this worker. (short form: /dbo)</value>
|
||||
</data>
|
||||
<data name="HelpText_DisplayHelp_DistributedBuildWorker" xml:space="preserve">
|
||||
<data name="HelpText_DisplayHelp_MachineHostName" xml:space="preserve">
|
||||
<value>Specifies the host name where the machine running the build can be reached. This value should only be overriden by build runners, never by a user. In particular, we need it to be overriddable because on ADO networks the machines are not reachable in the hostname that GetHostName returns, and we need a special suffix that is appended by the AdoBuildRunner.</value>
|
||||
</data>
|
||||
<data name="HelpText_DisplayHelp_DistributedBuildWorker" xml:space="preserve">
|
||||
<value>Specifies the IP address or host name and TCP port of remote worker build services which this process can dispatch work to during a distributed build (can specify multiple). This argument is redundant if the corresponding worker is invoked with /distributedBuildOrchestratorLocation specified. (short form: /dbw)</value>
|
||||
</data>
|
||||
<data name="HelpText_DisplayHelp_DistributedBuildServicePort" xml:space="preserve">
|
||||
|
|
|
@ -74,11 +74,6 @@ namespace BuildXL.Engine.Distribution
|
|||
return new ArraySegment<byte>(byteString.ToByteArray());
|
||||
}
|
||||
|
||||
internal static string GetServiceName(int port)
|
||||
{
|
||||
return GetServiceName(System.Net.Dns.GetHostName(), port);
|
||||
}
|
||||
|
||||
internal static string GetServiceName(string ipAddress, int port)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}::{1}", ipAddress, port);
|
||||
|
|
|
@ -59,6 +59,8 @@ namespace BuildXL.Engine.Distribution
|
|||
}
|
||||
}
|
||||
|
||||
internal readonly string Hostname;
|
||||
|
||||
private readonly RemoteWorker[] m_remoteWorkers;
|
||||
private readonly LoggingContext m_loggingContext;
|
||||
|
||||
|
@ -76,6 +78,8 @@ namespace BuildXL.Engine.Distribution
|
|||
{
|
||||
Contract.Requires(config != null && config.BuildRole.IsOrchestrator());
|
||||
|
||||
Hostname = config.MachineHostName;
|
||||
|
||||
// Create all remote workers
|
||||
m_buildServicePort = config.BuildServicePort;
|
||||
m_remoteWorkers = new RemoteWorker[config.RemoteWorkerCount];
|
||||
|
@ -381,7 +385,7 @@ namespace BuildXL.Engine.Distribution
|
|||
{
|
||||
lock (m_remoteWorkers)
|
||||
{
|
||||
if (m_remoteWorkers.Any(rw => rw.Location.IpAddress == workerLocation.IpAddress && rw.Location.Port == workerLocation.Port))
|
||||
if (m_remoteWorkers.Any(rw => rw.Location?.IpAddress == workerLocation.IpAddress && rw.Location?.Port == workerLocation.Port))
|
||||
{
|
||||
// We already know this worker (presumably, from the command line).
|
||||
// Just acknowledge the RPC.
|
||||
|
|
|
@ -442,7 +442,7 @@ namespace BuildXL.Engine.Distribution
|
|||
FingerprintSalt = m_orchestratorService.Environment.ContentFingerprinter.FingerprintSalt,
|
||||
OrchestratorLocation = new ServiceLocation
|
||||
{
|
||||
IpAddress = Dns.GetHostName(),
|
||||
IpAddress = m_orchestratorService.Hostname,
|
||||
Port = m_orchestratorService.Port,
|
||||
},
|
||||
};
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace BuildXL.Engine.Distribution
|
|||
m_orchestratorInitialized = true;
|
||||
m_orchestratorClient.Initialize(orchestratorLocation.IpAddress, orchestratorLocation.BuildServicePort, OnConnectionFailureAsync);
|
||||
|
||||
var helloResult = await m_orchestratorClient.SayHelloAsync(new ServiceLocation() { IpAddress = Dns.GetHostName(), Port = m_port });
|
||||
var helloResult = await m_orchestratorClient.SayHelloAsync(new ServiceLocation() { IpAddress = m_config.Distribution.MachineHostName, Port = m_port });
|
||||
if (!helloResult.Succeeded)
|
||||
{
|
||||
// If we can't say hello there is no hope for attachment
|
||||
|
|
|
@ -26,6 +26,9 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
/// <nodoc />
|
||||
public required string AgentMachineName { get; init; }
|
||||
|
||||
/// <nodoc />
|
||||
public required string AgentHostName { get; init; }
|
||||
|
||||
/// <nodoc />
|
||||
public required string SourcesDirectory { get; init; }
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
m_bxlExeLocation = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, exeName);
|
||||
}
|
||||
|
||||
private int ExecuteBuild(IEnumerable<string> arguments, string buildSourcesDirectory)
|
||||
private int ExecuteBuild(BuildContext buildContext, IEnumerable<string> arguments, string buildSourcesDirectory)
|
||||
{
|
||||
var fullArguments = SetDefaultArguments(arguments);
|
||||
var fullArguments = SetDefaultArguments(buildContext, arguments);
|
||||
|
||||
var process = new Process()
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
public int ExecuteSingleMachineBuild(BuildContext buildContext, string[] buildArguments)
|
||||
{
|
||||
Logger.Info($@"Launching single machine build");
|
||||
return ExecuteBuild(buildArguments, buildContext.SourcesDirectory);
|
||||
return ExecuteBuild(buildContext,buildArguments, buildContext.SourcesDirectory);
|
||||
}
|
||||
|
||||
/// <inherit />
|
||||
|
@ -102,6 +102,7 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
{
|
||||
Logger.Info($@"Launching distributed build as orchestrator");
|
||||
return ExecuteBuild(
|
||||
buildContext,
|
||||
buildArguments.Concat(new[]
|
||||
{
|
||||
$"/distributedBuildRole:orchestrator",
|
||||
|
@ -118,6 +119,7 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
Logger.Info($@"Launching distributed build as worker");
|
||||
|
||||
return ExecuteBuild(
|
||||
buildContext,
|
||||
// By default, set the timeout to 20min in the workers to avoid unnecessary waiting upon connection failures
|
||||
// (defaults are placed in front of user-provided arguments).
|
||||
new[]
|
||||
|
@ -142,7 +144,7 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
// No prep work to do
|
||||
}
|
||||
|
||||
private static IEnumerable<string> SetDefaultArguments(IEnumerable<string> arguments)
|
||||
private static IEnumerable<string> SetDefaultArguments(BuildContext buildContext, IEnumerable<string> arguments)
|
||||
{
|
||||
// The default values are added to the start of command line string.
|
||||
// This way, user-provided arguments will be able to override the defaults.
|
||||
|
@ -160,7 +162,8 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
"/earlyWorkerRelease-",
|
||||
// This flag could make sense to enable as default across the board (not only for ADO), but for now
|
||||
// let's keep dev builds out of it until we can validate it doesn't introduce a regression.
|
||||
"/useHistoricalCpuUsageInfo+"
|
||||
"/useHistoricalCpuUsageInfo+",
|
||||
$"/machineHostName:{buildContext.AgentHostName}"
|
||||
};
|
||||
|
||||
// Enable gRPC encryption
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
if (isOrchestrator)
|
||||
{
|
||||
// The orchestrator creates the build info and publishes it to the build properties
|
||||
var buildInfo = new BuildInfo { RelatedSessionId = Guid.NewGuid().ToString("D"), OrchestratorLocation = m_buildContext.AgentMachineName };
|
||||
var buildInfo = new BuildInfo { RelatedSessionId = Guid.NewGuid().ToString("D"), OrchestratorLocation = m_buildContext.AgentHostName };
|
||||
await m_vstsApi.PublishBuildInfo(m_buildContext, buildInfo);
|
||||
returnCode = m_executor.ExecuteDistributedBuildAsOrchestrator(m_buildContext, buildInfo.RelatedSessionId, m_buildArguments);
|
||||
}
|
||||
|
|
|
@ -43,27 +43,22 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
}
|
||||
|
||||
/// <inherit />
|
||||
public int ExecuteDistributedBuildAsOrchestrator(BuildContext buildContext, string relatedSessionId, string[] buildArguments)
|
||||
public int ExecuteDistributedBuildAsWorker(BuildContext buildContext, BuildInfo bi, string[] buildArguments)
|
||||
{
|
||||
// The ping executor does need the informations of all the workers
|
||||
m_vstsApi.WaitForOtherWorkersToBeReady().GetAwaiter().GetResult();
|
||||
var machines = m_vstsApi.GetWorkerAddressInformationAsync().GetAwaiter().GetResult().ToList();
|
||||
Logger.Info($@"Launching ping test: gettign build info");
|
||||
|
||||
Logger.Info($@"Launching ping test as orchestrator");
|
||||
var buildInfo = m_vstsApi.WaitForBuildInfo(buildContext).GetAwaiter().GetResult();
|
||||
|
||||
Logger.Info($@"Launching ping test: will send a ping to orchestrator");
|
||||
|
||||
var ip = buildArguments.Any(opt => opt == "ip");
|
||||
var usingV6 = buildArguments.Any(opt => opt == "ipv6");
|
||||
var ip = GetAgentIPAddress(usingV6);
|
||||
var origin = ip ? GetAgentIPAddress(usingV6) : buildContext.AgentMachineName;
|
||||
|
||||
var tasks = new Task<bool>[machines.Count];
|
||||
for (int i = 0; i < tasks.Length; i++)
|
||||
{
|
||||
var workerIp = machines[i][usingV6 ? Constants.MachineIpV6Address : Constants.MachineIpV4Address];
|
||||
tasks[i] = SendMessageToWorker(ip, machines[0][Constants.MachineHostName], workerIp, usingV6);
|
||||
}
|
||||
var task = SendMessage(origin, buildInfo.OrchestratorLocation, usingV6);
|
||||
|
||||
Task.WhenAll(tasks).GetAwaiter().GetResult();
|
||||
|
||||
if (!tasks.All(t => t.GetAwaiter().GetResult()))
|
||||
if (!task.GetAwaiter().GetResult())
|
||||
{
|
||||
// Some task failed
|
||||
return 1;
|
||||
|
@ -73,14 +68,18 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
}
|
||||
|
||||
/// <inherit />
|
||||
public int ExecuteDistributedBuildAsWorker(BuildContext buildContext, BuildInfo buildInfo, string[] buildArguments)
|
||||
public int ExecuteDistributedBuildAsOrchestrator(BuildContext buildContext, string rid, string[] buildArguments)
|
||||
{
|
||||
Logger.Info($@"Launching ping & connectivity test as worker");
|
||||
WaitMessageFromOrchestrator().GetAwaiter().GetResult();
|
||||
m_server = TcpListener.Create(ListeningPort);
|
||||
m_server.Start();
|
||||
Logger.Info($"Started server on port {ListeningPort}");
|
||||
|
||||
Logger.Info($@"Launching ping & connectivity test (will wait for connections)");
|
||||
WaitMessage().GetAwaiter().GetResult();
|
||||
return 0;
|
||||
}
|
||||
|
||||
private async Task WaitMessageFromOrchestrator()
|
||||
private async Task WaitMessage()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -132,7 +131,7 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
}
|
||||
}
|
||||
|
||||
private Task<bool> SendMessageToWorker(string myIp, string workerHostname, string workerIp, bool ipv6)
|
||||
private Task<bool> SendMessage(string myIp, string otherIp, bool ipv6)
|
||||
{
|
||||
// Ping
|
||||
try
|
||||
|
@ -140,11 +139,8 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
using var pinger = new Ping();
|
||||
PingReply reply = pinger.Send(workerIp, timeout: i*1000);
|
||||
Logger.Info($"Ping to IP {workerIp} response: {reply.Status} - {reply.RoundtripTime}ms");
|
||||
|
||||
reply = pinger.Send(workerHostname, timeout: i*1000);
|
||||
Logger.Info($"Ping to hostname {workerHostname} response: {reply.Status} - {reply.RoundtripTime}ms");
|
||||
PingReply reply = pinger.Send(otherIp, timeout: i*1000);
|
||||
Logger.Info($"Ping to {otherIp} response: {reply.Status} - {reply.RoundtripTime}ms");
|
||||
}
|
||||
}
|
||||
catch (PingException e)
|
||||
|
@ -153,8 +149,8 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
}
|
||||
|
||||
// TCP message
|
||||
Logger.Info($"Sending a message from {myIp} to {workerIp}:{ListeningPort}");
|
||||
return SendTcpMessageToWorker(workerIp, ListeningPort, ipv6 ? AddressFamily.InterNetworkV6 : AddressFamily.InterNetwork);
|
||||
Logger.Info($"Sending a message from {myIp} to {otherIp}:{ListeningPort}");
|
||||
return SendTcpMessageToWorker(otherIp, ListeningPort, ipv6 ? AddressFamily.InterNetworkV6 : AddressFamily.InterNetwork);
|
||||
}
|
||||
|
||||
private async Task<bool> SendTcpMessageToWorker(string workerIp, int port, AddressFamily addressFamily)
|
||||
|
@ -168,7 +164,15 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
try
|
||||
{
|
||||
client = new TcpClient(addressFamily);
|
||||
await client.ConnectAsync(IPAddress.Parse(workerIp), port);
|
||||
if (IPAddress.TryParse(workerIp, out var ip))
|
||||
{
|
||||
Logger.Info($"Connecting using IP");
|
||||
await client.ConnectAsync(ip, port);
|
||||
}
|
||||
else
|
||||
{
|
||||
await client.ConnectAsync(workerIp, port);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -225,9 +229,6 @@ namespace BuildXL.AdoBuildRunner.Build
|
|||
public void InitializeAsWorker(BuildContext buildContext, string[] buildArguments)
|
||||
{
|
||||
// Start listening for client requests.
|
||||
m_server = TcpListener.Create(ListeningPort);
|
||||
m_server.Start();
|
||||
Logger.Info($"Started server on port {ListeningPort}");
|
||||
}
|
||||
|
||||
private static string GetAgentIPAddress(bool ipv6)
|
||||
|
|
|
@ -57,7 +57,6 @@ namespace BuildXL.AdoBuildRunner
|
|||
{
|
||||
var api = new Api(logger);
|
||||
|
||||
|
||||
IBuildExecutor executor;
|
||||
if (args[0] == "ping")
|
||||
{
|
||||
|
@ -66,7 +65,7 @@ namespace BuildXL.AdoBuildRunner
|
|||
logger.Info("Performing connectivity test");
|
||||
executor = new PingExecutor(logger, api);
|
||||
var buildManager = new BuildManager(api, executor, buildContext, args, logger);
|
||||
return await buildManager.BuildAsync(isOrchestrator: true);
|
||||
return await buildManager.BuildAsync(isOrchestrator: Environment.GetEnvironmentVariable(Constants.AdoBuildRunnerPipelineRole) == "Orchestrator");
|
||||
}
|
||||
else if (args[0] == "launchworkers")
|
||||
{
|
||||
|
|
|
@ -529,6 +529,7 @@ namespace BuildXL.AdoBuildRunner.Vsts
|
|||
StartTime = await GetBuildStartTimeAsync(),
|
||||
BuildId = BuildId,
|
||||
AgentMachineName = AgentMachineName,
|
||||
AgentHostName = $"{AgentMachineName}.internal.cloudapp.net", // see https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances
|
||||
SourcesDirectory = SourcesDirectory,
|
||||
RepositoryUrl = RepositoryUrl,
|
||||
ServerUrl = ServerUri,
|
||||
|
|
|
@ -36,6 +36,19 @@ namespace BuildXL.Utilities.Configuration
|
|||
/// <remarks>Can be null (in non-dynamic workers)</remarks>
|
||||
IDistributionServiceLocation OrchestratorLocation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the host name where the machine running the build can be reached.
|
||||
/// By default, this is the value returned by <see cref="System.Net.Dns.GetHostName"/>
|
||||
/// but it can be overridden via the command line if needed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This value should only be overriden by build runners, never by a user.
|
||||
/// In particular, we need it to be overriddable because on ADO networks the machines are not reachable
|
||||
/// in the hostname that GetHostName returns, and we need a special suffix that is appended by the AdoBuildRunner.
|
||||
/// (see https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances)
|
||||
/// </remarks>
|
||||
string MachineHostName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The number of workers that may potentially join the build dynamically
|
||||
/// (this should be the precise amount that we expect, but technically we only require that it is an upper bound).
|
||||
|
@ -89,7 +102,6 @@ namespace BuildXL.Utilities.Configuration
|
|||
/// </summary>
|
||||
int? NumRetryFailedPipsOnAnotherWorker { get; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Verify that source files that are statically declared pip inputs match between an orchestrator and a worker.
|
||||
/// </summary>
|
||||
|
|
|
@ -5,6 +5,7 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.ContractsLight;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
|
||||
namespace BuildXL.Utilities.Configuration.Mutable
|
||||
{
|
||||
|
@ -15,6 +16,7 @@ namespace BuildXL.Utilities.Configuration.Mutable
|
|||
public DistributionConfiguration()
|
||||
{
|
||||
BuildWorkers = new List<IDistributionServiceLocation>();
|
||||
MachineHostName = Dns.GetHostName();
|
||||
|
||||
// Local worker is always connected.
|
||||
MinimumWorkers = 1;
|
||||
|
@ -35,6 +37,7 @@ namespace BuildXL.Utilities.Configuration.Mutable
|
|||
BuildWorkers = new List<IDistributionServiceLocation>(template.BuildWorkers.Select(location => new DistributionServiceLocation(location)));
|
||||
DynamicBuildWorkerSlots = template.DynamicBuildWorkerSlots;
|
||||
OrchestratorLocation = template.OrchestratorLocation;
|
||||
MachineHostName = template.MachineHostName;
|
||||
MinimumWorkers = template.MinimumWorkers;
|
||||
LowWorkersWarningThreshold = template.LowWorkersWarningThreshold;
|
||||
EarlyWorkerRelease = template.EarlyWorkerRelease;
|
||||
|
@ -56,11 +59,13 @@ namespace BuildXL.Utilities.Configuration.Mutable
|
|||
/// <nodoc />
|
||||
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public List<IDistributionServiceLocation> BuildWorkers { get; set; }
|
||||
|
||||
|
||||
/// <nodoc />
|
||||
[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
|
||||
public IDistributionServiceLocation OrchestratorLocation { get; set; }
|
||||
|
||||
/// <nodoc />
|
||||
public string MachineHostName { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public int DynamicBuildWorkerSlots { get; set; }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче