Skip to content

Commit

Permalink
[NU-1734] E2E Flink Streaming benchmark moved from Quickstart repo (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-software-pl authored Sep 6, 2024
1 parent a51d594 commit 8fd58c7
Show file tree
Hide file tree
Showing 55 changed files with 677 additions and 662 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/benchmark-e2e.yml
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Benchmarks
name: Benchmarks JMH
on:
schedule:
- cron: '0 23 * * *'
workflow_dispatch:
jobs:
benchmarks:
name: Benchmarks
name: Benchmarks JMH
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -19,4 +20,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: jmh-result.csv
path: benchmarks/jmh-result.csv
path: benchmarks/jmh-result.csv
17 changes: 17 additions & 0 deletions benchmarks/src/test/resources/benchmark-setup.override.yml
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
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" : [
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
transactions
processedEvents
alerts
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
}
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
}
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
}
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
)
)

}
Loading

0 comments on commit 8fd58c7

Please sign in to comment.