Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Torre committed Aug 14, 2023
2 parents 706fca2 + c706259 commit 7b3871b
Show file tree
Hide file tree
Showing 35 changed files with 703 additions and 464 deletions.
8 changes: 4 additions & 4 deletions Build-COSFPkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ function Build-SFPkg {
try {
Push-Location $scriptPath

Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Linux.SelfContained.2.2.4" "$scriptPath\bin\release\ClusterObserver\linux-x64\self-contained\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Linux.FrameworkDependent.2.2.4" "$scriptPath\bin\release\ClusterObserver\linux-x64\framework-dependent\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Linux.SelfContained.2.2.5" "$scriptPath\bin\release\ClusterObserver\linux-x64\self-contained\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Linux.FrameworkDependent.2.2.5" "$scriptPath\bin\release\ClusterObserver\linux-x64\framework-dependent\ClusterObserverType"

Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Windows.SelfContained.2.2.4" "$scriptPath\bin\release\ClusterObserver\win-x64\self-contained\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Windows.FrameworkDependent.2.2.4" "$scriptPath\bin\release\ClusterObserver\win-x64\framework-dependent\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Windows.SelfContained.2.2.5" "$scriptPath\bin\release\ClusterObserver\win-x64\self-contained\ClusterObserverType"
Build-SFPkg "Microsoft.ServiceFabricApps.ClusterObserver.Windows.FrameworkDependent.2.2.5" "$scriptPath\bin\release\ClusterObserver\win-x64\framework-dependent\ClusterObserverType"
}
finally {
Pop-Location
Expand Down
42 changes: 42 additions & 0 deletions Build-FabricObserverDebug.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
$ErrorActionPreference = "Stop"

$Configuration="Debug"
[string] $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition

try
{
Push-Location $scriptPath

Remove-Item $scriptPath\bin\debug\FabricObserver\ -Recurse -Force -EA SilentlyContinue

dotnet publish FabricObserver\FabricObserver.csproj -o bin\debug\FabricObserver\linux-x64\self-contained\FabricObserverType\FabricObserverPkg\Code -c $Configuration -r linux-x64 --self-contained true
dotnet publish FabricObserver\FabricObserver.csproj -o bin\debug\FabricObserver\linux-x64\framework-dependent\FabricObserverType\FabricObserverPkg\Code -c $Configuration -r linux-x64 --self-contained false
dotnet publish FabricObserver\FabricObserver.csproj -o bin\debug\FabricObserver\win-x64\self-contained\FabricObserverType\FabricObserverPkg\Code -c $Configuration -r win-x64 --self-contained true
dotnet publish FabricObserver\FabricObserver.csproj -o bin\debug\FabricObserver\win-x64\framework-dependent\FabricObserverType\FabricObserverPkg\Code -c $Configuration -r win-x64 --self-contained false

Copy-Item FabricObserver\PackageRoot\* bin\debug\FabricObserver\linux-x64\self-contained\FabricObserverType\FabricObserverPkg\ -Recurse
Copy-Item FabricObserver\PackageRoot\* bin\debug\FabricObserver\linux-x64\framework-dependent\FabricObserverType\FabricObserverPkg\ -Recurse

Copy-Item FabricObserver\PackageRoot\* bin\debug\FabricObserver\win-x64\self-contained\FabricObserverType\FabricObserverPkg\ -Recurse
Copy-Item FabricObserver\PackageRoot\* bin\debug\FabricObserver\win-x64\framework-dependent\FabricObserverType\FabricObserverPkg\ -Recurse

# ApplicationManifest - All
Copy-Item FabricObserverApp\ApplicationPackageRoot\ApplicationManifest.xml bin\debug\FabricObserver\linux-x64\self-contained\FabricObserverType\ApplicationManifest.xml
Copy-Item FabricObserverApp\ApplicationPackageRoot\ApplicationManifest.xml bin\debug\FabricObserver\linux-x64\framework-dependent\FabricObserverType\ApplicationManifest.xml
Copy-Item FabricObserverApp\ApplicationPackageRoot\ApplicationManifest.xml bin\debug\FabricObserver\win-x64\self-contained\FabricObserverType\ApplicationManifest.xml
Copy-Item FabricObserverApp\ApplicationPackageRoot\ApplicationManifest.xml bin\debug\FabricObserver\win-x64\framework-dependent\FabricObserverType\ApplicationManifest.xml

# ServiceManifest - Linux
Copy-Item FabricObserver\PackageRoot\ServiceManifest_linux.xml bin\debug\FabricObserver\linux-x64\framework-dependent\FabricObserverType\FabricObserverPkg\ServiceManifest.xml -Force -Confirm:$False
Copy-Item FabricObserver\PackageRoot\ServiceManifest_linux.xml bin\debug\FabricObserver\linux-x64\self-contained\FabricObserverType\FabricObserverPkg\ServiceManifest.xml -Force -Confirm:$False

# Get rid of ServiceManifest_linux.xml from build output.
Remove-Item bin\debug\FabricObserver\linux-x64\framework-dependent\FabricObserverType\FabricObserverPkg\ServiceManifest_linux.xml -Force -Confirm:$False
Remove-Item bin\debug\FabricObserver\win-x64\framework-dependent\FabricObserverType\FabricObserverPkg\ServiceManifest_linux.xml -Force -Confirm:$False
Remove-Item bin\debug\FabricObserver\linux-x64\self-contained\FabricObserverType\FabricObserverPkg\ServiceManifest_linux.xml -Force -Confirm:$False
Remove-Item bin\debug\FabricObserver\win-x64\self-contained\FabricObserverType\FabricObserverPkg\ServiceManifest_linux.xml -Force -Confirm:$False
}
finally
{
Pop-Location
}
2 changes: 1 addition & 1 deletion ClusterObserver.nuspec.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3.0">
<id>%PACKAGE_ID%</id>
<version>2.2.4</version>
<version>2.2.5</version>
<releaseNotes>
- Performance and Code improvements.
</releaseNotes>
Expand Down
72 changes: 37 additions & 35 deletions ClusterObserver/ClusterObserver.csproj
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>ClusterObserver</RootNamespace>
<AssemblyName>ClusterObserver</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>disable</Nullable>
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
<TargetLatestRuntimePatch>True</TargetLatestRuntimePatch>
<Copyright>Copyright © 2023</Copyright>
<Product>ClusterObserver</Product>
<Version>2.2.4</Version>
<FileVersion>2.2.4</FileVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Platforms>x64</Platforms>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Utilities\ClusterIdentificationUtility.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="ApplicationInsights.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="6.0.1017" />
<PackageReference Include="McMaster.NETCore.Plugins" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FabricObserver.Extensibility\FabricObserver.Extensibility.csproj" />
<ProjectReference Include="..\TelemetryLib\TelemetryLib.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="PackageRoot\Data\Plugins\" />
</ItemGroup>
</Project>
<PropertyGroup>
<ProjectGuid>{5E990052-7B55-4AF1-BCD9-48DE6EA0E547}</ProjectGuid>
<RootNamespace>ClusterObserver</RootNamespace>
<AssemblyName>ClusterObserver</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<Nullable>disable</Nullable>
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
<RuntimeIdentifiers>win-x64;linux-x64</RuntimeIdentifiers>
<TargetLatestRuntimePatch>True</TargetLatestRuntimePatch>
<Copyright>Copyright © 2022</Copyright>
<Product>ClusterObserver</Product>
<Version>2.2.5</Version>
<FileVersion>2.2.5</FileVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<StartupObject>ClusterObserver.Program</StartupObject>
<Platforms>x64</Platforms>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Utilities\ClusterIdentificationUtility.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="ApplicationInsights.config" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="6.0.1017" />
<PackageReference Include="McMaster.NETCore.Plugins" Version="1.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FabricObserver.Extensibility\FabricObserver.Extensibility.csproj" />
<ProjectReference Include="..\TelemetryLib\TelemetryLib.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="PackageRoot\Data\Plugins\" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion ClusterObserver/ClusterObserverManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public sealed class ClusterObserverManager : IDisposable
private bool appParamsUpdating;

// Folks often use their own version numbers. This is for internal diagnostic telemetry.
private const string InternalVersionNumber = "2.2.4";
private const string InternalVersionNumber = "2.2.5";

public bool EnableOperationalTelemetry
{
Expand Down
8 changes: 4 additions & 4 deletions ClusterObserver/PackageRoot/ServiceManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="ClusterObserverPkg"
Version="2.2.4"
Version="2.2.5"
xmlns="http://schemas.microsoft.com/2011/01/fabric"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
Expand All @@ -11,7 +11,7 @@
</ServiceTypes>

<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="2.2.4">
<CodePackage Name="Code" Version="2.2.5">
<EntryPoint>
<ExeHost>
<Program>ClusterObserver</Program>
Expand All @@ -21,11 +21,11 @@

<!-- Config package is the contents of the Config directory under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<ConfigPackage Name="Config" Version="2.2.4" />
<ConfigPackage Name="Config" Version="2.2.5" />

<!-- Config package is the contents of the Config directory under PackageRoot that contains an
independently-updateable and versioned set of custom configuration settings for your service. -->
<DataPackage Name="Data" Version="2.2.4" />
<DataPackage Name="Data" Version="2.2.5" />

<Resources>
<Endpoints>
Expand Down
37 changes: 29 additions & 8 deletions ClusterObserver/Readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### ClusterObserver 2.2.4
### ClusterObserver 2.2.5
#### This version - and all subsequent versions - requires SF Runtime >= 9.0 and targets .NET 6

ClusterObserver (CO) is a stateless singleton Service Fabric .NET 6 service that runs on one node in a cluster. CO observes cluster health (aggregated)
Expand All @@ -13,7 +13,7 @@ you want by implementing the IObserverTelemetryProvider interface. As stated, th

The core idea is that you use the aggregated cluster error/warning/Ok health state information from ClusterObserver to fire alerts and/or trigger some other action that gets your attention and/or some SF on-call's enagement via auto-creating a support incident (and an Ok signal would mean auto-mitigate the related incident/ticket).

```As of version 2.2.0.831/960, ClusterObserver supports the FabricObserver extensibility model. This means you can extend the behavior of ClusterObserver by writing your own observer plugins just as you can do with FabricObserver.```
```As of version 2.2.0, ClusterObserver supports the FabricObserver extensibility model. This means you can extend the behavior of ClusterObserver by writing your own observer plugins just as you can do with FabricObserver.```

[FabricObserver plugin documentation](https://github.com/microsoft/service-fabric-observer/blob/main/Documentation/Plugins.md) applies to ClusterObserver as well. The difference, of course, is that you will copy your plugin dll and its dependencies into ClusterObserver\PackageRoot\Data folder.

Expand All @@ -25,16 +25,37 @@ Application Parameter Upgrade Example:

* Connect to your Service Fabric cluster using Connect-ServiceFabricCluster command.

* Create a variable that contains all the settings you want update:
* Run the script below, which will preserve existing application parameters that were previously modified in an earlier parameter update.

```Powershell
$appParams = @{ "RunInterval" = "00:10:00"; "MaxTimeNodeStatusNotOk" = "04:00:00"; }
$appName = "fabric:/ClusterObserver"
$appVersion = "2.2.5"
$application = Get-ServiceFabricApplication -ApplicationName $appName
# Get current app parameter settings.
$appParamCollection = $application.ApplicationParameters
# Create a new map that will hold both the current set of parameters and your modified ones.
$applicationParameterMap = @{}
# Fill the new map with current app parameter settings first.
foreach ($pair in $appParamCollection)
{
$applicationParameterMap.Add($pair.Name, $pair.Value);
}
# Update parameters in the new collection with new values. The below is just an example of changing the RunInterval for cluster monitoring and how long a node needs to be Disabled before generating a Warning.
$applicationParameterMap["RunInterval"] = "00:10:00"
$applicationParameterMap["MaxTimeNodeStatusNotOk"] = "04:00:00"
```

Then execute the application upgrade with
Then execute the version-less, parameter-only application upgrade with

```Powershell
Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/ClusterObserver -ApplicationTypeVersion 2.2.0.960 -ApplicationParameter $appParams -Monitored -FailureAction rollback
Start-ServiceFabricApplicationUpgrade -ApplicationName $appName -ApplicationTypeVersion $appVersion -ApplicationParameter $applicationParameterMap -Monitored -FailureAction rollback
```

### ClusterObserver Configuration
Expand Down Expand Up @@ -140,7 +161,7 @@ Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/ClusterObserver -

``` XML
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="ClusterObserverType" ApplicationTypeVersion="2.2.4" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="ClusterObserverType" ApplicationTypeVersion="2.2.5" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<!-- ClusterObserverManager settings. -->
<Parameter Name="ObserverManagerObserverLoopSleepTimeSeconds" DefaultValue="30" />
Expand Down Expand Up @@ -169,7 +190,7 @@ Start-ServiceFabricApplicationUpgrade -ApplicationName fabric:/ClusterObserver -
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="ClusterObserverPkg" ServiceManifestVersion="2.2.4" />
<ServiceManifestRef ServiceManifestName="ClusterObserverPkg" ServiceManifestVersion="2.2.5" />
<ConfigOverrides>
<ConfigOverride Name="Config">
<Settings>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="ClusterObserverType" ApplicationTypeVersion="2.2.4" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="ClusterObserverType" ApplicationTypeVersion="2.2.5" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<!-- ClusterObserverManager settings. -->
<Parameter Name="ObserverManagerObserverLoopSleepTimeSeconds" DefaultValue="30" />
Expand Down Expand Up @@ -28,7 +28,7 @@
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="ClusterObserverPkg" ServiceManifestVersion="2.2.4" />
<ServiceManifestRef ServiceManifestName="ClusterObserverPkg" ServiceManifestVersion="2.2.5" />
<ConfigOverrides>
<ConfigOverride Name="Config">
<Settings>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"applicationTypeVersionClusterObserver": {
"type": "string",
"defaultValue": "2.2.4",
"defaultValue": "2.2.5",
"metadata": {
"description": "Provide the app version number of ClusterObserver. This must be identical to the version specified in the corresponding sfpkg."
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"value": "<ClusterResourceName>"
},
"applicationTypeVersionClusterObserver": {
"value": "2.2.4"
"value": "2.2.5"
},
"packageUrlClusterObserver": {
"value": "<PUBLIC-ACCESSIBLE-URL-FOR-CLUSTEROBSERVER-SFPKG>"
Expand Down
Loading

0 comments on commit 7b3871b

Please sign in to comment.