Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboarding Kafka benchmark workload [Windows] #259

Conversation

mohitgole
Copy link

@mohitgole mohitgole commented Feb 2, 2024

Added kafka workload support for windows x64 and arm64.

  1. Added server/client executors.
  2. Added producer/consumer parsers.
  3. Added unit tests.
  4. Added functional tests.
  5. Added documentation.

Note: Support for linux OS will be raised post current windows PR

…o users/mohitgole/kafka-workload-onboard
…o users/mohitgole/kafka-workload-onboard
…o users/mohitgole/kafka-workload-onboard
…o users/mohitgole/kafka-workload-onboard
…th latest changes in JDKPackageDependencyInstallation
@mohitgole mohitgole marked this pull request as ready for review February 2, 2024 10:59
"Parameters": {
"Scenario": "DownloadKafkaPackage",
"BlobContainer": "packages",
"BlobName": "kafka_2.13-3.6.1.zip",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document how this was packaged? And is it a 2.13 version or 3.6.1 version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so here 2.13 is scala version and 3.6.1 is kafka version.

<ItemGroup>
<ScriptFiles Include="$(RepoPath)\out\scripts\**\*.*" />
</ItemGroup>
<Target Name="CopyInScriptsToPublishDirectory" AfterTargets="Publish">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm your tab is 4 spaces.

@@ -292,6 +292,11 @@ protected virtual IServiceCollection InitializeDependencies(string[] args)
this.LoggingLevel = LogLevel.Trace;
}

if (this.Debug)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have this in, why do you need to add it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this looks like something came from merge conflict. Will remove it.

@@ -108,7 +113,9 @@ public static class VirtualClientComponentExtensions
CancellationToken cancellationToken,
bool runElevated = false,
string username = null,
Action<IProcessProxy> beforeExecution = null)
Action<IProcessProxy> beforeExecution = null,
TimeSpan? timeout = null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know why this change was needed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, creating similar method in KafkaExecutor and removing change in VirtualClientComponentExtensions.

/// </summary>
[UnixCompatible]
[WindowsCompatible]
public class KafkaExecutor : VirtualClientComponent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make it abstract if not intended for direct use and call it like KafkaBaseExecutor

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah.

public void KafkaProducerMetricsParserThrowIfInvalidOutputFormat()
{
string workingDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string outputPath = Path.Combine(workingDirectory, @"Examples\Kafka\KafkaProducerResultExample.txt");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use platform agnostic Path.Combine so that this works in linux unit test

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes made the change.

@@ -91,6 +91,7 @@ for using them.
| [Stressapptest](https://microsoft.github.io/VirtualClient/docs/workloads/stressapptest) | Fault Tolerance | linux-x64, linux-arm64 | [Apache-2.0](https://github.com/stressapptest/stressapptest/blob/master/NOTICE) |
| [Stress-ng](https://microsoft.github.io/VirtualClient/docs/workloads/stress-ng) | Fault Tolerance | linux-x64, linux-arm64 | [GPL-2.0](https://github.com/ColinIanKing/stress-ng/blob/master/COPYING) |
| [SuperBench](https://microsoft.github.io/VirtualClient/docs/workloads/superbenchmark) | Machine Learning | linux-x64 | [MIT](https://github.com/microsoft/superbenchmark/blob/main/LICENSE) |
| [Kafka](../workloads/kafka/kafka.md) | Streaming data | win-x64, win-arm64 | [Apache License 2.0](https://github.com/apache/kafka/blob/trunk/LICENSE) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just Apache-2.0 to align with the others

call :concat "%BASE_DIR%\libs\*;"
```

For reference [The input line is too long](https://github.com/kafka-dev/kafka/issues/61)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for documenting this


``` bash
# Single System (environment layout not required)
./VirtualClient --profile=PERF-KAFKA.json --system=Juno --timeout=1440
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all Juno references. If you find it elsewhere please remove too.

@@ -0,0 +1,498 @@
using System;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add mit header please

/// <summary>
/// Port on which server runs.
/// </summary>
public int Port
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For workloads like these we can have a default port so profile can be shorter.


private async Task ConfigurePropertiesFileAsync(EventContext telemetryContext, CancellationToken cancellationToken)
{
string logDir = "/tmp";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this PR have Linux support or not? Just to make sure we are coding for both OS in the future

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current PR targets support for windows. Linux will be tested and raised as separate PR.

this.KafkaPackagePath = kafkaPackage.Path;

switch (this.Platform)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe you would need this. You don't need cmd to act as a process exe

using VirtualClient.Contracts;
using VirtualClient.Contracts.Metadata;

namespace VirtualClient.Actions.Kafka
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For namespace we can just to VirtualClient.Actions. Apply thoughout

Copy link
Contributor

@yangpanMS yangpanMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be ok if you move this PR to the ADO so that we can vet it in QoS_VC internally first?

@mohitgole
Copy link
Author

Would you be ok if you move this PR to the ADO so that we can vet it in QoS_VC internally first?

Created another ADO PR.

@yangpanMS yangpanMS closed this Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants