From cf1bc970f75750e22e2a3d107d45c7924d406e0e Mon Sep 17 00:00:00 2001 From: Mateusz Walkiewicz Date: Wed, 7 Aug 2024 16:01:04 +0200 Subject: [PATCH] feat: Reset hardware profile on provider startup --- Golem.Package/Args.cs | 2 +- Golem.Tools/GolemPackageBuilder.cs | 2 +- Golem/Golem.cs | 3 ++- Golem/Yagna/Provider.cs | 7 ++++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Golem.Package/Args.cs b/Golem.Package/Args.cs index 3d3ffea..c805420 100644 --- a/Golem.Package/Args.cs +++ b/Golem.Package/Args.cs @@ -5,7 +5,7 @@ public class BuildArgs { [Option('t', "target", Default = "package", Required = false, HelpText = "Directory where binaries will be generated relative to working dir")] public required string Target { get; set; } - [Option('y', "yagna-version", Default = "pre-rel-v0.16.0-preview.ai.29", Required = false, HelpText = "Yagna version github tag")] + [Option('y', "yagna-version", Default = "pre-rel-v0.16.0-preview.ai.30", Required = false, HelpText = "Yagna version github tag")] public required string GolemVersion { get; set; } [Option('r', "runtime-version", Default = "v0.2.5", Required = false, HelpText = "Runtime version github tag")] public required string RuntimeVersion { get; set; } diff --git a/Golem.Tools/GolemPackageBuilder.cs b/Golem.Tools/GolemPackageBuilder.cs index 655704a..d9a1bf9 100644 --- a/Golem.Tools/GolemPackageBuilder.cs +++ b/Golem.Tools/GolemPackageBuilder.cs @@ -18,7 +18,7 @@ namespace Golem.Tools { public class PackageBuilder { - public static string CURRENT_GOLEM_VERSION = "pre-rel-v0.16.0-preview.ai.29"; + public static string CURRENT_GOLEM_VERSION = "pre-rel-v0.16.0-preview.ai.30"; public static string CURRENT_RUNTIME_VERSION = "v0.2.5"; internal static string InitTestDirectory(string name, bool cleanupData = true) diff --git a/Golem/Golem.cs b/Golem/Golem.cs index 8ec9ffe..78e7bde 100644 --- a/Golem/Golem.cs +++ b/Golem/Golem.cs @@ -312,6 +312,7 @@ private async Task StartupProvider(Func exitHandler, Cancella { try { + Provider.ResetDefaultProfile(); Provider.PresetConfig.InitilizeDefaultPresets(); await Provider.Run(Yagna.Options.AppKey, Yagna.Options.Network, exitHandler, cancellationToken, true); } @@ -452,4 +453,4 @@ public List LogFiles() return Provider.ProviderProcess?.Id; } } -} +} \ No newline at end of file diff --git a/Golem/Yagna/Provider.cs b/Golem/Yagna/Provider.cs index 75fc86f..c3c1cd9 100644 --- a/Golem/Yagna/Provider.cs +++ b/Golem/Yagna/Provider.cs @@ -203,6 +203,11 @@ public void UpdateDefaultProfile(String param, String value) ExecToText($"profile update {param} {value} default".Split()); } + public void ResetDefaultProfile() + { + ExecToText("profile update --reset-to-defaults --name default".Split()); + } + public async Task Run(string appKey, Network network, Func exitHandler, CancellationToken cancellationToken, bool enableDebugLogs = false) { await ProcLock.WaitAsync(cancellationToken); @@ -285,4 +290,4 @@ internal IEnumerable LogFiles() return logFiles.Concat(logGzFiles).Concat(runtimeLogFiles).Concat(runtimeLogGzFiles); } } -} +} \ No newline at end of file