akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.7k stars 1.04k forks source link

NetCore meta-issue / Status #2153

Closed alexvaluyskiy closed 7 years ago

alexvaluyskiy commented 8 years ago

What has been done

Critical

In progress

Tests

Working branch https://github.com/akkadotnet/akka.net/tree/v1.3

Alpha packages https://www.myget.org/gallery/akkadotnet-netcore

alexvaluyskiy commented 8 years ago

Missing StackTrace constructor in these places https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka.Tests.Shared.Internals/AkkaSpec.cs#L76 https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka.Remote.TestKit/MultiNodeSpec.cs#L370

Discussion on corefx repo https://github.com/dotnet/corefx/issues/1797

alexvaluyskiy commented 8 years ago

We don't have Delegate.Clone on NetCore, So this code won't work https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka/Actor/Props.cs#L766 We should find an equivalent. Is it a proper conversion?

var invokerCopy = (Func<TActor>)Delegate.CreateDelegate(typeof(TActor), invoker.Method);
alexvaluyskiy commented 8 years ago

NetCore doesn't have LambdaExpression.CompileToMethod https://github.com/akkadotnet/akka.net/blob/4acfa7c363bfa83ac71849a5a8487c8d6b1bbcb1/src/core/Akka/Util/MatchHandler/LambdaExpressionCompiler.cs#L23 We should find an equivalent.

rogeralsing commented 8 years ago

Hmm why would we need Delegate.Clone in the Props example to begin with? I'm failing to see how that delegate should ever change as Props are immutable.

alexvaluyskiy commented 8 years ago

Props.cs looks like very outdated and contains a lot of TODOs. It even contains JsonIgnore attributes. Probably we don't need Delegate.Clone here

rogeralsing commented 8 years ago

One thing that we need to think about is what is idiomatic to .NET core. My impression is that the Microsoft.Extensions.Logging and Microsoft.Extensions.DependencyInjection will be the way to go on .NET core for integration with the rest of the ecosystem.

So the question is, should we align the .NET core API of Akka.NET to this?

adamhathcock commented 8 years ago

I agree with @rogeralsing about using the ME.Logging and ME.DI. They're good all purpose shims.

I've been using them at work in large shared projects with success for a while now. The logging one especially allows for teams to use their logging framework of choice.

alexvaluyskiy commented 8 years ago

Why MS made this method as abstract in TextWriter class? https://github.com/alexvaluyskiy/akka.net/commit/a5b57a2a90cc641a13cd72ee90419cc84c19e947#diff-d033e8e925734250aa0ff60cc83e1714R90

alexvaluyskiy commented 8 years ago

@rogeralsing @adamhathcock I agree, DI and logging parts should be changed in Akka.NET. But it is out of scope here. Someone should do proof of concept.

adamhathcock commented 8 years ago

I'll see if I can find time in the coming days/weeks

alexvaluyskiy commented 8 years ago

@cconstantin We have a dependency on Akka.Remote assembly in Akka.Persistence.Tests. Here: https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka.Persistence.Tests/Serialization/SerializerSpec.cs#L362 So we can't port these tests to NetCore right now. Because we can't port Akka.Remote and co at the moment. Why we have Persistence + Remoting tests here?

alexvaluyskiy commented 8 years ago

@adamhathcock it is ahead of time. We should fix all NetCore issues before. I did all what I had planned to do in NetCore branch. So I need an assistance

adamhathcock commented 8 years ago

@alexvaluyskiy well, I'll help with some tasks on that if I can find time then :) It's just you can't rely on me for a stream of work between my job and two young kids

alexvaluyskiy commented 8 years ago

We should load App.config here in a some way https://github.com/alexvaluyskiy/akka.net/commit/cd5d931e7630e0d30200aac74b771fd6fd986b3e#diff-390a43cf44056dff8f1c42cee7ab169aR67

adamhathcock commented 8 years ago

@alexvaluyskiy could the Microsoft.Extensions.Configuration be done there instead? It's possible to make a HOCON reader for it as well as the usual JSON option they use. I use a YAML one personally.

Looking at HOCON and the config (from the light knowledge of it) I think YAML and IConfiguration could be dropped in place.

adamhathcock commented 8 years ago

For a smaller task, just loading directly from any file could be implemented. App.config just doesn't exist anymore in .NET Core land

alexvaluyskiy commented 8 years ago

But Akka will target both net45 and netcore. So we should not break compatibility on NET45

adamhathcock commented 8 years ago

Can keep the System.Configuration stuff in on a flag and support loading HOCON just from any file. I guess that's the most straight forward thing.

Personally, System.Configuration is a mess to me and encouraging many different config file that can merged into a single Configuration like Microsoft.Extensions.Configuration does is pretty nice. The only issue is that HOCON supports objects and arrays while ME.Configuration really only deals with string values.

adamhathcock commented 8 years ago

Actually, ME.Config allows for arrays but you have to address them in the key. If HOCON doesn't require values to be objects or arrays then it can be done.

All my research is done while holding a baby...so armchair coding here.

alexvaluyskiy commented 8 years ago

Yes, it will be under the flag and we should test it. But App.Config don't load automatically in XPROJ. And we should load the config somehow for the test.

marcpiechura commented 8 years ago

It seems that not everybody is happy with the way ME.DI abstraction was designed. Don't now if these remarks are valid points or not since I haven't used DI container that much, but we should take them into account before we make the final decision.

https://simpleinjector.org/blog/2016/06/whats-wrong-with-the-asp-net-core-di-abstraction/

http://blog.ploeh.dk/2014/05/19/conforming-container/

adamhathcock commented 8 years ago

That's true but they're working on it https://github.com/aspnet/DependencyInjection/issues/379

I think it will get sorted out and picking an interface such as IServiceProvider is a good idea

annymsMthd commented 8 years ago

Hey guys I would like to help out with this. Has anyone taken the Build/CI task yet?

alexvaluyskiy commented 8 years ago

@annymsMthd noone, you can take it

annymsMthd commented 8 years ago

Looks the Xunit2 project isn't implemented yet. Anyone on this? I can take this one too

alexvaluyskiy commented 8 years ago

It has implemented. I 've skipped only xunit1 project

annymsMthd commented 8 years ago

I see it now. Looks like my dotnet restore fails though. Ill look into it

alexvaluyskiy commented 8 years ago

Why we reference both Xunit1 and Xunit2 projects in Akka.TestKit.Tests? We can't port Xunit1 to NetCore, so it causes problems Should we support Xunit1 package? Xunit2 looks pretty mature

alexvaluyskiy commented 8 years ago

@annymsMthd fixed some bugs in Akka.TestKit.Tests project. Check it

alexvaluyskiy commented 8 years ago

Current status Akka.Tests (net45) Total: 730, Errors: 0, Failed: 1, Skipped: 9, Time: 187,564s (Configuration test) Akka.Tests (netstandard1.6) Total: 729, Errors: 0, Failed: 13, Skipped: 9, Time: 184,731s (Akka IO tests)

Akka.Persistence.Tests (net45) Total: 175, Errors: 0, Failed: 0, Skipped: 1, Time: 41,014s Akka.Persistence.Tests (netstandard1.6) Total: 175, Errors: 0, Failed: 0, Skipped: 1, Time: 33,719s

Akka.Streams (net45) Total: 1092, Errors: 0, Failed: 6, Skipped: 43, Time: 1340,570s

Akka.Streams.Tests.Dsl.FlowThrottleSpec.Throttle_for_single_cost_elements_must_send_elements_downstream_as_soon_as_time_comes
Akka.Streams.Tests.Dsl.FlowIdleInjectSpec.KeepAlive_must_emit_elements_periodically_after_silent_periods
Akka.Streams.Tests.Dsl.FlowFlattenMergeSpec.A_FlattenMerge_must_cancel_substreams_when_failing_map_function
Akka.Streams.Tests.Dsl.FlowConflateSpec.Conflate_must_work_on_a_variable_rate_chain_simple_conflate
Akka.Streams.Tests.Dsl.FlowConflateSpec.Conflate_must_work_on_a_variable_rate_chain

Akka.Streams (netstandard1.6) - Total: 1092, Errors: 0, Failed: 4, Skipped: 43, Time: 1259,884s

Akka.Streams.Tests.Dsl.FlowFlattenMergeSpec.A_FlattenMerge_must_cancel_substreams_when_failing_map_function
Akka.Streams.Tests.Dsl.FlowSelectAsyncUnorderedSpec.A_Flow_with_SelectAsyncUnordered_must_not_run_more_futures_than_configured
Akka.Streams.Tests.Dsl.FlowSelectAsyncSpec.A_Flow_with_SelectAsync_must_not_run_more_futures_than_configured
Akka.Streams.Tests.Dsl.FlowBatchSpec.Batch_must_work_on_a_variable_rate_chain
alexvaluyskiy commented 8 years ago

@Horusiath Converted Akka.FSharp and Akka.Persistence.FSharp with dotnet-cli-fsc alpha version I didn't manage to convert Akka.FSharp.Tests because of this error "The value or constructor 'equals' is not defined F# dotnet cli". Also it references XUnit1, which is not supported in netcore.

How to get netcore status of our dependencies? Is someone from F# community plans to convert the libraries?

alexvaluyskiy commented 8 years ago

@Aaronontheweb this code is no crossplatform anymore https://github.com/akkadotnet/akka.net/blob/dev/src/core/Akka/Util/MonotonicClock.cs#L40 It doesn't run on coreclr in Ubuntu

alexvaluyskiy commented 8 years ago

I didn't manage to run tests under Mono. I got this error "No executable found matching command dotnet-test-xunit"

cconstantin commented 8 years ago

@alexvaluyskiy we're testing that the message serializer works properly during remoting. I think it's a valid test to have.

alexvaluyskiy commented 8 years ago

@cconstantin Ok. I will temporarily disable them on netcore until we get Akka.Remote on netcore

Aaronontheweb commented 8 years ago

@alexvaluyskiy we could get rid of the P/Invoke call and just use the Stopwatch there instead. That's what we have to do for Mono anyway.

sdanishali commented 8 years ago

Does AKKA.Net now work with ASP.Net Core?

http://fizzylogic.nl/2016/05/22/Using-Akka-NET-from-your-ASP-NET-core-application/ https://github.com/wmeints/akka-aspnet-core

adamhathcock commented 8 years ago

It would always work with ASP.NET Core on the full framework. What's being added is support for .NET Core.

sdanishali commented 8 years ago

Oh Ok, got it. Thanks. By the way any idea on timeline for its support on .net core?

sdanishali commented 8 years ago

Btw, you guys are doing great job. Thanks.

Aaronontheweb commented 8 years ago

@alexvaluyskiy got NBench running on Mono and Helios is just about there as well. Will work dotnet core for NBench soon.

fergusn commented 8 years ago

I've got Akka Remote and Cluster running on .NET Core. Changes to Remote (willieferguson/akka.net@14a0ca54799d05486255f8c22fc8f9aaff275bbc) and Cluster (willieferguson/akka.net@03e755d19857bf18bd3d593456d2a22e8197d516) are trivial, but there are some issues with the dependencies:

Helios: There are a number of synchronization primitives used in Helios which are not available in CoreFX. I've used the Akka IO transport until Helios is supported.

Google.ProtocolBuffers: Although the changes required to ProtocolBuffers are trivial, it does not seem like Jon Skeet is accepting pull requests. I've tried using Google.Protobuf, which does support .NET core, but this library does not support Protocol Buffer v2, and therefore require updating the to v3.

This allows me to do this: docker-akka-cluster

alexvaluyskiy commented 8 years ago

I've created a myget feed with netcore versions of Akka modules https://www.myget.org/F/akka-netcore/api/v3/index.json Only Akka, Persistence and TeskKit are present at the moment

jbtibor commented 7 years ago

@alexvaluyskiy I tried the myget feed and it has only one package: Mono.Cecil.

alexvaluyskiy commented 7 years ago

@jbtibor try to check prerelease packages

jbtibor commented 7 years ago

Thank you, this was the missing piece. I have the packages available now.

runes83 commented 7 years ago

Is there any plans (timeframe) to have a akka version ready on Core?

uatec commented 7 years ago

@willieferguson What is outstanding on your work on Remote and Cluster?

christopherobin commented 7 years ago

Thanks for the hard work. Core support for DotNetty was merged last week: DotNetty#170

alexvaluyskiy commented 7 years ago

Updated NetCore packages on MyGet - https://www.myget.org/feed/Packages/akka-netcore