Opened 6 years ago
Last modified 5 years ago
#2924 accepted feature request
Provide .NET core version of HeuristicLab framework libraries
Reported by: | gkronber | Owned by: | dpiringe |
---|---|---|---|
Priority: | medium | Milestone: | HeuristicLab 4.x Backlog |
Component: | General | Version: | |
Keywords: | Cc: |
Description
HeuristicLab is primarily developed as a Windows desktop application. We provide a build configuration for Mono which allows building and running HL on Linux. With a trick it is even possible to use a limited version of the GUI on Linux.
Currently, .NET core is the recommended way to implement cross-plattform .NET applications. .NET core does not support the Windows.Forms API. However, large parts of the HeuristicLab framework do not depend on the GUI parts and can therefore be potentially migrated to .NET core.
Attachments (1)
Change History (30)
comment:1 Changed 6 years ago by gkronber
comment:2 Changed 6 years ago by gkronber
Necessary pre-conditions:
- Split PluginInfrastructure in two plugins to remove dependency on Windows.Forms (see #2522)
- Remove Image property in Item to remove dependency on System.Drawing (some efforts are underway to support System.Drawing on .NET core, https://github.com/dotnet/corefx/issues/20325)
comment:3 Changed 6 years ago by abeham
If I read the issue correctly you should use one of the compatibility packages on nuget if you want System.Drawing support, for instance System.Drawing.Common + System.Drawing.Primitives. There are more, but they don't look so good to me (CoreCompat.System.Drawing and CoreCompat.System.Drawing.v2).
comment:4 Changed 6 years ago by swagner
- Owner changed from gkronber to dpiringe
- Status changed from new to assigned
I assign this ticket to dpiringe as he will look into this in his internship.
comment:5 Changed 6 years ago by jkarder
I will recreate this branch from [16144/branches/2522_RefactorPluginInfrastructure] and reapply the changes from r16143.
comment:6 Changed 6 years ago by jkarder
- Owner changed from dpiringe to jkarder
- Status changed from assigned to accepted
comment:7 Changed 6 years ago by jkarder
r16145: deleted branch [15961/branches/2924-dotnet-core]
comment:8 Changed 6 years ago by jkarder
r16146: created branch for .NET Core migration
comment:9 Changed 6 years ago by jkarder
comment:10 Changed 6 years ago by dpiringe
r16192: added packages.config
comment:11 Changed 6 years ago by dpiringe
- Owner changed from jkarder to dpiringe
- Status changed from accepted to assigned
comment:12 Changed 6 years ago by dpiringe
- Status changed from assigned to accepted
comment:13 Changed 6 years ago by dpiringe
r16854: changed projects to reference System.Drawing.Common package instead of Microsoft.Windows.Compatibility package
comment:14 Changed 6 years ago by dpiringe
r16857: separated PasswordDialog from HeuristicLab.Clients.Common into new Project called HeuristicLab.PasswordDialog and migrated HeuristicLab.Clients.Common to .NET Standard
comment:15 Changed 6 years ago by dpiringe
- migrated PluginInfrastructure to .NET Standard
- created a new .NET Core project HeuristicLab.PluginInfrastructure.Runner, which contains the logic to load and isolate assemblies, based on the new interfaces from HeuristicLab.PluginInfrastructure
- recycled old plugin validation code
comment:16 Changed 5 years ago by dpiringe
r16965: changed project HeuristicLab.Persistence to be .net core compatible
comment:17 Changed 5 years ago by dpiringe
- merged projects HeuristicLab.PluginInfrastructure.Runner and HeuristicLab.PluginInfrastructure
- applied changes of code reviews (13.05.2019 and 22.05.2019) -> the old Runner is now RunnerHost and uses a Runner, which is executed on the child process
- added Type GetType(string) to IApplicationManager and implemented it for LightweightApplicationManager
- removed IActivator and IActivatorContext
- deleted unused types like PluginDescriptionIterator
comment:18 Changed 5 years ago by dpiringe
- added CLI Framework HeuristicLab.CommandLineInterface
- added definition language test project HeuristicLab.DefinitionLanguage
- added test project HeuristicLab.DynamicAssemblyTestApp, for PluginInfrastructure testing
- changed project HeuristicLab to .NET Core and used it to create a CLI-Tool with the new CLI Framework
- added Docker support to HeuristicLab
- added IRunnerHost.cs ... forgot last commit
- changed DockerRunnerHost and NativeRunnerHost to HeuristicLab-3.3.exe, was a little test project before
- added new solution file HeuristicLab 3.3 No Views.sln, where all view projects are unloaded at start
comment:19 Changed 5 years ago by dpiringe
- changed the use of AppDomain.CurrentDomain.BaseDirectory to Directory.GetCurrentDirectory() in projects HeuristicLab.MathJax and HeuristicLab.Problems.GeneticProgramming, this change helps to load these plugins correctly with the new PluginInfrastructure
- deleted obsolete files from folder HeuristicLab/3.3/Properties and added launchSettings.json for docker
comment:20 Changed 5 years ago by dpiringe
r16990: removed unused NuGet package references and migrated CodeDom NuGet package from packages.config to PackageReference format
comment:21 Changed 5 years ago by dpiringe
- removed unused NuGet packages for Projects:
- HeuristicLab.Visualization.ChartControlsExtensions-3.3
- HeuristicLab.Problems.ExternalEvaluation.Scilab-3.3
- HeuristicLab.Problems.DataAnalysis.Views-3.4
- HeuristicLab.Optimizer-3.3
- updated NuGet package System.Drawing.Common from 4.5.0 to 4.5.1 for Project HeuristicLab.Problems.DataAnalysis.Views-3.4
- added NuGet PackageReference Microsoft.Win32.Registry.AccessControl for Project HeuristicLab.Problems.ExternalEvaluation.Scilab-3.3
- added Key Files for Projects:
- HeuristicLab.DynamicAssemblyTestApp
- HeuristicLab.DefinitionLanguage
- HeuristicLab.CommandLineInterface
comment:22 Changed 5 years ago by dpiringe
- added IEnumerable<T> GetInstances<T>(params object[] args) where T: class and IEnumerable<object> GetInstances(Type type, params object[] args) method to IApplicationManager and implemented them in LightweightApplicationManager -> to instantiate types with specific constructor arguments
- added RunnerState State { get; } property in IRunnerHost, was already in RunnerHost
- added user authentication for NativeRunnerHost
- added optional check for a running docker daemon and available image for type DockerRunnerHost + Exception DockerException
- added caching of the saved IApplication in ApplicationRunner to prevent a new instance every get call
- removed System.ServiceModel.Primitives NuGet package
- lots of formatting
comment:23 Changed 5 years ago by dpiringe
- in project HeuristicLab.CommandLineInterface changed output for options -> hidden options are not shown in the help box anymore
- in project HeuristicLab.DynamicAssemblyTestApp:
- added ApplicationAttributes
- added full cancel/pause/resume support for class AppTest to test the same behaviour between main and child process
- in project HeuristicLab:
- changed auto generated Dockerfile -> only copies necessary projects -> speeds up the build process
- in file HeuristicLab-3.3.csproj:
- changed DockerDefaultTargetOS to Linux
- removed reference HeuristicLab.DefinitionLanguage
- added icon and manifest
- deleted folder Properties with file launchSettings.json
- changed the direct access to ApplicationTypes for OptimizeCommand and InspectCommand to new method IApplicationManager.GetInstances<T>(params object[] args)
- added build script for docker image dockerImageBuild.ps1
comment:24 Changed 5 years ago by dpiringe
- some changes in CLIApplication.cs to reduce unnecessary allocation of string objects
- renamed AppTest to ConsoleOptimizer and fixed race condition
- replaced enum RunnerJob with class RunnerMessage for more control of saved data
- changed usage of BinaryFormatter with HEAL.Attic, following types are now Storable:
- ConsoleOptimizer
- InspectApplication
- ApplicationBase
- ApplicationRunner
- AssemblyInfo
- Runner
- UniPath
- RunnerMessage
- switched QuietMode from ApplicationRunner to IRunner
- DockerRunnerHost can now automatically build docker images for linux and windows containers (also identifies which container type is active) -> removes the condition to have the image preinstalled
- to achieve this, there are two new folders DockerLinuxBuild and DockerWindowsBuild included in build output, which include Dockerfiles to build images for linux and windows container
- added NuGet package System.CodeDom to project HeuristicLab.Scripting-3.3
- added method Send(RunnerMessage) to IRunnerHost and transferred methods Pause and Resume to IRunner
- added internal reference of RunnerHost in Runner
- added abstract method SendMessage(RunnerMessage) in RunnerHost which gets called from method Send(RunnerMessage)
- because of a Google.Protobuf "bug", RunnerMessages cannot get serialized/deserialized directly on stream -> workaround with a byte array, which gets written and read
- additionally, the length of the array gets sent first (length as integer -> 4 bytes)
- static method in RunnerMessage to read a message from a stream
- the method SendMessage(RunnerMessage) in RunnerHost implements this functionality
comment:25 Changed 5 years ago by dpiringe
- added base attribute CLIBaseAttribute for CLI attributes, which contains the property Description
- changed inheritance from Attribute to CLIBaseAttribute for types: CommandAttribute, OptionAttribute and ValueAttribute
- added comment in RunnerHost
comment:26 Changed 5 years ago by dpiringe
- renamed HeuristicLab.DynamicAssemblyTestApp to HeuristicLab.ConsoleApplications
- incl. Namespace and plugin name
- renamed InspectApplication to ConsoleInspector
comment:27 Changed 5 years ago by dpiringe
- renamed HeuristicLab.DynamicAssemblyTestApp to HeuristicLab.ConsoleApplications on folder/solution level
- changed references from HeuristicLab.DynamicAssemblyTestApp to HeuristicLab.ConsoleApplications in HeuristicLab-3.3.csproj
comment:28 Changed 5 years ago by dpiringe
- removed a blank line in InspectCommand.cs
- removed BuildCommand.cs and project HeuristicLab.DefinitionLanguage, because it was only a test
- removed reference BuildCommand in ApplicationCommand
comment:29 Changed 5 years ago by dpiringe
- removed reference in HeuristicLab 3.3.sln to previous deleted project HeuristicLab.DefinitionLanguage
r15961: created branch for ticket