Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3bf8c37
Removing dependency from FioExecutor on DiskWorkloadExecutor.
Apr 17, 2024
4ec3c23
ScriptPath documentation.
Apr 24, 2024
364a9a6
PERF-IO-FIO-OLTP.json exposes the capability to execute a command whi…
Apr 25, 2024
eb407e2
Attempting to fix formatting errors for ScriptPath documentation.
Apr 25, 2024
d8c97ac
Using either job file or command line from profile, can create/update…
Apr 25, 2024
234f8de
Fixing issues with creating/updating job file at runtime.
Apr 26, 2024
4829d46
Simplifying CreateOrUpdateJobFile, the user is expected to provide ea…
Apr 26, 2024
df910b5
Added unit tests for FioExecutor using a jobfile.
Apr 26, 2024
5f07322
Removing architecture from unit test, does not need to be specified.
Apr 26, 2024
bd06415
Removing ioengine & file paths from profile.
Apr 27, 2024
3dfc8f5
Added a test for multiple job file templates.
Apr 27, 2024
c34d4a1
Including a job file template which does not have ioengine or filename.
Apr 27, 2024
d7a820b
Adding more sections to the OLTP profile for different block sizes.
Apr 27, 2024
a68d70d
Documentation.
Apr 28, 2024
95a7309
Filtering out wranings from standard output to avoid parsing error.
Apr 29, 2024
14b739d
Regex to replace text from template job files.
Apr 29, 2024
cdda36d
Merge branch 'main' into users/saibulusu/fio-job-file-support
Apr 29, 2024
51543f9
Slight documentation fix.
Apr 29, 2024
462f507
Updating vc version.
Apr 30, 2024
8c58659
Small profile fix in metadata section.
Apr 30, 2024
955e8d5
Small profile fix.
Apr 30, 2024
f6c4f3b
Resolving comments.
May 1, 2024
962f64a
Resolving comments: Adding seperate template job files, one for disk …
May 1, 2024
4c3b2e2
Resolving comments.
May 1, 2024
014389e
Resolving comments.
May 1, 2024
6d84bbf
Small profile fix.
May 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pipelines/azure-pipelines-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ resources:
options: --entrypoint=""

variables:
VcVersion : 1.14.19
VcVersion : 1.14.21
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.14.20
VcVersion : 1.14.21
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 @@ -4,6 +4,7 @@
namespace VirtualClient.Actions.DiskPerformance
{
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand All @@ -27,6 +28,7 @@ public class FioExecutorTests
private IEnumerable<Disk> disks;
private string mockCommandLine;
private string mockResults;
private DependencyPath mockWorkloadPackage;

[OneTimeSetUp]
public void SetupFixture()
Expand All @@ -48,14 +50,16 @@ public void SetupTest()
{ nameof(FioExecutor.CommandLine), this.mockCommandLine },
{ nameof(FioExecutor.ProcessModel), WorkloadProcessModel.SingleProcess },
{ nameof(FioExecutor.DeleteTestFilesOnFinish), "true" },
{ nameof(FioExecutor.TestName), "fio_test_1" }
{ nameof(FioExecutor.TestName), "fio_test_1" },
{ nameof(FioExecutor.PackageName), "fio" }
};

this.disks = this.mockFixture.CreateDisks(PlatformID.Unix, true);

this.mockFixture.DiskManager.Setup(mgr => mgr.GetDisksAsync(It.IsAny<CancellationToken>())).ReturnsAsync(() => this.disks);
this.mockFixture.PackageManager.OnGetPackage().ReturnsAsync(new DependencyPath("fio", this.mockFixture.GetPackagePath("fio")));
this.mockFixture.File.OnFileExists().Returns(true);
this.mockFixture.File.Setup(file => file.ReadAllText(It.IsAny<string>())).Returns(string.Empty);
this.mockFixture.ProcessManager.OnCreateProcess = (command, arguments, workingDir) =>
{
return new InMemoryProcess
Expand All @@ -71,6 +75,11 @@ public void SetupTest()
StandardOutput = new ConcurrentBuffer(new StringBuilder(this.mockResults))
};
};

string workloadName = "fio";
this.mockWorkloadPackage = new DependencyPath(
workloadName,
this.mockFixture.PlatformSpecifics.GetPackagePath(workloadName));
}

[Test]
Expand All @@ -97,6 +106,74 @@ public void FioExecutorAppliesConfigurationParametersCorrectly()
}
}

[Test]
public void FioExecutorThrowsOnNullCommandLineAndJobFiles()
{
this.profileParameters[nameof(TestFioExecutor.CommandLine)] = null;
this.profileParameters[nameof(TestFioExecutor.JobFiles)] = null;

using (TestFioExecutor executor = new TestFioExecutor(this.mockFixture.Dependencies, this.profileParameters))
{
WorkloadException error = Assert.Throws<WorkloadException>(executor.Validate);

Assert.AreEqual(ErrorReason.InvalidProfileDefinition, error.Reason);
}
}

[Test]
public void FioExecutorThrowsIfCommandLineAndJobFilesIncluded()
{
this.profileParameters[nameof(TestFioExecutor.CommandLine)] = "--name=fio_randwrite_{FileSize}_4k_d{QueueDepth}_th{ThreadCount}_direct --size=496GB --numjobs={ThreadCount} --rw=randwrite --bs=4k --iodepth={QueueDepth}";
this.profileParameters[nameof(TestFioExecutor.JobFiles)] = "{ScriptPath:fio}/oltp-c.fio.jobfile";

using (TestFioExecutor executor = new TestFioExecutor(this.mockFixture.Dependencies, this.profileParameters))
{
WorkloadException error = Assert.Throws<WorkloadException>(executor.Validate);

Assert.AreEqual(ErrorReason.InvalidProfileDefinition, error.Reason);
}
}

[Test]
public async Task FioExecutorRunsCommandWithJobFile()
{
this.profileParameters[nameof(TestFioExecutor.CommandLine)] = null;
this.profileParameters[nameof(TestFioExecutor.JobFiles)] = "jobfile1path";

DependencyPath workloadPlatformSpecificPackage =
this.mockFixture.ToPlatformSpecificPath(this.mockWorkloadPackage, this.mockFixture.Platform, this.mockFixture.CpuArchitecture);

using (TestFioExecutor executor = new TestFioExecutor(this.mockFixture.Dependencies, this.profileParameters))
{
await executor.ExecuteAsync(CancellationToken.None);

string updatedJobFilePath = this.mockFixture.PlatformSpecifics.Combine(workloadPlatformSpecificPackage.Path, "jobfile1path");

Assert.AreEqual($"{updatedJobFilePath} --output-format=json", executor.CommandLine);
}
}

[Test]
public async Task FioExecutorRunsCommandWithMultipleJobFiles()
{
this.profileParameters[nameof(TestFioExecutor.CommandLine)] = null;
this.profileParameters[nameof(TestFioExecutor.JobFiles)] = "path/to/jobfile1,path/jobfile2;path/jobfile3";

DependencyPath workloadPlatformSpecificPackage =
this.mockFixture.ToPlatformSpecificPath(this.mockWorkloadPackage, this.mockFixture.Platform, this.mockFixture.CpuArchitecture);

using (TestFioExecutor executor = new TestFioExecutor(this.mockFixture.Dependencies, this.profileParameters))
{
await executor.ExecuteAsync(CancellationToken.None);

string updatedJobFile1Path = this.mockFixture.PlatformSpecifics.Combine(workloadPlatformSpecificPackage.Path, "jobfile1");
string updatedJobFile2Path = this.mockFixture.PlatformSpecifics.Combine(workloadPlatformSpecificPackage.Path, "jobfile2");
string updatedJobFile3Path = this.mockFixture.PlatformSpecifics.Combine(workloadPlatformSpecificPackage.Path, "jobfile3");

Assert.AreEqual($"{updatedJobFile1Path} {updatedJobFile2Path} {updatedJobFile3Path} --output-format=json", executor.CommandLine);
}
}

[Test]
public void FioExecutorAppliesConfigurationParametersCorrectly_DiskFillScenario()
{
Expand Down Expand Up @@ -267,6 +344,11 @@ public TestFioExecutor(IServiceCollection dependencies, IDictionary<string, ICon
{
return base.CreateWorkloadProcess(executable, commandArguments, testedInstance, disksToTest);
}

public new void Validate()
{
base.Validate();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,23 @@ public List<string> BlockSize
}
}

/// <summary>
/// The size of the test file that should use in workload tests (e.g. 496GB).
/// </summary>
public string FileSize
{
get
{
this.Parameters.TryGetValue(nameof(DiskWorkloadExecutor.FileSize), out IConvertible fileSize);
return fileSize?.ToString();
}

set
{
this.Parameters[nameof(DiskWorkloadExecutor.FileSize)] = value;
}
}

/// <summary>
/// Parameter. True to used direct, non-buffered I/O (default). False to use buffered I/O.
/// </summary>
Expand Down
Loading