using CodexNetDeployer; using DistTestCore; using DistTestCore.Codex; using DistTestCore.Marketplace; using Utils; using Configuration = CodexNetDeployer.Configuration; public class Program { public static void Main(string[] args) { args = new[] { @"--kube-config=C:\Users\Ben\.kube\codex-tests-ams3-dev-kubeconfig.yaml", "--kube-namespace=testing-deployer", "--nodes=5", "--validators=3", "--storage-quota=1024", "--external" }; var nl = Environment.NewLine; Console.WriteLine("CodexNetDeployer" + nl + nl); var argOrVar = new ArgOrVar(args); if (args.Any(a => a == "-h" || a == "--help" || a == "-?")) { argOrVar.PrintHelp(); return; } var location = TestRunnerLocation.InternalToCluster; if (args.Any(a => a == "--external")) { location = TestRunnerLocation.ExternalToCluster; } var config = new Configuration( codexImage: argOrVar.Get(ArgOrVar.CodexImage, CodexContainerRecipe.DockerImage), gethImage: argOrVar.Get(ArgOrVar.GethImage, GethContainerRecipe.DockerImage), contractsImage: argOrVar.Get(ArgOrVar.ContractsImage, CodexContractsContainerRecipe.DockerImage), kubeConfigFile: argOrVar.Get(ArgOrVar.KubeConfigFile), kubeNamespace: argOrVar.Get(ArgOrVar.KubeNamespace), numberOfCodexNodes: argOrVar.GetInt(ArgOrVar.NumberOfCodexNodes), numberOfValidators: argOrVar.GetInt(ArgOrVar.NumberOfValidatorNodes), storageQuota: argOrVar.GetInt(ArgOrVar.StorageQuota), codexLogLevel: ParseEnum.Parse(argOrVar.Get(ArgOrVar.LogLevel, nameof(CodexLogLevel.Debug))), runnerLocation: location ); Console.WriteLine("Using:"); config.PrintConfig(); Console.WriteLine(nl); var errors = config.Validate(); if (errors.Any()) { Console.WriteLine($"Configuration errors: ({errors.Count})"); foreach ( var error in errors ) Console.WriteLine("\t" + error); Console.WriteLine(nl); argOrVar.PrintHelp(); return; } var deployer = new Deployer(config); deployer.Deploy(); Console.WriteLine("Done!"); } }