Commit Graph

298 Commits

Author SHA1 Message Date
Eric Anderson 61f19d707a
Swap Animalsniffer to Java 8 and Android 19
Also added missing signatures. Swapping to version catalog will make
this process easier in the future.
2022-08-10 12:41:57 -07:00
Eric Anderson 0ff9f37b9e Use Gradle's task configuration avoidance APIs
This can avoid creating an additional 736 tasks (previously 502 out of
1591 were not created). That's not all that important as the build time
is essentially the same, but this lets us see the poor behavior of the
protobuf plugin in our own project and increase our understanding of how
to avoid task creation when developing the plugin. Of the tasks still
being created, protobuf is the highest contributor with 165 tasks,
followed by maven-publish with 76 and appengine with 53. The remaining
59 are from our own build, but indirectly caused by maven-publish.
2022-07-08 12:16:40 -07:00
Terry Wilson 7bd0797496
all: Update netty to 4.1.77.Final and netty_tcnative to 2.0.53.Final (#9027)
all: Update netty to 4.1.77.Final and netty_tcnative to 2.0.53.Final

Also switches to a non-release version of rules_jvm_external to allow Bazel build to work with artifact classifiers.
2022-06-24 10:47:27 -07:00
Eric Anderson b06942d63b Use Gradle's version catalog
This moves our depedencies into a plain file that can be read and
updated by tooling. While the current tooling is not particularly better
than just using gradle-versions-plugin, it should put us on better
footing. gradle-versions-plugin is actually pretty nice, but will be
incompatible with Gradle 8, so we need to wait a bit to see what the
future holds.

Left libraries as an alias for libs to reduce the commit size and make
it easier to revert if we don't end up liking this approach.

We're using Gradle 7.3.3 where it was an incubating fetaure. But in
Gradle 7.4 is became stable.
2022-06-14 14:04:10 -07:00
Eric Anderson 5b825e8b17 Remove classifiers from ext.libraries
Classifier can't be specified in version catalog.
2022-06-14 14:04:10 -07:00
Eric Anderson c61b4af33d benchmarks: Raise timeout for aarch64
runUnaryBlockingClosedLoop is failing after 10.3s, which means 5.3s was
probably spent loading the LoadWorker. That means things are likely
indeed slow enough that 5s isn't enough time to wait for the server to
start. A successful execution of runUnaryBlockingClosedLoop takes
12.1 seconds, which again points to general slow execution.
2022-05-16 13:20:04 -07:00
Eric Anderson de7db565a3
benchmarks: Propagate errors in LoadWorkerTest startup
Also clean up resources at the end of test.
2022-05-03 16:55:08 -07:00
Eric Anderson cb61a5e284 benchmarks: Increase timeout of LoadWorkerTest
This should fix test failures on aarch64.
```
expected to be less than: 0.0
but was                 : 0.0
	at app//io.grpc.benchmarks.driver.LoadWorkerTest.assertWorkOccurred(LoadWorkerTest.java:198)
	at app//io.grpc.benchmarks.driver.LoadWorkerTest.runUnaryBlockingClosedLoop(LoadWorkerTest.java:90)
```

runUnaryBlockingClosedLoop() has been failing but the other tests
suceeding. The failure is complaining that getCount() == 0, which means
no RPCs completed. The slowest successful test has a mean RPC time of
226 ms (the unit was logged incorrectly) and comparing to x86 tests
runUnaryBlockingClosedLoop() is ~2x as slow because it executes first.
So this is probably _barely_ failing and 4 attempts instead of 3 would
be sufficient. While the test tries to wait for 10 RPCs to complete, it
seems likely it is stopping early even for the successful runs on
aarch64. There are 4 concurrent RPCs, so to get 10 RPCs we need to wait
for 3 batches of RPCs to complete which would be 1346 ms (5 loops)
assuming a 452 ms mean latency. Bumping timeout by 10x to give lots of
headroom.
2022-05-02 13:09:34 -07:00
Eric Anderson 2c3eca57e4 benchmarks: Shut down LoadClient at end of test 2022-05-02 12:14:08 -07:00
Eric Anderson fe5511cf21 benchmarks: Use Truth in LoadWorkerTest
This will produce better error messages when the comparisons fail. This
is to help debug aarch64 test failures.
2022-05-02 10:15:34 -07:00
Eric Anderson 7a9ceacafc
benchmarks: Modernize client to use target and credentials
This allows using LoadClient with xDS.

The changes to SocketAddressValidator are a bit hacky, but we really
don't care about cleanliness there. Eventually on client-side, we should
be deleting the unix special case entirely, as we'll have a unix name
resolver.

Fixes #8877
2022-02-07 13:11:04 -08:00
Eric Anderson d44de5069d
Bump to Gradle 6.9 and update plugins
These changes make the build compatible with Gradle 7, except for
Android which requires plugin updates.

I removed animalsniffer from binder because it did nothing (as there
were no signatures) and it was failing after setting toolVersion. It
failed because animalsniffer is only compatible with java plugin. After
this change I put the withId(animalsniffer) loading inside the
withId(java) to avoid a plugin ordering failure. That made it safe again
for binder to load animalsniffer, but it is still best to remove the
plugin from binder as it is misleading.

I did not upgrade Android plugin versions as newer versions (even 3.6)
require dealing with androidx (#8421).
2022-01-07 09:54:50 -08:00
Eric Anderson 0cabf5672a compiler: Add GrpcGenerated annotation to generated class
This can be used by annotation processors to avoid processing the
gRPC-generated code. The normal Generated annotation only has SOURCE
retention, so isn't available to annotation processors.

I don't include the service name within the annotation as that assumes
we'll never have need for any other type of generated class. If there's
a request for exposing service name via an annotation in the future, we
can make an RpcService annotation or the like.

Fixes #8158
2021-07-02 22:11:40 -07:00
ZHANG Dapeng 7d77f64773
compiler: remove some of the static imports in codegen (#7751)
Resolves #7741 
Some of the static methods in generated code have the same method name but different package name, such `ClientCalls.asyncClientStreamingCall` and `ServerCalls.asyncClientStreamingCall`. It's less readable using static import than using full-qualified method name in-place.
2020-12-23 11:28:03 -08:00
Eric Anderson ddd5dea7e9 Migrate callers to ServerCredentials 2020-11-13 11:13:33 -08:00
Jan Tattermusch 26d8f9cfa2
LoadWorker: clarify the semantics of --server_port flag
The behavior is as follows:
59528d8efe/benchmarks/src/main/java/io/grpc/benchmarks/driver/LoadWorker.java (L136)
(ServerConfig.port takes precedence if set).

grpc-go's documentation is clearer:
02cd07d9bb/benchmark/worker/main.go (L44)
2020-11-05 10:05:32 -08:00
Sergii Tkachenko 07b812b1f5 api, core: create ForwardingServerBuilder and ServerImplBuilder 2020-09-03 16:26:04 -04:00
Sergii Tkachenko c7f876d016 core: add default implementation of managed channel builder 2020-09-02 13:28:52 -04:00
Benjamin Reed 26cd69093b
benchmarks: Remove -javaagent in CreateStartScripts
The Jetty ALPN is not needed for benchmarks. This change removes the
-javaagent lines from the benchmarks/build.gradle file as suggested by
@ejona86.

The shell script references the Jetty ALPN agent stored in ~/.gradle which
is not available when just using the application artifacts. interop-testing
has a hack to make the agent work, but we don't really care about "plain"
Java performance for benchmarks so it is easier to just remove it.
2020-08-27 10:15:29 -07:00
Eric Anderson 8c4088a9e9 benchmarks: Avoid implementing Future
It's a lot of code and there are classes in Guava are better. This was noticed
with a lint checker. This commit does change the error-handling behavior, as
previous the code wrongly cancelled the Future instead of setting it to have an
exception.
2020-08-06 10:56:48 -05:00
Eric Anderson e92b2275f9 Update to Error Prone 2.4
Most of the changes should be semi-clear why they were made. However, BadImport
may not be as obvious: https://errorprone.info/bugpattern/BadImport . That
impacted classes named Type, Entry, and Factory. Also
PublicContructorForAbstractClass:
https://errorprone.info/bugpattern/PublicConstructorForAbstractClass

The JdkObsolete issue is already resolved but is not yet in a release.
2020-08-06 10:56:16 -05:00
Eric Anderson 026673cff5 gradle: Fix Gradle 6 warnings
Most of these are easy "replace X with Y."

The CreateStartScripts changes were because the scripts were being included in
the output zip/tar multiple times. The was because they were all using the same
output directory, and the entire output directory was being included for each.
The output directory tmp/ was particularly poor because other tasks were
dumping things into it, so our zip/tar was including those junk files as well.
2020-07-31 09:52:36 -05:00
Eric Anderson 44db31d147 benchmarks: Use correct classpath for scripts
'runtime' is the old classpath, pre-java-library plugin. We could swap to
'runtimeClasspath', but it is cleaner to just use startScript's defaults. We
already use that approach in interop-testing.

Fixes #7218
2020-07-16 13:00:01 -05:00
ZHANG Dapeng 0044f8ce56
all: migrate gradle build to java-library plugin
- Use gradle configuration `api` for dependencies that are part of grpc public api signatures.
- Replace deprecated gradle configurations `compile`, `testCompile`, `runtime` and `testRuntime`.
- With minimal change in dependencies: If we need dep X and Y to compile our code, and if X transitively depends on Y, then our build would still pass even if we only include X as `compile`/`implementation` dependency for our project. Ideally we should include both X and Y explicitly as `implementation` dependency for our project, but in this PR we don't add the missing Y if it is previously missing.
2020-05-04 16:44:30 -07:00
RiyaTyagi 20f712c14a
benckmarks: integrated the two README.md
The readme file present at "benchmarks/src/jmh/java/io/grpc/benchmarks/netty/README.md" is integrated with readme at "benchmarks/README.md".
2020-05-04 15:43:56 -07:00
Jihun Cho ae211a1ba8
benchmarks: fix missing configuration for netty server (#6877) 2020-03-31 13:00:10 -07:00
Chengyuan Zhang f85843bb88
benchmark: clean up jmh plugin configurations (#6803)
Bump jmh plugin to version 0.5.0. Put junit and mockito to test dependency. Eliminated jmh plugin config workaround for the known issue in previous version.
2020-03-04 16:04:09 -08:00
Jihun Cho 7db873f1f6
Roll-forward of stub,compiler: generated stub extends Abstract{Async,Future,Blocking}Stub #6196 (#6458)
This reverts commit 2eb3f8c34e (#6317).
2019-11-25 09:41:16 -08:00
Jihun Cho 296440a4db interop-testing,benchmarks: publish tar, zip 2019-10-31 17:12:30 -07:00
Jihun Cho 2eb3f8c34e
stub,compiler: Rollback Abstract{Future,Blocking,Async}Stub (#6317)
rollback of #6304 & #6196
2019-10-22 13:27:30 -07:00
Jihun Cho 45d49a56cc
stub,compiler: generated stub extends Abstract{Async,Future,Blocking}Stub (#6196) 2019-10-17 14:49:24 -07:00
Eric Anderson ad159cea96 Remove vestigial SuppressWarnings("LiteralClassName")
Error Prone 2.1.2 removed the warning.
2019-09-30 14:02:46 -07:00
Eric Anderson 65b495c6bc benchmarks: Remove unnecessary unchecked casts 2019-09-30 14:02:24 -07:00
Eric Anderson 4215b80b81 Apply java plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 3b29f74271 Move ALPN Agent configuration to each project needing it 2019-09-13 09:42:17 -07:00
Eric Anderson 5b838e5284 Apply maven-publish plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 55ac6f08af Apply JMH plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 3c3a823a81 Swap to Gradle's Plugin DSL for much of build
Examples and android projects were left unchanged. They can be changed
later.

No plugin versions were changed, to make this as non-functional of a
change as possible. Upgrading Gradle to 5.6 was necessary for
pluginManagement in settings.gradle.
2019-09-13 09:42:17 -07:00
Eric Anderson daad3bcdbf benchmarks: Disable NETTY_LOCAL in TransportBenchmark
NETTY_LOCAL seem to have a flow control issue. Disable it since we don't
really look at it very often and we care about the
streamingCallsMessageThroughput benchmark.
2019-08-29 16:29:08 -07:00
Eric Anderson daed6e01b1 benchmarks: Move message throughput benchmark to TransportBenchmark
This replaces FlowControlledMessagesPerSecondBenchmark, except it does not
avoid local flow control issues via request(5). If hacking in a request(5),
this benchmark produces similar results (non-direct: 671k vs previously 641k
msg/s).
2019-08-29 16:29:08 -07:00
Eric Anderson 8d18dbd501 benchmarks: Add byte throughput benchmark to TransportBenchmark
This is equivalent to UnaryCallResponseBandwidthBenchmark and
StreamingResponseBandwidthBenchmark, although without the interface selection
logic (which allows for traffic shaping).
2019-08-29 16:29:08 -07:00
Eric Anderson 0aaaacec83 benchmarks: Remove unnecessary volatile from TransportBenchmark
TearDown is guaranteed to execute after Setup; there is no synchronization
necessary. Although the volatile doesn't hurt anything functionally, it is
misleading and confusing.
2019-08-29 16:29:08 -07:00
Eric Anderson a919ef7f74 benchmarks: Delete SingleThreadBlockingQpsBenchmark
It is basically the same as TransportBenchmark without protobuf, smaller
payload, and only Netty. It does show latencies around 66 µs instead of
TransportBenchmark's 70 µs on my laptop, but a quick conversion of
TransportBenchmark to ByteBufOutputMarshaller made it 66 µs as well.
2019-08-29 16:29:08 -07:00
Eric Anderson 3a78325a65 Move HandlerRegistryBenchmark to core/
It blended in with Netty benchmarks, so was missed in our earlier
reorganization.
2019-08-29 16:29:08 -07:00
Jihun Cho 65109e6738
netty: Netty{Server,Channel}Builder requires all or none of ELG and ChannelType (#6014) 2019-07-26 09:25:02 -07:00
liym 47b11ab7a1 compiler: Use 'SERVICE_NAME' instead of duplicated '$Package$$service… (#5943)
* compiler: Use 'SERVICE_NAME' instead of duplicated '$Package$$service_name$'

* compiler: Align indentation

* Fix typo

* Add modified golden files and all re-generated code to meet Travis CI and Windows build requirements

See PR #5943

* Polishing
2019-07-24 10:37:13 -07:00
Nick Hill a8c73811dd benchmarks: Ensure ELGs used by TransportBenchmark.NETTY_LOCAL are shutdown
This was an omission from #5492, sorry! Without it there are some ugly warnings in the log.
2019-03-26 16:29:07 -07:00
Nick Hill c8ffa8a8db benchmarks: Use correct ELG type for TransportBenchmark NETTY_LOCAL test (#5492)
Netty LocalChannels are meant to be used with the DefaultEventLoopGroup, but the gRPC channel/server builders use NioEventLoopGroups by default.
2019-03-25 10:22:29 -07:00
Eric Anderson b48b0ac1d4 all: Stop committing generated protobuf messages
This commit swaps to using a Sync task to place generated code in the
src/generated folder instead of the gradle-protobuf-plugin's
generatedFilesBaseDir. This provides much nicer results on failed
builds, and you will no longer see all the generated files deleted.

But at the same time the Sync task makes it easy to only copy the
grpc-generated code. This was not previously done because we were lazy
and using generatedFilesBaseDir, which made it difficult to treat the
services differently from the messages.
2019-03-05 16:28:55 -07:00
Nguyen Quang Huy 05d5e4802a doc: Change http to https for security links
For security, we should change http into https links.

Co-Authored-By: Nguyen Van Trung [trungnvfet@outlook.com](mailto:trungnvfet@outlook.com)
Signed-off-by: Nguyen Quang Huy [huynq0911@gmail.com](mailto:huynq0911@gmail.com)
2019-02-27 17:25:42 -08:00