question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ISiloBuilder and Orleans 2.3.0 HostBuilder Extensions

See original GitHub issue

I upgraded to the latest Orleans 2.3.0 build today in hopes of using the new HostBuilder extensions. However, I noticed the HostBuilder.UseOrleans method expects an action with a parameter of ISiloBuilder instead of ISiloHostBuilder that Orleans.Clustering expects.

The change to support this looks to be a straightforward addition to the extensions class where the this parameter is of ISiloBuilder type.

        public static ISiloBuilder UseKubeMembership(this ISiloBuilder builder,
            Action<KubeClusteringOptions> configureOptions)
        {
            return builder.ConfigureServices(services => services.UseKubeMembership(configureOptions));
        }

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mthirdcommented, Apr 2, 2019

While moving the code over, I forgot to include the key piece:

.ConfigureEndpoints(10000, 30000, listenOnAnyHostAddress: true)

Thanks for your patience and for this great library.

1reaction
mthirdcommented, Apr 2, 2019

Edit: Leaving this here for posterity, but see next comment.

Odd, none of the endpoint options were necessary using the SiloHostBuilder.

In any case, here is my solution:

    .Configure<EndpointOptions>(options =>
    {
        var podIp = Environment.GetEnvironmentVariable("POD_IP");
        if (String.IsNullOrEmpty(podIp))
        {
            throw new Exception("Could not find POD_IP environment variable");
        }
        var listen = IPAddress.Parse(podIp);
        options.SiloListeningEndpoint = new IPEndPoint(listen, 10000);
        options.GatewayListeningEndpoint = new IPEndPoint(listen, 30000);
        options.AdvertisedIPAddress = listen;
    })
    .UseKubeMembership(opt =>
    {
        opt.CanCreateResources = false;
        opt.DropResourcesOnInit = false;
    });

Then use the downward api in the deployment manifest to get the pod IP:

          env:
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
Read more comments on GitHub >

github_iconTop Results From Across the Web

GenericHostExtensions.UseOrleans Method
Configures the host builder to host an Orleans silo. UseOrleans(IHostBuilder, Action<HostBuilderContext,ISiloBuilder>). Configures the host builder to host an ...
Read more >
SiloHostBuilderExtensions.Configure Method
The options type to be configured. Parameters. builder: ISiloHostBuilder. The host builder. configureOptions: Action<TOptions>.
Read more >
Parameter Null Exception when calling Microsoft. ...
Exception when creating Host builder. Our Cronjob was working before that date ... Extensions.Hosting.HostBuilder.ConfigureServices(Action`2 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found