diff --git a/DistTestCore/Codex/CodexContainerRecipe.cs b/DistTestCore/Codex/CodexContainerRecipe.cs index 67e59ef..6f2871b 100644 --- a/DistTestCore/Codex/CodexContainerRecipe.cs +++ b/DistTestCore/Codex/CodexContainerRecipe.cs @@ -5,12 +5,6 @@ namespace DistTestCore.Codex { public class CodexContainerRecipe : ContainerRecipeFactory { -#if Arm64 - public const string DockerImage = "codexstorage/nim-codex:sha-6dd7e55"; -#else - public const string DockerImage = "thatbenbierens/nim-codex:loopingyeah"; - //public const string DockerImage = "codexstorage/nim-codex:sha-6dd7e55"; -#endif public const string MetricsPortTag = "metrics_port"; public const string DiscoveryPortTag = "discovery-port"; @@ -18,15 +12,11 @@ namespace DistTestCore.Codex public static readonly TimeSpan MaxUploadTimePerMegabyte = TimeSpan.FromSeconds(2.0); public static readonly TimeSpan MaxDownloadTimePerMegabyte = TimeSpan.FromSeconds(2.0); - public static string DockerImageOverride = string.Empty; + public override string Image { get; } - protected override string Image + public CodexContainerRecipe() { - get - { - if (!string.IsNullOrEmpty(DockerImageOverride)) return DockerImageOverride; - return DockerImage; - } + Image = GetDockerImage(); } protected override void Initialize(StartupConfig startupConfig) @@ -92,5 +82,12 @@ namespace DistTestCore.Codex if (marketplaceConfig.AccountIndexOverride != null) return marketplaceConfig.AccountIndexOverride.Value; return Index; } + + private string GetDockerImage() + { + var image = Environment.GetEnvironmentVariable("CODEXDOCKERIMAGE"); + if (!string.IsNullOrEmpty(image)) return image; + return "codexstorage/nim-codex:sha-0265cad"; + } } } diff --git a/DistTestCore/DistTest.cs b/DistTestCore/DistTest.cs index 6a0f2f8..87208ad 100644 --- a/DistTestCore/DistTest.cs +++ b/DistTestCore/DistTest.cs @@ -37,9 +37,10 @@ namespace DistTestCore public void GlobalSetup() { fixtureLog.Log($"Codex Distributed Tests are starting..."); - fixtureLog.Log($"Codex image: '{CodexContainerRecipe.DockerImage}'"); - fixtureLog.Log($"Prometheus image: '{PrometheusContainerRecipe.DockerImage}'"); - fixtureLog.Log($"Geth image: '{GethContainerRecipe.DockerImage}'"); + fixtureLog.Log($"Codex image: '{new CodexContainerRecipe().Image}'"); + fixtureLog.Log($"CodexContracts image: '{new CodexContractsContainerRecipe().Image}'"); + fixtureLog.Log($"Prometheus image: '{new PrometheusContainerRecipe().Image}'"); + fixtureLog.Log($"Geth image: '{new GethContainerRecipe().Image}'"); // Previous test run may have been interrupted. // Begin by cleaning everything up. diff --git a/DistTestCore/Marketplace/CodexContractsContainerRecipe.cs b/DistTestCore/Marketplace/CodexContractsContainerRecipe.cs index 1ff0c06..d34aa6f 100644 --- a/DistTestCore/Marketplace/CodexContractsContainerRecipe.cs +++ b/DistTestCore/Marketplace/CodexContractsContainerRecipe.cs @@ -4,15 +4,19 @@ namespace DistTestCore.Marketplace { public class CodexContractsContainerRecipe : ContainerRecipeFactory { - #if Arm64 - public const string DockerImage = "emizzle/codex-contracts-deployment:latest"; - #else - public const string DockerImage = "thatbenbierens/codex-contracts-deployment:nomint2"; - #endif public const string MarketplaceAddressFilename = "/usr/app/deployments/codexdisttestnetwork/Marketplace.json"; public const string MarketplaceArtifactFilename = "/usr/app/artifacts/contracts/Marketplace.sol/Marketplace.json"; - protected override string Image => DockerImage; + public override string Image { get; } + + public CodexContractsContainerRecipe() + { +#if Arm64 + Image = "emizzle/codex-contracts-deployment:latest"; +#else + Image = "thatbenbierens/codex-contracts-deployment:nomint2"; +#endif + } protected override void Initialize(StartupConfig startupConfig) { diff --git a/DistTestCore/Marketplace/GethContainerRecipe.cs b/DistTestCore/Marketplace/GethContainerRecipe.cs index a377d69..c94f73d 100644 --- a/DistTestCore/Marketplace/GethContainerRecipe.cs +++ b/DistTestCore/Marketplace/GethContainerRecipe.cs @@ -4,19 +4,22 @@ namespace DistTestCore.Marketplace { public class GethContainerRecipe : ContainerRecipeFactory { - #if Arm64 - public const string DockerImage = "emizzle/geth-confenv:latest"; - #else - public const string DockerImage = "thatbenbierens/geth-confenv:onethousand"; - #endif + private const string defaultArgs = "--ipcdisable --syncmode full"; public const string HttpPortTag = "http_port"; public const string DiscoveryPortTag = "disc_port"; - private const string defaultArgs = "--ipcdisable --syncmode full"; - public const string AccountsFilename = "accounts.csv"; - protected override string Image => DockerImage; + public override string Image { get; } + + public GethContainerRecipe() + { +#if Arm64 + Image = "emizzle/geth-confenv:latest"; +#else + Image = "thatbenbierens/geth-confenv:onethousand"; +#endif + } protected override void Initialize(StartupConfig startupConfig) { diff --git a/DistTestCore/Metrics/PrometheusContainerRecipe.cs b/DistTestCore/Metrics/PrometheusContainerRecipe.cs index 46587cf..50e433a 100644 --- a/DistTestCore/Metrics/PrometheusContainerRecipe.cs +++ b/DistTestCore/Metrics/PrometheusContainerRecipe.cs @@ -4,9 +4,12 @@ namespace DistTestCore.Metrics { public class PrometheusContainerRecipe : ContainerRecipeFactory { - public const string DockerImage = "thatbenbierens/prometheus-envconf:latest"; + public override string Image { get; } - protected override string Image => DockerImage; + public PrometheusContainerRecipe() + { + Image = "thatbenbierens/prometheus-envconf:latest"; + } protected override void Initialize(StartupConfig startupConfig) { diff --git a/KubernetesWorkflow/ContainerRecipeFactory.cs b/KubernetesWorkflow/ContainerRecipeFactory.cs index 07dc58e..340ed2d 100644 --- a/KubernetesWorkflow/ContainerRecipeFactory.cs +++ b/KubernetesWorkflow/ContainerRecipeFactory.cs @@ -27,7 +27,7 @@ return recipe; } - protected abstract string Image { get; } + public abstract string Image { get; } protected int ContainerNumber { get; private set; } = 0; protected int Index { get; private set; } = 0; protected abstract void Initialize(StartupConfig config); diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 6445b93..afe4f8a 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -5,7 +5,9 @@ services: context: .. dockerfile: docker/Dockerfile environment: - - CODEX_LOG_LEVEL=${CODEX_LOG_LEVEL:-TRACE} - - CODEX_METRICS=${CODEX_METRICS:-false} + - BRANCH="feature/docker-image-testruns" + - KUBECONFIG=kubeconfigplease + - LOGPATH="/" + - RUNNERLOCATION="ExternalToCluster" ports: - 8080:8080/tcp # REST API