/// <summary> /// The program entry point. /// </summary> /// <param name="args">The command line arguments.</param> /// <returns>The tracking <see cref="Task"/>.</returns> public static async Task Main(string[] args) { NeonService.Initialize(); try { //------------------------------------------------------------- // Intercept and handle KubeOps [generator] commands executed by the // KubeOps MSBUILD tasks. if (await OperatorHelper.HandleGeneratorCommand <Startup>(args)) { return; } //------------------------------------------------------------- // Start the operator service. Service = new Service(KubeService.NeonClusterOperator); Environment.Exit(await Service.RunAsync()); } catch (Exception e) { // We really shouldn't see exceptions here but let's log something // just in case. Note that logging may not be initialized yet so // we'll just output a string. Console.Error.WriteLine(NeonHelper.ExceptionError(e)); Environment.Exit(-1); } }
/// <summary> /// The program entrypoint. /// </summary> /// <param name="args">The command line arguments.</param> public static async Task Main(string[] args) { NeonService.Initialize(); try { Service = new Service(KubeService.NeonSsoSessionProxy); Service.MetricsOptions.Mode = MetricsMode.Scrape; Service.MetricsOptions.GetCollector = () => { return(DotNetRuntimeStatsBuilder .Default() .StartCollecting()); }; Environment.Exit(await Service.RunAsync()); } catch (Exception e) { // We really shouldn't see exceptions here but let's log something // just in case. Note that logging may not be initialized yet so // we'll just output a string. Console.Error.WriteLine(NeonHelper.ExceptionError(e)); Environment.Exit(-1); } }
/// <summary> /// The program entrypoint. /// </summary> /// <param name="args">The command line arguments.</param> public static async Task Main(string[] args) { NeonService.Initialize(); var options = Parser.Default.ParseArguments <Options>(args).Value; try { Service = new Service(Service.ServiceName); if (!string.IsNullOrEmpty(options.ConfigFile)) { using (StreamReader reader = new StreamReader(new FileStream(options.ConfigFile, FileMode.Open, FileAccess.Read))) { Service.SetConfigFile(Service.ConfigFile, await reader.ReadToEndAsync()); } } if (!NeonHelper.IsDevWorkstation) { Service.MetricsOptions.Mode = MetricsMode.Scrape; Service.MetricsOptions.GetCollector = () => { return(DotNetRuntimeStatsBuilder .Default() .StartCollecting()); }; } Environment.Exit(await Service.RunAsync()); } catch (Exception e) { // We really shouldn't see exceptions here but let's log something // just in case. Note that logging may not be initialized yet so // we'll just output a string. Console.Error.WriteLine(NeonHelper.ExceptionError(e)); Environment.Exit(-1); } }
/// <summary> /// The program entry point. /// </summary> /// <param name="args">The command line arguments.</param> /// <returns>The tracking <see cref="Task"/>.</returns> public static async Task Main(string[] args) { NeonService.Initialize(); try { Service = new Service("test-cadence"); Environment.Exit(await Service.RunAsync()); } catch (Exception e) { // We really shouldn't see exceptions here but let's log something // just in case. Note that logging may not be initialized yet so // we'll just output a string. Console.Error.WriteLine(NeonHelper.ExceptionError(e)); Environment.Exit(-1); } }