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

test: enables local tracing in e2e benchmark tests #3514

Merged
merged 20 commits into from
Jun 4, 2024

Conversation

staheri14
Copy link
Contributor

@staheri14 staheri14 commented May 29, 2024

Closes #3318
It enables 1) local tracing in validators knuu instances 2) pushing locally traced data from validators to a S3 bucket, given that proper configs are passed via environment vars.

Additionally, it includes changes that:

  • Allow specifying the number of blobs per sequence parameter for TX clients (previously fixed at 5).
  • Log information about the presence of Grafana environment variables.

How to run

The E2EThroughput has been tested and I confirm both local tracing and pushing traces work correctly in knuu instances. To run the test:

go run ./test/e2e/benchmark  -v

You will see the consensus_round_state.jsonl file added to the root directory of the project, indicating the local tracing is operational in the validators' knuu instances.

In order to push traces to a S3 bucket, you would need to pass S3 bucket push configs as env variables. I also tested this feature, and it works fine. It downloads the traced data and places them under ./traces/ folder in the project root.

@staheri14 staheri14 self-assigned this May 29, 2024
@staheri14 staheri14 added WS: Big Blonks 🔭 Improving consensus critical gossiping protocols testing items that are strictly related to adding or extending test coverage labels May 29, 2024
@staheri14 staheri14 marked this pull request as ready for review May 29, 2024 20:48
@staheri14 staheri14 requested a review from a team as a code owner May 29, 2024 20:48
@staheri14 staheri14 requested review from rach-id and evan-forbes and removed request for a team May 29, 2024 20:48
Copy link
Contributor

coderabbitai bot commented May 29, 2024

Walkthrough

The changes introduce data tracing capabilities to the e2e tests by integrating the trace package from Tendermint. This involves updating various functions and structures to handle new tracing configurations, such as LocalTracingType, PushTrace, and DownloadTraces. Additionally, the code includes logic to manage tracing data, either by pulling from local nodes or downloading from S3, and updating the test network setup to accommodate these features.

Changes

Files Change Summaries
benchmark.go, throughput.go Added trace import, updated SetupNodes and E2EThroughput functions to handle new tracing configurations (LocalTracingType, PushTrace, DownloadTraces).
manifest.go Updated Manifest struct to include LocalTracingType, PushTrace, and DownloadTraces fields.
testnet/node.go Added trace and schema imports, tracingPort constant, traceProxyPort field, PullRoundStateTraces method, and updated NewNode and forwardPorts functions to handle tracing.
testnet/setup.go Added WithLocalTracing function to set tracing configuration in cfg.Instrumentation.
testnet/testnet.go Updated CreateGenesisNode, CreateTxClients, CreateTxClient, and CreateNode functions to include blobPerSequence parameter.
testnet/txsimNode.go Added blobsPerSeq parameter to CreateTxClient function and updated command construction.
testnet/util.go Added zerolog import and log statements in GetGrafanaInfoFromEnvVar function to provide information about Grafana environment variables.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant BenchmarkTest
    participant Testnet
    participant Node
    participant S3

    User ->> BenchmarkTest: Start e2e Test
    BenchmarkTest ->> Testnet: SetupNodes with tracing config
    Testnet ->> Node: CreateGenesisNode, CreateTxClients, CreateNode
    Node ->> BenchmarkTest: Return node setup status
    BenchmarkTest ->> Node: If LocalTracingType is "local", pull round state traces
    Node ->> Node: PullRoundStateTraces
    Node ->> BenchmarkTest: Return traces
    BenchmarkTest ->> S3: If PushTrace and DownloadTraces are enabled, download traces
    S3 ->> BenchmarkTest: Return downloaded traces
    BenchmarkTest ->> User: Return test results with tracing data
Loading

Assessment against linked issues

Objective (Issue #3318) Addressed Explanation
Integrate data tracing in e2e tests
Enable pulling data from local nodes
Enable downloading data from external servers
Modify test network setup to handle tracing

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@staheri14 staheri14 requested a review from rootulp May 29, 2024 20:48
@@ -49,6 +50,9 @@ func E2EThroughput() error {
Prometheus: true,
GovMaxSquareSize: appconsts.DefaultGovMaxSquareSize,
MaxBlockBytes: appconsts.DefaultMaxBytes,
LocalTracingType: "local",
PushTrace: false,
Copy link
Contributor Author

@staheri14 staheri14 May 29, 2024

Choose a reason for hiding this comment

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

[To reviewers] If you wish to push traced data to a s3 bucket, set PushTrace to true.

@staheri14
Copy link
Contributor Author

The govulncheck failure is unrelated to the content of this PR and needs to be addressed separately.

@staheri14 staheri14 changed the title test: enables local tracing in benchmark tests test: enables local tracing in e2e benchmark tests May 29, 2024
rootulp
rootulp previously approved these changes May 30, 2024
test/e2e/benchmark/benchmark.go Outdated Show resolved Hide resolved
test/e2e/benchmark/manifest.go Outdated Show resolved Hide resolved
test/e2e/benchmark/manifest.go Outdated Show resolved Hide resolved
test/e2e/testnet/node.go Outdated Show resolved Hide resolved
rootulp
rootulp previously approved these changes May 30, 2024
evan-forbes
evan-forbes previously approved these changes May 30, 2024
@celestia-bot celestia-bot requested review from a team and ramin and removed request for a team June 3, 2024 21:51
@staheri14 staheri14 dismissed stale reviews from evan-forbes and rootulp via 102272e June 3, 2024 21:53
@celestia-bot celestia-bot requested a review from a team June 3, 2024 21:54
@staheri14 staheri14 enabled auto-merge (squash) June 3, 2024 22:00
@celestia-bot celestia-bot requested a review from a team June 4, 2024 21:58
@staheri14 staheri14 disabled auto-merge June 4, 2024 21:58
@staheri14 staheri14 merged commit 32b391f into main Jun 4, 2024
32 of 33 checks passed
@staheri14 staheri14 deleted the sanaz/add-tracing-configs branch June 4, 2024 23:08
staheri14 added a commit that referenced this pull request Jun 19, 2024
Closes #3480 
This PR backports many optimizations introduced in the big block tests
via #3493 to the `main`
branch.

Will be ready for review after merging
#3514

---------

Co-authored-by: Evan Forbes <[email protected]>
0xchainlover pushed a commit to celestia-org/celestia-app that referenced this pull request Aug 1, 2024
Closes #3480 
This PR backports many optimizations introduced in the big block tests
via celestiaorg/celestia-app#3493 to the `main`
branch.

Will be ready for review after merging
celestiaorg/celestia-app#3514

---------

Co-authored-by: Evan Forbes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing items that are strictly related to adding or extending test coverage WS: Big Blonks 🔭 Improving consensus critical gossiping protocols
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrating data tracing in e2e tests
4 participants