Skip to content

Commit

Permalink
Merge branch 'main' into users/prachisingla/AddMonitorIterationsInBas…
Browse files Browse the repository at this point in the history
…eMonitor
  • Loading branch information
psingla1210 authored Aug 14, 2023
2 parents a5f33a4 + 850601e commit a196786
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 56 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@
/src/VirtualClient/VirtualClient.Packaging/win-x64/SQLTPCC/HammerDB/**/* eol=lf
/src/VirtualClient/VirtualClient.Actions/**/*.sh eol=lf
/src/VirtualClient/VirtualClient.Dependencies/**/*.sh eol=lf
yarn.lock eol=lf
yarn.lock eol=lf
/src/VirtualClient/VirtualClient.Actions/SuperBenchmark/local.ini eol=lf
2 changes: 1 addition & 1 deletion .pipelines/azure-pipelines-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pool:
vmImage: ubuntu-latest

variables:
VcVersion : 1.8.5
VcVersion : 1.8.6
ROOT: $(Build.SourcesDirectory)
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
ENABLE_PRS_DELAYSIGN: 1
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pool:
vmImage: windows-latest

variables:
VcVersion : 1.8.5
VcVersion : 1.8.6
ROOT: $(Build.SourcesDirectory)
CDP_DEFINITION_BUILD_COUNT: $[counter('', 0)] # needed for onebranch.pipeline.version task https://aka.ms/obpipelines/versioning
ENABLE_PRS_DELAYSIGN: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ public async Task SysbenchOLTPWorkloadProfileExecutesTheExpectedWorkloadsOnUnixP

string scriptPath = this.mockFixture.PlatformSpecifics.GetScriptPath("sysbencholtp");

string balancedClientScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balanced-Client.sh");
string balancedServerScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balanced-Server.sh");
string inMemoryScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "in-Memory.sh");
string balancedClientScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balanced-client.sh");
string balancedServerScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "balanced-server.sh");
string inMemoryScript = this.mockFixture.PlatformSpecifics.Combine(scriptPath, "in-memory.sh");

this.mockFixture.SetupFile(balancedServerScript);
this.mockFixture.SetupFile(balancedClientScript);
Expand Down Expand Up @@ -93,9 +93,9 @@ private IEnumerable<string> GetProfileExpectedCommands(PlatformID platform, Arch
{
"git clone https://github.com/akopytov/sysbench.git /home/user/tools/VirtualClient/packages/sysbench",

$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balanced-Server.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balanced-Client.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/in-Memory.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balanced-server.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/balanced-client.sh\"",
$"sudo chmod +x \"/home/user/tools/VirtualClient/scripts/sysbencholtp/in-memory.sh\"",

"sudo ./autogen.sh",
"sudo ./configure",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ public async Task SysbenchOLTPClientExecutorRunsTheExpectedWorkloadCommand()

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
"sudo ./autogen.sh",
"sudo ./configure",
"sudo make -j",
Expand Down Expand Up @@ -162,9 +162,9 @@ public async Task SysbenchOLTPClientExecutorUsesDefinedParameters()

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
"sudo ./autogen.sh",
"sudo ./configure",
"sudo make -j",
Expand Down Expand Up @@ -238,16 +238,16 @@ public async Task SysbenchOLTPClientExecutorRunsTheExpectedWorkloadCommandBalanc

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
"sudo ./autogen.sh",
"sudo ./configure",
"sudo make -j",
"sudo make install",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=1 --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
$"sudo {this.scriptPath}/balanced-Client.sh 1.2.3.5 10 sbtest /testdrive1 /testdrive2",
$"sudo {this.scriptPath}/balanced-client.sh 1.2.3.5 10 sbtest /testdrive1 /testdrive2",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads=1 --tables=10 --table-size={records} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
};

Expand Down Expand Up @@ -296,9 +296,9 @@ public async Task SysbenchOLTPClientExecutorSkipsInitializationOfTheWorkloadForE

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 cleanup",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_common --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 prepare",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run"
Expand Down Expand Up @@ -362,9 +362,9 @@ public async Task SysbenchOLTPClientExecutorSkipsPrepareAndCleanupSteps()

string[] expectedCommands =
{
$"sudo chmod +x \"{this.scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-Client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-server.sh\"",
$"sudo chmod +x \"{this.scriptPath}/balanced-client.sh\"",
$"sudo chmod +x \"{this.scriptPath}/in-memory.sh\"",
$"sudo /home/user/tools/VirtualClient/packages/sysbench/src/sysbench oltp_read_write --threads={this.threadCount} --tables=10 --table-size={this.recordCount} --mysql-db=sbtest --mysql-host=1.2.3.5 --time=10 run",
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ public async Task SysbenchOLTPServerExecutorExcutesExpectedProcessInMemoryScenar

string[] expectedCommands =
{
$"sudo chmod +x \"{scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Client.sh\"",
$"sudo {scriptPath}/in-Memory.sh 8192"
$"sudo chmod +x \"{scriptPath}/in-memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-client.sh\"",
$"sudo {scriptPath}/in-memory.sh 8192"
};

this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDirectory) =>
Expand Down Expand Up @@ -126,10 +126,10 @@ public async Task SysbenchOLTPServerExecutorExcutesExpectedProcessBalancedScenar

string[] expectedCommands =
{
$"sudo chmod +x \"{scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Client.sh\"",
$"sudo {scriptPath}/balanced-Server.sh {mountPaths}"
$"sudo chmod +x \"{scriptPath}/in-memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-client.sh\"",
$"sudo {scriptPath}/balanced-server.sh {mountPaths}"
};

this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDirectory) =>
Expand Down Expand Up @@ -170,10 +170,10 @@ public async Task SysbenchOLTPServerExecutorDoesNotExecuteBalancedScenarioOnInit

string[] expectedCommands =
{
$"sudo chmod +x \"{scriptPath}/in-Memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-Client.sh\"",
$"sudo {scriptPath}/balanced-Server.sh"
$"sudo chmod +x \"{scriptPath}/in-memory.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-server.sh\"",
$"sudo chmod +x \"{scriptPath}/balanced-client.sh\"",
$"sudo {scriptPath}/balanced-server.sh"
};

this.mockFixture.ProcessManager.OnCreateProcess = (exe, arguments, workingDirectory) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace VirtualClient.Actions
using System.IO.Abstractions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.DependencyInjection;
using VirtualClient.Common;
using VirtualClient.Common.Extensions;
Expand Down Expand Up @@ -159,7 +160,7 @@ protected override async Task InitializeAsync(EventContext telemetryContext, Can
string cloneDir = this.PlatformSpecifics.Combine(this.PlatformSpecifics.PackagesDirectory, "superbenchmark");
if (!this.fileSystem.Directory.Exists(cloneDir))
{
await this.ExecuteCommandAsync("git", $"clone -b v{this.Version} https://github.com/microsoft/superbenchmark", this.PlatformSpecifics.PackagesDirectory, telemetryContext, cancellationToken, runElevated: true);
await this.ExecuteSbCommandAsync("git", $"clone -b v{this.Version} https://github.com/microsoft/superbenchmark", this.PlatformSpecifics.PackagesDirectory, telemetryContext, cancellationToken, true);
}

foreach (string file in this.fileSystem.Directory.GetFiles(this.PlatformSpecifics.GetScriptPath("superbenchmark")))
Expand All @@ -170,15 +171,26 @@ protected override async Task InitializeAsync(EventContext telemetryContext, Can
true);
}

await this.ExecuteCommandAsync("bash", $"initialize.sh {this.Username}", this.SuperBenchmarkDirectory, telemetryContext, cancellationToken, runElevated: true);
await this.ExecuteCommandAsync("sb", $"deploy --host-list localhost -i {this.ContainerVersion}", this.SuperBenchmarkDirectory, telemetryContext, cancellationToken, runElevated: false);
await this.ExecuteSbCommandAsync("bash", $"initialize.sh {this.Username}", this.SuperBenchmarkDirectory, telemetryContext, cancellationToken, true);
await this.ExecuteSbCommandAsync("sb", $"deploy --host-list localhost -i {this.ContainerVersion}", this.SuperBenchmarkDirectory, telemetryContext, cancellationToken, false);

state.SuperBenchmarkInitialized = true;
}

await this.stateManager.SaveStateAsync<SuperBenchmarkState>($"{nameof(SuperBenchmarkState)}", state, cancellationToken);
}

private async Task ExecuteSbCommandAsync(string command, string commandArguments, string workingDirectory, EventContext telemetryContext, CancellationToken cancellationToken, bool runElevated)
{
IProcessProxy process = await this.ExecuteCommandAsync(command, commandArguments, workingDirectory, telemetryContext, cancellationToken, runElevated: runElevated);

if (!cancellationToken.IsCancellationRequested)
{
await this.LogProcessDetailsAsync(process, telemetryContext, "Superbench", logToFile: true);
process.ThrowIfWorkloadFailed();
}
}

private async Task CaptureMetricsAsync(IProcessProxy process, string commandArguments, EventContext telemetryContext, CancellationToken cancellationToken)
{
if (!cancellationToken.IsCancellationRequested)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[all]
localhost ansible_connection=local
localhost ansible_connection=local
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private async Task PrepareBalancedScenarioAsync(string diskPaths, EventContext t
// client work in the balanced scenario includes copying all tables from OS disk to data disk,
// dropping old tables & renaming them

string balancedScript = "balanced-Client.sh";
string balancedScript = "balanced-client.sh";
string scriptsDirectory = this.PlatformSpecifics.GetScriptPath("sysbencholtp");
string balancedArguments = $"{this.ServerIpAddress} 10 {this.DatabaseName} {diskPaths}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ protected async Task InitializeExecutablesAsync(CancellationToken cancellationTo
string scriptsDirectory = this.PlatformSpecifics.GetScriptPath("sysbencholtp");

await this.SystemManager.MakeFileExecutableAsync(
this.Combine(scriptsDirectory, "balanced-Server.sh"),
this.Combine(scriptsDirectory, "balanced-server.sh"),
this.Platform,
cancellationToken);

await this.SystemManager.MakeFileExecutableAsync(
this.Combine(scriptsDirectory, "balanced-Client.sh"),
this.Combine(scriptsDirectory, "balanced-client.sh"),
this.Platform,
cancellationToken);

await this.SystemManager.MakeFileExecutableAsync(
this.Combine(scriptsDirectory, "in-Memory.sh"),
this.Combine(scriptsDirectory, "in-memory.sh"),
this.Platform,
cancellationToken);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private async Task PrepareInMemoryScenarioAsync(EventContext telemetryContext, C
{
// server's job is to configure buffer size, in memory script updates the mysql config file

string inMemoryScript = "in-Memory.sh";
string inMemoryScript = "in-memory.sh";
string scriptsDirectory = this.PlatformSpecifics.GetScriptPath("sysbencholtp");

MemoryInfo memoryInfo = await this.SystemManager.GetMemoryInfoAsync(cancellationToken);
Expand Down Expand Up @@ -217,7 +217,7 @@ private async Task<string> PrepareBalancedScenarioAsync(EventContext telemetryCo
}
}

string balancedScript = "balanced-Server.sh";
string balancedScript = "balanced-server.sh";
string scriptsDirectory = this.PlatformSpecifics.GetScriptPath("sysbencholtp");

using (IProcessProxy process = await this.ExecuteCommandAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,7 @@
<ScriptFiles Include="PostgreSQL\*.sh" />
<ScriptFiles Include="SuperBenchmark\*.yaml;SuperBenchmark\*.sh;SuperBenchmark\*.ini" />
<ScriptFiles Include="MLPerf\**\*.py" />
<ScriptFiles Include="SysbenchOLTP\*.sh" />
</ItemGroup>

<ItemGroup>
<ScriptFiles Remove="SysbenchOLTP\balanced-Client.sh" />
<ScriptFiles Remove="SysbenchOLTP\balanced-Server.sh" />
<ScriptFiles Remove="SysbenchOLTP\in-Memory.sh" />
<ScriptFiles Include="SysbenchOLTP\*.sh" />
</ItemGroup>

<Target Name="CopyWorkloadScriptsToOutput" AfterTargets="Build">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@
NuGet package in the /content/win-x64|win-arm64/profiles folder
-->
<WindowsProfiles Include="profiles\GET-STARTED-OPENSSL.json" />
<WindowsProfiles Include="profiles\DEPENDENCY-AMD-GPU-DRIVER.json" />
<WindowsProfiles Include="profiles\DEPENDENCY-AMD-GPU-DRIVER.json" />
<WindowsProfiles Include="profiles\BOOTSTRAP-DEPENDENCIES.json" />
<WindowsProfiles Include="profiles\PERF-ASPNETBENCH.json" />
<WindowsProfiles Include="profiles\PERF-COMPRESSION.json" />
<WindowsProfiles Include="profiles\PERF-CPU-COREMARK.json" />
<WindowsProfiles Include="profiles\PERF-CPU-COREMARKPRO.json" />
<WindowsProfiles Include="profiles\PERF-GPU-FURMARK.json" />
<WindowsProfiles Include="profiles\PERF-GPU-FURMARK.json" />
<WindowsProfiles Include="profiles\PERF-CPU-GEEKBENCH.json" />
<WindowsProfiles Include="profiles\PERF-CPU-LAPACK.json" />
<WindowsProfiles Include="profiles\PERF-CPU-OPENSSL.json" />
Expand Down

0 comments on commit a196786

Please sign in to comment.