This commit is contained in:
Charles Torre 2022-02-08 18:03:29 -08:00
Родитель 8d66177fa7
Коммит 91c682020b
11 изменённых файлов: 33 добавлений и 35 удалений

Просмотреть файл

@ -26,7 +26,7 @@ function Build-Nuget {
[System.IO.File]::WriteAllText($nugetSpecPath, $nugetSpecTemplate.Replace("%PACKAGE_ID%", $packageId).Replace("%ROOT_PATH%", $scriptPath))
.\nuget.exe pack $nugetSpecPath -basepath $basePath -OutputDirectory bin\release\FabricHealer\Nugets -properties NoWarn=NU5100
.\nuget.exe pack $nugetSpecPath -basepath $basePath -OutputDirectory bin\release\FabricHealer\Nugets -properties NoWarn=NU5100,NU5128
}
[string] $scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Definition

Просмотреть файл

@ -23,11 +23,11 @@ function Build-SFPkg {
try {
Push-Location $scriptPath
Build-SFPkg "Microsoft.ServiceFabricApps.FabricHealer.Linux.SelfContained.1.0.12" "$scriptPath\bin\release\FabricHealer\linux-x64\self-contained\FabricHealerType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricHealer.Linux.FrameworkDependent.1.0.12" "$scriptPath\bin\release\FabricHealer\linux-x64\framework-dependent\FabricHealerType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricHealer.Linux.SelfContained.1.0.13" "$scriptPath\bin\release\FabricHealer\linux-x64\self-contained\FabricHealerType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricHealer.Linux.FrameworkDependent.1.0.13" "$scriptPath\bin\release\FabricHealer\linux-x64\framework-dependent\FabricHealerType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricHealer.Windows.SelfContained.1.0.12" "$scriptPath\bin\release\FabricHealer\win-x64\self-contained\FabricHealerType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricHealer.Windows.FrameworkDependent.1.0.12" "$scriptPath\bin\release\FabricHealer\win-x64\framework-dependent\FabricHealerType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricHealer.Windows.SelfContained.1.0.13" "$scriptPath\bin\release\FabricHealer\win-x64\self-contained\FabricHealerType"
Build-SFPkg "Microsoft.ServiceFabricApps.FabricHealer.Windows.FrameworkDependent.1.0.13" "$scriptPath\bin\release\FabricHealer\win-x64\framework-dependent\FabricHealerType"
}
finally {
Pop-Location

Просмотреть файл

@ -2,10 +2,11 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata minClientVersion="3.3.0">
<id>%PACKAGE_ID%</id>
<version>1.0.12</version>
<version>1.0.13</version>
<releaseNotes>
- Bug fix in Disk Repair feature.
- Added new named argument to DeleteFiles external predicate: SearchPattern, for use in searching specified folders for files with names matching specified pattern.
- Fixed bugs due to Guan 1.0.4 breaking changes. *This version requires Guan 1.0.4*.
- Updated Disk Repair feature.
- Updated logic rules.
</releaseNotes>
<authors>Microsoft</authors>
<license type="expression">MIT</license>
@ -18,9 +19,9 @@
<contentFiles>
<files include="**" buildAction="None" copyToOutput="true" />
</contentFiles>
<dependencies>
<group targetFramework=".NETStandard2.0" />
</dependencies>
<dependencies>
<dependency id="Microsoft.Logic.Guan" version="[1.0.4]" />
</dependencies>
<projectUrl>https://github.com/microsoft/service-fabric-healer</projectUrl>
<tags>azure servicefabric fabrichealer fabricobserver auto-mitigation logic-programming guan</tags>
<copyright>© Microsoft Corporation. All rights reserved.</copyright>

Просмотреть файл

@ -1,6 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ProjectGuid>{9A19103F-16F7-4668-BE54-9A1E7A4F7556}</ProjectGuid>
<RootNamespace>FabricHealer</RootNamespace>
<AssemblyName>FabricHealer</AssemblyName>
<TargetFramework>netcoreapp3.1</TargetFramework>
<PlatformTarget>x64</PlatformTarget>
<OutputType>Exe</OutputType>
@ -9,10 +11,9 @@
For Windows, use win-x64. For Linux, use linux-x64:
<RuntimeIdentifier>win-x64</RuntimeIdentifier>-->
<RuntimeIdentifiers>linux-x64;win-x64</RuntimeIdentifiers>
<RootNamespace>FabricHealer</RootNamespace>
<AssemblyName>FabricHealer</AssemblyName>
<AssemblyVersion>1.0.12</AssemblyVersion>
<FileVersion>1.0.12</FileVersion>
<Product>FabricHealer</Product>
<Version>1.0.13</Version>
<FileVersion>1.0.13</FileVersion>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<IsServiceFabricServiceProject>true</IsServiceFabricServiceProject>
<StartupObject>FabricHealer.Program</StartupObject>
@ -24,7 +25,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.17.0" />
<PackageReference Include="Microsoft.Logic.Guan" Version="1.0.3" />
<PackageReference Include="Microsoft.Logic.Guan" Version="1.0.4" />
<PackageReference Include="Microsoft.ServiceFabric" Version="7.2.452" />
<PackageReference Include="Microsoft.ServiceFabric.Services" Version="4.2.452" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />

Просмотреть файл

@ -28,7 +28,7 @@ namespace FabricHealer
internal static RepairData RepairHistory;
// Folks often use their own version numbers. This is for internal diagnostic telemetry.
private const string InternalVersionNumber = "1.0.12";
private const string InternalVersionNumber = "1.0.13";
private static FabricHealerManager singleton;
private bool disposedValue;
private readonly StatelessServiceContext serviceContext;

Просмотреть файл

@ -56,12 +56,12 @@
## *Note*: you must wrap the date string in quotes to make it explicit to Guan that the arg is a string as it contains mathematical operators (in this case a /).
## The rule below reads: If any of the specified (set in Mitigate) app's service processes have put it into Warning due to CPU over-consumption and today's date is later than the supplied end date, emit a message, stop processing rules (!).
Mitigate(AppName="fabric:/CpuStress", MetricName="CpuPercent") :- time() > DateTime("11/30/2021"),
Mitigate(AppName="fabric:/CpuStress", MetricName="CpuPercent") :- time() > DateTime("03/30/2022"),
EmitMessage("Exceeded specified end date for repair of fabric:/MyApp CpuPercent usage violations. Target end date: {0}. Current date (Utc): {1}", DateTime("11/30/2021"), time()), !.
## Alternatively, you could enforce repair end dates inline (as a subgoal) to any rule, e.g.,
Mitigate(AppName="fabric:/PortEater42", MetricName="EphemeralPorts", MetricValue=?MetricValue) :- time() < DateTime("11/30/2021"),
Mitigate(AppName="fabric:/PortEater42", MetricName="EphemeralPorts", MetricValue=?MetricValue) :- time() < DateTime("03/30/2022"),
?MetricValue >= 8500,
TimeScopedRestartCodePackage(4, 01:00:00).
@ -77,7 +77,7 @@ Mitigate(AppName="fabric:/PortEater42", MetricName="EphemeralPorts", MetricValue
Mitigate(AppName="fabric:/CpuStress", MetricName="CpuPercent", MetricValue=?MetricValue) :- ?MetricValue >= 15,
GetHealthEventHistory(?HealthEventCount, 00:15:00),
?HealthEventCount >= 3,
TimeScopedRestartReplica(1, 00:15:00).
TimeScopedRestartCodePackage(1, 00:15:00).
## CPU - Percent In Use - Constrained on AppName = "fabric:/MyApp42", observed Metric value and health event count within specified time range.
Mitigate(AppName="fabric:/MyApp42", MetricName="CpuPercent", MetricValue=?MetricValue) :- ?MetricValue >= 80,

Просмотреть файл

@ -39,4 +39,4 @@ Mitigate(MetricName=?MetricName) :- match(?MetricName, "DiskSpace"), GetRepairHi
Mitigate(MetricName=?MetricName) :- match(?MetricName, "DiskSpace"), GetRepairHistory(?repairCount, 08:00:00),
?repairCount < 4,
CheckFolderSize("C:\SFDevCluster\Log\Traces", MaxFolderSizeGB=20),
DeleteFiles("C:\SFDevCluster\Log\Traces", SortOrder=Ascending, MaxFilesToDelete=10, RecurseSubdirectories=true, SearchPattern="lease_traces*").
DeleteFiles("C:\SFDevCluster\Log\Traces", SortOrder=Ascending, MaxFilesToDelete=10, RecurseSubdirectories=true, SearchPattern="SFBDMiniport_traces*").

Просмотреть файл

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="FabricHealerPkg"
Version="1.0.12"
Version="1.0.13"
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">
@ -11,7 +11,7 @@
</ServiceTypes>
<!-- Code package is your service executable. -->
<CodePackage Name="Code" Version="1.0.12">
<CodePackage Name="Code" Version="1.0.13">
<EntryPoint>
<ExeHost>
<Program>FabricHealer</Program>
@ -21,5 +21,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. -->
<ConfigPackage Name="Config" Version="1.0.12" />
<ConfigPackage Name="Config" Version="1.0.13" />
</ServiceManifest>

Просмотреть файл

@ -20,13 +20,11 @@ namespace Guan.Logic
public async Task<bool> RunQueryAsync(string queryExpression)
{
ResolveOrder order = ResolveOrder.None;
QueryContext queryContext = new QueryContext();
queryContext.SetDirection(null, order);
ModuleProvider moduleProvider = new ModuleProvider();
moduleProvider.Add(module_);
Query query = Query.Create(queryExpression, queryContext, moduleProvider);
QueryContext queryContext = new QueryContext(moduleProvider);
queryContext.SetDirection(null, order);
Query query = Query.Create(queryExpression, queryContext);
await query.GetNextAsync().ConfigureAwait(false);
return true;
}
@ -34,13 +32,11 @@ namespace Guan.Logic
public async Task<bool> RunQueryAsync(List<CompoundTerm> queryExpressions)
{
ResolveOrder order = ResolveOrder.None;
QueryContext queryContext = new QueryContext();
queryContext.SetDirection(null, order);
ModuleProvider moduleProvider = new ModuleProvider();
moduleProvider.Add(module_);
QueryContext queryContext = new QueryContext(moduleProvider);
queryContext.SetDirection(null, order);
Query query = Query.Create(queryExpressions, queryContext, moduleProvider);
await query.GetNextAsync().ConfigureAwait(false);
return true;
}

Просмотреть файл

@ -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="FabricHealerType" ApplicationTypeVersion="1.0.12" 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="FabricHealerType" ApplicationTypeVersion="1.0.13" xmlns="http://schemas.microsoft.com/2011/01/fabric">
<Parameters>
<Parameter Name="FabricHealer_InstanceCount" DefaultValue="-1" />
<!-- FabricHealerManager Settings -->
@ -25,7 +25,7 @@
should match the Name and Version attributes of the ServiceManifest element defined in the
ServiceManifest.xml file. -->
<ServiceManifestImport>
<ServiceManifestRef ServiceManifestName="FabricHealerPkg" ServiceManifestVersion="1.0.12" />
<ServiceManifestRef ServiceManifestName="FabricHealerPkg" ServiceManifestVersion="1.0.13" />
<ConfigOverrides>
<ConfigOverride Name="Config">
<Settings>

Двоичные данные
nuget.exe Normal file

Двоичный файл не отображается.