From d25d413415b2c429febe14fd2c34d06fd02615b5 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 7 Mar 2022 11:55:08 +0100 Subject: build: Move build dependencies into version catalog This change moves build dependencies used by Gradle into the version catalog to ensure a single location for all dependency versions. --- gradle/libs.versions.toml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'gradle') diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5fe5cc33..a1251a1c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,25 +3,33 @@ classgraph = "4.8.138" clikt = "3.3.0" config = "1.4.1" commons-math3 = "3.6.1" +dokka = "1.6.10" hadoop = "3.3.1" jackson = "2.13.1" +jmh-gradle = "0.6.6" junit-jupiter = "5.8.2" junit-platform = "1.8.2" +kotlin = "1.6.10" kotlin-logging = "2.1.21" kotlinx-coroutines = "1.6.0" +ktlint-gradle = "10.2.1" ktor = "1.6.7" log4j = "2.17.1" mockk = "1.12.2" opentelemetry-main = "1.11.0" -opentelemetry-metrics = "1.10.1-alpha" -opentelemetry-semconv = "1.10.1-alpha" +opentelemetry-metrics = "1.11.0-alpha" +opentelemetry-semconv = "1.11.0-alpha" parquet = "1.12.2" progressbar = "0.9.2" sentry = "5.5.2" +shadow = "7.1.2" slf4j = "1.7.32" [libraries] # Kotlin +kotlin-gradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-allopen = { module = "org.jetbrains.kotlin:kotlin-allopen", version.ref = "kotlin" } +kotlin-noarg = { module = "org.jetbrains.kotlin:kotlin-noarg", version.ref = "kotlin" } kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" } # Logging @@ -68,3 +76,9 @@ classgraph = { module = "io.github.classgraph:classgraph", version.ref = "classg hadoop-common = { module = "org.apache.hadoop:hadoop-common", version.ref = "hadoop" } hadoop-mapreduce-client-core = { module = "org.apache.hadoop:hadoop-mapreduce-client-core", version.ref = "hadoop" } commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" } + +# Other (Build) +dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } +ktlint-gradle = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint-gradle" } +jmh-gradle = { module = "me.champeau.jmh:jmh-gradle-plugin", version.ref = "jmh-gradle" } +shadow = { module = "gradle.plugin.com.github.johnrengelman:shadow", version.ref = "shadow" } -- cgit v1.2.3 From 8f958c5a578dc11b890c96c0dc48e3e3f92a4d07 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 7 Mar 2022 22:21:25 +0100 Subject: feat(web/proto): Design unified communication protocol This change adds a unified communication protocol in form of the module opendc-web-proto which contains the classes that form the communication protocol of OpenDC's API v2. By having the protocol in a separate module, we can utilize the classes in both server and client. --- gradle/libs.versions.toml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gradle') diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a1251a1c..4c52627d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,9 @@ commons-math3 = "3.6.1" dokka = "1.6.10" hadoop = "3.3.1" jackson = "2.13.1" +jandex-gradle = "0.11.0" jmh-gradle = "0.6.6" +jakarta-validation = "2.0.2" junit-jupiter = "5.8.2" junit-platform = "1.8.2" kotlin = "1.6.10" @@ -15,6 +17,7 @@ kotlinx-coroutines = "1.6.0" ktlint-gradle = "10.2.1" ktor = "1.6.7" log4j = "2.17.1" +microprofile-openapi = "3.0" mockk = "1.12.2" opentelemetry-main = "1.11.0" opentelemetry-metrics = "1.11.0-alpha" @@ -58,6 +61,7 @@ progressbar = { module = "me.tongfei:progressbar", version.ref = "progressbar" } # Format jackson-core = { module = "com.fasterxml.jackson.core:jackson-core", version.ref = "jackson" } +jackson-annotations = { module = "com.fasterxml.jackson.core:jackson-annotations", version.ref = "jackson" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" } jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "jackson" } @@ -73,12 +77,15 @@ ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" } # Other classgraph = { module = "io.github.classgraph:classgraph", version.ref = "classgraph" } +jakarta-validation = { module = "jakarta.validation:jakarta.validation-api", version.ref = "jakarta-validation" } hadoop-common = { module = "org.apache.hadoop:hadoop-common", version.ref = "hadoop" } hadoop-mapreduce-client-core = { module = "org.apache.hadoop:hadoop-mapreduce-client-core", version.ref = "hadoop" } commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" } +microprofile-openapi-api = { module = "org.eclipse.microprofile.openapi:microprofile-openapi-api", version.ref = "microprofile-openapi" } # Other (Build) dokka-gradle = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" } +jandex-gradle = { module = "org.kordamp.gradle:jandex-gradle-plugin", version.ref = "jandex-gradle" } ktlint-gradle = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint-gradle" } jmh-gradle = { module = "me.champeau.jmh:jmh-gradle-plugin", version.ref = "jmh-gradle" } shadow = { module = "gradle.plugin.com.github.johnrengelman:shadow", version.ref = "shadow" } -- cgit v1.2.3 From f0c472b1792779e63fdeb97a470b46300de00050 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 26 Oct 2021 16:19:55 +0200 Subject: feat(web/api): Initial API implementation in Kotlin This change adds the initial implementation of the new API server in Kotlin, replacing the old API written in Python. The implementation uses Quarkus, RESTEasy, and Hibernate to implement the new API endpoints. The reason for replacing the old API server is unifying the build and deployment toolchains, reducing the number of technologies necessary to work with OpenDC. Furthermore, we envision bundling the entire OpenDC project into a single distributions, allowing users to launch their own deployment trivially. --- gradle/libs.versions.toml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'gradle') diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4c52627d..8967b8eb 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,6 +24,9 @@ opentelemetry-metrics = "1.11.0-alpha" opentelemetry-semconv = "1.11.0-alpha" parquet = "1.12.2" progressbar = "0.9.2" +quarkus = "2.7.5.Final" +quarkus-hibernate-types = "0.2.0" +quarkus-junit5-mockk = "0.3.0" sentry = "5.5.2" shadow = "7.1.2" slf4j = "1.7.32" @@ -69,6 +72,30 @@ jackson-dataformat-csv = { module = "com.fasterxml.jackson.dataformat:jackson-da parquet = { module = "org.apache.parquet:parquet-avro", version.ref = "parquet" } config = { module = "com.typesafe:config", version.ref = "config" } +# Quarkus +quarkus-gradle = { module = "io.quarkus:gradle-application-plugin", version.ref = "quarkus" } +quarkus-bom = { module = "io.quarkus:quarkus-bom", version.ref = "quarkus" } +quarkus-kotlin = { module = "io.quarkus:quarkus-kotlin" } +quarkus-resteasy-core = { module = "io.quarkus:quarkus-resteasy" } +quarkus-resteasy-jackson = { module = "io.quarkus:quarkus-resteasy-jackson" } +quarkus-smallrye-openapi = { module = "io.quarkus:quarkus-smallrye-openapi" } +quarkus-security = { module = "io.quarkus:quarkus-security" } +quarkus-oidc = { module = "io.quarkus:quarkus-oidc" } +quarkus-hibernate-orm = { module = "io.quarkus:quarkus-hibernate-orm" } +quarkus-hibernate-validator = { module = "io.quarkus:quarkus-hibernate-validator" } +quarkus-hibernate-types = { module = "io.quarkiverse.hibernatetypes:quarkus-hibernate-types", version.ref = "quarkus-hibernate-types" } +quarkus-jdbc-h2 = { module = "io.quarkus:quarkus-jdbc-h2" } +quarkus-jdbc-postgresql = { module = "io.quarkus:quarkus-jdbc-postgresql" } +quarkus-flyway = { module = "io.quarkus:quarkus-flyway" } + +# Quarkus (Testing) +quarkus-junit5-core = { module = "io.quarkus:quarkus-junit5" } +quarkus-junit5-mockk = { module = "io.quarkiverse.mockk:quarkus-junit5-mockk", version.ref = "quarkus-junit5-mockk" } +quarkus-jacoco = { module = "io.quarkus:quarkus-jacoco" } +quarkus-test-security = { module = "io.quarkus:quarkus-test-security" } +restassured-core = { module = "io.rest-assured:rest-assured" } +restassured-kotlin = { module = "io.rest-assured:kotlin-extensions" } + # HTTP client ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } ktor-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" } -- cgit v1.2.3 From 98273d483e68e333f9bf5c39510f9a46f3f3a74f Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Tue, 22 Mar 2022 10:57:02 +0100 Subject: fix(web/api): Support dynamic JSON type selection for DB This change adds support for dynamically selecting the appropriate JSON type for the current database. For Postgres, this will be the JSONB type, while for H2 this is either the BLOB or JSON type. --- gradle/libs.versions.toml | 2 -- 1 file changed, 2 deletions(-) (limited to 'gradle') diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8967b8eb..4411bd87 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -25,7 +25,6 @@ opentelemetry-semconv = "1.11.0-alpha" parquet = "1.12.2" progressbar = "0.9.2" quarkus = "2.7.5.Final" -quarkus-hibernate-types = "0.2.0" quarkus-junit5-mockk = "0.3.0" sentry = "5.5.2" shadow = "7.1.2" @@ -83,7 +82,6 @@ quarkus-security = { module = "io.quarkus:quarkus-security" } quarkus-oidc = { module = "io.quarkus:quarkus-oidc" } quarkus-hibernate-orm = { module = "io.quarkus:quarkus-hibernate-orm" } quarkus-hibernate-validator = { module = "io.quarkus:quarkus-hibernate-validator" } -quarkus-hibernate-types = { module = "io.quarkiverse.hibernatetypes:quarkus-hibernate-types", version.ref = "quarkus-hibernate-types" } quarkus-jdbc-h2 = { module = "io.quarkus:quarkus-jdbc-h2" } quarkus-jdbc-postgresql = { module = "io.quarkus:quarkus-jdbc-postgresql" } quarkus-flyway = { module = "io.quarkus:quarkus-flyway" } -- cgit v1.2.3 From d12efc754a1611a624d170b4d1fa6085e6bb177b Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 7 Mar 2022 17:58:08 +0100 Subject: refactor(web/runner): Update runner to use new web client This change updates the web runner implementation to use the new API client introduced in the previous commit. --- gradle/libs.versions.toml | 7 ------- 1 file changed, 7 deletions(-) (limited to 'gradle') diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4411bd87..fbed7e7b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,6 @@ kotlin = "1.6.10" kotlin-logging = "2.1.21" kotlinx-coroutines = "1.6.0" ktlint-gradle = "10.2.1" -ktor = "1.6.7" log4j = "2.17.1" microprofile-openapi = "3.0" mockk = "1.12.2" @@ -94,12 +93,6 @@ quarkus-test-security = { module = "io.quarkus:quarkus-test-security" } restassured-core = { module = "io.rest-assured:rest-assured" } restassured-kotlin = { module = "io.rest-assured:kotlin-extensions" } -# HTTP client -ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } -ktor-client-auth = { module = "io.ktor:ktor-client-auth", version.ref = "ktor" } -ktor-client-jackson = { module = "io.ktor:ktor-client-jackson", version.ref = "ktor" } -ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" } - # Other classgraph = { module = "io.github.classgraph:classgraph", version.ref = "classgraph" } jakarta-validation = { module = "jakarta.validation:jakarta.validation-api", version.ref = "jakarta-validation" } -- cgit v1.2.3