Skip to content

Commit

Permalink
Merge pull request #98 from RADAR-base/release-0.7.0
Browse files Browse the repository at this point in the history
Release 0.7.0
  • Loading branch information
blootsvoets authored Oct 25, 2023
2 parents 5039e14 + ada0785 commit 1205398
Show file tree
Hide file tree
Showing 41 changed files with 1,098 additions and 855 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
KAFKA_CONFLUENT_VERSION=7.3.2
KAFKA_CONFLUENT_VERSION=7.5.0
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM --platform=$BUILDPLATFORM gradle:8.0-jdk17 as builder
FROM --platform=$BUILDPLATFORM gradle:8.4-jdk17 as builder

RUN mkdir /code
WORKDIR /code
ENV GRADLE_USER_HOME=/code/.gradlecache \
GRADLE_OPTS="-Djdk.lang.Process.launchMechanism=vfork -Dorg.gradle.vfs.watch=false"

COPY build.gradle.kts settings.gradle.kts gradle.properties /code/
COPY buildSrc /code/buildSrc

RUN gradle downloadDependencies copyDependencies startScripts

Expand Down
190 changes: 52 additions & 138 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.radarbase.gradle.plugin.radarKotlin
import java.time.Duration

plugins {
id("idea")
kotlin("plugin.serialization") version Versions.kotlin
id("application")
kotlin("jvm")
id("com.avast.gradle.docker-compose")
id("com.github.ben-manes.versions")
id("org.jlleitschuh.gradle.ktlint")
id("org.radarbase.radar-root-project") version Versions.radarCommons
id("org.radarbase.radar-dependency-management") version Versions.radarCommons
id("org.radarbase.radar-kotlin") version Versions.radarCommons
id("com.avast.gradle.docker-compose") version Versions.dockerCompose
}

description = "RADAR Gateway to handle secured data flow to backend."
group = "org.radarbase"
version = "0.6.0"

repositories {
mavenCentral()
mavenLocal()
maven(url = "https://packages.confluent.io/maven/")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")

radarRootProject {
projectVersion.set(Versions.project)
gradleVersion.set(Versions.wrapper)
}

radarKotlin {
kotlinVersion.set(Versions.kotlin)
javaVersion.set(Versions.java)
log4j2Version.set(Versions.log4j2)
slf4jVersion.set(Versions.slf4j)
}

val integrationTestSourceSet = sourceSets.create("integrationTest") {
val integrationTestSourceSet: SourceSet = sourceSets.create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
Expand All @@ -39,96 +39,56 @@ dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))

val radarCommonsVersion: String by project
implementation("org.radarbase:radar-commons:$radarCommonsVersion")
val radarJerseyVersion: String by project
implementation("org.radarbase:radar-jersey:$radarJerseyVersion")
val radarAuthVersion: String by project
implementation("org.radarbase:managementportal-client:$radarAuthVersion")
val lzfseVersion: String by project
implementation("org.radarbase:lzfse-decode:$lzfseVersion")

val kafkaVersion: String by project
implementation("org.apache.kafka:kafka-clients:$kafkaVersion")
val confluentVersion: String by project
implementation("io.confluent:kafka-avro-serializer:$confluentVersion")
implementation("io.confluent:kafka-schema-registry-client:$confluentVersion")

val slf4jVersion: String by project
implementation("org.slf4j:slf4j-api:$slf4jVersion")

val jacksonVersion: String by project
implementation(platform("com.fasterxml.jackson:jackson-bom:$jacksonVersion"))
implementation("org.radarbase:radar-commons:${Versions.radarCommons}")
implementation("org.radarbase:radar-commons-kotlin:${Versions.radarCommons}")
implementation("org.radarbase:radar-jersey:${Versions.radarJersey}")
implementation("org.radarbase:managementportal-client:${Versions.radarAuth}")
implementation("org.radarbase:lzfse-decode:${Versions.lzfse}")
implementation("org.radarbase:radar-auth:${Versions.radarAuth}")

implementation("org.apache.kafka:kafka-clients:${Versions.kafka}")
implementation("io.confluent:kafka-avro-serializer:${Versions.confluent}")
implementation("io.confluent:kafka-schema-registry-client:${Versions.confluent}")

// Fix snyk issue part of confluent dependencies
// https://security.snyk.io/vuln/SNYK-JAVA-ORGXERIALSNAPPY-5918282
runtimeOnly("org.xerial.snappy:snappy-java:${Versions.snappy}")

implementation(platform("com.fasterxml.jackson:jackson-bom:${Versions.jackson}"))
implementation("com.fasterxml.jackson.core:jackson-databind")

val avroVersion: String by project
runtimeOnly("org.apache.avro:avro:$avroVersion")

val grizzlyVersion: String by project
runtimeOnly("org.glassfish.grizzly:grizzly-framework-monitoring:$grizzlyVersion")
runtimeOnly("org.glassfish.grizzly:grizzly-http-monitoring:$grizzlyVersion")
runtimeOnly("org.glassfish.grizzly:grizzly-http-server-monitoring:$grizzlyVersion")

val log4j2Version: String by project
runtimeOnly("org.apache.logging.log4j:log4j-core:$log4j2Version")
runtimeOnly("org.apache.logging.log4j:log4j-slf4j2-impl:$log4j2Version")
runtimeOnly("org.apache.logging.log4j:log4j-jul:$log4j2Version")

val junitVersion: String by project
val okhttp3Version: String by project
val radarSchemasVersion: String by project
val mockitoKotlinVersion: String by project
val hamcrestVersion: String by project
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion")
testImplementation("com.squareup.okhttp3:mockwebserver:$okhttp3Version") {
exclude(group = "junit", module = "junit")
}
testImplementation("org.hamcrest:hamcrest:$hamcrestVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")

testImplementation("org.radarbase:radar-schemas-commons:$radarSchemasVersion")
integrationTestImplementation("com.squareup.okhttp3:okhttp:$okhttp3Version")
integrationTestImplementation("org.radarbase:radar-schemas-commons:$radarSchemasVersion")
integrationTestImplementation("org.radarbase:radar-commons-testing:$radarCommonsVersion")
}
implementation(platform("io.ktor:ktor-bom:${Versions.ktor}"))
implementation("io.ktor:ktor-client-auth")

val jvmTargetVersion = 17
runtimeOnly("org.apache.avro:avro:${Versions.avro}")

tasks.withType<JavaCompile> {
options.release.set(jvmTargetVersion)
}
runtimeOnly("org.glassfish.grizzly:grizzly-framework-monitoring:${Versions.grizzly}")
runtimeOnly("org.glassfish.grizzly:grizzly-http-monitoring:${Versions.grizzly}")
runtimeOnly("org.glassfish.grizzly:grizzly-http-server-monitoring:${Versions.grizzly}")

testImplementation("org.mockito.kotlin:mockito-kotlin:${Versions.mockitoKotlin}")
testImplementation("org.hamcrest:hamcrest:${Versions.hamcrest}")

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.fromTarget(jvmTargetVersion.toString()))
apiVersion.set(KotlinVersion.KOTLIN_1_8)
languageVersion.set(KotlinVersion.KOTLIN_1_8)
}
integrationTestImplementation(platform("io.ktor:ktor-bom:${Versions.ktor}"))
integrationTestImplementation("io.ktor:ktor-client-content-negotiation")
integrationTestImplementation("io.ktor:ktor-client-content-negotiation")
integrationTestImplementation("io.ktor:ktor-serialization-kotlinx-json")

testImplementation("org.radarbase:radar-schemas-commons:${Versions.radarSchemas}")
integrationTestImplementation("org.radarbase:radar-schemas-commons:${Versions.radarSchemas}")
integrationTestImplementation("org.radarbase:radar-commons-testing:${Versions.radarCommons}")
}

val integrationTest by tasks.registering(Test::class) {
description = "Runs integration tests."
group = "verification"
testClassesDirs = integrationTestSourceSet.output.classesDirs
classpath = integrationTestSourceSet.runtimeClasspath
testLogging.showStandardStreams = true
shouldRunAfter("test")
outputs.upToDateWhen { false }
}

tasks.withType<Test> {
testLogging {
showStandardStreams = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
useJUnitPlatform()
}

tasks.withType<Tar> {
compression = Compression.GZIP
archiveExtension.set("tar.gz")
}

application {
mainClass.set("org.radarbase.gateway.MainKt")

Expand All @@ -155,49 +115,3 @@ dockerCompose {
captureContainersOutputToFiles.set(project.file("build/container-logs"))
isRequiredBy(integrationTest)
}

idea {
module {
isDownloadSources = true
}
}

ktlint {
val ktlintVersion: String by project
version.set(ktlintVersion)
}

tasks.register("downloadDependencies") {
doFirst {
configurations["compileClasspath"].files
configurations["runtimeClasspath"].files
println("Downloaded all dependencies")
}
outputs.upToDateWhen { false }
}

tasks.register<Copy>("copyDependencies") {
from(configurations.runtimeClasspath.map { it.files })
into("$buildDir/third-party/")
doLast {
println("Copied third-party runtime dependencies")
}
}

tasks.withType<DependencyUpdatesTask> {
doFirst {
allprojects {
repositories.removeAll {
it is MavenArtifactRepository && it.url.toString().contains("snapshot")
}
}
}
val isStable = "(^[0-9,.v-]+(-r)?|RELEASE|FINAL|GA|-CE)$".toRegex(RegexOption.IGNORE_CASE)
rejectVersionIf {
!isStable.containsMatchIn(candidate.version)
}
}

tasks.wrapper {
gradleVersion = "8.0.2"
}
21 changes: 21 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.9.10"
}

repositories {
mavenCentral()
}

tasks.withType<JavaCompile> {
sourceCompatibility = "17"
targetCompatibility = "17"
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
28 changes: 28 additions & 0 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@Suppress("ConstPropertyName")
object Versions {
const val project = "0.7.0"

const val java = 17
const val kotlin = "1.9.10"
const val dockerCompose = "0.17.5"

const val ktor = "2.3.5"
const val radarJersey = "0.11.0"
const val radarCommons = "1.1.1"
const val radarSchemas = "0.8.5"
const val jackson = "2.15.2"
const val slf4j = "2.0.9"
const val log4j2 = "2.21.1"
const val lzfse = "0.1.1"
const val radarAuth = "2.1.0"
const val avro = "1.11.2"
const val confluent = "7.5.1"
const val kafka = "$confluent-ce"
const val snappy = "1.1.10.4"

const val mockitoKotlin = "5.1.0"
const val grizzly = "4.0.0"
const val hamcrest = "2.2"

const val wrapper = "8.4"
}
12 changes: 7 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@ services:
#---------------------------------------------------------------------------#
# Management Portal #
#---------------------------------------------------------------------------#
managementportal-app:
managementportal:
image: radarbase/management-portal:2.0.0
ports:
- "127.0.0.1:8080:8080"
environment:
SPRING_PROFILES_ACTIVE: dev
MANAGEMENTPORTAL_FRONTEND_CLIENT_SECRET: ""
MANAGEMENTPORTAL_COMMON_BASE_URL: http://localhost:8080
MANAGEMENTPORTAL_COMMON_MANAGEMENT_PORTAL_BASE_URL: http://localhost:8080
MANAGEMENTPORTAL_FRONTEND_CLIENT_SECRET: "testMe"
MANAGEMENTPORTAL_COMMON_BASE_URL: http://localhost:8080/managementportal
MANAGEMENTPORTAL_COMMON_MANAGEMENT_PORTAL_BASE_URL: http://localhost:8080/managementportal
MANAGEMENTPORTAL_OAUTH_CLIENTS_FILE: /mp-includes/config/oauth_client_details.csv
MANAGEMENTPORTAL_CATALOGUE_SERVER_ENABLE_AUTO_IMPORT: 'false'
SERVER_SERVLET_SESSION_COOKIE_SECURE: "false"
SERVER_SERVLET_CONTEXT_PATH: /managementportal
JAVA_OPTS: -Xmx256m # maximum heap size for the JVM running ManagementPortal, increase this as necessary
volumes:
- ./src/integrationTest/docker/etc/:/mp-includes/
Expand All @@ -72,7 +74,7 @@ services:
depends_on:
- kafka-1
- schema-registry
- managementportal-app
- managementportal
ports:
- "127.0.0.1:8090:8090"
volumes:
Expand Down
2 changes: 1 addition & 1 deletion gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ kafka:
auth:
# ManagementPortal URL. If available, this is used to read the public key from
# ManagementPortal directly. This is the recommended method of getting public key.
managementPortalUrl: http://managementportal-app:8080
managementPortalUrl: http://managementportal:8080/managementportal
# Whether to check that the user that submits data has the reported source ID registered
# in the ManagementPortal.
#checkSourceId: true
Expand Down
25 changes: 1 addition & 24 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,27 +1,4 @@
org.gradle.jvmargs=-Xmx3072m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
kotlin.code.style=official
dockerComposeStopContainers=true

kotlinVersion=1.8.10
ktlintVersion=0.48.2
ktlintPluginVersion=11.3.1
dockerComposeVersion=0.16.12
dependencyUpdatesVersion=0.46.0

okhttp3Version=4.10.0
radarJerseyVersion=0.10.0
radarCommonsVersion=0.15.0
radarSchemasVersion=0.8.2
jacksonVersion=2.14.2
slf4jVersion=2.0.7
log4j2Version=2.20.0
lzfseVersion=0.1.1
radarAuthVersion=2.0.0
avroVersion=1.11.1
kafkaVersion=7.3.2-ce
confluentVersion=7.3.2

mockitoKotlinVersion=4.1.0
junitVersion=5.9.2
grizzlyVersion=4.0.0
hamcrestVersion=2.2
dockerComposeStopContainers=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 1205398

Please sign in to comment.