Skip to content

Commit

Permalink
Merge branch 'users/v-rkambaiahg/SpecParam' of https://github.com/Rak…
Browse files Browse the repository at this point in the history
…eshwarK/VirtualClient into users/v-rkambaiahg/SpecParam
  • Loading branch information
RakeshwarK committed Nov 27, 2024
2 parents 967ffa3 + 1b73a80 commit 62d0012
Show file tree
Hide file tree
Showing 21 changed files with 286 additions and 59 deletions.
3 changes: 0 additions & 3 deletions src/VirtualClient/Module.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
<!-- Azure.Storage.Blobs -->
<Azure_Storage_Blobs_PackageVersion>12.18.0</Azure_Storage_Blobs_PackageVersion>

<!-- Extreme.Numerics -->
<Extreme_Numerics_PackageVersion>8.1.9</Extreme_Numerics_PackageVersion>

<!-- MathNet.Numerics.Signed -->
<MathNet_Numerics_Signed_PackageVersion>5.0.0</MathNet_Numerics_Signed_PackageVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ public async Task HPLinpackExecutorExecutesWorkloadAsExpectedWithPerformanceLibr
{
this.SetupDefaultMockBehavior(platform, architecture);
this.fixture.Parameters["PerformanceLibrary"] = "ARM";
this.fixture.Parameters["PerformanceLibraryVersion"] = "24.04";
this.fixture.Parameters["PerformanceLibraryVersion"] = "24.10";

using (TestHPLExecutor executor = new TestHPLExecutor(this.fixture))
{
List<string> expectedCommands = new List<string>()
{
$"sudo chmod +x {this.fixture.PlatformSpecifics.Combine(this.mockPath.Path, "ARM", "arm-performance-libraries_24.04.sh")}",
$"sudo ./arm-performance-libraries_24.04.sh -a",
$"sudo chmod +x {this.fixture.PlatformSpecifics.Combine(this.mockPath.Path, "ARM", "arm-performance-libraries_24.10.sh")}",
$"sudo ./arm-performance-libraries_24.10.sh -a",
$"sudo bash -c \"source make_generic\"",
$"mv Make.UNKNOWN Make.Linux_GCC",
$"ln -s {this.fixture.PlatformSpecifics.Combine(executor.GetHPLDirectory, "setup", "Make.Linux_GCC" )} Make.Linux_GCC",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Extreme.Statistics;
using NUnit.Framework;
using VirtualClient.Contracts;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Extreme.Statistics;
using NUnit.Framework;
using VirtualClient.Contracts;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ private async Task ConfigurePerformanceLibrary(EventContext telemetryContext, Ca
case "23.04.1":
this.hplPerfLibraryInfo = "arm-performance-libraries_23.04.1";
break;
case "24.04":
this.hplPerfLibraryInfo = "arm-performance-libraries_24.04";
case "24.10":
this.hplPerfLibraryInfo = "arm-performance-libraries_24.10";
break;
default:
throw new WorkloadException(
$"The HPL workload is currently only supports the perf libraries versions 23.04.1 and 24.04 on the following platform/architectures: " +
$"The HPL workload is currently only supports the perf libraries versions 23.04.1 and 24.10 on the following platform/architectures: " +
$"'{PlatformSpecifics.LinuxArm64}'.",
ErrorReason.PlatformNotSupported);
}
Expand Down Expand Up @@ -368,13 +368,13 @@ await this.fileSystem.File.ReplaceInFileAsync(
await this.fileSystem.File.ReplaceInFileAsync(
makeFilePath, @"LAlib *= *[^\n]*", "LAlib = /opt/arm/armpl_23.04.1_gcc-11.3/lib/libarmpl.a", cancellationToken);
break;
case "24.04":
case "24.10":
await this.fileSystem.File.ReplaceInFileAsync(
makeFilePath, @"LAlib *= *[^\n]*", "LAlib = /opt/arm/armpl_24.04_gcc/lib/libarmpl.a", cancellationToken);
makeFilePath, @"LAlib *= *[^\n]*", "LAlib = /opt/arm/armpl_24.10_gcc/lib/libarmpl.a", cancellationToken);
break;
default:
throw new WorkloadException(
$"The HPL workload is currently only supports the perf libraries versions 23.04.1 and 24.04 on the following platform/architectures: " +
$"The HPL workload is currently only supports the perf libraries versions 23.04.1 and 24.10 on the following platform/architectures: " +
$"'{PlatformSpecifics.LinuxArm64}'.",
ErrorReason.PlatformNotSupported);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace VirtualClient.Actions.NetworkPerformance
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Extreme.Statistics;
using MathNet.Numerics.Distributions;
using MathNet.Numerics.Statistics;
using VirtualClient.Contracts;
Expand Down Expand Up @@ -95,7 +94,9 @@ private static void AddStatisticalMetrics(IList<Metric> metrics, List<double> ti
metrics.Add(new Metric("ConnectsPerSec_P99_9", Statistics.QuantileCustom(connectsPerSec, 1d - 0.001d, QuantileDefinition.R3)));
metrics.Add(new Metric("ConnectsPerSec_P99_99", Statistics.QuantileCustom(connectsPerSec, 1d - 0.0001d, QuantileDefinition.R3)));
metrics.Add(new Metric("ConnectsPerSec_P99_999", Statistics.QuantileCustom(connectsPerSec, 1d - 0.00001d, QuantileDefinition.R3)));
metrics.Add(new Metric("ConnectsPerSec_Mad", Stats.MedianAbsoluteDeviation(connectsPerSec.ToArray())));
double median = Statistics.Median(connectsPerSec);
double[] absoluteDeviations = connectsPerSec.Select(x => Math.Abs(x - median)).ToArray();
metrics.Add(new Metric("ConnectsPerSec_Mad", Statistics.Median(absoluteDeviations)));
metrics.Add(new Metric("ConnectsPerSec_StandardErrorMean", sem));
metrics.Add(new Metric("ConnectsPerSec_LowerCI", lowerCI));
metrics.Add(new Metric("ConnectsPerSec_UpperCI", upperCI));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace VirtualClient.Actions
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Extreme.Statistics;
using MathNet.Numerics.Distributions;
using MathNet.Numerics.Statistics;
using VirtualClient.Contracts;
Expand Down Expand Up @@ -121,7 +120,9 @@ private static void AddStatisticalMetrics(IList<Metric> metrics, List<double> pa
metrics.Add(new Metric("Latency-P99.9", Statistics.QuantileCustom(packetsLatencyValues, 1d - 0.001d, QuantileDefinition.R3), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-P99.99", Statistics.QuantileCustom(packetsLatencyValues, 1d - 0.0001d, QuantileDefinition.R3), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-P99.999", Statistics.QuantileCustom(packetsLatencyValues, 1d - 0.00001d, QuantileDefinition.R3), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-Mad", Extreme.Statistics.Stats.MedianAbsoluteDeviation(packetsLatencyValues.ToArray()), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
double median = Statistics.Median(packetsLatencyValues);
double[] absoluteDeviations = packetsLatencyValues.Select(x => Math.Abs(x - median)).ToArray();
metrics.Add(new Metric("Latency-Mad", Statistics.Median(absoluteDeviations), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-StandardErrorMean", sem, MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-Stdev", sd, MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-LowerCI", lowerCI));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace VirtualClient.Actions.NetworkPerformance
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using Extreme.Statistics;
using MathNet.Numerics.Distributions;
using MathNet.Numerics.Statistics;
using VirtualClient.Contracts;
Expand Down Expand Up @@ -95,7 +94,9 @@ private static void AddStatisticalMetrics(IList<Metric> metrics, List<double> ti
metrics.Add(new Metric("ConnectsPerSec_P99_9", Statistics.QuantileCustom(connectsPerSec, 1d - 0.001d, QuantileDefinition.R3)));
metrics.Add(new Metric("ConnectsPerSec_P99_99", Statistics.QuantileCustom(connectsPerSec, 1d - 0.0001d, QuantileDefinition.R3)));
metrics.Add(new Metric("ConnectsPerSec_P99_999", Statistics.QuantileCustom(connectsPerSec, 1d - 0.00001d, QuantileDefinition.R3)));
metrics.Add(new Metric("ConnectsPerSec_Mad", Stats.MedianAbsoluteDeviation(connectsPerSec.ToArray())));
double median = Statistics.Median(connectsPerSec);
double[] absoluteDeviations = connectsPerSec.Select(x => Math.Abs(x - median)).ToArray();
metrics.Add(new Metric("ConnectsPerSec_Mad", Statistics.Median(absoluteDeviations)));
metrics.Add(new Metric("ConnectsPerSec_StandardErrorMean", sem));
metrics.Add(new Metric("ConnectsPerSec_LowerCI", lowerCI));
metrics.Add(new Metric("ConnectsPerSec_UpperCI", upperCI));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace VirtualClient.Actions
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Extreme.Statistics;
using MathNet.Numerics.Distributions;
using MathNet.Numerics.Statistics;
using Microsoft.Azure.Amqp.Framing;
using VirtualClient.Contracts;

/// <summary>
Expand Down Expand Up @@ -137,7 +137,9 @@ private static void AddStatisticalMetrics(IList<Metric> metrics, List<double> pa
metrics.Add(new Metric("Latency-P99.9", Statistics.QuantileCustom(packetsLatencyValues, 1d - 0.001d, QuantileDefinition.R3), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-P99.99", Statistics.QuantileCustom(packetsLatencyValues, 1d - 0.0001d, QuantileDefinition.R3), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-P99.999", Statistics.QuantileCustom(packetsLatencyValues, 1d - 0.00001d, QuantileDefinition.R3), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-Mad", Extreme.Statistics.Stats.MedianAbsoluteDeviation(packetsLatencyValues.ToArray()), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
double median = Statistics.Median(packetsLatencyValues);
double[] absoluteDeviations = packetsLatencyValues.Select(x => Math.Abs(x - median)).ToArray();
metrics.Add(new Metric("Latency-Mad", Statistics.Median(absoluteDeviations), MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-StandardErrorMean", sem, MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-Stdev", sd, MetricUnit.Microseconds, MetricRelativity.LowerIsBetter));
metrics.Add(new Metric("Latency-LowerCI", lowerCI));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

<ItemGroup>
<!-- Global package dependency versions are defined in the Module.props for the solution. -->
<PackageReference Include="Extreme.Numerics" Version="$(Extreme_Numerics_PackageVersion)" />
<PackageReference Include="MathNet.Numerics.Signed" Version="$(MathNet_Numerics_Signed_PackageVersion)" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="$(Microsoft_Windows_Compatibility_PackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="$(Microsoft_Extensions_Http_Polly_PackageVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public void InitializeTest()
[Test]
[TestCase("AME")]
[TestCase("GBL")]
[TestCase("AME Infra CA 02")]
[TestCase("AME Infra CA 06")]
[TestCase("DC=AME")]
[TestCase("DC=GBL")]
[TestCase("CN=AME")]
[TestCase("CN=AME Infra CA 02")]
[TestCase("CN=AME Infra CA 02, DC=AME, DC=GBL")]
[TestCase("CN=AME Infra CA 02,DC=AME,DC=GBL")]
[TestCase("CN=AME Infra CA 06")]
[TestCase("CN=AME Infra CA 06, DC=AME, DC=GBL")]
[TestCase("CN=AME Infra CA 06,DC=AME,DC=GBL")]
public void CertificateManagerSearchesSupportsARangeOfFormatsForIssuersOnCertificates(string issuer)
{
X509Certificate2 certificate = this.mockFixture.Create<X509Certificate2>();
Expand All @@ -67,10 +67,10 @@ public void CertificateManagerDoesNotMismatchIssuersOnCertificates(string issuer

[Test]
[TestCase("virtualclient")]
[TestCase("virtualclient.corp")]
[TestCase("virtualclient.corp.azure.com")]
[TestCase("CN=virtualclient.corp")]
[TestCase("CN=virtualclient.corp.azure.com")]
[TestCase("virtualclient.test.corp")]
[TestCase("virtualclient.test.corp.azure.com")]
[TestCase("CN=virtualclient.test.corp")]
[TestCase("CN=virtualclient.test.corp.azure.com")]
public void CertificateManagerSearchesSupportsARangeOfFormatsForSubjectNamesOnCertificates(string subjectName)
{
X509Certificate2 certificate = this.mockFixture.Create<X509Certificate2>();
Expand All @@ -95,13 +95,13 @@ public async Task CertificateManagerSearchesTheExpectedDirectoryForCertificates(
this.testCertificateManager = new TestCertificateManager(this.mockFixture);

string expectedDirectory = CertificateManager.DefaultUnixCertificateDirectory;
string expectedCertificateFile = this.mockFixture.Combine(expectedDirectory, "A3706B2B12D35F8B2B5F8176F7B6F18534A23FAD");
string expectedCertificateFile = this.mockFixture.Combine(expectedDirectory, "C3F4A77CAD588341B8D62EE4DA02D85E8F100EFA");
bool confirmedDir = false;
bool confirmedFile = false;

// Issuer: AME
// Subject Name: virtualclient.corp.azure.com
// Thumbprint: A3706B2B12D35F8B2B5F8176F7B6F18534A23FAD
// Subject Name: virtualclient.test.corp.azure.com
// Thumbprint: C3F4A77CAD588341B8D62EE4DA02D85E8F100EFA
//
// Note that this is an expired/invalid certificate so there are no security concerns. It is merely
// used for testing purposes.
Expand Down Expand Up @@ -138,35 +138,35 @@ public async Task CertificateManagerSearchesTheExpectedDirectoryForCertificates(
// Expectation:
// We do not need to compare the certificate properties. We just need to ensure we attempted to
// read from the expected directory and that the certificate deserializes without error.
await this.testCertificateManager.GetCertificateFromPathAsync("AME", "virtualclient.corp.azure.com", expectedDirectory);
await this.testCertificateManager.GetCertificateFromPathAsync("AME", "virtualclient.test.corp.azure.com", expectedDirectory);

Assert.IsTrue(confirmedDir);
Assert.IsTrue(confirmedFile);
}

[Test]
[TestCase("AME", "virtualclient.corp.azure.com")]
[TestCase("GBL", "virtualclient.corp.azure.com")]
[TestCase("AME Infra CA 02", "virtualclient")]
[TestCase("AME", "virtualclient.test.corp.azure.com")]
[TestCase("GBL", "virtualclient.test.corp.azure.com")]
[TestCase("AME Infra CA 06", "virtualclient")]
[TestCase("DC=AME", "corp.azure.com")]
[TestCase("DC=GBL", "azure.com")]
[TestCase("CN=AME", "virtualclient.corp.azure.com")]
[TestCase("CN=AME Infra CA 02", "CN=virtualclient.corp.azure.com")]
[TestCase("CN=AME Infra CA 02, DC=AME, DC=GBL", "CN=virtualclient.corp.azure.com")]
[TestCase("CN=AME Infra CA 02,DC=AME,DC=GBL", "CN=virtualclient.corp.azure.com")]
[TestCase("CN=AME", "virtualclient.test.corp.azure.com")]
[TestCase("CN=AME Infra CA 06", "CN=virtualclient.test.corp.azure.com")]
[TestCase("CN=AME Infra CA 06, DC=AME, DC=GBL", "CN=virtualclient.test.corp.azure.com")]
[TestCase("CN=AME Infra CA 06,DC=AME,DC=GBL", "CN=virtualclient.test.corp.azure.com")]
public async Task CertificateManagerHandlesDifferentIssuerAndSubjectNameFormats(string issuer, string subjectName)
{
this.mockFixture.Setup(PlatformID.Unix);
this.testCertificateManager = new TestCertificateManager(this.mockFixture);

string expectedDirectory = CertificateManager.DefaultUnixCertificateDirectory;
string expectedCertificateFile = this.mockFixture.Combine(expectedDirectory, "A3706B2B12D35F8B2B5F8176F7B6F18534A23FAD");
string expectedCertificateFile = this.mockFixture.Combine(expectedDirectory, "C3F4A77CAD588341B8D62EE4DA02D85E8F100EFA");
bool confirmedDir = false;
bool confirmedFile = false;

// Issuer: AME
// Subject Name: virtualclient.corp.azure.com
// Thumbprint: A3706B2B12D35F8B2B5F8176F7B6F18534A23FAD
// Subject Name: virtualclient.test.corp.azure.com
// Thumbprint: C3F4A77CAD588341B8D62EE4DA02D85E8F100EFA
//
// Note that this is an expired/invalid certificate so there are no security concerns. It is merely
// used for testing purposes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"Parameters": {
"Scenario": "DownloadHPLPerformanceLibrariesPackage",
"BlobContainer": "packages",
"BlobName": "hplperformancelibraries.1.1.0.zip",
"BlobName": "hplperformancelibraries.1.1.1.zip",
"PackageName": "hplperformancelibraries",
"Extract": true
}
Expand Down
4 changes: 2 additions & 2 deletions src/VirtualClient/VirtualClient.Monitors/FileUploadMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ private async Task ProcessFileUploadsAsync(IBlobManager blobManager, EventContex

try
{
await Task.Delay(this.ProcessingIntervalWaitTime, cancellationToken);

// We do not honor the cancellation token until ALL files have been processed.
while (await this.UploadFilesAsync(blobManager, relatedContext))
{
Expand All @@ -103,8 +105,6 @@ private async Task ProcessFileUploadsAsync(IBlobManager blobManager, EventContex
// to process, we will exit.
}
}

await Task.Delay(this.ProcessingIntervalWaitTime, cancellationToken);
}
catch (OperationCanceledException)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ private static X509Certificate2 CreateCertificate(bool withPrivateKey = false)
if (withPrivateKey)
{
certificate = new X509Certificate2(
File.ReadAllBytes(Path.Combine(resourcesDirectory, "testcertificate2.private")),
File.ReadAllBytes(Path.Combine(resourcesDirectory, "test-certificate.private")),
string.Empty.ToSecureString(),
X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
}
else
{
certificate = new X509Certificate2(
File.ReadAllBytes(Path.Combine(resourcesDirectory, "testcertificate2.private")));
File.ReadAllBytes(Path.Combine(resourcesDirectory, "test-certificate.private")));
}

return certificate;
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</ItemGroup>

<ItemGroup>
<None Update="Resources\testcertificate2.private">
<None Update="Resources\test-certificate.private">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
Expand Down
Loading

0 comments on commit 62d0012

Please sign in to comment.