Fix typos and format of LoadTest generator output. (#26149)

This change fixes typos and makes minor changes to the format of the generated yaml files for LoadTest configuration (embedded scenarios end in newline, and element lists are indented). The templates generated earlier are also updated.
reviewable/pr26152/r1
Paulo Castello da Costa 4 years ago committed by GitHub
parent d61db49b48
commit 44a4a2ea62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      tools/run_tests/performance/README.md
  2. 16
      tools/run_tests/performance/loadtest_config.py
  3. 11
      tools/run_tests/performance/loadtest_template.py
  4. 476
      tools/run_tests/performance/templates/loadtest_template_basic_all_languages.yaml

@ -29,8 +29,8 @@ server, it might be useful to run workers manually.
2. Connect to each worker machine and start up a benchmark worker with a
"driver_port".
- For example, to start the grpc-go benchmark worker: [grpc-go worker
main.go](https://github.com/grpc/grpc-go/blob/master/benchmark/worker/main.go)
- For example, to start the grpc-go benchmark worker:
[grpc-go worker main.go](https://github.com/grpc/grpc-go/blob/master/benchmark/worker/main.go)
--driver_port <driver_port>
#### Commands to start workers in different languages:
@ -347,7 +347,7 @@ $ ./tools/run_tests/performance/loadtest_template.py \
--name basic_all_languages
```
The script `loadest_template.py` takes the following options:
The script `loadtest_template.py` takes the following options:
- `-i`, `--inputs`<br> Space-separated list of the names of input files
containing LoadTest configurations. May be repeated.

@ -150,7 +150,8 @@ def gen_loadtest_configs(
uniq = (uniquifier_elements +
[run_index] if run_index else uniquifier_elements)
name = loadtest_name(prefix, scenario['name'], uniq)
scenario_str = json.dumps({'scenarios': scenario}, indent=' ')
scenario_str = json.dumps({'scenarios': scenario},
indent=' ') + '\n'
config = copy.deepcopy(base_config)
@ -206,7 +207,7 @@ def parse_key_value_args(args: Optional[Iterable[str]]) -> Dict[str, str]:
return d
def config_dumper(header_comment: str) -> Type[yaml.Dumper]:
def config_dumper(header_comment: str) -> Type[yaml.SafeDumper]:
"""Returns a custom dumper to dump configurations in the expected format."""
class ConfigDumper(yaml.SafeDumper):
@ -217,6 +218,15 @@ def config_dumper(header_comment: str) -> Type[yaml.Dumper]:
self.write_indent()
self.write_indicator(header_comment, need_whitespace=False)
def expect_block_sequence(self):
super().expect_block_sequence()
self.increase_indent()
def expect_block_sequence_item(self, first=False):
if isinstance(self.event, yaml.SequenceEndEvent):
self.indent = self.indents.pop()
super().expect_block_sequence_item(first)
def str_presenter(dumper, data):
if '\n' in data:
return dumper.represent_scalar('tag:yaml.org,2002:str',
@ -266,7 +276,7 @@ def main() -> None:
argp.add_argument(
'-d',
action='store_true',
help='Use creation date and time as an addditional uniquifier element.')
help='Use creation date and time as an additional uniquifier element.')
argp.add_argument('-a',
'--annotation',
action='append',

@ -122,7 +122,7 @@ def loadtest_template(
return template
def template_dumper(header_comment: str) -> Type[yaml.Dumper]:
def template_dumper(header_comment: str) -> Type[yaml.SafeDumper]:
"""Returns a custom dumper to dump templates in the expected format."""
class TemplateDumper(yaml.SafeDumper):
@ -133,6 +133,15 @@ def template_dumper(header_comment: str) -> Type[yaml.Dumper]:
self.write_indent()
self.write_indicator(header_comment, need_whitespace=False)
def expect_block_sequence(self):
super().expect_block_sequence()
self.increase_indent()
def expect_block_sequence_item(self, first=False):
if isinstance(self.event, yaml.SequenceEndEvent):
self.indent = self.indents.pop()
super().expect_block_sequence_item(first)
return TemplateDumper

@ -14,246 +14,246 @@ metadata:
name: basic_all_languages
spec:
clients:
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: csharp
pool: ${client_pool}
run:
args:
- exec
- qps_worker/Grpc.IntegrationTesting.QpsWorker.dll
command:
- dotnet
- build:
args:
- build
- //test/cpp/qps:qps_worker
command:
- bazel
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: cxx
pool: ${client_pool}
run:
command:
- bazel-bin/test/cpp/qps/qps_worker
- build:
args:
- build
- -o
- /src/workspace/bin/worker
- ./benchmark/worker
command:
- go
clone:
gitRef: master
repo: https://github.com/grpc/grpc-go.git
language: go
pool: ${client_pool}
run:
command:
- /src/workspace/bin/worker
- build:
args:
- -PskipAndroid=true
- -PskipCodegen=true
- :grpc-benchmarks:installDist
command:
- gradle
clone:
gitRef: master
repo: https://github.com/grpc/grpc-java.git
language: java
pool: ${client_pool}
run:
command:
- benchmarks/build/install/grpc-benchmarks/bin/benchmark_worker
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc-node.git
language: node
pool: ${client_pool}
run:
args:
- -r
- ./test/fixtures/native_native.js
- test/performance/worker.js
- --benchmark_impl=grpc
command:
- node
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: php
pool: ${client_pool}
run:
command:
- bash
- /run_scripts/run_worker.sh
- build:
args:
- build
- //src/python/grpcio_tests/tests/qps:qps_worker
command:
- bazel
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: python
pool: ${client_pool}
run:
command:
- bazel-bin/src/python/grpcio_tests/tests/qps/qps_worker
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc
language: ruby
pool: ${client_pool}
run:
args:
- src/ruby/qps/worker.rb
command:
- ruby
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: csharp
pool: ${client_pool}
run:
args:
- exec
- qps_worker/Grpc.IntegrationTesting.QpsWorker.dll
command:
- dotnet
- build:
args:
- build
- //test/cpp/qps:qps_worker
command:
- bazel
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: cxx
pool: ${client_pool}
run:
command:
- bazel-bin/test/cpp/qps/qps_worker
- build:
args:
- build
- -o
- /src/workspace/bin/worker
- ./benchmark/worker
command:
- go
clone:
gitRef: master
repo: https://github.com/grpc/grpc-go.git
language: go
pool: ${client_pool}
run:
command:
- /src/workspace/bin/worker
- build:
args:
- -PskipAndroid=true
- -PskipCodegen=true
- :grpc-benchmarks:installDist
command:
- gradle
clone:
gitRef: master
repo: https://github.com/grpc/grpc-java.git
language: java
pool: ${client_pool}
run:
command:
- benchmarks/build/install/grpc-benchmarks/bin/benchmark_worker
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc-node.git
language: node
pool: ${client_pool}
run:
args:
- -r
- ./test/fixtures/native_native.js
- test/performance/worker.js
- --benchmark_impl=grpc
command:
- node
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: php
pool: ${client_pool}
run:
command:
- bash
- /run_scripts/run_worker.sh
- build:
args:
- build
- //src/python/grpcio_tests/tests/qps:qps_worker
command:
- bazel
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: python
pool: ${client_pool}
run:
command:
- bazel-bin/src/python/grpcio_tests/tests/qps/qps_worker
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc
language: ruby
pool: ${client_pool}
run:
args:
- src/ruby/qps/worker.rb
command:
- ruby
results:
bigQueryTable: ${big_query_table}
servers:
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: csharp
pool: ${server_pool}
run:
args:
- exec
- qps_worker/Grpc.IntegrationTesting.QpsWorker.dll
command:
- dotnet
- build:
args:
- build
- //test/cpp/qps:qps_worker
command:
- bazel
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: cxx
pool: ${server_pool}
run:
args:
- --server_port=10010
command:
- bazel-bin/test/cpp/qps/qps_worker
- build:
args:
- build
- -o
- /src/workspace/bin/worker
- ./benchmark/worker
command:
- go
clone:
gitRef: master
repo: https://github.com/grpc/grpc-go.git
language: go
pool: ${server_pool}
run:
command:
- /src/workspace/bin/worker
- build:
args:
- -PskipAndroid=true
- -PskipCodegen=true
- :grpc-benchmarks:installDist
command:
- gradle
clone:
gitRef: master
repo: https://github.com/grpc/grpc-java.git
language: java
pool: ${server_pool}
run:
command:
- benchmarks/build/install/grpc-benchmarks/bin/benchmark_worker
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc-node.git
language: node
pool: ${server_pool}
run:
args:
- -r
- ./test/fixtures/native_native.js
- test/performance/worker.js
- --benchmark_impl=grpc
command:
- node
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: php
pool: ${server_pool}
run:
command:
- bash
- /run_scripts/run_worker.sh
- build:
args:
- build
- //src/python/grpcio_tests/tests/qps:qps_worker
command:
- bazel
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: python
pool: ${server_pool}
run:
command:
- bazel-bin/src/python/grpcio_tests/tests/qps/qps_worker
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc
language: ruby
pool: ${server_pool}
run:
args:
- src/ruby/qps/worker.rb
command:
- ruby
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: csharp
pool: ${server_pool}
run:
args:
- exec
- qps_worker/Grpc.IntegrationTesting.QpsWorker.dll
command:
- dotnet
- build:
args:
- build
- //test/cpp/qps:qps_worker
command:
- bazel
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: cxx
pool: ${server_pool}
run:
args:
- --server_port=10010
command:
- bazel-bin/test/cpp/qps/qps_worker
- build:
args:
- build
- -o
- /src/workspace/bin/worker
- ./benchmark/worker
command:
- go
clone:
gitRef: master
repo: https://github.com/grpc/grpc-go.git
language: go
pool: ${server_pool}
run:
command:
- /src/workspace/bin/worker
- build:
args:
- -PskipAndroid=true
- -PskipCodegen=true
- :grpc-benchmarks:installDist
command:
- gradle
clone:
gitRef: master
repo: https://github.com/grpc/grpc-java.git
language: java
pool: ${server_pool}
run:
command:
- benchmarks/build/install/grpc-benchmarks/bin/benchmark_worker
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc-node.git
language: node
pool: ${server_pool}
run:
args:
- -r
- ./test/fixtures/native_native.js
- test/performance/worker.js
- --benchmark_impl=grpc
command:
- node
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: php
pool: ${server_pool}
run:
command:
- bash
- /run_scripts/run_worker.sh
- build:
args:
- build
- //src/python/grpcio_tests/tests/qps:qps_worker
command:
- bazel
clone:
gitRef: master
repo: https://github.com/grpc/grpc.git
language: python
pool: ${server_pool}
run:
command:
- bazel-bin/src/python/grpcio_tests/tests/qps/qps_worker
- build:
command:
- bash
- /build_scripts/build_qps_worker.sh
clone:
gitRef: master
repo: https://github.com/grpc/grpc
language: ruby
pool: ${server_pool}
run:
args:
- src/ruby/qps/worker.rb
command:
- ruby
timeoutSeconds: ${timeout_seconds}
ttlSeconds: 86400

Loading…
Cancel
Save