Skip to content

Conversation

@stefanadranca
Copy link
Collaborator

@stefanadranca stefanadranca commented Mar 13, 2024

Motivation:

The first step in implementing QPS testing for V2 is to add the proto files representing the services and messages used in QPS and generating the code for them.

Modifications:

  • Modified the fetch script to add the proto files we need
  • Modified the generate script to generate code for them
  • Created executable target for QPS worker

Result:

We can start implementing the performance worker.

Motivation:

The first step in implementing QPS testing for V2 is to add the proto files representing
the services and messages used in QPS and generating the code for them.

Modifications:

- Modified the fetch script to add the proto files we need
- Modified the generate script to generate code for them
-Created executable target for QPS worker

Result:

We can start implementing the performance worker.
@stefanadranca stefanadranca requested a review from glbrntt March 13, 2024 11:00
@stefanadranca stefanadranca marked this pull request as ready for review March 13, 2024 11:00
Protos/fetch.sh Outdated

# Clone the grpc and google protos into the staging area.
git clone --depth 1 https://github.com/grpc/grpc-proto "$checkouts/grpc-proto"
git clone --depth 2 https://github.com/grpc/grpc-proto "$checkouts/grpc-proto"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why did the depth change to 2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, I left it by mistake in the PR. (it's from something I tried but wasn't necessary)

Comment on lines 34 to 37
mkdir -p "$upstream/grpc"
mkdir -p "$upstream/google"
mkdir -p "$upstream/grpc/testing"
mkdir -p "$upstream/grpc/core"
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit, we no longer need to mkdir grpc if we make subdirectories within it:

Suggested change
mkdir -p "$upstream/grpc"
mkdir -p "$upstream/google"
mkdir -p "$upstream/grpc/testing"
mkdir -p "$upstream/grpc/core"
mkdir -p "$upstream/google"
mkdir -p "$upstream/grpc/testing"
mkdir -p "$upstream/grpc/core"

done
}

function generate_qps_code {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we call this generate_worker_service? The previous naming we used was qps, but I'm not sure where that actually came from.


local output="$root/Sources/performance-worker/Generated"

generate_message "$here/upstream/grpc/core/stats.proto" "$here/upstream" "$output" "Visibility=Internal" "FileNaming=PathToUnderscores"
Copy link
Collaborator

Choose a reason for hiding this comment

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

here we use "FileNaming=PathToUnderscores" but below we use "FileNaming=DropPath" – why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There are 2 stat.proto file - one in grpc/core and one in grpc/testing. As all the other .proto files are located within 'grpc/testing' I was thinking we can drop the path from their names, and keep the path only for the 'stats.proto' file from the other module, to differentiate the 2 files containing generated code for the 2 'stats.proto' files.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, I didn't realise there were two, thanks for explaining. In that case I'd rather we stick to one naming style if possible.


for proto in "${protos[@]}"; do
generate_message "$proto" "$here/upstream" "$output" "Visibility=Internal" "FileNaming=DropPath"
generate_grpc "$proto" "$here/upstream/" "$output" "Visibility=Internal" "Server=true" "_V2=true" "FileNaming=DropPath"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
generate_grpc "$proto" "$here/upstream/" "$output" "Visibility=Internal" "Server=true" "_V2=true" "FileNaming=DropPath"
generate_grpc "$proto" "$here/upstream" "$output" "Visibility=Internal" "Server=true" "_V2=true" "FileNaming=DropPath"

Comment on lines 212 to 214
)

local output="$root/Sources/performance-worker/Generated"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
)
local output="$root/Sources/performance-worker/Generated"
)
local output="$root/Sources/performance-worker/Generated"

@stefanadranca stefanadranca requested a review from glbrntt March 13, 2024 14:39

for proto in "${protos[@]}"; do
generate_message "$proto" "$here/upstream" "$output" "Visibility=Internal" "FileNaming=PathToUnderscores"
generate_grpc "$proto" "$here/upstream" "$output" "Visibility=Internal" "Server=true" "_V2=true" "FileNaming=PathToUnderscores"
Copy link
Collaborator

Choose a reason for hiding this comment

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

We're actually generating client and server here even though we only set Server=true (true is the default for both client and server).

I think we only need to generate the server for worker_service.proto but need both for benchmark_service.proto.

Copy link
Collaborator

Choose a reason for hiding this comment

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

(Sorry, I didn't pick up on this in the last review!)

@stefanadranca stefanadranca requested a review from glbrntt March 13, 2024 15:09
@stefanadranca stefanadranca added the version/v2 Relates to v2 label Mar 13, 2024
@stefanadranca stefanadranca merged commit 53e2739 into grpc:main Mar 13, 2024
@gjcairo gjcairo added semver/none No version bump required. and removed semver/none No version bump required. labels Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

version/v2 Relates to v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants