Skip to content

Contribution idea: Port Orleans to coreclr #368

@gabikliot

Description

@gabikliot

Port the Orleans code to run on coreclr.
Some APIs from the full .NET got deprecated in coreclr (aka .NET Core), mainly around files and reflection, but at large the porting effort shouldn't be too big. This will allow to run Orleans efficiently across different platforms.


Tools:
Coreclr api search
.NET API Usage
.NET Portability Analyzer - download and Install
.NET Portability Analyzer Usage

Progress so far:
CoreCLR milestones
ApiPortabilityAnalysis result file for all projects (let's find an appropriate place to place updates of this file, please don't pollute the master branch with these big reports)


There are 2 types of issues:
(a) easy, just change an API - we have done all those.
(b) deeper profound issues where API was deprecated or changed significantly and we will need to investigate other ways to achieve the same functionality:

Need to investigate and consider profound rewrite - feel to open a GH issue with ideas on how to handle each one of those issues (separate issue for each) :
High priority

  • Create a v2 branch that changes target for Orleans to .NET Standard 1.6
  • Remove usage of App Domains for scanning https://github.com/dotnet/coreclr/issues/919
  • Provide an alternative fallback serializer (BinaryFormatter is not supported in .NET Core). The biggest concern is serializing exceptions, as they are not typically part of the grain interfaces, and we don't generate Orleans serializers for all exceptions in the system. We have a few workarounds in prototype that need to be enhanced.
  • PerformanceCounter - not supported in .NET Core.
  • Environment.UserName
  • CallContext.LogicalSetData - potentially replace with AsyncLocal<T>
  • Update codegen to be more aggressive and generate serializers for Exception types
  • SerializationInfo - not supported in .NET Core.

2nd priority

  • Compile time codegen working with new dotnet cli tooling (although be aware that the tooling will drop support for project.json once it RTMs, and we are not sure if the build tools will work once they start using csproj once again)
    • Avoid having OrleansCodeGenerator depend on Orleans project, since that creates a circular dependency to getting codegen to work easily (especially since Orleans.dll requires build time codegen). This is a nice to have, but not required if we solve the previous item in some other way.
  • Allow TestCluster to work without creating new AppDomains for each silo (for example, by leveraging containers, or spawning and managing new processes)

3rd priority

  • Separate test projects for each provider that brings in a new dependency (ideally even if that dependency is also supported in .NET Core, otherwise we would need to port the entire codebase before we can start testing each individual component we port)
  • CI servers run tests in many platforms
  • System.Runtime.Serialization.FormatterServices.GetUninitializedObject
  • System.Diagnostics.Process.Handle -> System.Diagnostics.Process.SafeHandle

Already done issues (for progress tracking):

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions