Gives deployments a name.
This commit is contained in:
parent
ad70394333
commit
e11a7d1600
|
@ -24,8 +24,9 @@ namespace CodexPlugin
|
|||
|
||||
public class DeploymentMetadata
|
||||
{
|
||||
public DeploymentMetadata(DateTime startUtc, DateTime finishedUtc, string kubeNamespace, int numberOfCodexNodes, int numberOfValidators, int storageQuotaMB, CodexLogLevel codexLogLevel, int initialTestTokens, int minPrice, int maxCollateral, int maxDuration, int blockTTL, int blockMI, int blockMN)
|
||||
public DeploymentMetadata(string name, DateTime startUtc, DateTime finishedUtc, string kubeNamespace, int numberOfCodexNodes, int numberOfValidators, int storageQuotaMB, CodexLogLevel codexLogLevel, int initialTestTokens, int minPrice, int maxCollateral, int maxDuration, int blockTTL, int blockMI, int blockMN)
|
||||
{
|
||||
Name = name;
|
||||
StartUtc = startUtc;
|
||||
FinishedUtc = finishedUtc;
|
||||
KubeNamespace = kubeNamespace;
|
||||
|
@ -42,6 +43,7 @@ namespace CodexPlugin
|
|||
BlockMN = blockMN;
|
||||
}
|
||||
|
||||
public string Name { get; }
|
||||
public DateTime StartUtc { get; }
|
||||
public DateTime FinishedUtc { get; }
|
||||
public string KubeNamespace { get; }
|
||||
|
|
|
@ -9,6 +9,7 @@ cd ../../Tools/CodexNetDeployer
|
|||
for i in $( seq 0 $replication)
|
||||
do
|
||||
dotnet run \
|
||||
--deploy-name=codex-continuous-$name-$i \
|
||||
--kube-config=/opt/kubeconfig.yaml \
|
||||
--kube-namespace=codex-continuous-$name-tests-$i \
|
||||
--deploy-file=codex-deployment-$name-$i.json \
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Discord.WebSocket;
|
||||
using CodexPlugin;
|
||||
using Discord.WebSocket;
|
||||
|
||||
namespace BiblioTech.Commands
|
||||
{
|
||||
|
@ -25,7 +26,13 @@ namespace BiblioTech.Commands
|
|||
return;
|
||||
}
|
||||
|
||||
await command.FollowupAsync($"Deployments: {string.Join(", ", deployments.Select(d => d.Metadata.StartUtc.ToString("o")))}");
|
||||
await command.FollowupAsync($"Deployments: {string.Join(", ", deployments.Select(FormatDeployment))}");
|
||||
}
|
||||
|
||||
private string FormatDeployment(CodexDeployment deployment)
|
||||
{
|
||||
var m = deployment.Metadata;
|
||||
return $"{m.Name} ({m.StartUtc.ToString("o")})";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,3 +4,4 @@ services:
|
|||
environment:
|
||||
- TOKEN=tokenplz
|
||||
- SERVERNAME=ThatBen's server
|
||||
- ADMINROLE=adminers
|
||||
|
|
|
@ -8,6 +8,9 @@ namespace CodexNetDeployer
|
|||
public const int SecondsIn1Day = 24 * 60 * 60;
|
||||
public const int TenMinutes = 10 * 60;
|
||||
|
||||
[Uniform("deploy-name", "nm", "DEPLOYNAME", false, "Name of the deployment. (optional)")]
|
||||
public string DeploymentName { get; set; } = "unnamed";
|
||||
|
||||
[Uniform("kube-config", "kc", "KUBECONFIG", false, "Path to Kubeconfig file. Use 'null' (default) to use local cluster.")]
|
||||
public string KubeConfigFile { get; set; } = "null";
|
||||
|
||||
|
|
|
@ -151,6 +151,7 @@ namespace CodexNetDeployer
|
|||
private DeploymentMetadata CreateMetadata(DateTime startUtc)
|
||||
{
|
||||
return new DeploymentMetadata(
|
||||
name: config.DeploymentName,
|
||||
startUtc: startUtc,
|
||||
finishedUtc: DateTime.UtcNow,
|
||||
kubeNamespace: config.KubeNamespace,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
dotnet run \
|
||||
--deploy-name=codex-continuous-test-deployment \
|
||||
--kube-config=/opt/kubeconfig.yaml \
|
||||
--kube-namespace=codex-continuous-tests \
|
||||
--deploy-file=codex-deployment.json \
|
||||
|
|
Loading…
Reference in New Issue