Move Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes to stable#7253
Move Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes to stable#7253amadeuszl wants to merge 5 commits intodotnet:mainfrom
Conversation
|
@evgenyfedorov2 We probably should drop reading requests in Linux due to change in formula for weights from #7239. internal sealed class KubernetesResourceQuotaProvider : ResourceQuotaProvider
{
public override ResourceQuota GetResourceQuota()
{
ResourceQuota quota = new()
{
BaselineCpuInCores = ConvertMillicoreToCpuUnit(_kubernetesMetadata.RequestsCpu),
MaxCpuInCores = ConvertMillicoreToCpuUnit(_kubernetesMetadata.LimitsCpu),
BaselineMemoryInBytes = _kubernetesMetadata.RequestsMemory,
MaxMemoryInBytes = _kubernetesMetadata.LimitsMemory,
};
// On Linux, CPU requests are determined with weights, where eg. 1 CPUs' weight is equal to 1.02539062
// If we decide to read from K8s metadata it will have different results.
if (OperatingSystem.IsLinux())
{
if (_useLinuxCalculationV2)
{
quota.BaselineCpuInCores = _parser.GetCgroupRequestCpuV2();
}
else
{
quota.BaselineCpuInCores = _parser.GetCgroupRequestCpu();
}
}
if (quota.BaselineCpuInCores <= 0.0)
{
quota.BaselineCpuInCores = quota.MaxCpuInCores;
}
if (quota.BaselineMemoryInBytes == 0)
{
quota.BaselineMemoryInBytes = quota.MaxMemoryInBytes;
}
return quota;
}
} |
There was a problem hiding this comment.
Pull request overview
This PR transitions the Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes library from experimental/dev stage to stable by removing experimental attributes and increasing quality thresholds. However, there is a critical issue with an invalid Stage value that must be corrected.
Changes:
- Removes experimental attribute injection and dev stage diagnostic ID (EXTEXP0016)
- Changes Stage from "dev" to "stable" (invalid - should be "normal")
- Increases MinMutationScore requirement from 90 to 95
...eMonitoring.Kubernetes/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes.csproj
Outdated
Show resolved
Hide resolved
…ing.Kubernetes/Microsoft.Extensions.Diagnostics.ResourceMonitoring.Kubernetes.csproj Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
do we really need this file? I don't remember having to generate it here https://github.com/dotnet/extensions/pull/7161/changes, for instance
There was a problem hiding this comment.
I'm getting failures in the build because of lack of the experimental flag for new API. I though it will disable it but it didn't, the <EnablePackageValidation>false</EnablePackageValidation> is not fixing that either.
There was a problem hiding this comment.
can you try a json file similar to this https://github.com/evgenyfedorov2/dotnet-extensions/blob/91cce8dd711dcad476be62009b146c60415d722c/src/Libraries/Microsoft.Extensions.AmbientMetadata.Build/Microsoft.Extensions.AmbientMetadata.Build.json - you can generate it with https://github.com/evgenyfedorov2/dotnet-extensions/tree/main/eng/Tools/ApiChief
Microsoft Reviewers: Open in CodeFlow