diff --git a/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchClientExecutor.cs b/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchClientExecutor.cs index b7b17d1a3..239e92cc9 100644 --- a/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchClientExecutor.cs +++ b/src/VirtualClient/VirtualClient.Actions/Sysbench/SysbenchClientExecutor.cs @@ -215,11 +215,10 @@ private async Task RunOLTPWorkloadAsync(EventContext telemetryContext, Cancellat this.sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --workload {this.Workload} --threadCount {threadCount} --tableCount {tableCount} --recordCount {recordCount} "; this.sysbenchExecutionArguments = this.sysbenchLoggingArguments + $"--hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}"; - string command = "python3"; string script = $"{this.SysbenchPackagePath}/run-workload.py "; using (IProcessProxy process = await this.ExecuteCommandAsync( - command, + PythonCommand, script + this.sysbenchExecutionArguments, this.SysbenchPackagePath, telemetryContext, @@ -244,11 +243,10 @@ private async Task RunTPCCWorkloadAsync(EventContext telemetryContext, Cancellat this.sysbenchLoggingArguments = $"--dbName {this.DatabaseName} --databaseSystem {this.DatabaseSystem} --benchmark {this.Benchmark} --workload tpcc --threadCount {threadCount} --tableCount {tableCount} --warehouses {warehouseCount} "; this.sysbenchExecutionArguments = this.sysbenchLoggingArguments + $"--hostIpAddress {this.ServerIpAddress} --durationSecs {this.Duration.TotalSeconds} --password {this.SuperUserPassword}"; - string command = "python3"; string script = $"{this.SysbenchPackagePath}/run-workload.py "; using (IProcessProxy process = await this.ExecuteCommandAsync( - command, + PythonCommand, script + this.sysbenchExecutionArguments, this.SysbenchPackagePath, telemetryContext, diff --git a/src/VirtualClient/VirtualClient.Dependencies/MySqlServer/MySqlServerConfiguration.cs b/src/VirtualClient/VirtualClient.Dependencies/MySqlServer/MySqlServerConfiguration.cs index 707c6acf1..1331137d6 100644 --- a/src/VirtualClient/VirtualClient.Dependencies/MySqlServer/MySqlServerConfiguration.cs +++ b/src/VirtualClient/VirtualClient.Dependencies/MySqlServer/MySqlServerConfiguration.cs @@ -113,68 +113,6 @@ public bool InMemory /// protected ISystemManagement SystemManager { get; } - /* - /// - /// Client used to communicate with the hosted instance of the - /// Virtual Client API at server side. - /// - public IApiClient ServerApiClient { get; set; }*/ - - /* - /// - /// Server IpAddress on which MySQL Server runs. - /// - protected string ServerIpAddress { get; set; } - - /// - /// Initializes the environment for execution of the Sysbench workload. - /// - protected override async Task InitializeAsync(EventContext telemetryContext, CancellationToken cancellationToken) - { - DependencyPath workloadPackage = await this.GetPackageAsync(this.PackageName, cancellationToken).ConfigureAwait(false); - workloadPackage.ThrowIfNull(this.PackageName); - - DependencyPath package = await this.GetPlatformSpecificPackageAsync(this.PackageName, cancellationToken); - this.packageDirectory = package.Path; - - this.InitializeApiClients(telemetryContext, cancellationToken); - - if (this.IsMultiRoleLayout()) - { - ClientInstance clientInstance = this.GetLayoutClientInstance(); - string layoutIPAddress = clientInstance.IPAddress; - - this.ThrowIfLayoutClientIPAddressNotFound(layoutIPAddress); - this.ThrowIfRoleNotSupported(clientInstance.Role); - } - } - - /// - /// Initializes API client. - /// - protected void InitializeApiClients(EventContext telemetryContext, CancellationToken cancellationToken) - { - if (!cancellationToken.IsCancellationRequested) - { - IApiClientManager clientManager = this.Dependencies.GetService(); - - if (!this.IsMultiRoleLayout()) - { - this.ServerIpAddress = IPAddress.Loopback.ToString(); - this.ServerApiClient = clientManager.GetOrCreateApiClient(this.ServerIpAddress, IPAddress.Loopback); - } - else - { - ClientInstance serverInstance = this.GetLayoutClientInstances(ClientRole.Server).First(); - IPAddress.TryParse(serverInstance.IPAddress, out IPAddress serverIPAddress); - - this.ServerIpAddress = serverIPAddress.ToString(); - this.ServerApiClient = clientManager.GetOrCreateApiClient(this.ServerIpAddress, serverIPAddress); - this.RegisterToSendExitNotifications($"{this.TypeName}.ExitNotification", this.ServerApiClient); - } - } - }*/ - /// /// Installs MySQL /// @@ -193,13 +131,6 @@ protected override async Task ExecuteAsync(EventContext telemetryContext, Cancel DependencyPath package = await this.GetPlatformSpecificPackageAsync(this.PackageName, cancellationToken); this.packageDirectory = package.Path; - /*if (this.WaitForServer) - { - string serverstateId = $"{nameof(MySQLServerConfiguration)}-{this.Action}-action-success"; - ConfigurationState configurationState = await this.stateManager.GetStateAsync(serverstateId, cancellationToken) - .ConfigureAwait(false); - }*/ - if (!this.SkipInitialize) { if (configurationState == null) @@ -227,11 +158,6 @@ await this.DistributeMySQLDatabaseAsync(telemetryContext, cancellationToken) await this.SetMySQLGlobalVariableAsync(telemetryContext, cancellationToken) .ConfigureAwait(false); } - else if (this.Action == ConfigurationAction.TruncateDatabase) - { - await this.TruncateMySQLDatabaseAsync(telemetryContext, cancellationToken) - .ConfigureAwait(false); - } } } @@ -328,32 +254,6 @@ private async Task DistributeMySQLDatabaseAsync(EventContext telemetryContext, C } } - private async Task TruncateMySQLDatabaseAsync(EventContext telemetryContext, CancellationToken cancellationToken) - { - string arguments = $"{this.packageDirectory}/truncate-tables.py --dbName {this.DatabaseName}"; - - if (this.IsMultiRoleLayout()) - { - ClientInstance instance = this.Layout.GetClientInstance(this.AgentId); - string serverIps = (instance.Role == ClientRole.Server) ? "localhost" : this.GetServerIpAddress(); - arguments += $" --clientIps \"{serverIps}\""; - } - - using (IProcessProxy process = await this.ExecuteCommandAsync( - PythonCommand, - arguments, - Environment.CurrentDirectory, - telemetryContext, - cancellationToken)) - { - if (!cancellationToken.IsCancellationRequested) - { - await this.LogProcessDetailsAsync(process, telemetryContext, "MySQLServerConfiguration", logToFile: true); - process.ThrowIfDependencyInstallationFailed(process.StandardError.ToString()); - } - } - } - private async Task GetMySQLInnodbDirectoriesAsync(CancellationToken cancellationToken) { string diskPaths = string.Empty; @@ -452,13 +352,7 @@ internal class ConfigurationAction /// /// Distributes existing database to disks on the system /// - public const string DistributeDatabase = nameof(DistributeDatabase); - - /// - /// Truncates all tables existing in database - /// - public const string TruncateDatabase = nameof(TruncateDatabase); - + public const string DistributeDatabase = nameof(DistributeDatabase); } internal class ConfigurationState