Skip to content

Commit 98befe2

Browse files
committed
Merge branch 'no-redisson-shutdown' into 'master'
Bump versions, remove redisson, graceful shutdown See merge request videocore/encore!155
2 parents 97e2899 + 2f9e0b1 commit 98befe2

File tree

99 files changed

+1150
-983
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1150
-983
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
insert_final_newline = true
5+
6+
[{*.kt,*.kts}]
7+
ktlint_code_style = intellij_idea
8+
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
9+
10+
# Disable wildcard imports entirely
11+
ij_kotlin_name_count_to_use_star_import = 2147483647
12+
ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
13+
ij_kotlin_packages_to_use_import_on_demand = unset

.github/workflows/publishjar.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@ jobs:
1818
- name: Set up GraalVm
1919
uses: graalvm/setup-graalvm@v1
2020
with:
21-
java-version: '17'
21+
java-version: '21'
2222
distribution: 'graalvm-community'
2323
github-token: ${{ secrets.GITHUB_TOKEN }}
2424

2525
- name: Grant execute permission for gradlew
2626
run: chmod +x gradlew
2727

2828
- name: Build jars and native images with Gradle
29-
run: ./gradlew build nativeCompile -x test
29+
run: |
30+
export LC_ALL=C.UTF-8
31+
export LANG=C.UTF-8
32+
export NATIVE_IMAGE_CONFIG_FILE="$(pwd)/native-image.properties"
33+
echo 'NativeImageArgs = -J-Xmx14G -H:+AddAllCharsets -J-Dfile.encoding=UTF-8' > $NATIVE_IMAGE_CONFIG_FILE
34+
./gradlew build nativeCompile -x test
3035
3136
- name: Release Jars and native images
3237
uses: softprops/action-gh-release@v1

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
include:
22
- project: 'videocore/gitlab-templates'
3-
file: 'encore.yml'
3+
file: 'encore.yml'

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
 
99
 
1010

11-
SVT *Encore* is a scalable video transcoding tool, built on Open Source giants like [FFmpeg](https://www.ffmpeg.org/) and [Redisson](https://github.com/redisson).
11+
SVT *Encore* is a scalable video transcoding tool, built on Open Source giants like [FFmpeg](https://www.ffmpeg.org/) and [Spring Boot](https://spring.io/projects/spring-boot).
1212

1313

1414
*Encore* was created to scale, and abstract the transcoding _power of FFmpeg_, and to offer a simple solution for Transcoding - Transcoding-as-a-Service.
@@ -34,7 +34,6 @@ _Built with_
3434
* Gradle
3535
* Spring Boot
3636
* FFmpeg
37-
* Redisson
3837
* and many other great projects
3938

4039
## Documentation

buildSrc/build.gradle.kts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@ repositories {
77
gradlePluginPortal()
88
}
99
kotlin {
10-
jvmToolchain(17)
10+
jvmToolchain(21)
1111
}
12+
1213
dependencies {
13-
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.10"))
14-
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.1.3"))
15-
implementation(platform("org.springframework.cloud:spring-cloud-dependencies:2022.0.4"))
16-
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin")
17-
implementation("org.jetbrains.kotlin:kotlin-allopen")
18-
implementation("org.springframework.boot:spring-boot-gradle-plugin:3.1.3")
19-
implementation("org.jmailen.gradle:kotlinter-gradle:3.13.0")
20-
implementation("pl.allegro.tech.build:axion-release-plugin:1.14.3")
21-
implementation("org.graalvm.buildtools:native-gradle-plugin:0.9.25")
14+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25")
15+
implementation("org.jetbrains.kotlin:kotlin-allopen:1.9.25")
16+
implementation("org.springframework.boot:spring-boot-gradle-plugin:3.4.3")
17+
implementation("io.spring.gradle:dependency-management-plugin:1.1.5")
18+
implementation("org.jmailen.gradle:kotlinter-gradle:4.4.1")
19+
implementation("pl.allegro.tech.build:axion-release-plugin:1.18.8")
20+
implementation("org.graalvm.buildtools:native-gradle-plugin:0.10.5")
2221
implementation("com.github.fhermansson:assertj-gradle-plugin:1.1.5")
23-
implementation("se.ascp.gradle:gradle-versions-filter:0.1.16")
22+
implementation("com.github.ben-manes:gradle-versions-plugin:0.51.0")
2423
}

buildSrc/src/main/kotlin/encore.kotlin-conventions.gradle.kts

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
2+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
14
plugins {
25
idea
36
jacoco
@@ -6,7 +9,8 @@ plugins {
69
id("pl.allegro.tech.build.axion-release")
710
id("com.github.fhermansson.assertj-generator")
811
id("org.jmailen.kotlinter")
9-
id("se.ascp.gradle.gradle-versions-filter")
12+
id("com.github.ben-manes.versions")
13+
id("io.spring.dependency-management")
1014
}
1115

1216
group = "se.svt.oss"
@@ -21,21 +25,32 @@ repositories {
2125
}
2226

2327
kotlin {
24-
jvmToolchain(17)
28+
jvmToolchain(21)
29+
compilerOptions {
30+
freeCompilerArgs.addAll("-Xjsr305=strict")
31+
}
32+
}
33+
34+
fun isNonStable(version: String): Boolean {
35+
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) }
36+
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
37+
val isStable = stableKeyword || regex.matches(version)
38+
return isStable.not()
2539
}
40+
41+
tasks.withType<DependencyUpdatesTask> {
42+
rejectVersionIf {
43+
isNonStable(candidate.version)
44+
}
45+
}
46+
2647
tasks.lintKotlinTest {
2748
source = (source - fileTree("src/test/generated-java")).asFileTree
2849
}
2950
tasks.formatKotlinTest {
3051
source = (source - fileTree("src/test/generated-java")).asFileTree
3152
}
32-
kotlinter {
33-
disabledRules = arrayOf(
34-
"import-ordering",
35-
"trailing-comma-on-declaration-site",
36-
"trailing-comma-on-call-site"
37-
)
38-
}
53+
3954
assertjGenerator {
4055
classOrPackageNames = arrayOf(
4156
"se.svt.oss.encore.model",
@@ -44,20 +59,24 @@ assertjGenerator {
4459
entryPointPackage = "se.svt.oss.encore"
4560
useJakartaAnnotations = true
4661
}
47-
48-
val redissonVersion = "3.23.2"
49-
62+
tasks.test {
63+
jvmArgs("-XX:+EnableDynamicAgentLoading")
64+
}
65+
dependencyManagement {
66+
imports {
67+
mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.3")
68+
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2024.0.0")
69+
}
70+
}
5071
dependencies {
51-
implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.9.10"))
52-
implementation(platform("org.springframework.boot:spring-boot-dependencies:3.1.3"))
53-
implementation(platform("org.springframework.cloud:spring-cloud-dependencies:2022.0.4"))
5472
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
55-
implementation("io.github.microutils:kotlin-logging:3.0.5")
56-
implementation("org.redisson:redisson-spring-boot-starter:$redissonVersion")
57-
implementation("org.redisson:redisson-spring-data-31:$redissonVersion") // match boot version
58-
testImplementation("org.springframework.boot:spring-boot-starter-test")
73+
implementation("io.github.oshai:kotlin-logging-jvm:7.0.5")
74+
implementation("org.springframework.boot:spring-boot-starter-data-redis")
75+
testImplementation("org.springframework.boot:spring-boot-starter-test") {
76+
exclude(group = "org.mockito")
77+
}
5978
testImplementation("org.assertj:assertj-core")
60-
testImplementation("io.mockk:mockk:1.13.7")
79+
testImplementation("io.mockk:mockk:1.13.17")
6180
}
6281

6382

buildSrc/src/main/kotlin/encore.spring-boot-app-conventions.gradle.kts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,28 @@ plugins {
44
kotlin("plugin.spring")
55
id("org.springframework.boot")
66
id("org.graalvm.buildtools.native")
7+
id("io.spring.dependency-management")
78
}
89

10+
graalvmNative {
11+
binaries.all {
12+
buildArgs.add("--strict-image-heap")
13+
}
14+
}
915
tasks.named<BootJar>("bootJar") {
1016
archiveClassifier.set("boot")
1117
}
12-
18+
dependencyManagement {
19+
imports {
20+
mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.3")
21+
mavenBom("org.springframework.cloud:spring-cloud-dependencies:2024.0.0")
22+
}
23+
}
1324
dependencies {
1425
implementation("org.springframework.boot:spring-boot-starter")
1526
implementation("org.springframework.cloud:spring-cloud-starter-config")
1627
implementation("org.springframework.boot:spring-boot-starter-logging")
17-
implementation("net.logstash.logback:logstash-logback-encoder:7.4")
28+
implementation("net.logstash.logback:logstash-logback-encoder:8.0")
1829
}
1930

2031

checks.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jacocoTestCoverageVerification {
1111
'*.static {...}',
1212
'*.model.*.get*',
1313
'*.service.localencode.LocalEncodeService.moveFile*',
14+
'*QueueService.getQueue*',
15+
'*QueueService.migrateQueues()',
16+
'*.ShutdownHandler.*',
17+
'*FfmpegExecutor.runFfmpeg$lambda$7(java.lang.Process)',
1418
]
1519
limit {
1620
counter = 'LINE'

encore-common/build.gradle.kts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,27 @@ plugins {
55

66
dependencies {
77

8-
api("se.svt.oss:media-analyzer:2.0.4")
8+
api("se.svt.oss:media-analyzer:2.0.7")
99
implementation(kotlin("reflect"))
1010

11-
compileOnly("org.springdoc:springdoc-openapi-starter-webmvc-api:2.2.0")
11+
compileOnly("org.springdoc:springdoc-openapi-starter-webmvc-api:2.6.0")
1212
compileOnly("org.springframework.data:spring-data-rest-core")
13+
compileOnly("org.springframework.boot:spring-boot-starter-validation")
1314
implementation("org.springframework.boot:spring-boot-starter-webflux")
14-
implementation("org.springframework.boot:spring-boot-starter-validation")
15+
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml")
1516

16-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
17-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:1.7.3")
17+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
18+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j")
1819

1920
testImplementation(project(":encore-web"))
2021
testImplementation("org.springframework.security:spring-security-test")
2122
testImplementation("org.awaitility:awaitility")
22-
testImplementation("com.github.tomakehurst:wiremock-jre8-standalone:2.35.0")
23-
testImplementation("org.springframework.boot:spring-boot-starter-webflux")
23+
testImplementation("org.wiremock:wiremock-standalone:3.12.1")
2424
testImplementation("org.springframework.boot:spring-boot-starter-data-rest")
25-
testFixturesImplementation(platform("org.springframework.boot:spring-boot-dependencies:3.1.3"))
26-
testFixturesImplementation("com.redis:testcontainers-redis:2.2.0")
25+
testFixturesImplementation(platform("org.springframework.boot:spring-boot-dependencies:3.4.3"))
26+
testFixturesImplementation("com.redis:testcontainers-redis:2.2.4")
2727
testFixturesImplementation("io.github.microutils:kotlin-logging:3.0.5")
2828
testFixturesImplementation("org.junit.jupiter:junit-jupiter-api")
29+
testFixturesRuntimeOnly("org.junit.platform:junit-platform-launcher")
2930
}
3031

encore-common/src/main/kotlin/se/svt/oss/encore/ClientConfiguration.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ClientConfiguration {
2121
val webClient = WebClient.builder()
2222
.defaultHeader(HttpHeaders.USER_AGENT, userAgent)
2323
.build()
24-
return HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient))
24+
return HttpServiceProxyFactory.builderFor(WebClientAdapter.create(webClient))
2525
.build()
2626
.createClient(CallbackClient::class.java)
2727
}

encore-common/src/main/kotlin/se/svt/oss/encore/EncoreRuntimeHints.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,19 @@ import se.svt.oss.encore.config.EncoreProperties
1313

1414
class EncoreRuntimeHints : RuntimeHintsRegistrar {
1515
override fun registerHints(hints: RuntimeHints, classLoader: ClassLoader?) {
16+
hints.resources().registerPattern("migrate_queue_script.lua")
1617
hints.reflection()
1718
.registerType(
1819
EncoreProperties::class.java,
1920
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
2021
)
2122
.registerType(
2223
EncodingProperties::class.java,
23-
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS
24+
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
2425
)
2526
.registerType(
2627
AudioMixPreset::class.java,
27-
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS
28+
MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
2829
)
2930
}
3031
}

0 commit comments

Comments
 (0)