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-5226] infra-operator periodically deletes redundant resources from RabbitMQ instead of remove on start #119

Closed
wants to merge 19 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
03123a6
[TH2-5226] moved kotlin files to the src/kotlin dir
Nikita-Smirnov-Exactpro Aug 7, 2024
a19d4b5
[TH2-5226] Added RabbitMQGcTask
Nikita-Smirnov-Exactpro Aug 8, 2024
04e15b9
[TH2-5226] Updated libraries
Nikita-Smirnov-Exactpro Aug 8, 2024
a565d2d
[TH2-5226] Implemented RabbitMQGcTask.deleteRedundantExchanges
Nikita-Smirnov-Exactpro Aug 8, 2024
17879e0
[TH2-5226] added configure logging method
Nikita-Smirnov-Exactpro Aug 8, 2024
1add5b3
[TH2-5226] Refactored
Nikita-Smirnov-Exactpro Aug 8, 2024
98b1655
[TH2-5226] added wrapper closure into build script
Nikita-Smirnov-Exactpro Aug 9, 2024
d34bbb3
[TH2-5226] moved kotlin files to the src/kotlin dir
Nikita-Smirnov-Exactpro Aug 7, 2024
9391349
[TH2-5226] Added `rabbitMQManagement.cleanUpOnStart` option
Nikita-Smirnov-Exactpro Aug 13, 2024
bd6c67b
[TH2-5226] Corrected GitHub workflow
Nikita-Smirnov-Exactpro Aug 13, 2024
3e4130c
Merge remote-tracking branch 'origin/TH2-5226-hotfix-2' into TH2-5226
Nikita-Smirnov-Exactpro Aug 14, 2024
0b04c17
[TH2-5226] registered exception handler for informers
Nikita-Smirnov-Exactpro Aug 15, 2024
c4041b9
[TH2-5226] added deleteRabbitMQRubbish method
Nikita-Smirnov-Exactpro Aug 16, 2024
a6d9014
[TH2-5226] set true for clearOnStart by default
Nikita-Smirnov-Exactpro Aug 16, 2024
ada9bf0
[TH2-5226] refactored
Nikita-Smirnov-Exactpro Aug 16, 2024
34816d5
Merge remote-tracking branch 'origin/master' into TH2-5226
Nikita-Smirnov-Exactpro Aug 16, 2024
1bc6904
[TH2-5226] corrected after review
Nikita-Smirnov-Exactpro Aug 19, 2024
2e47d42
[TH2-5226] refactored after review
Nikita-Smirnov-Exactpro Aug 19, 2024
123585d
Update src/main/kotlin/com/exactpro/th2/infraoperator/util/RabbitMQUt…
Nikita-Smirnov-Exactpro Aug 19, 2024
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
15 changes: 15 additions & 0 deletions .github/workflows/build-dev-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and publish dev release Docker image to Github Container Registry ghcr.io

on: workflow_dispatch

jobs:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker'
devRelease: true
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
15 changes: 15 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and publish release Docker image to Github Container Registry ghcr.io

on: workflow_dispatch

jobs:
build:
uses: th2-net/.github/.github/workflows/compound-java.yml@main
with:
build-target: 'Docker'
devRelease: false
createTag: true
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Dev build and publish Docker images to github registry
name: Build and publish Docker image to Github Container Registry ghcr.io

on:
push:
branches-ignore:
- master
- version-*
- dev-version-*
- dependabot*
- dependabot**
paths-ignore:
- README.md

Expand All @@ -15,8 +14,7 @@ jobs:
uses: th2-net/.github/.github/workflows/compound-java-dev.yml@main
with:
build-target: 'Docker'
runsOn: ubuntu-latest
gradleVersion: '7'
docker-username: ${{ github.actor }}
secrets:
docker-password: ${{ secrets.GITHUB_TOKEN }}
docker-password: ${{ secrets.GITHUB_TOKEN }}
nvd-api-key: ${{ secrets.NVD_APIKEY }}
28 changes: 14 additions & 14 deletions .github/workflows/ci-unwelcome-words.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
test:
runs-on: ubuntu-20.04
Nikita-Smirnov-Exactpro marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.sha }}
- name: Checkout tool
uses: actions/checkout@v2
with:
repository: exactpro-th2/ci-github-action
ref: master
token: ${{ secrets.PAT_CI_ACTION }}
path: ci-github-action
- name: Run CI action
uses: ./ci-github-action
with:
ref: ${{ github.sha }}
- uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
- name: Checkout tool
uses: actions/checkout@v4
with:
repository: exactpro-th2/ci-github-action
ref: master
token: ${{ secrets.PAT_CI_ACTION }}
path: ci-github-action
- name: Run CI action
uses: ./ci-github-action
with:
ref: ${{ github.sha }}
20 changes: 0 additions & 20 deletions .github/workflows/java-publish-docker.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ RUN gradle --no-daemon clean build dockerPrepare -Prelease_version=${release_ver
FROM adoptopenjdk/openjdk11:alpine
WORKDIR /home
COPY --from=build /home/gradle/build/docker .
ENTRYPOINT ["/home/service/bin/service", "-Dlog4j2.configurationFile=file:/var/th2/config/log4j2.properties"]
ENTRYPOINT ["/home/service/bin/service"]
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,31 @@ chart:

rabbitMQManagement:
host: host
# RabbitMQ host used for managing vHosts and users

port: 8080
# RabbitMQ port
# host used for managing vHosts and users

managementPort: 15672
# management port for HTTP requests

applicationPort: 5672
# AMQP port

vhostName: vHost
# AMQP vHost name

exchangeName: exchange
# topic exchange name

username: username
# RabbitMQ management username
# username for management and AMQP

password: password
# password for management user
# password for management and AMQP

persistence: true
# determines if the RabbitMQ resources are persistent or not

gcIntervalSec: 900
# Interval of garbage collection in RabbitMQ. Each GC task integration consist of:
rubbishCollectionInterval: 900
# Interval in seconds of rubbish collection (RC) in RabbitMQ. Each RC task integration consist of:
# 1) collect redundant resources according current RabbitMQ and Kubernetes resources state.
# 2) delete only resources included into both current and previous integrations (previous intersect current).
# 3) save collected resources but not included in the previous integration (current minus previous) for the next iteration
Expand Down
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ dependencies {
testImplementation libs.junit.jupiter.api
testRuntimeOnly libs.junit.jupiter.engine

detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:${detekt_version}")
detektPlugins libs.detekt.formatting
}

wrapper {
version '8.7'
distributionType Wrapper.DistributionType.BIN
}

test {
Expand Down
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ kotlin = "1.8.22"
th2-plugin = "0.1.1"
jupiter = "5.10.3"
okhttp3 = "4.12.0"
detekt = "1.23.6"

[libraries]
kotlin-logging = { group = "io.github.microutils", name = "kotlin-logging", version = "3.0.5" }

okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp3" }
logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor", version.ref = "okhttp3" }
kubernetes-client = { group = "io.fabric8", name = "kubernetes-client", version = "6.13.1" }
Expand All @@ -17,8 +17,10 @@ mockito-core = { group = "org.mockito", name = "mockito-core", version = "5.12.0
junit-jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "jupiter" }
junit-jupiter-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "jupiter" }

detekt-formatting = { group = "io.gitlab.arturbosch.detekt", name = "detekt-formatting", version.ref = "detekt" }

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.6" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }

th2-component = { id = "com.exactpro.th2.gradle.component", version.ref = "th2-plugin" }
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Mon May 04 17:09:53 MSK 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
Loading