Removes codex net downloader
This commit is contained in:
parent
3b6fdaa3bc
commit
48da92c737
|
@ -1,16 +0,0 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\ArgsUniform\ArgsUniform.csproj" />
|
|
||||||
<ProjectReference Include="..\ContinuousTests\ContinuousTests.csproj" />
|
|
||||||
<ProjectReference Include="..\DistTestCore\DistTestCore.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
|
@ -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!;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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<CodexNetDownloader.Configuration>(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<CodexDeployment>(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);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue