mirror of
https://github.com/logos-storage/logos-storage-nim-cs-dist-tests.git
synced 2026-05-08 02:19:31 +00:00
* ci(docker): build dist-tests images * Update to .net 10, kubernetes client 18.0.13 Kubernetes client 18.0.13 is compatible with Kubernetes 1.34.x. The Kubernetes version is selected automatically by kubeadm in docker desktop (v1.34.1). See https://github.com/kubernetes-client/csharp#version-compatibility for a compatibility table. * Updates to support Kubernetes upgrade * bump openapi.yaml to match openapi.yaml in the logos-storage-nim docker image * bump doc to .net 10 * bump docker to .net 10 * Build image with latest tag always Always build an image with a latest tag (as well as a sha commit hash) when there's a push to master * docker image tag as "latest" only when pushing to master * Update docker image to install doctl * Remove doctl install kubeconfig is now created and uses a plain bearer token instead of using doctl as a credential mgr * Rename and remove all instances of Codex * Further remove CodexNetDeployer as it is no longer needed --------- Co-authored-by: Adam Uhlíř <adam@uhlir.dev>
82 lines
2.8 KiB
C#
82 lines
2.8 KiB
C#
using LogosStorageClient;
|
|
using FileUtils;
|
|
using Logging;
|
|
using MetricsPlugin;
|
|
using Utils;
|
|
|
|
namespace ContinuousTests
|
|
{
|
|
public abstract class ContinuousTestLongTimeouts : ContinuousTest
|
|
{
|
|
}
|
|
|
|
public abstract class ContinuousTest
|
|
{
|
|
protected const int Zero = 0;
|
|
protected const int MinuteOne = 60;
|
|
protected const int MinuteFive = MinuteOne * 5;
|
|
protected const int HourOne = MinuteOne * 60;
|
|
protected const int HourThree = HourOne * 3;
|
|
protected const int DayOne = HourOne * 24;
|
|
protected const int DayThree = DayOne * 3;
|
|
|
|
public void Initialize(IStorageNode[] nodes, ILog log, IFileManager fileManager, Configuration configuration, CancellationToken cancelToken)
|
|
{
|
|
Nodes = nodes;
|
|
Log = log;
|
|
FileManager = fileManager;
|
|
Configuration = configuration;
|
|
CancelToken = cancelToken;
|
|
|
|
if (nodes != null)
|
|
{
|
|
NodeRunner = new NodeRunner(Nodes, configuration, Log, CustomK8sNamespace);
|
|
}
|
|
else
|
|
{
|
|
NodeRunner = null!;
|
|
}
|
|
}
|
|
|
|
public IStorageNode[] Nodes { get; private set; } = null!;
|
|
public ILog Log { get; private set; } = null!;
|
|
public IFileManager FileManager { get; private set; } = null!;
|
|
public Configuration Configuration { get; private set; } = null!;
|
|
public CancellationToken CancelToken { get; private set; } = new CancellationToken();
|
|
public NodeRunner NodeRunner { get; private set; } = null!;
|
|
|
|
public IMetricsAccess CreateMetricsAccess(IHasMetricsScrapeTarget target)
|
|
{
|
|
return CreateMetricsAccess(target.GetMetricsScrapeTarget());
|
|
}
|
|
|
|
public IMetricsAccess CreateMetricsAccess(Address target)
|
|
{
|
|
if (Configuration.LogosStorageDeployment.PrometheusContainer == null) throw new Exception("Expected prometheus to be part of Logos Storage deployment.");
|
|
|
|
var entryPointFactory = new EntryPointFactory();
|
|
var entryPoint = entryPointFactory.CreateEntryPoint(Configuration.KubeConfigFile, Configuration.DataPath, Configuration.LogosStorageDeployment.Metadata.KubeNamespace, Log);
|
|
return entryPoint.CreateInterface().WrapMetricsCollector(Configuration.LogosStorageDeployment.PrometheusContainer, target);
|
|
}
|
|
|
|
public abstract int RequiredNumberOfNodes { get; }
|
|
public abstract TimeSpan RunTestEvery { get; }
|
|
public abstract TestFailMode TestFailMode { get; }
|
|
public virtual string CustomK8sNamespace { get { return string.Empty; } }
|
|
|
|
public string Name
|
|
{
|
|
get
|
|
{
|
|
return GetType().Name;
|
|
}
|
|
}
|
|
}
|
|
|
|
public enum TestFailMode
|
|
{
|
|
StopAfterFirstFailure,
|
|
AlwaysRunAllMoments
|
|
}
|
|
}
|