From 1f21c505121f60eb73cf7c3a717b93dfabc739ed Mon Sep 17 00:00:00 2001 From: ThatBen Date: Sun, 4 May 2025 10:53:43 +0200 Subject: [PATCH 1/5] Updates api --- ProjectPlugins/CodexClient/openapi.yaml | 20 +++++++++++++++++++ .../ChainMonitor/ChainEvents.cs | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ProjectPlugins/CodexClient/openapi.yaml b/ProjectPlugins/CodexClient/openapi.yaml index d59cbcfa..b221db82 100644 --- a/ProjectPlugins/CodexClient/openapi.yaml +++ b/ProjectPlugins/CodexClient/openapi.yaml @@ -627,6 +627,26 @@ paths: "500": description: Well it was bad-bad + delete: + summary: "Deletes either a single block or an entire dataset from the local node." + tags: [Data] + operationId: deleteLocal + parameters: + - in: path + name: cid + required: true + schema: + $ref: "#/components/schemas/Cid" + description: Block or dataset to be deleted. + + responses: + "204": + description: Data was successfully deleted. + "400": + description: Invalid CID is specified + "500": + description: There was an error during deletion + "/data/{cid}/network": post: summary: "Download a file from the network to the local node if it's not available locally. Note: Download is performed async. Call can return before download is completed." diff --git a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainEvents.cs b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainEvents.cs index 8c2992da..6bbfa3cc 100644 --- a/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainEvents.cs +++ b/ProjectPlugins/CodexContractsPlugin/ChainMonitor/ChainEvents.cs @@ -1,5 +1,4 @@ using CodexContractsPlugin.Marketplace; -using System.Collections.Generic; using Utils; namespace CodexContractsPlugin.ChainMonitor From 5e62c3520c4ce71f8474cca6fe9ac5557cc12fe2 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 14 May 2025 11:45:15 +0200 Subject: [PATCH 2/5] Prevents downloading of crash log in retry loop --- Framework/KubernetesWorkflow/ContainerCrashWatcher.cs | 9 +++++---- ProjectPlugins/CodexPlugin/ApiChecker.cs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Framework/KubernetesWorkflow/ContainerCrashWatcher.cs b/Framework/KubernetesWorkflow/ContainerCrashWatcher.cs index f4f181aa..ff4dcc1e 100644 --- a/Framework/KubernetesWorkflow/ContainerCrashWatcher.cs +++ b/Framework/KubernetesWorkflow/ContainerCrashWatcher.cs @@ -14,6 +14,7 @@ namespace KubernetesWorkflow private CancellationTokenSource cts; private Task? worker; private Exception? workerException; + private bool hasCrashed = false; public ContainerCrashWatcher(ILog log, KubernetesClientConfiguration config, string containerName, string podName, string recipeName, string k8sNamespace) { @@ -47,10 +48,7 @@ namespace KubernetesWorkflow public bool HasCrashed() { - using var client = new Kubernetes(config); - var result = HasContainerBeenRestarted(client); - if (result) DownloadCrashedContainerLogs(client); - return result; + return hasCrashed; } private void Worker() @@ -72,6 +70,9 @@ namespace KubernetesWorkflow { if (HasContainerBeenRestarted(client)) { + hasCrashed = true; + cts.Cancel(); + DownloadCrashedContainerLogs(client); return; } diff --git a/ProjectPlugins/CodexPlugin/ApiChecker.cs b/ProjectPlugins/CodexPlugin/ApiChecker.cs index 4b190b34..ba799e60 100644 --- a/ProjectPlugins/CodexPlugin/ApiChecker.cs +++ b/ProjectPlugins/CodexPlugin/ApiChecker.cs @@ -10,7 +10,7 @@ namespace CodexPlugin public class ApiChecker { // - private const string OpenApiYamlHash = "06-B9-41-E8-C8-6C-DE-01-86-83-F3-9A-E4-AC-E7-30-D9-E6-64-60-E0-21-81-9E-4E-C5-93-77-2C-71-79-14"; + private const string OpenApiYamlHash = "FD-C8-0F-19-5E-14-09-C9-05-93-17-4A-97-50-1D-7E-37-50-B2-30-B2-E6-66-37-23-FA-35-F5-AB-A0-C6-BD"; private const string OpenApiFilePath = "/codex/openapi.yaml"; private const string DisableEnvironmentVariable = "CODEXPLUGIN_DISABLE_APICHECK"; From fe2d7484dbfbec98b01f2522ae96f3f2a528364a Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 14 May 2025 14:11:36 +0200 Subject: [PATCH 3/5] Updates API --- ProjectPlugins/CodexClient/openapi.yaml | 1 + ProjectPlugins/CodexPlugin/ApiChecker.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ProjectPlugins/CodexClient/openapi.yaml b/ProjectPlugins/CodexClient/openapi.yaml index b221db82..fae38467 100644 --- a/ProjectPlugins/CodexClient/openapi.yaml +++ b/ProjectPlugins/CodexClient/openapi.yaml @@ -205,6 +205,7 @@ components: required: - id - totalRemainingCollateral + - freeSize allOf: - $ref: "#/components/schemas/SalesAvailability" - type: object diff --git a/ProjectPlugins/CodexPlugin/ApiChecker.cs b/ProjectPlugins/CodexPlugin/ApiChecker.cs index ba799e60..d4c1a615 100644 --- a/ProjectPlugins/CodexPlugin/ApiChecker.cs +++ b/ProjectPlugins/CodexPlugin/ApiChecker.cs @@ -10,7 +10,7 @@ namespace CodexPlugin public class ApiChecker { // - private const string OpenApiYamlHash = "FD-C8-0F-19-5E-14-09-C9-05-93-17-4A-97-50-1D-7E-37-50-B2-30-B2-E6-66-37-23-FA-35-F5-AB-A0-C6-BD"; + private const string OpenApiYamlHash = "2F-9D-82-3C-F0-2F-D3-C9-72-C3-F2-6E-BD-C3-63-F5-67-62-D1-03-B6-60-75-31-22-DF-3F-63-A2-8D-AA-4B"; private const string OpenApiFilePath = "/codex/openapi.yaml"; private const string DisableEnvironmentVariable = "CODEXPLUGIN_DISABLE_APICHECK"; From 18b1f73025a4142a40c0242c1968879fb2d3450a Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 14 May 2025 15:01:21 +0200 Subject: [PATCH 4/5] Enables console output for test logs --- Tests/DistTestCore/Global.cs | 9 +++++++-- Tests/DistTestCore/Logs/BaseTestLog.cs | 18 +----------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Tests/DistTestCore/Global.cs b/Tests/DistTestCore/Global.cs index 4ba1374b..ddd7a5cc 100644 --- a/Tests/DistTestCore/Global.cs +++ b/Tests/DistTestCore/Global.cs @@ -1,4 +1,5 @@ -using System.Reflection; +using System.Diagnostics; +using System.Reflection; using Core; using Logging; @@ -33,7 +34,9 @@ namespace DistTestCore { try { - Stopwatch.Measure(log, "Global setup", () => + Trace.Listeners.Add(new ConsoleTraceListener()); + + Logging.Stopwatch.Measure(log, "Global setup", () => { globalEntryPoint.Announce(); globalEntryPoint.Tools.CreateWorkflow().DeleteNamespacesStartingWith(TestNamespacePrefix, wait: true); @@ -55,6 +58,8 @@ namespace DistTestCore deleteTrackedFiles: true, waitTillDone: true ); + + Trace.Flush(); } } } diff --git a/Tests/DistTestCore/Logs/BaseTestLog.cs b/Tests/DistTestCore/Logs/BaseTestLog.cs index e670e0c1..51775512 100644 --- a/Tests/DistTestCore/Logs/BaseTestLog.cs +++ b/Tests/DistTestCore/Logs/BaseTestLog.cs @@ -59,24 +59,8 @@ namespace DistTestCore.Logs protected static ILog CreateMainLog(string fullName, string name) { - ILog log = new FileLog(fullName); - log = ApplyConsoleOutput(log); - return log; - } - - private static ILog ApplyConsoleOutput(ILog log) - { - // If we're running as a release test, we'll split the log output - // to the console as well. - - var testType = Environment.GetEnvironmentVariable("TEST_TYPE"); - if (string.IsNullOrEmpty(testType) || testType.ToLowerInvariant() != "release-tests") - { - return log; - } - return new LogSplitter( - log, + new FileLog(fullName), new ConsoleLog() ); } From c3f3ef3f960fdb53352bc1bff323cc8ca6f6b0ad Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 14 May 2025 15:40:22 +0200 Subject: [PATCH 5/5] Reduce concurrency for cloud runner because volume claims are more restricted there --- Tests/CodexReleaseTests/Parallelism.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CodexReleaseTests/Parallelism.cs b/Tests/CodexReleaseTests/Parallelism.cs index d589af32..44731c5e 100644 --- a/Tests/CodexReleaseTests/Parallelism.cs +++ b/Tests/CodexReleaseTests/Parallelism.cs @@ -1,6 +1,6 @@ using NUnit.Framework; -[assembly: LevelOfParallelism(10)] +[assembly: LevelOfParallelism(2)] namespace CodexReleaseTests { }