Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
gosha20777 authored May 22, 2020
2 parents d6c1c4c + 88ea0a8 commit 2987c22
Show file tree
Hide file tree
Showing 18 changed files with 128 additions and 60 deletions.
9 changes: 9 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Packaging.Targets">
<Version>0.1.155-*</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions src/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,9 @@
<StyleInclude Source="resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?assembly=Avalonia.Themes.Default"/>
-->
</Application.Styles>
<NativeMenu.Menu>
<NativeMenu>
<NativeMenuItem Header="About Lacmus"/>
</NativeMenu>
</NativeMenu.Menu>
</Application>
9 changes: 4 additions & 5 deletions src/LacmusApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
<Company>Lacmus Foundation</Company>
<AssemblyVersion>0.4.0.0</AssemblyVersion>
<FileVersion>0.4.0.0</FileVersion>
<AssemblyVersion>0.4.2.0</AssemblyVersion>
<FileVersion>0.4.2.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<Compile Update="**\*.xaml.cs">
Expand All @@ -24,8 +24,7 @@
<PackageReference Include="Avalonia.Native" Version="0.9.9" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.9" />
<PackageReference Include="Avalonia.Skia.Linux.Natives" Version="1.68.0.2" />
<PackageReference Include="Citrus.Avalonia" Version="1.2.5" />
<PackageReference Include="CUDAfy.NET" Version="1.29.5576.13786" />
<PackageReference Include="Citrus.Avalonia" Version="1.2.4" />
<PackageReference Include="Docker.DotNet" Version="3.125.2" />
<PackageReference Include="Material.Avalonia" Version="0.9.0" />
<PackageReference Include="MessageBox.Avalonia" Version="0.9.6.1" />
Expand All @@ -41,4 +40,4 @@
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.7.0" />
<PackageReference Include="ThemeEditor.Controls.ColorPicker" Version="0.9.4" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/Models/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public async Task Save(string path)

public async Task Save()
{
var confDir = Path.Join(AppDomain.CurrentDomain.BaseDirectory, "conf");
var confDir = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus");
var configPath = Path.Join(confDir,"appConfig.json");
await Save(configPath);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Docker/Docker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public async Task<string> CreateContainer(IDockerImage image)
{
var stdOut = "";
var bash = new BashCommand();
stdOut = bash.Execute($"docker create --runtime=nvidia -p 5000:5000 {image.Name}:{image.Tag}", out var err);
stdOut = bash.Execute($"docker create --gpus all -p 5000:5000 {image.Name}:{image.Tag}", out var err);

await Task.Delay(800);
stdOut = stdOut.Replace(Environment.NewLine, String.Empty);
Expand Down
15 changes: 14 additions & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Runtime.InteropServices;
using Avalonia;
using Avalonia.Logging.Serilog;
Expand All @@ -21,10 +22,11 @@ private static void Main(string[] args)
Console.WriteLine("This is free software, and you are welcome to redistribute it under GNU GPL license;\nClick `help` -> `about' for details.");
Console.WriteLine("------------------------------------");

var logPath = Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "lacmus", "log.log");
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.WriteTo.File("log.txt",
.WriteTo.File(logPath,
rollingInterval: RollingInterval.Day,
rollOnFileSizeLimit: true)
.CreateLogger();
Expand All @@ -48,6 +50,17 @@ public static string GetVersion()

private static AppBuilder BuildAvaloniaApp()
{
//FOR TEST IN VirtualBox
/*
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
return AppBuilder.Configure<App>()
.UsePlatformDetect()
.With(new Win32PlatformOptions {EnableMultitouch = true, AllowEglInitialization = true})
.With(new AvaloniaNativePlatformOptions {UseGpu = false})
.UseReactiveUI()
.LogToDebug();
*/

return AppBuilder.Configure<App>()
.UsePlatformDetect()
.With(new Win32PlatformOptions {EnableMultitouch = true, AllowEglInitialization = true})
Expand Down
Loading

0 comments on commit 2987c22

Please sign in to comment.