diff --git a/VERSION b/VERSION index f6828e201..82bc7734a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.15.15 +1.15.18 \ No newline at end of file diff --git a/src/VirtualClient/VirtualClient.Actions/Memtier/MemtierBenchmarkClientExecutor.cs b/src/VirtualClient/VirtualClient.Actions/Memtier/MemtierBenchmarkClientExecutor.cs index ad7244418..1382fa4b3 100644 --- a/src/VirtualClient/VirtualClient.Actions/Memtier/MemtierBenchmarkClientExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/Memtier/MemtierBenchmarkClientExecutor.cs @@ -58,7 +58,6 @@ public MemtierBenchmarkClientExecutor(IServiceCollection dependencies, IDictiona // Ensure the duration is in integer (seconds) form. int duration = this.Duration; this.Parameters[nameof(this.Duration)] = duration; - this.processOutputDescriptions = new List(); } /// @@ -231,6 +230,7 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel { IPAddress ipAddress; List clientWorkloadTasks = new List(); + this.processOutputDescriptions = new List(); if (this.IsMultiRoleLayout()) { diff --git a/src/VirtualClient/VirtualClient.Contracts/PlatformSpecifics.cs b/src/VirtualClient/VirtualClient.Contracts/PlatformSpecifics.cs index 04a01b2ca..910999525 100644 --- a/src/VirtualClient/VirtualClient.Contracts/PlatformSpecifics.cs +++ b/src/VirtualClient/VirtualClient.Contracts/PlatformSpecifics.cs @@ -5,6 +5,7 @@ namespace VirtualClient.Contracts { using System; using System.Collections.Generic; + using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text.RegularExpressions; @@ -237,7 +238,8 @@ public static bool IsFullyQualifiedPath(string path) /// public static bool IsRunningInContainer() { - return (Convert.ToBoolean(Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER")) == true); + // DOTNET does not properly recognize some containers. Adding /.dockerenv file as back up. + return (Convert.ToBoolean(Environment.GetEnvironmentVariable("DOTNET_RUNNING_IN_CONTAINER")) == true || File.Exists("/.dockerenv")); } /// diff --git a/src/VirtualClient/VirtualClient.Core/PackageManager.cs b/src/VirtualClient/VirtualClient.Core/PackageManager.cs index 4c8e6634f..573cb9965 100644 --- a/src/VirtualClient/VirtualClient.Core/PackageManager.cs +++ b/src/VirtualClient/VirtualClient.Core/PackageManager.cs @@ -5,6 +5,7 @@ namespace VirtualClient { using System; using System.Collections.Generic; + using System.Globalization; using System.IO; using System.IO.Abstractions; using System.IO.Compression; @@ -27,6 +28,11 @@ namespace VirtualClient /// public class PackageManager : IPackageManager, IDisposable { + /// + /// The metadata key for built-it toolsets/packages. + /// + public const string BuiltIn = "built-in"; + /// /// The name of the built-in package containing the lshw toolset. /// @@ -369,6 +375,7 @@ public Task> DiscoverPackagesAsync(CancellationToken if (toolsPackages?.Any() == true) { + PackageManager.SetAsBuiltInToolset(toolsPackages?.ToArray()); discoveredPackages.AddRange(toolsPackages); } @@ -703,9 +710,16 @@ public Task RegisterPackageAsync(DependencyPath package, CancellationToken cance return this.Logger.LogMessageAsync($"{nameof(PackageManager)}.RegisterPackage", LogLevel.Trace, telemetryContext, async () => { - string packageDirectory = Path.GetDirectoryName(package.Path); + // We register packages in the packages directory by default. Built-in toolsets are registered + // in the tools directory. + string registrationDirectory = this.PlatformSpecifics.GetPackagePath(); + if (PackageManager.IsBuiltInToolset(package)) + { + registrationDirectory = this.PlatformSpecifics.GetToolsPath(); + } + string registrationFileName = $"{package.Name.ToLowerInvariant()}{PackageManager.VCPkgRegExtension}"; - string registrationFilePath = this.PlatformSpecifics.Combine(packageDirectory, registrationFileName); + string registrationFilePath = this.PlatformSpecifics.Combine(registrationDirectory, registrationFileName); string registrationFileContent = package.ToJson(); await RetryPolicies.FileOperations.ExecuteAsync(() => @@ -874,6 +888,27 @@ protected virtual async Task ExtractTarballAsync(string archiveFilepath, string } } + private static bool IsBuiltInToolset(DependencyPath package) + { + if (package.Metadata.TryGetValue(PackageManager.BuiltIn, out IConvertible builtIn)) + { + return true; + } + + return false; + } + + private static void SetAsBuiltInToolset(params DependencyPath[] packages) + { + if (packages?.Any() == true) + { + foreach (DependencyPath package in packages) + { + package.Metadata[PackageManager.BuiltIn] = true; + } + } + } + private void CreateDirectoryIfNotExists(string directoryPath) { if (!this.FileSystem.Directory.Exists(directoryPath)) diff --git a/src/VirtualClient/VirtualClient.Core/SystemManagementExtensions.cs b/src/VirtualClient/VirtualClient.Core/SystemManagementExtensions.cs index f2900ee1d..7c12ed93c 100644 --- a/src/VirtualClient/VirtualClient.Core/SystemManagementExtensions.cs +++ b/src/VirtualClient/VirtualClient.Core/SystemManagementExtensions.cs @@ -70,7 +70,7 @@ public static async Task MakeFileExecutableAsync(this ISystemManagement systemMa if (!systemManagement.FileSystem.File.Exists(filePath)) { - throw new DependencyException($"The binary at path '{filePath}' does not exist.", ErrorReason.WorkloadDependencyMissing); + throw new DependencyException($"The file at path '{filePath}' does not exist.", ErrorReason.WorkloadDependencyMissing); } switch (platform) diff --git a/src/VirtualClient/VirtualClient.Packaging/nuspec/VirtualClient.nuspec b/src/VirtualClient/VirtualClient.Packaging/nuspec/VirtualClient.nuspec index b0c2af671..401940c68 100644 --- a/src/VirtualClient/VirtualClient.Packaging/nuspec/VirtualClient.nuspec +++ b/src/VirtualClient/VirtualClient.Packaging/nuspec/VirtualClient.nuspec @@ -26,25 +26,25 @@ win-x64 ============================================================================================= --> - + - + - + - + \ No newline at end of file diff --git a/website/package-lock.json b/website/package-lock.json index 9d5b03b58..c1da89114 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -3574,26 +3574,6 @@ "@types/ms": "*" } }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "license": "MIT", - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "license": "MIT", - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -6734,10 +6714,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", - "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", - "license": "MIT", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" @@ -12125,10 +12104,9 @@ "license": "MIT" }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", - "license": "MIT", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -16405,12 +16383,10 @@ "license": "Apache-2.0" }, "node_modules/webpack": { - "version": "5.92.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.0.tgz", - "integrity": "sha512-Bsw2X39MYIgxouNATyVpCNVWBCuUwDgWtN78g6lSdPJRLaQ/PUVm/oXcaRAyY/sMFoKFQrsPeqvTizWtq7QPCA==", - "license": "MIT", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", @@ -16419,7 +16395,7 @@ "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.17.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", diff --git a/website/yarn.lock b/website/yarn.lock index c6e22b17d..862fda219 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -2055,22 +2055,6 @@ dependencies: "@types/ms" "*" -"@types/eslint-scope@^3.7.3": - version "3.7.7" - resolved "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz" - integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== - dependencies: - "@types/eslint" "*" - "@types/estree" "*" - -"@types/eslint@*": - version "8.56.10" - resolved "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz" - integrity sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ== - dependencies: - "@types/estree" "*" - "@types/json-schema" "*" - "@types/estree-jsx@^1.0.0": version "1.0.5" resolved "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz" @@ -2161,7 +2145,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -4061,10 +4045,10 @@ encodeurl@~1.0.2: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== -enhanced-resolve@^5.17.0: - version "5.17.0" - resolved "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz" - integrity sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA== +enhanced-resolve@^5.17.1: + version "5.17.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" + integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -6535,9 +6519,9 @@ micromark@^4.0.0: micromark-util-types "^2.0.0" micromatch@^4.0.2, micromatch@^4.0.4, micromatch@^4.0.5: - version "4.0.7" - resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz" - integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== + version "4.0.8" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" + integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== dependencies: braces "^3.0.3" picomatch "^2.3.1" @@ -8895,11 +8879,10 @@ webpack-sources@^3.2.3: integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== webpack@^5.88.1: - version "5.92.0" - resolved "https://registry.npmjs.org/webpack/-/webpack-5.92.0.tgz" - integrity sha512-Bsw2X39MYIgxouNATyVpCNVWBCuUwDgWtN78g6lSdPJRLaQ/PUVm/oXcaRAyY/sMFoKFQrsPeqvTizWtq7QPCA== + version "5.94.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.94.0.tgz#77a6089c716e7ab90c1c67574a28da518a20970f" + integrity sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg== dependencies: - "@types/eslint-scope" "^3.7.3" "@types/estree" "^1.0.5" "@webassemblyjs/ast" "^1.12.1" "@webassemblyjs/wasm-edit" "^1.12.1" @@ -8908,7 +8891,7 @@ webpack@^5.88.1: acorn-import-attributes "^1.9.5" browserslist "^4.21.10" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.17.0" + enhanced-resolve "^5.17.1" es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0"