Skip to content

Commit

Permalink
Merge pull request #102 from RADAR-base/release-0.7.1
Browse files Browse the repository at this point in the history
Release 0.7.1
  • Loading branch information
Bdegraaf1234 authored May 2, 2024
2 parents 1205398 + 43a61c2 commit 184a911
Show file tree
Hide file tree
Showing 60 changed files with 155 additions and 138 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/src/integrationTest
/src/test
/radar-gateway/src/integrationTest
/radar-gateway/src/test
/build
/out
/.git
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ jobs:
# Use runtime labels from docker_meta as well as fixed labels
labels: |
${{ steps.docker_meta.outputs.labels }}
maintainer=Joris Borgdorff <joris@thehyve.nl>
org.opencontainers.image.authors=Joris Borgdorff <joris@thehyve.nl>
maintainer=Bastiaan de Graaf <bastiaan@thehyve.nl>
org.opencontainers.image.authors=Bastiaan de Graaf <bastiaan@thehyve.nl>
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
Expand Down Expand Up @@ -133,7 +133,7 @@ jobs:
# Gradle check
- name: Integration test
run: |
echo "RADAR_GATEWAY_TAG=${{ steps.docker_meta.outputs.version }}" >> src/integrationTest/docker/.env
echo "RADAR_GATEWAY_TAG=${{ steps.docker_meta.outputs.version }}" >> radar-gateway/src/integrationTest/docker/.env
./gradlew composeUp -PdockerComposeBuild=false
sleep 15
./gradlew integrationTest -PdockerComposeBuild=false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ jobs:
# Use runtime labels from docker_meta as well as fixed labels
labels: |
${{ steps.docker_meta.outputs.labels }}
maintainer=Joris Borgdorff <joris@thehyve.nl>
org.opencontainers.image.authors=Joris Borgdorff <joris@thehyve.nl>
maintainer=Bastiaan de Graaf <bastiaan@thehyve.nl>
org.opencontainers.image.authors=Bastiaan de Graaf <bastiaan@thehyve.nl>
org.opencontainers.image.vendor=RADAR-base
org.opencontainers.image.licenses=Apache-2.0
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/snyk.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Snyk test
on:
pull_request:
branches:
- main
branches: [ main, dev ]

jobs:
security:
Expand All @@ -25,7 +24,10 @@ jobs:
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
run: >
snyk test
--configuration-matching='^runtimeClasspath$'
--org=radar-base
--policy-path=$PWD/.snyk
snyk test
--configuration-matching="^runtimeClasspath$"
--org=radar-base
--policy-path=.snyk
--all-projects
--fail-on=upgradable
--severity-threshold=high
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,29 @@ 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
COPY ./buildSrc /code/buildSrc
COPY ./build.gradle.kts ./settings.gradle.kts ./gradle.properties /code/
COPY radar-gateway/build.gradle.kts /code/radar-gateway/

RUN gradle downloadDependencies copyDependencies startScripts

COPY src/ /code/src
COPY radar-gateway/src/ /code/radar-gateway/src

RUN gradle jar

FROM eclipse-temurin:17-jre

MAINTAINER @blootsvoets
MAINTAINER @bdegraaf1234

LABEL description="RADAR-base Gateway docker container"

# Override JAVA_OPTS to set heap parameters, for example
ENV JAVA_OPTS="" \
RADAR_GATEWAY_OPTS=""

COPY --from=builder /code/build/scripts/* /usr/bin/
COPY --from=builder /code/build/third-party/* /usr/lib/
COPY --from=builder /code/build/libs/*.jar /usr/lib/
COPY --from=builder /code/radar-gateway/build/scripts/* /usr/bin/
COPY --from=builder /code/radar-gateway/build/third-party/* /usr/lib/
COPY --from=builder /code/radar-gateway/build/libs/*.jar /usr/lib/

USER 101

Expand Down
110 changes: 11 additions & 99 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,116 +2,28 @@ import org.radarbase.gradle.plugin.radarKotlin
import java.time.Duration

plugins {
kotlin("plugin.serialization") version Versions.kotlin
id("application")
kotlin("plugin.serialization") version Versions.kotlin apply false
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
id("org.radarbase.radar-kotlin") version Versions.radarCommons apply false
id("com.avast.gradle.docker-compose") version Versions.dockerCompose apply false
}

description = "RADAR Gateway to handle secured data flow to backend."

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: SourceSet = sourceSets.create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}
subprojects {
apply(plugin = "org.radarbase.radar-kotlin")

val integrationTestImplementation: Configuration by configurations.getting {
extendsFrom(configurations.testImplementation.get())
radarKotlin {
kotlinVersion.set(Versions.kotlin)
javaVersion.set(Versions.java)
log4j2Version.set(Versions.log4j2)
slf4jVersion.set(Versions.slf4j)
}
}

configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.testRuntimeOnly.get())

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))

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")

implementation(platform("io.ktor:ktor-bom:${Versions.ktor}"))
implementation("io.ktor:ktor-client-auth")

runtimeOnly("org.apache.avro:avro:${Versions.avro}")

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}")

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 }
}

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

applicationDefaultJvmArgs = listOf(
"-Dcom.sun.management.jmxremote",
"-Dcom.sun.management.jmxremote.local.only=false",
"-Dcom.sun.management.jmxremote.port=9010",
"-Dcom.sun.management.jmxremote.authenticate=false",
"-Dcom.sun.management.jmxremote.ssl=false",
)
}

dockerCompose {
useComposeFiles.set(listOf("src/integrationTest/docker/docker-compose.yml"))
val dockerComposeBuild: String? by project
val doBuild = dockerComposeBuild?.toBoolean() ?: true
buildBeforeUp.set(doBuild)
buildBeforePull.set(doBuild)
buildAdditionalArgs.set(emptyList<String>())
val dockerComposeStopContainers: String? by project
stopContainers.set(dockerComposeStopContainers?.toBoolean() ?: true)
waitForTcpPortsTimeout.set(Duration.ofMinutes(3))
environment.put("SERVICES_HOST", "localhost")
captureContainersOutputToFiles.set(project.file("build/container-logs"))
isRequiredBy(integrationTest)
}
31 changes: 15 additions & 16 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
@Suppress("ConstPropertyName")
object Versions {
const val project = "0.7.0"
const val project = "0.7.1"

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

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 ktor = "2.3.10"
const val radarJersey = "0.11.1"
const val radarCommons = "1.1.2"
const val radarSchemas = "0.8.7"
const val jackson = "2.15.3"
const val slf4j = "2.0.13"
const val log4j2 = "2.23.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 radarAuth = "2.1.1"
const val avro = "1.11.3"
const val confluent = "7.6.0"
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 mockitoKotlin = "5.3.1"
const val grizzly = "4.0.2"
const val hamcrest = "2.2"

const val wrapper = "8.4"
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ services:
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/
- ./radar-gateway/src/integrationTest/docker/etc/:/mp-includes/

gateway:
build: .
Expand Down
97 changes: 97 additions & 0 deletions radar-gateway/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import java.time.Duration

plugins {
application
kotlin("plugin.serialization") version Versions.kotlin
id("com.avast.gradle.docker-compose") version Versions.dockerCompose
}

description = "RADAR Gateway to handle secured data flow to backend."

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

applicationDefaultJvmArgs = listOf(
"-Dcom.sun.management.jmxremote",
"-Dcom.sun.management.jmxremote.local.only=false",
"-Dcom.sun.management.jmxremote.port=9010",
"-Dcom.sun.management.jmxremote.authenticate=false",
"-Dcom.sun.management.jmxremote.ssl=false",
)
}

val integrationTestSourceSet = sourceSets.create("integrationTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
}

val integrationTestImplementation: Configuration by configurations.getting {
extendsFrom(configurations.testImplementation.get())
}

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 }
}

dockerCompose {
useComposeFiles.set(listOf("src/integrationTest/docker/docker-compose.yml"))
val dockerComposeBuild: String? by project
val doBuild = dockerComposeBuild?.toBoolean() ?: true
buildBeforeUp.set(doBuild)
buildBeforePull.set(doBuild)
buildAdditionalArgs.set(emptyList<String>())
val dockerComposeStopContainers: String? by project
stopContainers.set(dockerComposeStopContainers?.toBoolean() ?: true)
waitForTcpPortsTimeout.set(Duration.ofMinutes(3))
environment.put("SERVICES_HOST", "localhost")
captureContainersOutputToFiles.set(project.file("build/container-logs"))
isRequiredBy(integrationTest)
}

configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.testRuntimeOnly.get())

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))

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}")

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

implementation(platform("io.ktor:ktor-bom:${Versions.ktor}"))
implementation("io.ktor:ktor-client-auth")

runtimeOnly("org.apache.avro:avro:${Versions.avro}")

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}")

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}")
}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ services:

gateway:
build:
context: ../../..
context: ../../../..
image: radarbase/radar-gateway:${RADAR_GATEWAY_TAG}
depends_on:
- kafka-1
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import java.net.URI

data class GatewayServerConfig(
/** Base URL to serve data with. This will determine the base path and the port. */
val baseUri: URI = URI.create("http://0.0.0.0:8090/radar-gateway/"),
val baseUri: URI = URI.create("http://0.0.0.0:8090/kafka/"),
/** Maximum number of simultaneous requests. */
val maxRequests: Int = 200,
/**
Expand Down
Loading

0 comments on commit 184a911

Please sign in to comment.