Skip to content

Commit

Permalink
feat: Reset hardware profile on provider startup
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalkiewicz committed Aug 9, 2024
1 parent cece46f commit 73233e8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Golem.Package/Args.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.33", 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; }
Expand All @@ -23,7 +23,7 @@ public class DownloadArgs
{
[Option('t', "target", Default = "modules", Required = false, HelpText = "Directory where binaries will be generated relative to working dir")]
public required string Target { get; set; }
[Option('p', "version", Default = "pre-rel-v5.0.7", Required = false, HelpText = "Gamerhash module integration package version")]
[Option('p', "version", Default = "v5.0.10", Required = false, HelpText = "Gamerhash module integration package version")]
public required string PackageVersion { get; set; }
}

Expand Down
2 changes: 1 addition & 1 deletion Golem.Tools/GolemPackageBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.33";
public static string CURRENT_RUNTIME_VERSION = "v0.2.5";

internal static string InitTestDirectory(string name, bool cleanupData = true)
Expand Down
3 changes: 2 additions & 1 deletion Golem/Golem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ private async Task StartupProvider(Func<int, string, Task> exitHandler, Cancella
{
try
{
Provider.ResetDefaultProfile();
Provider.PresetConfig.InitilizeDefaultPresets();
await Provider.Run(Yagna.Options.AppKey, Yagna.Options.Network, exitHandler, cancellationToken, true);
}
Expand Down Expand Up @@ -452,4 +453,4 @@ public List<String> LogFiles()
return Provider.ProviderProcess?.Id;
}
}
}
}
7 changes: 6 additions & 1 deletion Golem/Yagna/Provider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ public void UpdateDefaultProfile(String param, String value)
ExecToText($"profile update {param} {value} default".Split());
}

public void ResetDefaultProfile()
{
ExecToText("profile reset --name default".Split());
}

public async Task Run(string appKey, Network network, Func<int, string, Task> exitHandler, CancellationToken cancellationToken, bool enableDebugLogs = false)
{
await ProcLock.WaitAsync(cancellationToken);
Expand Down Expand Up @@ -285,4 +290,4 @@ internal IEnumerable<string> LogFiles()
return logFiles.Concat(logGzFiles).Concat(runtimeLogFiles).Concat(runtimeLogGzFiles);
}
}
}
}

0 comments on commit 73233e8

Please sign in to comment.