Skip to content

feat(samples): add basic clustering sample - #10622

Merged
ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-add-basic-clustering-sample
Aug 17, 2026
Merged

ReubenBond merged 2 commits into
dotnet:mainfrom
ReubenBond:rb-add-basic-clustering-sample

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 16, 2026

Copy link
Copy Markdown
Member

Problem

The repository did not have a focused sample showing newcomers how more than one Orleans silo forms a cluster. The original MembershipTableGrain approach requested by #4547 is obsolete, while existing multi-silo samples also demonstrate unrelated application features.

Solution

Add a self-contained Basic Clustering sample which uses Aspire to start two silo replicas and Redis for membership and gateway discovery. The sample reports membership changes, makes the same grain call from both silos, includes safe local-versus-production guidance, and is registered in the sample gallery.

Rationale

This keeps the learning path small while demonstrating the current external membership-provider model and automatic per-replica endpoint configuration. The README also identifies UseLocalhostClustering and UseDevelopmentClustering as development-only in-memory alternatives instead of presenting them as production configuration.

Fixes #4547

Microsoft Reviewers: Open in CodeFlow

Add an Aspire-orchestrated two-silo cluster backed by Redis membership, with observable membership changes and grain routing.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings August 16, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Basic Clustering sample under samples/ to demonstrate how multiple Orleans silo processes form a cluster, using Aspire for orchestration and Redis for membership/gateway discovery. This fits the repository’s samples gallery as a focused, minimal multi-silo onboarding step.

Changes:

  • Added a new samples/BasicClustering sample (AppHost + Silo) showing a 2-replica Orleans cluster using Redis membership via Aspire.
  • Registered the sample in the gallery manifest and regenerated the samples index README entry.
  • Included the new sample projects in samples/Samples.slnx for validation/build.
Show a summary per file
File Description
samples/Samples.slnx Adds the BasicClustering projects to the samples solution.
samples/README.md Updates the generated sample index to include Basic Clustering.
samples/gallery.json Registers the Basic Clustering sample in the gallery manifest.
samples/BasicClustering/README.md Documents what the sample demonstrates and how to run it via Aspire.
samples/BasicClustering/Directory.Packages.props Declares centrally-managed package versions for the sample.
samples/BasicClustering/BasicClustering.slnx Adds a sample-local solution including AppHost and Silo projects.
samples/BasicClustering/BasicClustering.Silo/Program.cs Configures the silo host to use Aspire-provided Redis and Orleans hosting.
samples/BasicClustering/BasicClustering.Silo/IHelloGrain.cs Introduces a minimal grain contract used by the sample.
samples/BasicClustering/BasicClustering.Silo/HelloGrain.cs Implements the hello grain returning runtime identity info.
samples/BasicClustering/BasicClustering.Silo/ClusterMonitor.cs Adds a background service which logs membership and performs a cross-silo grain call.
samples/BasicClustering/BasicClustering.Silo/BasicClustering.Silo.csproj Defines the silo project and required package references.
samples/BasicClustering/BasicClustering.AppHost/Properties/launchSettings.json Sets local Aspire dashboard/host launch configuration.
samples/BasicClustering/BasicClustering.AppHost/Program.cs Defines the Aspire app host, Redis resource, and 2-replica silo project.
samples/BasicClustering/BasicClustering.AppHost/BasicClustering.AppHost.csproj Defines the AppHost project using Aspire.AppHost.Sdk and references the silo project.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 14/14 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread samples/BasicClustering/BasicClustering.AppHost/Program.cs Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 16, 2026 14:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 14/14 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@ReubenBond
ReubenBond merged commit 1059732 into dotnet:main Aug 17, 2026
134 of 137 checks passed
@ReubenBond
ReubenBond deleted the rb-add-basic-clustering-sample branch August 17, 2026 18:50
This was referenced Aug 28, 2026
This was referenced Sep 7, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Basic Clustering Sample

2 participants