read cdn yaml config from api

automate tensorrt model conversion in case of no existing one for user's gpu
This commit is contained in:
Alex Bezdieniezhnykh
2025-04-23 23:20:08 +03:00
parent c68c293448
commit e798af470b
23 changed files with 265 additions and 93 deletions
+4 -5
View File
@@ -89,21 +89,20 @@ public partial class App
{
new ConfigUpdater().CheckConfig();
var secureAppConfig = ReadSecureAppConfig();
var apiDir = secureAppConfig.DirectoriesConfig.ApiResourcesDirectory;
_inferenceClient = new InferenceClient(new OptionsWrapper<InferenceClientConfig>(secureAppConfig.InferenceClientConfig));
_resourceLoader = new ResourceLoader(_inferenceClient);
var login = new Login();
login.CredentialsEntered += async (_, credentials) =>
{
credentials.Folder = secureAppConfig.DirectoriesConfig.ApiResourcesDirectory;
_inferenceClient.Send(RemoteCommand.Create(CommandType.Login, credentials));
_azaionApi = new AzaionApi(new HttpClient { BaseAddress = new Uri(SecurityConstants.API_URL) }, _cache, credentials, _hardwareService);
try
{
_securedConfig = _resourceLoader.LoadFile("config.secured.json");
_systemConfig = _resourceLoader.LoadFile("config.system.json");
_securedConfig = _resourceLoader.LoadFile("config.secured.json", apiDir);
_systemConfig = _resourceLoader.LoadFile("config.system.json", apiDir);
}
catch (Exception e)
{
@@ -125,7 +124,7 @@ public partial class App
{
try
{
var stream = _resourceLoader.LoadFile($"{assemblyName}.dll");
var stream = _resourceLoader.LoadFile($"{assemblyName}.dll", apiDir);
return Assembly.Load(stream.ToArray());
}
catch (Exception e)