Esempio n. 1
0
        public ServerInterceptor(LoggingContext loggingContext, DistributedInvocationId invocationId)
        {
            m_loggingContext    = loggingContext;
            m_invocationId      = invocationId;
            m_encryptionEnabled = EngineEnvironmentSettings.GrpcEncryptionEnabled;

            if (m_encryptionEnabled)
            {
                m_token = GrpcEncryptionUtil.TryGetTokenBuildIdentityToken(EngineEnvironmentSettings.CBBuildIdentityTokenPath);
            }
        }
Esempio n. 2
0
        public OrchestratorService(IDistributionConfiguration config, LoggingContext loggingContext, DistributedInvocationId invocationId, PipExecutionContext context) : base(invocationId)
        {
            Contract.Requires(config != null && config.BuildRole.IsOrchestrator());

            // Create all remote workers
            m_buildServicePort = config.BuildServicePort;
            m_remoteWorkers    = new RemoteWorker[config.BuildWorkers.Count];

            m_loggingContext = loggingContext;

            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, context);
            }

            m_orchestratorServer = new Grpc.GrpcOrchestratorServer(loggingContext, this, invocationId);
        }
Esempio n. 3
0
 private bool IsUnrecoverableMismatch(DistributedInvocationId senderInvocationId)
 {
     // If the build ids match, we don't want to signal an unrecoverable state
     return(senderInvocationId.RelatedActivityId != m_invocationId.RelatedActivityId);
 }
Esempio n. 4
0
 /// <nodoc/>
 public DistributionService(DistributedInvocationId invocationId)
 {
     InvocationId = invocationId;
 }