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

[TH2-5004] Added optional session alias to group cache to translate c… #352

Merged
merged 28 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
cff20f4
update cradle version
Jun 15, 2023
7c4f5fa
change message id in StreamInfo from -1 to 0
Jun 29, 2023
94a997a
[TH2-5004] Added optional session alias to group cache to translate c…
Nikita-Smirnov-Exactpro Jul 25, 2023
762ea11
[TH2-5004] Implemented search mapping between alias and group based o…
Nikita-Smirnov-Exactpro Jul 27, 2023
647a8f8
[TH2-5004] Corrected PageInfo.toInterval method
Nikita-Smirnov-Exactpro Jul 27, 2023
a474138
Merge remote-tracking branch 'origin/th2-4731' into TH2-5004
Nikita-Smirnov-Exactpro Jul 27, 2023
d21ec9d
[TH2-5004] Optimised search mapping
Nikita-Smirnov-Exactpro Jul 27, 2023
c973036
[TH2-5004] Corrected cradle version
Nikita-Smirnov-Exactpro Jul 27, 2023
8580ef8
[TH2-5004] Filter convertation
Nikita-Smirnov-Exactpro Jul 27, 2023
132c247
[TH2-5004] Fixed NPE
Nikita-Smirnov-Exactpro Jul 27, 2023
3e4a533
[TH2-5004] Refactoring
Nikita-Smirnov-Exactpro Jul 27, 2023
9ccc20b
[TH2-5004] support transport protocol
Nikita-Smirnov-Exactpro Jul 28, 2023
e43fb56
[TH2-5004] add generic parameters to the Context class
Nikita-Smirnov-Exactpro Jul 31, 2023
2cdeedb
[TH2-5004] Added new files
Nikita-Smirnov-Exactpro Jul 31, 2023
b82ea16
[TH2-5004] Corrected main method
Nikita-Smirnov-Exactpro Jul 31, 2023
d8579ca
[TH2-5004] Updated common
Nikita-Smirnov-Exactpro Jul 31, 2023
6121dff
[TH2-5004] Migrate to statistics (#353)
Nikita-Smirnov-Exactpro Aug 1, 2023
871f45a
[TH2-5004] Refactoring after review
Nikita-Smirnov-Exactpro Aug 2, 2023
3c02927
[TH2-5004] Refactoring after review
Nikita-Smirnov-Exactpro Aug 2, 2023
ef2eed9
[TH2-5030] Added limitation for from / to timestamp parameters
Nikita-Smirnov-Exactpro Aug 10, 2023
99509d1
TH2-1836 check licenses check
Aug 10, 2023
229fde2
[TH2-5004] Find pages without start time
Nikita-Smirnov-Exactpro Aug 11, 2023
511f584
[TH2-5030] Implemented fallback to search group by page
Nikita-Smirnov-Exactpro Aug 10, 2023
791a6c8
[TH2-5030] Corrected max / min timestamps
Nikita-Smirnov-Exactpro Aug 11, 2023
1ac7ba9
[TH2-5030] Used cradle witch include start/end page during search
Nikita-Smirnov-Exactpro Aug 11, 2023
da61ea4
[TH2-5030] Used release versions
Nikita-Smirnov-Exactpro Aug 14, 2023
e3751c4
Merge pull request #354 from th2-net/TH2-5004-two-approaches
Nikita-Smirnov-Exactpro Aug 14, 2023
7c5da1c
Merge remote-tracking branch 'origin/dev-version-5.7' into TH2-5004
Nikita-Smirnov-Exactpro Aug 14, 2023
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
1 change: 0 additions & 1 deletion .github/workflows/dev-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches-ignore:
- master
- version-*
- dev-version-*

jobs:
build-job:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/dev-release-docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: Build and publish Docker distributions to Github Container Registry ghcr.i
on:
workflow_dispatch:
push:
branches:
- dev-version-*
paths:
- gradle.properties
tags:
- \d+.\d+.\d+-dev

jobs:
build-job:
Expand Down
78 changes: 60 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Report data provider
# Report data provider (5.7.0)

# Overview
This component serves as a backend for rpt-viewer. It will connect to the cassandra database via cradle api and expose the data stored in there as REST resources.
Expand Down Expand Up @@ -184,17 +184,18 @@ id: event / message id | null | null | null


# Configuration

schema component description example (rpt-data-provider.yml):
```
apiVersion: th2.exactpro.com/v1
apiVersion: th2.exactpro.com/v2
kind: Th2CoreBox
metadata:
name: rpt-data-provider
spec:
image-name: ghcr.io/th2-net/th2-rpt-data-provider
image-version: 2.2.5 // change this line if you want to use a newer version
imageName: ghcr.io/th2-net/th2-rpt-data-provider
imageVersion: 5.7.0 // change this line if you want to use a newer version
type: th2-rpt-data-provider
custom-config:
customConfig:
hostname: localhost
port: 8080
responseTimeout: 60000 // maximum request processing time in milliseconds
Expand Down Expand Up @@ -241,28 +242,47 @@ spec:

eventSearchTimeOffset: 5000 // sets the offset in milliseconds on search events. (startTimestamp - eventSearchTimeOffset) and (endTimestamp + eventSearchTimeOffset)

searchBySessionGroup: true // if true data-provider uses the session alias to group cache and translates http / gRPC requests by session alias to group th2 storage request
aliasToGroupCacheSize: 1000 // the size of cache for the mapping between session alias and group.

useTransportMode: true // if true data-provider uses th2 transport protocol to interact with thw codecs

pins: // pins are used to communicate with codec components to parse message data
- name: to_codec
connection-type: mq
attributes:
- to_codec
- raw
- publish
- name: from_codec
connection-type: mq
attributes:
mq:
subscribers:
- name: from_codec
attributes:
- from_codec
- parsed
- transport-group
- subscribe
extended-settings:
chart-cfg:
linkTo:
- box: codec-fix
pin: out_codec_decode
publishers:
- name: to_codec_fix
attributes:
- to_codec
- transport-group
- publish
filters:
- metadata:
- fieldName: "session_group"
expectedValue: "fix*"
operation: WILDCARD

extendedSettings:
chartCfg:
ref: schema-stable
path: custom-component
service:
enabled: false
nodePort: '31275'
envVariables:
JAVA_TOOL_OPTIONS: "-XX:+ExitOnOutOfMemoryError -Ddatastax-java-driver.advanced.connection.init-query-timeout=\"5000 milliseconds\""
JAVA_TOOL_OPTIONS: >
-XX:+ExitOnOutOfMemoryError
-Ddatastax-java-driver.advanced.connection.init-query-timeout="5000 milliseconds"
-XX:+UseContainerSupport
-XX:MaxRAMPercentage=85
resources:
limits:
memory: 2000Mi
Expand All @@ -272,3 +292,25 @@ spec:
cpu: 50m

```

# Release notes

## 5.7.0

### Feature
+ Added optional session alias to group cache to translate cradle queries from `messages` to `grouped_messages` tables.
User can enable this feature by `searchBySessionGroup` option and set cache size in entries by `aliasToGroupCacheSize` option
+ Added mode to interact with codec by th2 transport protocol

### Updated
+ gradle
+ owasp `8.3.1`

+ th2
+ cradle `5.1.0`
+ bom `4.4.0`
+ common `5.3.0`

### Added
+ gradle
+ gradle-git-properties `2.4.1` (gradle plugin for git metadata genration)
50 changes: 24 additions & 26 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer

/*******************************************************************************
* Copyright 2009-2020 Exactpro (Exactpro Systems Limited)
* Copyright 2009-2023 Exactpro (Exactpro Systems Limited)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,13 +27,14 @@ plugins {
id 'application'
id 'com.palantir.docker' version '0.25.0'
id "org.owasp.dependencycheck" version "8.3.1"
id "com.gorylenko.gradle-git-properties" version "2.4.1"
id 'com.github.jk1.dependency-license-report' version '2.5'
id "de.undercouch.download" version "5.4.0"
}

ext {
dockerImageVersion = release_version
cradleVersion = '5.0.1'
cradleVersion = '5.1.1-dev'
}

group 'com.exactpro.th2'
Expand All @@ -49,7 +54,7 @@ repositories {


dependencies {
api platform('com.exactpro.th2:bom:4.2.0')
api platform('com.exactpro.th2:bom:4.4.0')

implementation 'org.slf4j:slf4j-api'

Expand All @@ -61,48 +66,41 @@ dependencies {

implementation 'org.apache.commons:commons-lang3'

implementation('com.exactpro.th2:common:5.2.0') {
exclude group: 'com.fasterxml.jackson.core'
exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
implementation('com.exactpro.th2:common:5.3.2-dev') {
exclude group: 'com.exactpro.th2', module: 'cradle-core'
exclude group: 'com.exactpro.th2', module: 'cradle-cassandra'
}
implementation 'com.exactpro.th2:common-utils:2.1.1-dev'

implementation("com.exactpro.th2:cradle-core:${cradleVersion}") {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
implementation "com.exactpro.th2:cradle-core:${cradleVersion}"

implementation("com.exactpro.th2:cradle-cassandra:${cradleVersion}") {
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'com.fasterxml.jackson.core'
}

implementation('org.apache.logging.log4j:log4j-core') {
because('need to have log4j core inside the classpath')
}
implementation('org.apache.logging.log4j:log4j-slf4j2-impl') {
because('need loging impl')
}
implementation "com.exactpro.th2:cradle-cassandra:${cradleVersion}"

implementation 'com.exactpro.th2:grpc-data-provider:0.1.8'

implementation 'io.github.microutils:kotlin-logging:2.1.23'
implementation 'io.github.microutils:kotlin-logging:3.0.0' // The last version bases on kotlin 1.6.0

implementation 'io.prometheus:simpleclient'

implementation 'io.ktor:ktor-server-netty:1.6.8'
implementation 'org.ehcache:ehcache:3.8.1'

testImplementation('io.mockk:mockk:1.9.3') {
testImplementation('io.mockk:mockk:1.12.4') { // The last version bases on kotlin 1.6.0
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-reflect' // because we need kotlin reflect with different version
}
testImplementation('org.jetbrains.kotlin:kotlin-reflect') {
because('mockk needs it')
}
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testImplementation "org.junit.jupiter:junit-jupiter-params:5.8.1"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
testImplementation "org.junit.jupiter:junit-jupiter-params:5.10.0"

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
}

tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}

jar {
Expand Down Expand Up @@ -152,7 +150,7 @@ application {
mainClassName = "com.exactpro.th2.rptdataprovider.MainKt"
}

configurations.all {
configurations.configureEach {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
resolutionStrategy.cacheDynamicVersionsFor 0, 'seconds'
}
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# Copyright 2009-2020 Exactpro (Exactpro Systems Limited)
# Copyright 2009-2023 Exactpro (Exactpro Systems Limited)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,6 +16,6 @@

kotlin.code.style=official

release_version=5.6.0
release_version=5.7.0

docker_image_name=
docker_image_name=
Loading
Loading