-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NU-1734] E2E Flink Streaming benchmark moved from Quickstart repo (#…
- Loading branch information
1 parent
a51d594
commit 8fd58c7
Showing
55 changed files
with
677 additions
and
662 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Benchmarks E2E | ||
on: | ||
schedule: | ||
- cron: '0 23 * * *' | ||
workflow_dispatch: | ||
jobs: | ||
benchmarks: | ||
name: Benchmarks E2E | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Scala | ||
uses: olafurpg/setup-scala@v10 | ||
with: | ||
java-version: "[email protected]" | ||
- name: Run benchmarks | ||
run: | | ||
bash -c "export NUSSKNACKER_SCALA_VERSION=2.12 && sbt \"benchmarks/test:runMain pl.touk.nussknacker.engine.benchmarks.e2e.FlinkSteamingScenarioBenchmark 10000000\"" | ||
- name: Store benchmark results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: benchmark-e2e.csv | ||
path: tmp/benchmarkResult.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
benchmarks/src/test/resources/benchmark-setup.override.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
services: | ||
|
||
bootstrap-setup: | ||
environment: | ||
BENCHMARK_FLINK_DEPLOY: false | ||
volumes: | ||
- ../../benchmarks/src/test/resources/e2e/benchmark-flink:/scenario-examples/benchmark-flink | ||
|
||
designer: | ||
environment: | ||
KAFKA_AUTO_OFFSET_RESET: "earliest" | ||
|
||
kafka: | ||
deploy: | ||
resources: | ||
limits: | ||
memory: 2048M |
202 changes: 202 additions & 0 deletions
202
benchmarks/src/test/resources/e2e/benchmark-flink/DetectLargeTransactions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
{ | ||
"metaData" : { | ||
"id" : "DetectLargeTransactions", | ||
"additionalFields" : { | ||
"description" : null, | ||
"properties" : { | ||
"parallelism" : "2" | ||
}, | ||
"metaDataType": "StreamMetaData" | ||
} | ||
}, | ||
"nodes" : [ | ||
{ | ||
"id" : "transactions", | ||
"ref" : { | ||
"typ" : "kafka", | ||
"parameters" : [ | ||
{ | ||
"name" : "Topic", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "'transactions'" | ||
} | ||
}, | ||
{ | ||
"name" : "Schema version", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "'latest'" | ||
} | ||
} | ||
] | ||
}, | ||
"additionalFields" : { | ||
"description" : null, | ||
"layoutData" : { | ||
"x" : 180, | ||
"y" : 0 | ||
} | ||
}, | ||
"type" : "Source" | ||
}, | ||
{ | ||
"nextFalse" : [ | ||
{ | ||
"nextFalse" : [ | ||
], | ||
"id" : "only large ones", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "#input.amount > 30" | ||
}, | ||
"isDisabled" : null, | ||
"additionalFields" : { | ||
"description" : null, | ||
"layoutData" : { | ||
"x" : 0, | ||
"y" : 360 | ||
} | ||
}, | ||
"type" : "Filter" | ||
}, | ||
{ | ||
"id" : "send for audit", | ||
"ref" : { | ||
"typ" : "kafka", | ||
"parameters" : [ | ||
{ | ||
"name" : "Topic", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "'processedEvents'" | ||
} | ||
}, | ||
{ | ||
"name" : "Schema version", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "'latest'" | ||
} | ||
}, | ||
{ | ||
"name" : "Key", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "" | ||
} | ||
}, | ||
{ | ||
"name" : "Raw editor", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "true" | ||
} | ||
}, | ||
{ | ||
"name" : "Value validation mode", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "'strict'" | ||
} | ||
}, | ||
{ | ||
"name" : "Value", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "#input" | ||
} | ||
} | ||
] | ||
}, | ||
"endResult" : null, | ||
"isDisabled" : null, | ||
"additionalFields" : { | ||
"description" : null, | ||
"layoutData" : { | ||
"x" : 0, | ||
"y" : 540 | ||
} | ||
}, | ||
"type" : "Sink" | ||
} | ||
], | ||
"id" : "last packet", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "#input.isLast" | ||
}, | ||
"isDisabled" : null, | ||
"additionalFields" : { | ||
"description" : null, | ||
"layoutData" : { | ||
"x" : 180, | ||
"y" : 180 | ||
} | ||
}, | ||
"type" : "Filter" | ||
}, | ||
{ | ||
"id" : "send to alerts", | ||
"ref" : { | ||
"typ" : "kafka", | ||
"parameters" : [ | ||
{ | ||
"name" : "Topic", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "'alerts'" | ||
} | ||
}, | ||
{ | ||
"name" : "Schema version", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "'latest'" | ||
} | ||
}, | ||
{ | ||
"name" : "Key", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "" | ||
} | ||
}, | ||
{ | ||
"name" : "Raw editor", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "false" | ||
} | ||
}, | ||
{ | ||
"name" : "message", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "\"Last request\"" | ||
} | ||
}, | ||
{ | ||
"name" : "eventDate", | ||
"expression" : { | ||
"language" : "spel", | ||
"expression" : "#DATE.now.toEpochMilli" | ||
} | ||
} | ||
] | ||
}, | ||
"endResult" : null, | ||
"isDisabled" : null, | ||
"additionalFields" : { | ||
"description" : null, | ||
"layoutData" : { | ||
"x" : 360, | ||
"y" : 360 | ||
} | ||
}, | ||
"type" : "Sink" | ||
} | ||
], | ||
"additionalBranches" : [ | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
benchmarks/src/test/resources/e2e/benchmark-flink/setup/kafka/topics.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
transactions | ||
processedEvents | ||
alerts |
10 changes: 10 additions & 0 deletions
10
benchmarks/src/test/resources/e2e/benchmark-flink/setup/schema-registry/alerts.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"type": "object", | ||
"properties": { | ||
"message": { "type": "string" }, | ||
"eventDate": { "type": "integer" } | ||
}, | ||
"required": ["message"], | ||
"additionalProperties": false | ||
} |
11 changes: 11 additions & 0 deletions
11
.../src/test/resources/e2e/benchmark-flink/setup/schema-registry/processedEvents.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"type": "object", | ||
"properties": { | ||
"clientId": { "type": "string" }, | ||
"amount": { "type": "integer" }, | ||
"isLast": { "type": "boolean", "default": false } | ||
}, | ||
"required": ["clientId", "amount"], | ||
"additionalProperties": false | ||
} |
11 changes: 11 additions & 0 deletions
11
...rks/src/test/resources/e2e/benchmark-flink/setup/schema-registry/transactions.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema", | ||
"type": "object", | ||
"properties": { | ||
"clientId": { "type": "string" }, | ||
"amount": { "type": "integer" }, | ||
"isLast": { "type": "boolean", "default": false } | ||
}, | ||
"required": ["clientId", "amount"], | ||
"additionalProperties": false | ||
} |
31 changes: 31 additions & 0 deletions
31
benchmarks/src/test/scala/pl/touk/nussknacker/engine/benchmarks/e2e/BaseE2EBenchmark.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package pl.touk.nussknacker.engine.benchmarks.e2e | ||
|
||
import com.typesafe.scalalogging.LazyLogging | ||
import pl.touk.nussknacker.engine.version.BuildInfo | ||
import pl.touk.nussknacker.test.installationexample.{ | ||
DockerBasedInstallationExampleClient, | ||
DockerBasedInstallationExampleNuEnvironment | ||
} | ||
import pl.touk.nussknacker.test.MiscUtils._ | ||
|
||
// Before running benchmarks in this module, a fresh docker image should be built from sources and placed in the local | ||
// registry. If you run tests based on this trait in Intellij Idea and the images is not built, you can do it manually: | ||
// `bash -c "export NUSSKNACKER_SCALA_VERSION=2.12 && sbt dist/Docker/publishLocal"` | ||
trait BaseE2EBenchmark { | ||
|
||
val client: DockerBasedInstallationExampleClient = | ||
BaseE2EBenchmark.dockerBasedInstallationExampleNuEnvironmentSingleton.client | ||
|
||
} | ||
|
||
object BaseE2EBenchmark extends LazyLogging { | ||
|
||
val dockerBasedInstallationExampleNuEnvironmentSingleton = | ||
new DockerBasedInstallationExampleNuEnvironment( | ||
nussknackerImageVersion = BuildInfo.version, | ||
dockerComposeTweakFiles = List( | ||
BaseE2EBenchmark.getClass.getResourceAsStream("/benchmark-setup.override.yml").toFile | ||
) | ||
) | ||
|
||
} |
Oops, something went wrong.