Skip to content

Commit

Permalink
Uptake pekko jars, use pekko names in packages and configs (#23)
Browse files Browse the repository at this point in the history
* uptake pekko jars, use pekko names in packages and configs

scalafmt and disable header check

sbt-pekko-grpc

doc build

rename more classes

proto package names

pekko configs

Update VersionGenerator.scala

pekko-http config

pekko-http config

benchmark-java compile

Delete release-drafter.yml

doc issues

fix doc build

temporarily remove `@apidoc` refs that are broken

try to fix build resolve issue

try to fix build

try to fix plugin tests

more akka refs

try to fix sbt tests

more sbt plugin test changes

test issue

try again to fix sbt tests

try to fix more tests

scalafmt

more akka refs

more akka refs

Update PekkoGrpcPlugin.scala

Update PekkoGrpcPlugin.groovy

Update PekkoGrpcPlugin.groovy

Update PekkoGrpcPlugin.groovy

fix names of artifacts

add scala-library

revert speculative change

name issue

Update build.gradle

Update build.gradle

revert unwanted changes

* fix up formerly broken apidocs refs

* disable cors support for grpc-web for now (#1)

Update deploy.md

* more Akka refs

scalafmt

---------

Co-authored-by: Johannes Rudolph <johannes.rudolph@gmail.com>
  • Loading branch information
pjfanning and jrudolph committed Feb 27, 2023
1 parent ad46551 commit 7ad0b5d
Show file tree
Hide file tree
Showing 349 changed files with 2,184 additions and 2,141 deletions.
24 changes: 0 additions & 24 deletions .github/release-drafter.yml

This file was deleted.

17 changes: 9 additions & 8 deletions .github/workflows/build-test.yml
Expand Up @@ -39,10 +39,11 @@ jobs:
# env:
# FOSSA_API_KEY: "${{secrets.FOSSA_API_KEY}}"

# TODO add back headerCheckAll
- name: Binary-compatibility check
run: |-
cp .jvmopts-ghactions .jvmopts
sbt headerCheckAll grpcVersionSyncCheck googleProtobufVersionSyncCheck +mimaReportBinaryIssues
sbt grpcVersionSyncCheck googleProtobufVersionSyncCheck +mimaReportBinaryIssues
compile-benchmarks:
name: Compile Benchmarks
Expand Down Expand Up @@ -123,7 +124,7 @@ jobs:
uses: coursier/cache-action@v6

- name: Scripted ${{ matrix.test-set }}
run: cp .jvmopts-ghactions .jvmopts && sbt ++${{ matrix.scala-version }}.* "sbt-akka-grpc/scripted ${{ matrix.test-set }}/*"
run: cp .jvmopts-ghactions .jvmopts && sbt ++${{ matrix.scala-version }}.* "sbt-pekko-grpc/scripted ${{ matrix.test-set }}/*"

test-gradle:
name: Gradle tests
Expand Down Expand Up @@ -161,20 +162,20 @@ jobs:
- name: Publish artifacts locally
run: |-
cp .jvmopts-ghactions .jvmopts
sbt akka-grpc-codegen/publishM2 akka-grpc-scalapb-protoc-plugin/publishM2 +akka-grpc-runtime/publishM2
sbt pekko-grpc-codegen/publishM2 pekko-grpc-scalapb-protoc-plugin/publishM2 +pekko-grpc-runtime/publishM2
cd gradle-plugin
./gradlew clean publishToMavenLocal --console=plain --info --stacktrace
find ~/.m2 | grep gradle
- name: Test Gradle Java ${{ matrix.SCALA_VERSION }}
run: |-
cd plugin-tester-java
./gradlew clean test --console=plain --info --stacktrace -Dakka.grpc.project.version=$(cat ~/.version | sed -e s/-SNAPSHOT//)
./gradlew clean test --console=plain --info --stacktrace -Dpekko.grpc.project.version=$(cat ~/.version | sed -e s/-SNAPSHOT//)
- name: Test Gradle Scala ${{ matrix.SCALA_VERSION }}
run: |-
cd plugin-tester-scala
./gradlew clean test --console=plain --info --stacktrace -Dakka.grpc.project.version=$(cat ~/.version | sed -e s/-SNAPSHOT//)
./gradlew clean test --console=plain --info --stacktrace -Dpekko.grpc.project.version=$(cat ~/.version | sed -e s/-SNAPSHOT//)
- name: Stop Gradle Daemon
# as suggested in https://github.com/actions/cache/blob/main/examples.md#java---gradle
Expand Down Expand Up @@ -215,17 +216,17 @@ jobs:
- name: Publish artifacts locally
run: |-
cp .jvmopts-ghactions .jvmopts
sbt akka-grpc-codegen/publishM2 akka-grpc-scalapb-protoc-plugin/publishM2 +akka-grpc-runtime/publishM2 akka-grpc-maven-plugin/publishM2
sbt pekko-grpc-codegen/publishM2 pekko-grpc-scalapb-protoc-plugin/publishM2 +pekko-grpc-runtime/publishM2 pekko-grpc-maven-plugin/publishM2
- name: Test Maven Java
run: |-
cd plugin-tester-java
mvn -Dakka.grpc.project.version=`cat ~/.version` akka-grpc:generate compile
mvn -Dpekko.grpc.project.version=`cat ~/.version` pekko-grpc:generate compile
- name: Test Maven Scala
run: |-
cd plugin-tester-scala
mvn -Dakka.grpc.project.version=`cat ~/.version` akka-grpc:generate scala:compile
mvn -Dpekko.grpc.project.version=`cat ~/.version` pekko-grpc:generate scala:compile
test-docs:
name: Docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Expand Up @@ -20,5 +20,5 @@ jobs:
- name: Check project is formatted
uses: jrouly/scalafmt-native-action@v2
with:
version: '3.6.1'
version: '3.7.1'
arguments: '--list --mode diff-ref=origin/main'
2 changes: 1 addition & 1 deletion .github/workflows/link-validator.yml
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: coursier/cache-action@v6

- name: sbt site
run: sbt akka-grpc-docs/makeSite
run: sbt pekko-grpc-docs/makeSite

- name: Install Coursier command line tool
run: curl -fLo cs https://git.io/coursier-cli-linux && chmod +x cs && ./cs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |-
cp .jvmopts-ghactions .jvmopts
sbt ci-release
CI_RELEASE=akka-grpc-codegen/publishSigned CI_SNAPSHOT_RELEASE=akka-grpc-codegen/publish sbt ++2.13.8\! ci-release
CI_RELEASE=pekko-grpc-codegen/publishSigned CI_SNAPSHOT_RELEASE=pekko-grpc-codegen/publish sbt ++2.13.8\! ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down Expand Up @@ -82,6 +82,6 @@ jobs:
chmod 600 /tmp/id_rsa
ssh-add /tmp/id_rsa
cp .jvmopts-ghactions .jvmopts
sbt akka-grpc-docs/publishRsync
sbt pekko-grpc-docs/publishRsync
env:
SCP_SECRET: ${{ secrets.SCP_SECRET }}
19 changes: 0 additions & 19 deletions .github/workflows/release-drafter.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .scalafmt.conf
@@ -1,4 +1,4 @@
version = 3.6.1
version = 3.7.1
runner.dialect = scala213
project.git = true
style = defaultWithAlign
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -175,7 +175,7 @@ Refer to its documentation to learn about the more advanced features it provides
To generate documentation you can:

```
> project akka-grpc-docs
> project pekko-grpc-docs
> paradox
```

Expand All @@ -189,7 +189,7 @@ Generating JavaDoc is not enabled by default, as it's not needed on day-to-day d
If you'd like to check if you links and formatting looks good in JavaDoc (and not only in ScalaDoc), you can generate it by running:

```
sbt -Dakka.genjavadoc.enabled=true javaunidoc:doc
sbt -Dpekko.genjavadoc.enabled=true javaunidoc:doc
```

Which will generate JavaDoc style docs in `./target/javaunidoc/index.html`
Expand Down
4 changes: 2 additions & 2 deletions README.md
@@ -1,7 +1,7 @@
# Apache Pekko gRPC

Support for building streaming gRPC servers and clients on top
of Pekko Streams.
of Apache Pekko Streams.

This library is meant to be used as a building block in projects using the Pekko
toolkit.
Expand Down Expand Up @@ -34,7 +34,7 @@ Based on a protobuf service definition, pekko-grpc can generate:

* Model classes (using plain protoc for Java or scalapb for Scala)
* The API (as an interface for Java or a trait for Scala), expressed in Pekko Streams `Source`s
* On the server side, code to create an Pekko HTTP route based on your implementation of the API
* On the server side, code to create a Pekko HTTP route based on your implementation of the API
* On the client side, a client for the API.

## Project structure
Expand Down
8 changes: 4 additions & 4 deletions benchmark-java/README.md
Expand Up @@ -11,24 +11,24 @@ grpc-java and akka-grpc.
Server:

```
sbt "runMain akka.grpc.benchmarks.qps.AsyncServer --tls --address=localhost:50051"
sbt "runMain org.apache.pekko.grpc.benchmarks.qps.AsyncServer --tls --address=localhost:50051"
```

Client with unary calls:

```
sbt "runMain akka.grpc.benchmarks.qps.AsyncClient --tls --address=localhost:50051 --warmup_duration=15 --duration=30 --channels=1 --outstanding_rpcs=16"
sbt "runMain org.apache.pekko.grpc.benchmarks.qps.AsyncClient --tls --address=localhost:50051 --warmup_duration=15 --duration=30 --channels=1 --outstanding_rpcs=16"
```

Client with streaming calls:

```
sbt "runMain akka.grpc.benchmarks.qps.AsyncClient --tls --address=localhost:50051 --warmup_duration=15 --duration=30 --channels=1 --outstanding_rpcs=16 --streaming_rpcs"
sbt "runMain org.apache.pekko.grpc.benchmarks.qps.AsyncClient --tls --address=localhost:50051 --warmup_duration=15 --duration=30 --channels=1 --outstanding_rpcs=16 --streaming_rpcs"
```

Use `--help` to show description of all options.

More scenarios can be tested with the `akka.grpc.benchmarks.driver.LoadWorker`. See `LoadWorkerTest`.
More scenarios can be tested with the `org.apache.pekko.grpc.benchmarks.driver.LoadWorker`. See `LoadWorkerTest`.

## Visualizing the Latency Distribution

Expand Down
10 changes: 5 additions & 5 deletions benchmark-java/build.sbt
@@ -1,23 +1,23 @@
enablePlugins(AkkaGrpcPlugin)
enablePlugins(PekkoGrpcPlugin)

run / javaOptions ++= List("-Xms1g", "-Xmx1g", "-XX:+PrintGCDetails", "-XX:+PrintGCTimeStamps")

// generate both client and server (default) in Java
akkaGrpcGeneratedLanguages := Seq(AkkaGrpc.Java)
pekkoGrpcGeneratedLanguages := Seq(PekkoGrpc.Java)

val grpcVersion = "1.48.1" // checked synced by VersionSyncCheckPlugin

val runtimeProject = ProjectRef(file("../"), "akka-grpc-runtime")
val runtimeProject = ProjectRef(file("../"), "pekko-grpc-runtime")

val codeGenProject = ProjectRef(file("../"), "akka-grpc-codegen")
val codeGenProject = ProjectRef(file("../"), "pekko-grpc-codegen")

val root = project
.in(file("."))
.dependsOn(runtimeProject)
// Use this instead of above when importing to IDEA, after publishLocal and replacing the version here
/*
.settings(libraryDependencies ++= Seq(
"com.lightbend.akka.grpc" %% "akka-grpc-runtime" % "0.1+32-fd597fcb+20180618-1248"
"com.lightbend.akka.grpc" %% "pekko-grpc-runtime" % "0.1+32-fd597fcb+20180618-1248"
))
*/
.settings(
Expand Down
4 changes: 2 additions & 2 deletions benchmark-java/project/plugins.sbt
@@ -1,3 +1,3 @@
lazy val plugins = (project in file(".")).dependsOn(ProjectRef(file("../../"), "sbt-akka-grpc"))
lazy val plugins = (project in file(".")).dependsOn(ProjectRef(file("../../"), "sbt-pekko-grpc"))
// Use this instead of above when importing to IDEA, after publishLocal and replacing the version here
//addSbtPlugin("com.lightbend.akka.grpc" % "sbt-akka-grpc" % "0.1+32-fd597fcb+20180618-1248")
//addSbtPlugin("com.lightbend.akka.grpc" % "sbt-pekko-grpc" % "0.1+32-fd597fcb+20180618-1248")
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package akka.grpc.benchmarks;
package org.apache.pekko.grpc.benchmarks;

import com.google.errorprone.annotations.Immutable;

Expand Down
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package akka.grpc.benchmarks;
package org.apache.pekko.grpc.benchmarks;

import java.net.SocketAddress;

Expand Down
Expand Up @@ -15,17 +15,17 @@
* limitations under the License.
*/

package akka.grpc.benchmarks;

import akka.actor.ActorSystem;
import akka.grpc.GrpcClientSettings;
import akka.grpc.SSLContextUtils;
import akka.grpc.benchmarks.proto.Messages;
import akka.grpc.benchmarks.proto.Messages.Payload;
import akka.grpc.benchmarks.proto.Messages.SimpleRequest;
import akka.grpc.benchmarks.proto.Messages.SimpleResponse;
import akka.http.javadsl.ConnectionContext;
import akka.http.javadsl.HttpsConnectionContext;
package org.apache.pekko.grpc.benchmarks;

import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.grpc.GrpcClientSettings;
import org.apache.pekko.grpc.SSLContextUtils;
import org.apache.pekko.grpc.benchmarks.proto.Messages;
import org.apache.pekko.grpc.benchmarks.proto.Messages.Payload;
import org.apache.pekko.grpc.benchmarks.proto.Messages.SimpleRequest;
import org.apache.pekko.grpc.benchmarks.proto.Messages.SimpleResponse;
import org.apache.pekko.http.javadsl.ConnectionContext;
import org.apache.pekko.http.javadsl.HttpsConnectionContext;
import com.google.protobuf.ByteString;
import io.grpc.Status;
import io.grpc.internal.testing.TestUtils;
Expand Down
Expand Up @@ -15,20 +15,20 @@
* limitations under the License.
*/

package akka.grpc.benchmarks.driver;

import akka.Done;
import akka.NotUsed;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.grpc.GrpcClientSettings;
import akka.grpc.benchmarks.Utils;
import akka.grpc.benchmarks.proto.*;
import akka.stream.Materializer;
import akka.stream.SystemMaterializer;
import akka.stream.OverflowStrategy;
import akka.stream.javadsl.Sink;
import akka.stream.javadsl.Source;
package org.apache.pekko.grpc.benchmarks.driver;

import org.apache.pekko.Done;
import org.apache.pekko.NotUsed;
import org.apache.pekko.actor.ActorRef;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.grpc.GrpcClientSettings;
import org.apache.pekko.grpc.benchmarks.Utils;
import org.apache.pekko.grpc.benchmarks.proto.*;
import org.apache.pekko.stream.Materializer;
import org.apache.pekko.stream.SystemMaterializer;
import org.apache.pekko.stream.OverflowStrategy;
import org.apache.pekko.stream.javadsl.Sink;
import org.apache.pekko.stream.javadsl.Source;
import com.sun.management.OperatingSystemMXBean;
import io.grpc.Status;
import io.grpc.netty.shaded.io.netty.util.concurrent.DefaultThreadFactory;
Expand Down Expand Up @@ -317,7 +317,7 @@ public void run() {
.runWith(Sink.foreach(rsp -> {
delay(System.nanoTime() - lastCall.get());
if (shutdown) {
requestIngress.get().tell(new akka.actor.Status.Success("done"), ActorRef.noSender());
requestIngress.get().tell(new org.apache.pekko.actor.Status.Success("done"), ActorRef.noSender());
// Must not send another request.
return;
}
Expand Down
Expand Up @@ -15,12 +15,12 @@
* limitations under the License.
*/

package akka.grpc.benchmarks.driver;
package org.apache.pekko.grpc.benchmarks.driver;

import akka.grpc.benchmarks.Utils;
import akka.grpc.benchmarks.proto.Control;
import akka.grpc.benchmarks.proto.Stats;
import akka.grpc.benchmarks.qps.AsyncServer;
import org.apache.pekko.grpc.benchmarks.Utils;
import org.apache.pekko.grpc.benchmarks.proto.Control;
import org.apache.pekko.grpc.benchmarks.proto.Stats;
import org.apache.pekko.grpc.benchmarks.qps.AsyncServer;
import com.sun.management.OperatingSystemMXBean;

import java.lang.management.ManagementFactory;
Expand Down

0 comments on commit 7ad0b5d

Please sign in to comment.