Eric 13d453d5ed
chore: Docker updates to support release tests in logos-storage-nim, and remove Codex references (#124)
* 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>
2026-04-17 15:03:22 +10:00

136 lines
4.5 KiB
C#

using LogosStorageClient;
using KubernetesWorkflow;
using Utils;
namespace StoragePlugin
{
public interface ILogosStorageSetup
{
ILogosStorageSetup WithName(string name);
ILogosStorageSetup At(ILocation location);
ILogosStorageSetup WithBootstrapNode(IStorageNode node);
ILogosStorageSetup WithLogLevel(LogosStorageLogLevel level);
ILogosStorageSetup WithLogLevel(LogosStorageLogLevel level, LogosStorageLogCustomTopics customTopics);
ILogosStorageSetup WithStorageQuota(ByteSize storageQuota);
ILogosStorageSetup WithBlockTTL(TimeSpan duration);
ILogosStorageSetup WithBlockMaintenanceInterval(TimeSpan duration);
ILogosStorageSetup WithBlockMaintenanceNumber(int numberOfBlocks);
ILogosStorageSetup EnableMetrics();
ILogosStorageSetup AsPublicTestNet(LogosStorageTestNetConfig testNetConfig);
}
public class LogosStorageLogCustomTopics
{
public LogosStorageLogCustomTopics(LogosStorageLogLevel discV5, LogosStorageLogLevel libp2p, LogosStorageLogLevel blockExchange)
{
DiscV5 = discV5;
Libp2p = libp2p;
BlockExchange = blockExchange;
}
public LogosStorageLogCustomTopics(LogosStorageLogLevel discV5, LogosStorageLogLevel libp2p)
{
DiscV5 = discV5;
Libp2p = libp2p;
}
public LogosStorageLogLevel DiscV5 { get; set; }
public LogosStorageLogLevel Libp2p { get; set; }
public LogosStorageLogLevel ContractClock { get; set; } = LogosStorageLogLevel.Warn;
public LogosStorageLogLevel? BlockExchange { get; }
public LogosStorageLogLevel JsonSerialize { get; set; } = LogosStorageLogLevel.Warn;
public LogosStorageLogLevel MarketplaceInfra { get; set; } = LogosStorageLogLevel.Warn;
}
public class LogosStorageSetup : LogosStorageStartupConfig, ILogosStorageSetup
{
public int NumberOfNodes { get; }
public LogosStorageSetup(int numberOfNodes)
{
NumberOfNodes = numberOfNodes;
}
public ILogosStorageSetup WithName(string name)
{
NameOverride = name;
return this;
}
public ILogosStorageSetup At(ILocation location)
{
Location = location;
return this;
}
public ILogosStorageSetup WithBootstrapNode(IStorageNode node)
{
BootstrapSpr = node.GetDebugInfo().Spr;
return this;
}
public ILogosStorageSetup WithLogLevel(LogosStorageLogLevel level)
{
LogLevel = level;
return this;
}
public ILogosStorageSetup WithLogLevel(LogosStorageLogLevel level, LogosStorageLogCustomTopics customTopics)
{
LogLevel = level;
CustomTopics = customTopics;
return this;
}
public ILogosStorageSetup WithStorageQuota(ByteSize storageQuota)
{
StorageQuota = storageQuota;
return this;
}
public ILogosStorageSetup WithBlockTTL(TimeSpan duration)
{
BlockTTL = Convert.ToInt32(duration.TotalSeconds);
return this;
}
public ILogosStorageSetup WithBlockMaintenanceInterval(TimeSpan duration)
{
BlockMaintenanceInterval = duration;
return this;
}
public ILogosStorageSetup WithBlockMaintenanceNumber(int numberOfBlocks)
{
BlockMaintenanceNumber = numberOfBlocks;
return this;
}
public ILogosStorageSetup EnableMetrics()
{
MetricsEnabled = true;
return this;
}
public ILogosStorageSetup AsPublicTestNet(LogosStorageTestNetConfig testNetConfig)
{
PublicTestNet = testNetConfig;
return this;
}
public string Describe()
{
var args = string.Join(',', DescribeArgs());
return $"({NumberOfNodes} Logos Storage Nodes with args:[{args}])";
}
private IEnumerable<string> DescribeArgs()
{
if (PublicTestNet != null) yield return $"<!>Public TestNet with listenPort: {PublicTestNet.PublicListenPort}<!>";
yield return $"LogLevel={LogLevelWithTopics()}";
if (BootstrapSpr != null) yield return $"BootstrapNode={BootstrapSpr}";
if (StorageQuota != null) yield return $"StorageQuota={StorageQuota}";
}
}
}