Skip to content

Commit dcd2c57

Browse files
saibulususaibulusu
andauthored
Using fio from package manager (#464)
* Removed fio u24 profile, added fio from package manager to 3 fio profiles. * Using scripts/updated for the updated job files. * removing 'templates' from file path in profile for OLTP. * Cleanup + fixing unit tests. * Keeping installation from storage for win-x64, and fixing profile tests. --------- Co-authored-by: saibulusu <[email protected]>
1 parent 31ea287 commit dcd2c57

File tree

12 files changed

+49
-573
lines changed

12 files changed

+49
-573
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.16.34
1+
1.16.35

src/VirtualClient/VirtualClient.Actions.FunctionalTests/FioDiscoveryProfileTests.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,8 @@ public async Task FioDiscoveryWorkloadProfileInstallsTheExpectedDependenciesOnUn
5656

5757
// Apt packages expectations
5858
// There are a few Apt packages that must be installed for the FIO workload to run.
59-
WorkloadAssert.AptPackageInstalled(this.mockFixture, "libaio1");
6059
WorkloadAssert.AptPackageInstalled(this.mockFixture, "libaio-dev");
61-
62-
// Workload dependency package expectations
63-
// The FIO workload dependency package should have been installed at this point.
64-
WorkloadAssert.WorkloadPackageInstalled(this.mockFixture, "fio");
60+
WorkloadAssert.AptPackageInstalled(this.mockFixture, "fio");
6561
}
6662
}
6763

src/VirtualClient/VirtualClient.Actions.FunctionalTests/FioMultiThroughputProfileTests.cs

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,8 @@ public async Task FioWorkloadMultiThroughputProfileInstallsTheExpectedDependenci
5858

5959
// Apt packages expectations
6060
// There are a few Apt packages that must be installed for the FIO workload to run.
61-
WorkloadAssert.AptPackageInstalled(this.mockFixture, "libaio1");
6261
WorkloadAssert.AptPackageInstalled(this.mockFixture, "libaio-dev");
63-
64-
// Workload dependency package expectations
65-
// The FIO workload dependency package should have been installed at this point.
66-
WorkloadAssert.WorkloadPackageInstalled(this.mockFixture, "fio");
62+
WorkloadAssert.AptPackageInstalled(this.mockFixture, "fio");
6763
}
6864
}
6965

@@ -103,34 +99,12 @@ public async Task FioWorkloadMultiThroughputProfileExecutesTheExpectedWorkloadsO
10399
}
104100
}
105101

106-
[Test]
107-
[TestCase("PERF-IO-FIO-MULTITHROUGHPUT.json")]
108-
public void FioWorkloadMultiThroughputProfileActionsWillNotBeExecutedIfTheWorkloadPackageDoesNotExist(string profile)
109-
{
110-
// Setup disks the expected scenarios:
111-
// - Disks are formatted and ready
112-
this.mockFixture.Setup(PlatformID.Unix);
113-
this.mockFixture.SetupDisks(withUnformatted: false);
114-
115-
// We ensure the workload package does not exist.
116-
this.mockFixture.PackageManager.Clear();
117-
118-
using (ProfileExecutor executor = TestDependencies.CreateProfileExecutor(profile, this.mockFixture.Dependencies))
119-
{
120-
executor.ExecuteDependencies = false;
121-
122-
DependencyException error = Assert.ThrowsAsync<DependencyException>(() => executor.ExecuteAsync(ProfileTiming.OneIteration(), CancellationToken.None));
123-
Assert.AreEqual(ErrorReason.WorkloadDependencyMissing, error.Reason);
124-
Assert.IsFalse(this.mockFixture.ProcessManager.Commands.Contains("fio"));
125-
}
126-
}
127-
128102
private static IEnumerable<string> GetFioStressProfileExpectedCommands(PlatformID platform)
129103
{
130104
return new List<string>
131105
{
132-
"/home/user/tools/VirtualClient/packages/fio/linux-x64/fio /home/user/tools/VirtualClient/packages/fio/linux-x64/FioMultiThroughputExecutoroltp-c.fio.jobfile --section initrandomio --section initsequentialio",
133-
"/home/user/tools/VirtualClient/packages/fio/linux-x64/fio /home/user/tools/VirtualClient/packages/fio/linux-x64/FioMultiThroughputExecutoroltp-c.fio.jobfile --section randomreader --section randomwriter --section sequentialwriter"
106+
"fio /home/user/tools/VirtualClient/scripts/fio/updated/FioMultiThroughputExecutoroltp-c.fio.jobfile --section initrandomio --section initsequentialio",
107+
"fio /home/user/tools/VirtualClient/scripts/fio/updated/FioMultiThroughputExecutoroltp-c.fio.jobfile --section randomreader --section randomwriter --section sequentialwriter"
134108
};
135109
}
136110
}

src/VirtualClient/VirtualClient.Actions.FunctionalTests/FioProfileTests.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ public async Task FioWorkloadProfileInstallsTheExpectedDependenciesOnWindowsPlat
5555
WorkloadAssert.DisksAreInitialized(this.mockFixture);
5656
WorkloadAssert.DisksHaveAccessPaths(this.mockFixture);
5757

58-
// Workload dependency package expectations
59-
// The FIO workload dependency package should have been installed at this point.
6058
WorkloadAssert.WorkloadPackageInstalled(this.mockFixture, "fio");
6159
}
6260
}
@@ -81,12 +79,8 @@ public async Task FioWorkloadProfileInstallsTheExpectedDependenciesOnUnixPlatfor
8179

8280
// Apt packages expectations
8381
// There are a few Apt packages that must be installed for the FIO workload to run.
84-
WorkloadAssert.AptPackageInstalled(this.mockFixture, "libaio1");
8582
WorkloadAssert.AptPackageInstalled(this.mockFixture, "libaio-dev");
86-
87-
// Workload dependency package expectations
88-
// The FIO workload dependency package should have been installed at this point.
89-
WorkloadAssert.WorkloadPackageInstalled(this.mockFixture, "fio");
83+
WorkloadAssert.AptPackageInstalled(this.mockFixture, "fio");
9084
}
9185
}
9286

src/VirtualClient/VirtualClient.Actions.UnitTests/FIO/FioMultiThroughputExecutorTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public async Task FioMultiThroughputExecutorInitializeAsExpected()
106106
{
107107
if (!arguments.Contains("chmod"))
108108
{
109-
Assert.IsTrue(arguments.Equals($"{this.mockPackage.Path}/linux-x64/fio {this.mockPackage.Path}/linux-x64/" +
109+
Assert.IsTrue(arguments.Equals($"{this.mockPackage.Path}/linux-x64/fio {this.mockFixture.PlatformSpecifics.GetScriptPath("fio")}/updated/" +
110110
$"{nameof(FioMultiThroughputExecutor)}" +
111111
$"{executor.Parameters[nameof(FioMultiThroughputExecutor.TemplateJobFile)]} " +
112112
$"--section initrandomio --section initsequentialio " +
@@ -185,7 +185,7 @@ public async Task FioMultiThroughputExecutorExecutesExpectedCommandLine()
185185
if (!arguments.Contains("chmod"))
186186
{
187187
executions++;
188-
Assert.IsTrue(arguments.Equals($"{this.mockPackage.Path}/linux-x64/fio {this.mockPackage.Path}/linux-x64/" +
188+
Assert.IsTrue(arguments.Equals($"{this.mockPackage.Path}/linux-x64/fio {this.mockFixture.PlatformSpecifics.GetScriptPath("fio")}/updated/" +
189189
$"{nameof(FioMultiThroughputExecutor)}" +
190190
$"{executor.Parameters[nameof(FioMultiThroughputExecutor.TemplateJobFile)]}" +
191191
$" --section randomreader --section randomwriter --section sequentialwriter --time_based --output-format=json --thread --fallocate=none"));
@@ -360,7 +360,7 @@ public async Task FioMultiThroughputSucceedsIfGroupIDIsRemoved()
360360
if (!arguments.Contains("chmod"))
361361
{
362362
executions++;
363-
Assert.IsTrue(arguments.Equals($"{this.mockPackage.Path}/linux-x64/fio {this.mockPackage.Path}/linux-x64/" +
363+
Assert.IsTrue(arguments.Equals($"{this.mockPackage.Path}/linux-x64/fio {this.mockFixture.PlatformSpecifics.GetScriptPath("fio")}/updated/" +
364364
$"{nameof(FioMultiThroughputExecutor)}" +
365365
$"{executor.Parameters[nameof(FioMultiThroughputExecutor.TemplateJobFile)]}" +
366366
$" --section randomreader --section randomwriter --section sequentialwriter --time_based --output-format=json --thread --fallocate=none"));
@@ -388,7 +388,7 @@ public async Task FioMultiThroughputSucceedsIfGroupIDHasBadCasing()
388388
if (!arguments.Contains("chmod"))
389389
{
390390
executions++;
391-
Assert.IsTrue(arguments.Equals($"{this.mockPackage.Path}/linux-x64/fio {this.mockPackage.Path}/linux-x64/" +
391+
Assert.IsTrue(arguments.Equals($"{this.mockPackage.Path}/linux-x64/fio {this.mockFixture.PlatformSpecifics.GetScriptPath("fio")}/updated/" +
392392
$"{nameof(FioMultiThroughputExecutor)}" +
393393
$"{executor.Parameters[nameof(FioMultiThroughputExecutor.TemplateJobFile)]}" +
394394
$" --section randomreader --section randomwriter --section sequentialwriter --time_based --output-format=json --thread --fallocate=none"));

src/VirtualClient/VirtualClient.Actions/FIO/FioExecutor.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel
295295

296296
if (!string.IsNullOrEmpty(this.JobFiles))
297297
{
298-
this.CommandLine = await this.GetCommandForJobFilesAsync(cancellationToken);
298+
this.CommandLine = this.GetCommandForJobFilesAsync(cancellationToken);
299299
}
300300

301301
// Apply parameters to the FIO command line options.
@@ -964,9 +964,15 @@ private string SanitizeFilePath(string filePath)
964964
return sanitizedFilePath;
965965
}
966966

967-
private async Task<string> GetCommandForJobFilesAsync(CancellationToken cancellationToken)
967+
private string GetCommandForJobFilesAsync(CancellationToken cancellationToken)
968968
{
969-
DependencyPath workloadPackage = await this.GetPlatformSpecificPackageAsync(this.PackageName, cancellationToken);
969+
string jobFileFolder = this.PlatformSpecifics.GetScriptPath("fio");
970+
string updatedJobFileFolder = Path.Combine(jobFileFolder, "updated");
971+
972+
if (!this.SystemManagement.FileSystem.Directory.Exists(updatedJobFileFolder))
973+
{
974+
this.SystemManagement.FileSystem.Directory.CreateDirectory(updatedJobFileFolder);
975+
}
970976

971977
string command = string.Empty;
972978
string[] templateJobFilePaths = this.JobFiles.Split(new char[] { ';', ',' });
@@ -975,7 +981,7 @@ private async Task<string> GetCommandForJobFilesAsync(CancellationToken cancella
975981
{
976982
// Create/update new job file at runtime.
977983
string templateJobFileName = Path.GetFileName(templateJobFilePath);
978-
string updatedJobFilePath = this.PlatformSpecifics.Combine(workloadPackage.Path, templateJobFileName);
984+
string updatedJobFilePath = this.PlatformSpecifics.Combine(jobFileFolder, "updated", templateJobFileName);
979985
this.CreateOrUpdateJobFile(templateJobFilePath, updatedJobFilePath);
980986

981987
// Update command to include the new job file.

src/VirtualClient/VirtualClient.Actions/FIO/FioMultiThroughputExecutor.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace VirtualClient.Actions
55
{
66
using System;
77
using System.Collections.Generic;
8+
using System.IO;
89
using System.Linq;
910
using System.Threading;
1011
using System.Threading.Tasks;
@@ -543,11 +544,16 @@ private async Task ExecuteWorkloadAsync(string testName, Dictionary<string, ICon
543544
telemetryContext.AddContext(nameof(ioEngine), ioEngine);
544545
telemetryContext.AddContext(nameof(this.TemplateJobFile), this.TemplateJobFile);
545546

546-
DependencyPath workloadPackage = await this.GetPlatformSpecificPackageAsync(this.PackageName, cancellationToken);
547-
548547
string jobFileFolder = this.PlatformSpecifics.GetScriptPath("fio");
548+
string updatedJobFileFolder = Path.Combine(jobFileFolder, "updated");
549+
550+
if (!this.SystemManagement.FileSystem.Directory.Exists(updatedJobFileFolder))
551+
{
552+
this.SystemManagement.FileSystem.Directory.CreateDirectory(updatedJobFileFolder);
553+
}
554+
549555
string templateJobFilePath = this.PlatformSpecifics.Combine(jobFileFolder, this.TemplateJobFile);
550-
string jobFilePath = this.PlatformSpecifics.Combine(workloadPackage.Path, nameof(FioMultiThroughputExecutor) + this.TemplateJobFile);
556+
string jobFilePath = this.PlatformSpecifics.Combine(jobFileFolder, "updated", nameof(FioMultiThroughputExecutor) + this.TemplateJobFile);
551557

552558
this.CreateOrUpdateJobFile(templateJobFilePath, jobFilePath);
553559

src/VirtualClient/VirtualClient.Main/profiles/PERF-IO-FIO-DISCOVERY.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,10 @@
492492
"Type": "LinuxPackageInstallation",
493493
"Parameters": {
494494
"Scenario": "InstallLinuxPackages",
495-
"Packages-Apt": "libaio1,libaio-dev",
496-
"Packages-Dnf": "libaio,libaio-devel,lshw,parted",
497-
"Packages-Yum": "libaio,libaio-devel",
498-
"Packages-Zypper": "libaio1,libaio-dev"
495+
"Packages-Apt": "fio,libaio-dev",
496+
"Packages-Dnf": "fio,libaio-devel,lshw,parted",
497+
"Packages-Yum": "fio,libaio-devel",
498+
"Packages-Zypper": "fio,libaio-dev"
499499
}
500500
},
501501
{
@@ -509,6 +509,7 @@
509509
"Type": "DependencyPackageInstallation",
510510
"Parameters": {
511511
"Scenario": "InstallFIOPackage",
512+
"SupportedPlatforms": "win-x64",
512513
"BlobContainer": "packages",
513514
"BlobName": "fio.3.30.0.zip",
514515
"PackageName": "fio",

src/VirtualClient/VirtualClient.Main/profiles/PERF-IO-FIO-MULTITHROUGHPUT.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@
7575
"Type": "LinuxPackageInstallation",
7676
"Parameters": {
7777
"Scenario": "InstallLinuxPackages",
78-
"Packages-Apt": "libaio1,libaio-dev",
79-
"Packages-Dnf": "libaio,libaio-devel,lshw,parted",
80-
"Packages-Yum": "libaio,libaio-devel",
81-
"Packages-Zypper": "libaio1,libaio-dev"
78+
"Packages-Apt": "fio,libaio-dev",
79+
"Packages-Dnf": "fio,libaio-devel,lshw,parted",
80+
"Packages-Yum": "fio,libaio-devel",
81+
"Packages-Zypper": "fio,libaio-dev"
8282
}
8383
},
8484
{
@@ -92,6 +92,7 @@
9292
"Type": "DependencyPackageInstallation",
9393
"Parameters": {
9494
"Scenario": "InstallFIOPackage",
95+
"SupportedPlatforms": "win-x64",
9596
"BlobContainer": "packages",
9697
"BlobName": "fio.3.30.0.zip",
9798
"PackageName": "fio",

src/VirtualClient/VirtualClient.Main/profiles/PERF-IO-FIO-OLTP.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,10 @@
192192
"Type": "LinuxPackageInstallation",
193193
"Parameters": {
194194
"Scenario": "InstallLinuxPackages",
195-
"Packages-Apt": "libaio1,libaio-dev",
196-
"Packages-Dnf": "libaio,libaio-devel,lshw,parted",
197-
"Packages-Yum": "libaio,libaio-devel",
198-
"Packages-Zypper": "libaio1,libaio-dev"
195+
"Packages-Apt": "fio,libaio-dev",
196+
"Packages-Dnf": "fio,libaio-devel,lshw,parted",
197+
"Packages-Yum": "fio,libaio-devel",
198+
"Packages-Zypper": "fio,libaio-dev"
199199
}
200200
},
201201
{
@@ -208,6 +208,7 @@
208208
"Type": "DependencyPackageInstallation",
209209
"Parameters": {
210210
"Scenario": "InstallFIOPackage",
211+
"SupportedPlatforms": "win-x64",
211212
"BlobContainer": "packages",
212213
"BlobName": "fio.3.30.0.zip",
213214
"PackageName": "fio",

0 commit comments

Comments
 (0)