Skip to content

Commit

Permalink
Merge pull request #311 from petabridge/dev
Browse files Browse the repository at this point in the history
1.7.2 Release
  • Loading branch information
Aaronontheweb authored Dec 20, 2022
2 parents aefd4a6 + 51d6bfa commit 5160174
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 18 deletions.
8 changes: 4 additions & 4 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#### 1.7.1 October 24 2022 ####
#### 1.7.2 December 20 2022 ####

* [Bumped Akka.NET version to 1.4.45](https://github.com/akkadotnet/akka.net/releases/tag/1.4.45)
* [Bumped Akka.Hosting to 0.5.1](https://github.com/akkadotnet/Akka.Hosting/releases/tag/0.5.1).
* [Upgraded to Petabridge.Cmd 1.1.3](https://cmd.petabridge.com/articles/RELEASE_NOTES.html) and used Akka.Hosting support;
* [Bumped Akka.NET version to 1.4.47](https://github.com/akkadotnet/akka.net/releases/tag/1.4.47)
* [Added Serilog logging, configurable by `/app/serilog.json`](https://github.com/petabridge/lighthouse/pull/304)
* [Upgraded to Petabridge.Cmd 1.2.1](https://cmd.petabridge.com/articles/RELEASE_NOTES.html) and used Akka.Hosting support.
6 changes: 5 additions & 1 deletion src/Lighthouse/Lighthouse.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Akka.Cluster.Hosting" Version="0.5.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="6.0.0" />
<PackageReference Include="Akka.Logger.Serilog" Version="1.4.42" />
<PackageReference Include="Microsoft.Extensions.Configuration.Xml" Version="7.0.0" />
<PackageReference Include="Petabridge.Cmd.Cluster" Version="$(PbmVersion)" />
<PackageReference Include="Petabridge.Cmd.Remote" Version="$(PbmVersion)" />
<PackageReference Include="Akka.Bootstrap.Docker">
<Version>0.5.3</Version>
</PackageReference>
<PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions src/Lighthouse/LighthouseConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Akka.Actor;
using Akka.Bootstrap.Docker;
using Akka.Configuration;
using Serilog;
using static System.String;

namespace Lighthouse
Expand Down Expand Up @@ -58,10 +59,10 @@ public static (Config config, string actorSystemName) LaunchLighthouse(string ip
/*
* Sanity check
*/
Console.WriteLine($"[Lighthouse] ActorSystem: {systemName}; IP: {ipAddress}; PORT: {port}");
Console.WriteLine("[Lighthouse] Performing pre-boot sanity check. Should be able to parse address [{0}]",
Log.Logger.Information($"[Lighthouse] ActorSystem: {systemName}; IP: {ipAddress}; PORT: {port}");
Log.Logger.Information("[Lighthouse] Performing pre-boot sanity check. Should be able to parse address [{0}]",
selfAddress);
Console.WriteLine("[Lighthouse] Parse successful.");
Log.Logger.Information("[Lighthouse] Parse successful.");


var seeds = clusterConfig.GetStringList("akka.cluster.seed-nodes").ToList();
Expand Down
35 changes: 35 additions & 0 deletions src/Lighthouse/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@
// -----------------------------------------------------------------------

using System;
using System.IO;
using System.Threading.Tasks;
using Akka.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Petabridge.Cmd.Cluster;
using Petabridge.Cmd.Host;
using Petabridge.Cmd.Remote;
using Serilog;

namespace Lighthouse
{
public class Program
{
public static async Task Main(string[] args)
{
InitializeLogger(args);
var (config, actorSystemName) = LighthouseConfigurator.LaunchLighthouse();
var hostBuilder = new HostBuilder();
hostBuilder.ConfigureServices(services =>
Expand All @@ -36,5 +40,36 @@ public static async Task Main(string[] args)
var host = hostBuilder.Build();
await host.RunAsync();
}

private static void InitializeLogger(string[] args)
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Debug()
.WriteTo.Console()
.CreateLogger();

Log.Logger.Information("Initializing logging from (serilog.json) configuration");
try
{

var configuration = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("serilog.json")
.AddJsonFile($"serilog.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", true)
.AddEnvironmentVariables()
.AddCommandLine(args)
.Build();

var configuredLogger = new LoggerConfiguration()
.ReadFrom.Configuration(configuration)
.CreateLogger();

Log.Logger = configuredLogger;
}
catch(Exception ex)
{
Log.Logger.Information("Log configuration failed ({Message}), continuing with default logger", ex.Message);
}
}
}
}
6 changes: 4 additions & 2 deletions src/Lighthouse/akka.hocon
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
lighthouse{
lighthouse {
actorsystem: "actor-system" #POPULATE NAME OF YOUR ACTOR SYSTEM HERE
}

# See petabridge.cmd configuration options here: https://cmd.petabridge.com/articles/install/host-configuration.html
petabridge.cmd{
petabridge.cmd {
# default IP address used to listen for incoming petabridge.cmd client connections
# should be a safe default as it listens on "all network interfaces".
host = "0.0.0.0"
Expand All @@ -13,6 +13,8 @@ petabridge.cmd{
}

akka {
loglevel = DEBUG
loggers = ["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]
actor {
provider = cluster

Expand Down
16 changes: 8 additions & 8 deletions src/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<Copyright>Copyright © 2015-2022 Petabridge, LLC</Copyright>
<Authors>Petabridge</Authors>
<VersionPrefix>1.7.0</VersionPrefix>
<PackageReleaseNotes>[Bumped Akka.NET version to 1.4.40](https://github.com/akkadotnet/akka.net/releases/tag/1.4.40)
[Bumped Akka.Hosting to 0.4.1](https://github.com/akkadotnet/Akka.Hosting/releases/tag/0.4.1).
[Upgraded to Petabridge.Cmd 1.1.0](https://cmd.petabridge.com/articles/RELEASE_NOTES.html) and used Akka.Hosting support;
Added ARM64 support to Docker image `petabridge/lighthouse:latest` and all other Linux images for Lighthouse.
<PackageReleaseNotes>[Bumped Akka.NET version to 1.4.40](https://github.com/akkadotnet/akka.net/releases/tag/1.4.40)
[Bumped Akka.Hosting to 0.4.1](https://github.com/akkadotnet/Akka.Hosting/releases/tag/0.4.1).
[Upgraded to Petabridge.Cmd 1.1.0](https://cmd.petabridge.com/articles/RELEASE_NOTES.html) and used Akka.Hosting support;
Added ARM64 support to Docker image `petabridge/lighthouse:latest` and all other Linux images for Lighthouse.
Migrated onto .NET 6.</PackageReleaseNotes>
<PackageIconUrl>https://petabridge.com/images/logo.png</PackageIconUrl>
<PackageProjectUrl>
Expand All @@ -19,13 +19,13 @@ Migrated onto .NET 6.</PackageReleaseNotes>
</PropertyGroup>
<PropertyGroup>
<XunitVersion>2.4.2</XunitVersion>
<MicrosoftSdkVersion>17.3.2</MicrosoftSdkVersion>
<MicrosoftSdkVersion>17.4.1</MicrosoftSdkVersion>
<FluentAssertionsVersion>6.8.0</FluentAssertionsVersion>
<NetCoreVersion>net6.0</NetCoreVersion>
<NetStandardVersion>netstandard1.6</NetStandardVersion>
<NetFrameworkLibVersion>net461</NetFrameworkLibVersion>
<NetFrameworkTestVersion>net6.0</NetFrameworkTestVersion>
<AkkaVersion>1.4.45</AkkaVersion>
<PbmVersion>1.1.3</PbmVersion>
<AkkaVersion>1.4.47</AkkaVersion>
<PbmVersion>1.2.1</PbmVersion>
</PropertyGroup>
</Project>
</Project>

0 comments on commit 5160174

Please sign in to comment.