diff --git a/Tools/CodexNetDownloader/CodexNetDownloader.csproj b/Tools/CodexNetDownloader/CodexNetDownloader.csproj deleted file mode 100644 index 0df1223..0000000 --- a/Tools/CodexNetDownloader/CodexNetDownloader.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - Exe - net7.0 - enable - enable - - - - - - - - - diff --git a/Tools/CodexNetDownloader/Configuration.cs b/Tools/CodexNetDownloader/Configuration.cs deleted file mode 100644 index a42136a..0000000 --- a/Tools/CodexNetDownloader/Configuration.cs +++ /dev/null @@ -1,19 +0,0 @@ -using ArgsUniform; -using DistTestCore.Codex; - -namespace CodexNetDownloader -{ - public class Configuration - { - [Uniform("output-path", "o", "OUTPUT", true, "Path where files will be written.")] - public string OutputPath { get; set; } = "output"; - - [Uniform("codex-deployment", "c", "CODEXDEPLOYMENT", true, "Path to codex-deployment JSON file.")] - public string CodexDeploymentJson { get; set; } = string.Empty; - - [Uniform("kube-config", "kc", "KUBECONFIG", true, "Path to Kubeconfig file. Use 'null' (default) to use local cluster.")] - public string KubeConfigFile { get; set; } = "null"; - - public CodexDeployment CodexDeployment { get; set; } = null!; - } -} diff --git a/Tools/CodexNetDownloader/Program.cs b/Tools/CodexNetDownloader/Program.cs deleted file mode 100644 index 5744e71..0000000 --- a/Tools/CodexNetDownloader/Program.cs +++ /dev/null @@ -1,48 +0,0 @@ -using ArgsUniform; -using ContinuousTests; -using DistTestCore; -using DistTestCore.Codex; -using Logging; -using Newtonsoft.Json; - -public class Program -{ - public static void Main(string[] args) - { - var nl = Environment.NewLine; - Console.WriteLine("CodexNetDownloader" + nl); - - var uniformArgs = new ArgsUniform(PrintHelp, args); - var config = uniformArgs.Parse(true); - - config.CodexDeployment = ParseCodexDeploymentJson(config.CodexDeploymentJson); - - if (!Directory.Exists(config.OutputPath)) Directory.CreateDirectory(config.OutputPath); - - var k8sFactory = new K8sFactory(); - var lifecycle = k8sFactory.CreateTestLifecycle(config.KubeConfigFile, config.OutputPath, "dataPath", config.CodexDeployment.Metadata.KubeNamespace, new DefaultTimeSet(), new NullLog()); - - foreach (var container in config.CodexDeployment.CodexContainers) - { - lifecycle.DownloadLog(container); - } - - Console.WriteLine("Done!"); - } - - private static CodexDeployment ParseCodexDeploymentJson(string filename) - { - var d = JsonConvert.DeserializeObject(File.ReadAllText(filename))!; - if (d == null) throw new Exception("Unable to parse " + filename); - return d; - } - - private static void PrintHelp() - { - var nl = Environment.NewLine; - Console.WriteLine("CodexNetDownloader lets you download all container logs given a codex-deployment.json file." + nl); - - Console.WriteLine("CodexNetDownloader assumes you are running this tool from *inside* the Kubernetes cluster. " + - "If you are not running this from a container inside the cluster, add the argument '--external'." + nl); - } -}