/// <summary> /// Class constructor /// </summary> /// <param name="appLoggingContext">Application-level logging context</param> /// <param name="maxProcesses">the maximum number of concurrent pips on the worker</param> /// <param name="config">Distribution config</param>\ /// <param name="buildId">the build id</param> public WorkerService(LoggingContext appLoggingContext, int maxProcesses, IDistributionConfiguration config, string buildId) { m_isGrpcEnabled = config.IsGrpcEnabled; m_appLoggingContext = appLoggingContext; m_maxProcesses = maxProcesses; m_port = config.BuildServicePort; m_services = new DistributionServices(buildId); if (m_isGrpcEnabled) { m_workerServer = new Grpc.GrpcWorkerServer(this, appLoggingContext, buildId); } else { #if !DISABLE_FEATURE_BOND_RPC m_bondWorkerService = new InternalBond.BondWorkerServer(appLoggingContext, this, m_port, m_services); m_workerServer = m_bondWorkerService; #endif } m_attachCompletionSource = TaskSourceSlim.Create <bool>(); m_exitCompletionSource = TaskSourceSlim.Create <bool>(); m_workerRunnablePipObserver = new WorkerRunnablePipObserver(this); m_sendThread = new Thread(SendBuildResults); }
public MasterService(IDistributionConfiguration config, LoggingContext loggingContext, string buildId) { Contract.Requires(config != null && config.BuildRole == DistributedBuildRoles.Master); Contract.Ensures(m_remoteWorkers != null); m_isGrpcEnabled = config.IsGrpcEnabled; // Create all remote workers m_buildServicePort = config.BuildServicePort; m_remoteWorkers = new RemoteWorker[config.BuildWorkers.Count]; m_loggingContext = loggingContext; DistributionServices = new DistributionServices(buildId); for (int i = 0; i < m_remoteWorkers.Length; i++) { var configWorker = config.BuildWorkers[i]; var workerId = i + 1; // 0 represents the local worker. var serviceLocation = new ServiceLocation { IpAddress = configWorker.IpAddress, Port = configWorker.BuildServicePort }; m_remoteWorkers[i] = new RemoteWorker(m_isGrpcEnabled, loggingContext, (uint)workerId, this, serviceLocation); } if (m_isGrpcEnabled) { m_masterServer = new Grpc.GrpcMasterServer(loggingContext, this, buildId); } else { #if !DISABLE_FEATURE_BOND_RPC m_masterServer = new InternalBond.BondMasterServer(loggingContext, this); #endif } }
/// <summary> /// Class constructor /// </summary> /// <param name="appLoggingContext">Application-level logging context</param> /// <param name="maxProcesses">the maximum number of concurrent pips on the worker</param> /// <param name="config">Distribution config</param>\ /// <param name="buildId">the build id</param> public WorkerService(LoggingContext appLoggingContext, int maxProcesses, IDistributionConfiguration config, string buildId) { m_appLoggingContext = appLoggingContext; m_maxProcesses = maxProcesses; m_port = config.BuildServicePort; m_services = new DistributionServices(buildId); m_workerServer = new Grpc.GrpcWorkerServer(this, appLoggingContext, buildId); m_attachCompletionSource = TaskSourceSlim.Create <bool>(); m_exitCompletionSource = TaskSourceSlim.Create <bool>(); m_workerRunnablePipObserver = new WorkerRunnablePipObserver(this); m_sendThread = new Thread(SendBuildResults); }
/// <nodoc/> public WorkerNotificationManager(WorkerService workerService, EngineSchedule schedule, IPipExecutionEnvironment environment, DistributionServices services) { WorkerService = workerService; DistributionServices = services; m_scheduler = schedule.Scheduler; m_environment = environment; m_forwardingEventListener = new ForwardingEventListener(this); m_sendCancellationSource = new CancellationTokenSource(); m_pipResultListener = new PipResultListener(this, schedule, environment); m_sendThread = new Thread(() => SendNotifications(m_sendCancellationSource.Token)); }
public MasterService(IDistributionConfiguration config, LoggingContext loggingContext, string buildId) { Contract.Requires(config != null && config.BuildRole == DistributedBuildRoles.Master); Contract.Ensures(m_remoteWorkers != null); // Create all remote workers m_buildServicePort = config.BuildServicePort; m_remoteWorkers = new RemoteWorker[config.BuildWorkers.Count]; m_loggingContext = loggingContext; DistributionServices = new DistributionServices(buildId); for (int i = 0; i < m_remoteWorkers.Length; i++) { var configWorker = config.BuildWorkers[i]; var workerId = i + 1; // 0 represents the local worker. var serviceLocation = new ServiceLocation { IpAddress = configWorker.IpAddress, Port = configWorker.BuildServicePort }; m_remoteWorkers[i] = new RemoteWorker(loggingContext, (uint)workerId, this, serviceLocation); } m_masterServer = new Grpc.GrpcMasterServer(loggingContext, this, buildId); }
public NotifyStream(uint workerId, IMasterClient masterClient, DistributionServices services) { m_workerId = workerId; m_masterClient = masterClient; m_services = services; }
internal NotifyMasterExecutionLogTarget(uint workerId, IMasterClient masterClient, PipExecutionContext context, Guid logId, int lastStaticAbsolutePathIndex, DistributionServices services) : this(new NotifyStream(workerId, masterClient, services), context, logId, lastStaticAbsolutePathIndex) { }