Problem statement - what is the nature of the issue we’re going to try to solve with this specification?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ----------------------------------------------------------------------- | |
// <copyright file="GenericChildPerEntityParent.cs" company="Akka.NET Project"> | |
// Copyright (C) 2015-2023 .NET Petabridge, LLC | |
// </copyright> | |
// ----------------------------------------------------------------------- | |
using Akka.Actor; | |
using Akka.Cluster.Sharding; | |
namespace Sdkbin.NuGet.Actors.Utility; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: grafana-loadbalancer | |
namespace: observability | |
spec: | |
type: LoadBalancer | |
selector: | |
app.kubernetes.io/name: grafana | |
ports: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# create the docker data drive | |
mkdir /mnt/docker-base | |
# allow the root service account, which docker runs as, to own this directory and have write permissions | |
chown -R root:root /mnt/docker-base | |
chmod 701 /mnt/docker-base | |
# create a `daemon.json` file for the docker runtime |
Install .NET via the following script:
I advise to first do a dry run and to enable verbose mode to review if envvar DOTNET_INSTALL_DIR
is set correctly:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async Task Main() | |
{ | |
var actorSystem = ActorSystem.Create("Sys"); | |
var persistentActor = actorSystem.ActorOf<ExamplePersistentActor>("exampleActor"); | |
var watch = persistentActor.WatchAsync(); | |
// Sending multiple "save" commands to create snapshots | |
persistentActor.Tell("save-1"); | |
await Task.Delay(TimeSpan.FromSeconds(1)); // spacing out snapshots, time-wise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
jaeger: | |
image: jaegertracing/all-in-one:1.55 | |
hostname: jaeger | |
restart: always | |
ports: | |
- '16686:16686' | |
- '5775:5775/udp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Command<ProjectionStarting>(_ => | |
{ | |
// TODO: seeing multiple of these being logged, which makes me think there's a problem with our Akka.Streams graph | |
_log.Info("Projection for Tag [{0}] is starting from Offset [{1}] - instance [{2}] rand [{3}]", NuGetPersistenceTags.NuGetProductTag, | |
CurrentState.LastOffset.AsLong(), Self.Path.Uid, Random.Shared.Next()); | |
Sender.Tell(ProjectionAck.Instance); | |
}); | |
Command<ProjectionCompleted>(_ => | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// requires the `Akka` NuGet package to be installed in the query | |
int entitiesPerNodeFactor = 100; | |
List<string> nodes = Enumerable.Range(0, 10).Select(c => $"hostname-{c}").ToList(); | |
Dictionary<string, int> entityToNodeAllocations = nodes.ToDictionary(c => c, k => 0); | |
var entityIds = Enumerable.Range(0, nodes.Count * entitiesPerNodeFactor).Select(e => $"entity-{e}"); | |
foreach(var e in entityIds){ | |
var hashCode = MurmurHash.StringHash(e); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async Task Main() | |
{ | |
var actorSystem = ActorSystem.Create("Sys"); | |
var producerSettings = ProducerController.Settings.Create(actorSystem); | |
using var cts = new CancellationTokenSource(); | |
var (queue, producerController) = StreamConstruction.CreateProducerStream<IMessageProtocol>(actorSystem, producerSettings, "myproducer", cts.Token); | |
var myConsumer = actorSystem.ActorOf(Props.Create(() => new ConsumerActor(producerController)), "consumer"); | |
NewerOlder