Exemplo n.º 1
0
        private static AggregateApplicationProcessor CreateApplicationProcessor(ReplicaRegistry replicaRegistry, string[] args, string[] servicesToDebug, Microsoft.Extensions.Logging.ILogger logger, IConfiguration configuration)
        {
            var diagnosticOptions    = DiagnosticOptions.FromConfiguration(configuration);
            var diagnosticsCollector = new DiagnosticsCollector(logger, diagnosticOptions);

            // Print out what providers were selected and their values
            diagnosticOptions.DumpDiagnostics(logger);

            var processors = new List <IApplicationProcessor>
            {
                new EventPipeDiagnosticsRunner(logger, diagnosticsCollector),
                new PortAssigner(logger),
                new ProxyService(logger),
                new HttpProxyService(logger),
                new DockerRunner(logger, replicaRegistry),
                new ProcessRunner(logger, replicaRegistry, ProcessRunnerOptions.FromArgs(args, servicesToDebug))
            };

            // If the docker command is specified then transform the ProjectRunInfo into DockerRunInfo
            if (args.Contains("--docker"))
            {
                processors.Insert(0, new TransformProjectsIntoContainers(logger));
            }

            return(new AggregateApplicationProcessor(processors));
        }
Exemplo n.º 2
0
        public ProcessRunner(ILogger logger, ReplicaRegistry replicaRegistry, ProcessRunnerOptions options)
        {
            _logger          = logger;
            _replicaRegistry = replicaRegistry;
            _options         = options;

            _watchBuilderWorker = new BuildWatcher(logger);
        }
Exemplo n.º 3
0
        private static AggregateApplicationProcessor CreateApplicationProcessor(string[] args, Microsoft.Extensions.Logging.ILogger logger, IConfiguration configuration)
        {
            var diagnosticOptions    = DiagnosticOptions.FromConfiguration(configuration);
            var diagnosticsCollector = new DiagnosticsCollector(logger, diagnosticOptions);

            // Print out what providers were selected and their values
            diagnosticOptions.DumpDiagnostics(logger);

            var processor = new AggregateApplicationProcessor(new IApplicationProcessor[] {
                new EventPipeDiagnosticsRunner(logger, diagnosticsCollector),
                new ProxyService(logger),
                new DockerRunner(logger),
                new ProcessRunner(logger, ProcessRunnerOptions.FromArgs(args)),
            });

            return(processor);
        }
Exemplo n.º 4
0
        private static AggregateApplicationProcessor CreateApplicationProcessor(ReplicaRegistry replicaRegistry, HostOptions options, Microsoft.Extensions.Logging.ILogger logger)
        {
            var diagnosticsCollector = new DiagnosticsCollector(logger)
            {
                // Local run always uses metrics for the dashboard
                MetricSink = new MetricSink(logger),
            };

            if (options.LoggingProvider != null &&
                DiagnosticsProvider.TryParse(options.LoggingProvider, out var logging))
            {
                diagnosticsCollector.LoggingSink = new LoggingSink(logger, logging);
            }

            if (options.DistributedTraceProvider != null &&
                DiagnosticsProvider.TryParse(options.DistributedTraceProvider, out var tracing))
            {
                diagnosticsCollector.TracingSink = new TracingSink(logger, tracing);
            }

            // Print out what providers were selected and their values
            DumpDiagnostics(options, logger);

            var processors = new List <IApplicationProcessor>
            {
                new EventPipeDiagnosticsRunner(logger, diagnosticsCollector),
                new PortAssigner(logger),
                new ProxyService(logger),
                new HttpProxyService(logger),
                new DockerImagePuller(logger),
                new FuncFinder(logger),
                new ReplicaMonitor(logger),
                new DockerRunner(logger, replicaRegistry),
                new ProcessRunner(logger, replicaRegistry, ProcessRunnerOptions.FromHostOptions(options))
            };

            // If the docker command is specified then transform the ProjectRunInfo into DockerRunInfo
            if (options.Docker)
            {
                processors.Insert(0, new TransformProjectsIntoContainers(logger));
            }

            return(new AggregateApplicationProcessor(processors));
        }
Exemplo n.º 5
0
 public ProcessRunner(ILogger logger, ProcessRunnerOptions options)
 {
     _logger  = logger;
     _options = options;
 }
Exemplo n.º 6
0
 public ProcessRunner(ILogger logger, ReplicaRegistry replicaRegistry, ProcessRunnerOptions options)
 {
     _logger          = logger;
     _replicaRegistry = replicaRegistry;
     _options         = options;
 }
Exemplo n.º 7
0
        private void ConfigureApplication(IApplicationBuilder app)
        {
            app.UseDeveloperExceptionPage();

            app.UseCors("default");

            app.UseStaticFiles();

            app.UseRouting();

            if (_logger != null && _replicaRegistry != null)
            {
                var api = new TyeDashboardApi(new ProcessRunner(_logger, _replicaRegistry, ProcessRunnerOptions.FromHostOptions(_options)));

                app.UseEndpoints(endpoints =>
                {
                    api.MapRoutes(endpoints);
                    endpoints.MapBlazorHub();
                    endpoints.MapFallbackToPage("/_Host");
                });
            }
        }
Exemplo n.º 8
0
 public ProcessRunner(ILogger logger, ProcessRunnerOptions options)
 {
     _logger        = logger;
     _debugMode     = options.DebugMode;
     _buildProjects = options.BuildProjects;
 }