Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Support defining Silo metadata #8189

Open
cecilphillip opened this issue Nov 25, 2022 · 4 comments
Open

[Proposal] Support defining Silo metadata #8189

cecilphillip opened this issue Nov 25, 2022 · 4 comments

Comments

@cecilphillip
Copy link

Overview

I'd like to propose the ability for developers to attach additional metadata attributes to their silo definitions.

Use cases

Enabling this feature would open up the ability to better categorize, inspect, and filter out silo instances. Similar capabilities exist in other frameworks such as AkkaDotNet . This would be particularly useful when creating custom placement strategies.

Possible workaround

Today, the SiloOptions only has a single property,SiloName. Also it is possible to create a non standard naming structure to embed metadata into silo, this is a bit of a hack.

// structure => "siloName.siloRole.SiloCategory"
 opts.SiloName = "MySilo.workflo.blue";

Possible API changes

  • Add Metadata property to SiloOptions
  • Expose Metadata on SiloAddress
     builder.Host.UseOrleans((context, siloBuilder) =>
        {
            siloBuilder
                .Configure<SiloOptions>(opts =>
                {
                    opts.SiloName = "MySilo";
                    opts.Metadata = new Dictionary<string, string>()
                    {
                        ["category"] = "blue",
                        ["custom.data"] = "My Custom Value",
                        [Constants.DefaultRolesNameKey] = "role1, role2, role3"
                    };
                })
  });

Conditions

  • Silo metadata should be immutable. Once the silo has started, the properties cannot be changed
  • Silo metadata should be added to the Membership table records
@ghost ghost added the Needs: triage 🔍 label Nov 25, 2022
@Romanx
Copy link
Contributor

Romanx commented Nov 25, 2022

I have a use-case for this in that we may want to place a specific grain only on Silos that have certain metadata as mentioned by @cecilphillip in our case it could be based on the hardware that the silo is on for example.

@SebastianStehle
Copy link
Contributor

I would have a look if it can be implemented without changing the membership implementation. Perhaps with some grains. Would make it easier to implement it as small improvement.

@Romanx
Copy link
Contributor

Romanx commented Nov 28, 2022

We actually do store this silo metadata in a grain. The grain itself is keyed by the silo address and we created a placement strategy that places the grain on the silo that matches.

The further placement strategy that requires the silo metadata reads the information from the silo metadata grain and caches it to avoid chatty lookups on placement. It works fine at the moment for our use-case but something more in-box would be great.

@rkargMsft
Copy link
Contributor

PR #9271 is up that would address this Issue. Any feedback would be welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants