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

bump: update all the things (akka 24.10) #15

Merged
merged 6 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 40 additions & 27 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,49 @@ on:
jobs:
check-code-style:
name: Checks
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-projection-testing'
steps:
- name: Checkout
uses: actions/checkout@v2
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
# we don't know what commit the last tag was it's safer to get entire repo so previousStableVersion resolves
fetch-depth: 0

- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Set up JDK 11
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

- name: Cache Coursier cache
uses: coursier/cache-action@v5
# https://github.com/coursier/cache-action/releases
# v6.4.5
uses: coursier/cache-action@1ff273bff02a8787bc9f1877d347948af647956d

- name: Set up JDK 21
# https://github.com/coursier/setup-action/releases
# v1.3.5
uses: coursier/setup-action@7bde40eee928896f074dbb76d22dd772eed5c65f
with:
jvm: temurin:1.21

- name: Code style check
run: |-
cp .jvmopts-ci .jvmopts
sbt verifyCodeStyle

test:
name: Run tests
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
if: github.repository == 'akka/akka-projection-testing'
steps:
- name: Checkout
uses: actions/checkout@v2
# https://github.com/actions/checkout/releases
# v4.1.1
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0

Expand All @@ -50,27 +62,28 @@ jobs:
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch

- name: Set up JDK 11
uses: olafurpg/setup-scala@v10
with:
java-version: [email protected]

- name: Cache Coursier cache
uses: coursier/cache-action@v5
# https://github.com/coursier/cache-action/releases
# v6.4.5
uses: coursier/cache-action@1ff273bff02a8787bc9f1877d347948af647956d

- name: docker-compose
run: |-
docker-compose -f docker/docker-compose-postgres.yml up -d
# TODO: could we poll the port instead of sleep?
sleep 10
docker exec -i docker_postgres-db_1 psql -U postgres -t < ddl-scripts/create_tables_postgres.sql
- name: Set up JDK 21
# https://github.com/coursier/setup-action/releases
# v1.3.5
uses: coursier/setup-action@7bde40eee928896f074dbb76d22dd772eed5c65f
with:
jvm: temurin:1.21

- name: docker-compose
run: docker-compose -f docker/docker-compose-cassandra.yml up -d
- name: Docker - Postgres
run: |-
docker compose -f docker/docker-compose-postgres.yml up --wait
docker exec -i postgres-db psql -U postgres -t < ddl-scripts/create_tables_postgres.sql

- name: test
run: sbt -jvm-opts .jvmopts-ci test
- name: Test (R2DBC)
run: |-
cp .jvmopts-ci .jvmopts
sbt test

- name: after failure
- name: After failure - docker logs
if: ${{ failure() }}
run: docker-compose logs
run: docker compose logs
17 changes: 6 additions & 11 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
version = 2.1.0
version = 3.8.3

style = defaultWithAlign
runner.dialect = scala213

docstrings = JavaDoc
indentOperator = spray
docstrings.style = Asterisk
indentOperator.preset = spray
maxColumn = 120
rewrite.rules = [RedundantParens, SortImports, AvoidInfix]
unindentTopLevelOperators = true
align.tokens = [{code = "=>", owner = "Case"}]
align.openParenDefnSite = false
align.openParenCallSite = false
optIn.breakChainOnFirstMethodDot = false
optIn.configStyleArguments = false
danglingParentheses = false
danglingParentheses.preset = false
spaces.inImportCurlyBraces = true
newlines.afterCurlyLambda = preserve
rewrite.neverInfix.excludeFilters = [
and
min
Expand Down Expand Up @@ -45,8 +45,3 @@ rewrite.neverInfix.excludeFilters = [
inOrderElementsOf
theSameElementsAs
]
rewriteTokens = {
"⇒": "=>"
"→": "->"
"←": "<-"
}
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@ It is currently support the following alternative Akka Persistence and Akka Proj
Start a local PostgresSQL server on default port 5432. Note that this is also needed when testing with Cassandra.

```shell
docker-compose -f docker/docker-compose-postgres.yml up -d
docker compose -f docker/docker-compose-postgres.yml up --wait
```

For testing with R2DBC you need to create the tables with:
```shell
docker exec -i postgres_db psql -U postgres -t < ddl-scripts/create_tables.sql
docker exec -i postgres-db psql -U postgres -t < ddl-scripts/create_tables_postgres.sql
```

For testing with Cassandra start a local Cassandra in addition to the PostgresSQL:

```shell
docker-compose -f docker/docker-compose-cassandra.yml up -d
docker compose -f docker/docker-compose-cassandra.yml up --wait
```

Adjust the includes in `local.conf` to choose testing with Cassandra, R2DBC or JDBC.

Start the application:

```
sbt "run 2551"
```shell
sbt "run 2551"
```

Start a test run:

```
```shell
curl -X POST --data '{"name":"","nrActors":1000, "messagesPerActor": 100, "concurrentActors": 100, "bytesPerEvent": 100, "timeout": 60000}' --header "content-type: application/json" http://127.0.0.1:8051/test
```

Expand All @@ -63,8 +63,8 @@ are detected with a primary key.

To inspect the database:

```
docker exec -it docker-postgres-db-1 psql -U postgres
```shell
docker exec -it postgres-db psql -U postgres
```


Expand Down
104 changes: 49 additions & 55 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
val AkkaVersion = "2.9.0-M1"
val AkkaPersistenceCassandraVersion = "1.1.1"
val AkkaHttpVersion = "10.5.2"
val AkkaProjectionVersion = "1.5.0-M4"
val AkkaManagementVersion = "1.4.1"
val AkkaPersistenceJdbc = "5.2.1"
val AkkaPersistenceR2dbc = "1.2.0-M5"
val AkkaVersion = "2.10.0"
val AkkaPersistenceCassandraVersion = "1.3.0"
val AkkaHttpVersion = "10.7.0"
val AkkaProjectionVersion = "1.6.5"
val AkkaManagementVersion = "1.6.0"
val AkkaPersistenceJdbc = "5.5.0"
val AkkaPersistenceR2dbc = "1.3.0"

ThisBuild / dynverSeparator := "-"

Expand All @@ -13,78 +13,72 @@ lazy val `akka-projection-testing` = project
.enablePlugins(JavaAppPackaging, DockerPlugin)
.settings(
organization := "akka.projection.testing",
scalaVersion := "2.13.11",
scalaVersion := "2.13.15",
organization := "com.typesafe.akka",
organizationName := "Lightbend Inc.",
organizationHomepage := Some(url("https://www.lightbend.com/")),
startYear := Some(2020),
homepage := Some(url("https://akka.io")),
licenses += ("Apache-2.0", new URL("https://www.apache.org/licenses/LICENSE-2.0.txt")),
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.txt")),
headerLicense := Some(
HeaderLicense.Custom("""Copyright (C) 2020 - 2023 Lightbend Inc. <https://www.lightbend.com>""")
),
scalacOptions in Compile ++= Seq("-deprecation", "-feature", "-unchecked", "-Xlog-reflective-calls", "-Xlint"),
javacOptions in Compile ++= Seq("-Xlint:unchecked", "-Xlint:deprecation"),
HeaderLicense.Custom("""Copyright (C) 2020 - 2024 Lightbend Inc. <https://www.lightbend.com>""")),
Compile / scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-Xlog-reflective-calls", "-Xlint"),
Compile / javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation"),
resolvers += "Akka library repository".at("https://repo.akka.io/maven"),
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-cluster-sharding-typed" % AkkaVersion,
"com.typesafe.akka" %% "akka-persistence-typed" % AkkaVersion,
"com.typesafe.akka" %% "akka-discovery" % AkkaVersion,
"com.typesafe.akka" %% "akka-persistence-query" % AkkaVersion,
"com.typesafe.akka" %% "akka-serialization-jackson" % AkkaVersion,
"com.typesafe.akka" %% "akka-persistence-cassandra" % AkkaPersistenceCassandraVersion,
"com.typesafe.akka" %% "akka-persistence-cassandra-launcher" % AkkaPersistenceCassandraVersion,
"com.lightbend.akka" %% "akka-persistence-jdbc" % AkkaPersistenceJdbc,
"com.lightbend.akka" %% "akka-persistence-r2dbc" % AkkaPersistenceR2dbc,
"com.lightbend.akka" %% "akka-projection-r2dbc" % AkkaProjectionVersion,
"com.lightbend.akka" %% "akka-projection-eventsourced" % AkkaProjectionVersion,
"com.lightbend.akka" %% "akka-projection-cassandra" % AkkaProjectionVersion,
"com.lightbend.akka" %% "akka-projection-jdbc" % AkkaProjectionVersion,
"com.lightbend.akka.management" %% "akka-management" % AkkaManagementVersion,
"com.lightbend.akka.management" %% "akka-management-cluster-http" % AkkaManagementVersion,
"com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % AkkaManagementVersion,
"com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % AkkaManagementVersion,
"com.zaxxer" % "HikariCP" % "3.4.5",
"com.typesafe.akka" %% "akka-http" % AkkaHttpVersion,
"com.typesafe.akka" %% "akka-http-spray-json" % AkkaHttpVersion,
"com.typesafe.akka" %% "akka-slf4j" % AkkaVersion,
// FIXME strange, something brings in slf4j 2.0.0-alpha
"org.slf4j" % "slf4j-api" % "2.0.6",
//"ch.qos.logback" % "logback-classic" % "1.2.11",
"ch.qos.logback" % "logback-classic" % "1.4.5", // for slf4j 2.0
"org.postgresql" % "postgresql" % "42.2.24",
"org.hdrhistogram" % "HdrHistogram" % "2.1.12",
"com.typesafe.akka" %% "akka-actor-testkit-typed" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-persistence-testkit" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-stream-testkit" % AkkaVersion % Test,
"com.lightbend.akka" %% "akka-projection-testkit" % AkkaProjectionVersion % Test,
"org.scalatest" %% "scalatest" % "3.2.7" % Test,
"commons-io" % "commons-io" % "2.4" % Test
"com.typesafe.akka" %% "akka-cluster-sharding-typed" % AkkaVersion,
"com.typesafe.akka" %% "akka-persistence-typed" % AkkaVersion,
"com.typesafe.akka" %% "akka-discovery" % AkkaVersion,
"com.typesafe.akka" %% "akka-persistence-query" % AkkaVersion,
"com.typesafe.akka" %% "akka-serialization-jackson" % AkkaVersion,
"com.typesafe.akka" %% "akka-persistence-cassandra" % AkkaPersistenceCassandraVersion,
"com.lightbend.akka" %% "akka-persistence-jdbc" % AkkaPersistenceJdbc,
"com.lightbend.akka" %% "akka-persistence-r2dbc" % AkkaPersistenceR2dbc,
"com.lightbend.akka" %% "akka-projection-r2dbc" % AkkaProjectionVersion,
"com.lightbend.akka" %% "akka-projection-eventsourced" % AkkaProjectionVersion,
"com.lightbend.akka" %% "akka-projection-cassandra" % AkkaProjectionVersion,
"com.lightbend.akka" %% "akka-projection-jdbc" % AkkaProjectionVersion,
"com.lightbend.akka.management" %% "akka-management" % AkkaManagementVersion,
"com.lightbend.akka.management" %% "akka-management-cluster-http" % AkkaManagementVersion,
"com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % AkkaManagementVersion,
"com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api" % AkkaManagementVersion,
"com.zaxxer" % "HikariCP" % "6.2.1",
"com.typesafe.akka" %% "akka-http" % AkkaHttpVersion,
"com.typesafe.akka" %% "akka-http-spray-json" % AkkaHttpVersion,
"com.typesafe.akka" %% "akka-slf4j" % AkkaVersion,
"ch.qos.logback" % "logback-classic" % "1.5.12",
"org.postgresql" % "postgresql" % "42.7.4",
"org.hdrhistogram" % "HdrHistogram" % "2.2.2",
"com.typesafe.akka" %% "akka-actor-testkit-typed" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-persistence-testkit" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-stream-testkit" % AkkaVersion % Test,
"com.lightbend.akka" %% "akka-projection-testkit" % AkkaProjectionVersion % Test,
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"commons-io" % "commons-io" % "2.18.0" % Test
// Cinnamon.library.cinnamonPrometheus,
// Cinnamon.library.cinnamonPrometheusHttpServer,
// Cinnamon.library.cinnamonAkkaTyped,
// Cinnamon.library.cinnamonAkkaPersistence
),
),
// cinnamon in run := true,
run / fork := true,
// pass along config selection to forked jvm
run / javaOptions ++= sys.props
.get("config.resource")
.fold(Seq.empty[String])(res => Seq(s"-Dconfig.resource=$res")),
.get("config.resource")
.fold(Seq.empty[String])(res => Seq(s"-Dconfig.resource=$res")),
Global / cancelable := false, // ctrl-c
mainClass in (Compile, run) := Some("akka.projection.testing.Main"),
Compile / run / mainClass := Some("akka.projection.testing.Main"),
// disable parallel tests
parallelExecution in Test := false,
Test / parallelExecution := false,
// show full stack traces and test case durations
testOptions in Test += Tests.Argument("-oDF"),
logBuffered in Test := false)
Test / testOptions += Tests.Argument("-oDF"),
Test / logBuffered := false)
// .enablePlugins(Cinnamon)
.settings(
dockerBaseImage := "eclipse-temurin:17.0.3_7-jre-jammy",
dockerBaseImage := "eclipse-temurin:21.0.5_11-jre-noble",
dockerUsername := sys.props.get("docker.username"),
dockerRepository := sys.props.get("docker.registry"),
dockerUpdateLatest := true)
.configs(IntegrationTest)

TaskKey[Unit]("verifyCodeFmt") := {
scalafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach { _ =>
Expand Down
3 changes: 1 addition & 2 deletions docker/docker-compose-cassandra.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
version: '2.2'
services:
cassandra:
image: cassandra:3
container_name: apt_cassandra
container_name: cassandra
ports:
- "9042:9042"
healthcheck:
Expand Down
8 changes: 7 additions & 1 deletion docker/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
version: '2.2'
services:
postgres-db:
image: postgres:latest
container_name: postgres-db
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
healthcheck:
test: ['CMD', 'pg_isready', "-q", "-d", "postgres", "-U", "postgres"]
interval: 5s
retries: 5
start_period: 5s
timeout: 5s
2 changes: 0 additions & 2 deletions docker/docker-compose-yugabyte.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '2'

# Local Yugabyte database, see https://docs.yugabyte.com/latest/deploy/docker/docker-compose/

volumes:
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.7.2
sbt.version=1.10.6
10 changes: 5 additions & 5 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//addSbtPlugin("com.lightbend.cinnamon" % "sbt-cinnamon" % "2.14.6")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.1")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.4.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
//addSbtPlugin("com.lightbend.cinnamon" % "sbt-cinnamon" % "2.21.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.4")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.1.0")
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 - 2023 Lightbend Inc. <https://www.lightbend.com>
* Copyright (C) 2020 - 2024 Lightbend Inc. <https://www.lightbend.com>
*/

package akka.projection.testing
Expand Down
Loading