petabridge / akkadotnet-bootstrap Goto Github PK
View Code? Open in Web Editor NEWAkka.Remote and Akka.Cluster Bootstrapping Tools for Akka.NET
License: Apache License 2.0
Akka.Remote and Akka.Cluster Bootstrapping Tools for Akka.NET
License: Apache License 2.0
The cluster IP is not being set correctly. Having looked at both the .cs and DockerFile get-dockerip.sh is never actually executed.
I followed all steps given in readme file of akkadotnet-bootstrap but I am getting an error
Step 1/16 : FROM microsoft/dotnet:2.0-sdk AS build-env
---> 331b8f314522
Step 2/16 : WORKDIR /app
---> Using cache
---> 49f0b8ee57a5
Step 3/16 : ENV CLUSTER_SEEDS "[]"
---> Using cache
---> b647d400006b
Step 4/16 : ENV CLUSTER_IP ""
---> Using cache
---> d30a5852fe16
Step 5/16 : ENV CLUSTER_PORT "5011"
---> Using cache
---> 068d47bdb21d
Step 6/16 : COPY . ./
---> Using cache
---> 98ed09828702
Step 7/16 : RUN dotnet restore
---> Running in dca31f8ea870
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(928,5): warning MSB3202: The project file "C:\AlertProcessorPortal\AlertProcessorPortal.csproj" was not found. [C:\app\MessageGateway.csproj]
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(928,5): warning MSB3202: The project file "C:\DeviceManagerPortal\DeviceManagerPortal.csproj" was not found. [C:\app\MessageGateway.csproj]
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(928,5): warning MSB3202: The project file "C:\ReportPortal\ReportProcessorPortal.csproj" was not found. [C:\app\MessageGateway.csproj]
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(1019,5): warning MSB3202: The project file "C:\AlertProcessorPortal\AlertProcessorPortal.csproj" was not found. [C:\app\MessageGateway.csproj]
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(1019,5): warning MSB3202: The project file "C:\DeviceManagerPortal\DeviceManagerPortal.csproj" was not found. [C:\app\MessageGateway.csproj]
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(1019,5): warning MSB3202: The project file "C:\ReportPortal\ReportProcessorPortal.csproj" was not found. [C:\app\MessageGateway.csproj]
Restoring packages for C:\app\MessageGateway.csproj...
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(114,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [C:\app\MessageGateway.csproj]
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(114,5): error : An error occurred while sending the request. [C:\app\MessageGateway.csproj]
C:\Program Files\dotnet\sdk\2.1.202\NuGet.targets(114,5): error : The server name or address could not be resolved [C:\app\MessageGateway.csproj]
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; dotnet restore' returned a non-zero code: 1
It fails on step-7. Do you have any solution to this problem?
Affects version 0.5.1 and previous
Cluster formation will be broken, randomly as a result of environment variable randomization, if we quote CLUSTER_SEEDS
:
apiVersion: v1
kind: Namespace
metadata:
name: lighthouse-sbr2
---
apiVersion: v1
kind: Service
metadata:
name: lighthouse
namespace: lighthouse-sbr2
labels:
app: lighthouse
spec:
clusterIP: None
ports:
- port: 4053
selector:
app: lighthouse
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: lighthouse-sbr2
name: lighthouse
labels:
app: lighthouse
spec:
serviceName: lighthouse
replicas: 2
selector:
matchLabels:
app: lighthouse
template:
metadata:
labels:
app: lighthouse
spec:
terminationGracePeriodSeconds: 35
containers:
- name: lighthouse
image: arkatufus/lighthouse:1.5.2
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "pbm 127.0.0.1:9110 cluster leave"]
env:
- name: ACTORSYSTEM
value: AkkaTrader
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CLUSTER_IP
value: "$(POD_NAME).lighthouse"
- name: CLUSTER_SEEDS
value: "akka.tcp://$(ACTORSYSTEM)@lighthouse-0.lighthouse:4053,akka.tcp://$(ACTORSYSTEM)@lighthouse-1.lighthouse:4053,akka.tcp://$(ACTORSYSTEM)@lighthouse-2.lighthouse:4053"
- name: AKKA__CLUSTER__DOWNING_PROVIDER_CLASS
value: "Akka.Cluster.SBR.SplitBrainResolverProvider, Akka.Cluster"
- name: AKKA__CLUSTER__SPLIT_BRAIN_RESOLVER__ACTIVE_STRATEGY
value: "keep-majority"
livenessProbe:
tcpSocket:
port: 4053
ports:
- containerPort: 4053
protocol: TCP
If I unquote CLUSTER_SEEDS
then cluster formation works fine:
apiVersion: v1
kind: Namespace
metadata:
name: lighthouse-sbr2
---
apiVersion: v1
kind: Service
metadata:
name: lighthouse
namespace: lighthouse-sbr2
labels:
app: lighthouse
spec:
clusterIP: None
ports:
- port: 4053
selector:
app: lighthouse
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: lighthouse-sbr2
name: lighthouse
labels:
app: lighthouse
spec:
serviceName: lighthouse
replicas: 2
selector:
matchLabels:
app: lighthouse
template:
metadata:
labels:
app: lighthouse
spec:
terminationGracePeriodSeconds: 35
containers:
- name: lighthouse
image: arkatufus/lighthouse:1.5.2
lifecycle:
preStop:
exec:
command: ["/bin/sh", "-c", "pbm 127.0.0.1:9110 cluster leave"]
env:
- name: ACTORSYSTEM
value: AkkaTrader
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: CLUSTER_IP
value: "$(POD_NAME).lighthouse"
- name: CLUSTER_SEEDS
value: akka.tcp://$(ACTORSYSTEM)@lighthouse-0.lighthouse:4053,akka.tcp://$(ACTORSYSTEM)@lighthouse-1.lighthouse:4053,akka.tcp://$(ACTORSYSTEM)@lighthouse-2.lighthouse:4053
- name: AKKA__CLUSTER__DOWNING_PROVIDER_CLASS
value: "Akka.Cluster.SBR.SplitBrainResolverProvider, Akka.Cluster"
- name: AKKA__CLUSTER__SPLIT_BRAIN_RESOLVER__ACTIVE_STRATEGY
value: "keep-majority"
livenessProbe:
tcpSocket:
port: 4053
ports:
- containerPort: 4053
protocol: TCP
If we're not running in PCF, the environment variables we need will not be populated. We should signal that via bool on PcfEnvironment
to avoid blow-ups when people want to run their app locally even though it's destined for PCF.
Is this production ready or is just for testing. Your approach doesn't actually need to perform a DNS resolution on startup. Ans special reason why?
It currently prints out the System.List type:
[Docker-Bootstrap] SEEDS=System.Collections.Generic.List
1[System.String]`
Should probably be something like SEEDS=["akka:tcp//host:5055", "akka:tcp//host:5055"]
#60 - need to add these changes to the README file.
cc @nagytech
In order to properly bootstrap a Docker container / PCF cell / etc, we really need to add support for the bind-port option to Akka.Net, which is in progress here: akkadotnet/akka.net#3358
akkadotnet-bootstrap/src/Akka.Bootstrap.Docker/DockerBootstrap.cs
Lines 59 to 63 in 4f70ba0
ILogger
here or maybe use a callback that will allow the user to override how this is logged.k8s support for contact-point-discovery would be great.
Scaling out would be much easier.
Thanks and best regards
Thomas
See https://github.com/Aaronontheweb/Akka.Cluster.SBRDemo for full reproduction and demo
When calling BootstrapFromDocker setting the assignDefaultHostName
parameter has no effect, the code always sets the hostname using Dns.GetHostName()
The text in the guidance for using Akka.NET in docker is not great. It has broken links, unfinished sentences and an example that is not very good.
Unfinished sentence: The Dockerfile and get-dockerip.sh
In the latter part you say:
That will create a new docker image you can use. Suppose we called our image foo.
Once our image is created, we can start it via docker run:
PS> docker run -p 5044:5011 -e CLUSTER_SEEDS='akka.tcp://[email protected]:4053' --name dread1 dread.collector
Why do you mention that the name is foo if you do not use it in the docker run command?
Instead, please provide an end-to-end example where you create a running simple demo app, possibly with a command line app that talks to an actor in the container.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.