Skip to content

Commit

Permalink
Merge branch 'release/5.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
milux committed May 19, 2021
2 parents 5a0a2dc + 919073e commit faa35bd
Show file tree
Hide file tree
Showing 469 changed files with 10,450 additions and 14,275 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Cache gradle modules
uses: actions/cache@v1
env:
cache-name: cache-gradle-modules
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
path: ~/.gradle
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/gradle.build') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
java-version: 14
- name: Setup protoc
uses: arduino/setup-protoc@v1.1.2
with:
version: 3.x
- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Build
run: |
mkdir -p ~/.gradle
mkdir -p ~/.m2
./build.sh
./gradlew --parallel build
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

# IDEA
*.iml
*.idea
/.idea

# VSCode
Expand Down Expand Up @@ -45,4 +46,5 @@ out
.lock

# Version file
/version.txt
/version.txt
etc/settings.mapdb
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
![build](https://github.com/industrial-data-space/trusted-connector/workflows/build/badge.svg)

> :warning: Note: We are currently in the transition of OSGi to Spring Boot. You can track the current progress in [this](https://github.com/industrial-data-space/trusted-connector/issues/49) issue. If you are looking for a stable version, please use the latest OSGi-based release ([4.0.0](https://github.com/industrial-data-space/trusted-connector/releases/tag/4.0.0)) or the [master](https://github.com/industrial-data-space/trusted-connector/tree/master) branch.
The _Trusted Connector_ is an Apache Karaf-based platform for the Industrial Internet of Things (IIoT). It supports Docker and trust|me as containerization environments and provides the following features:

* Message routing and conversion between protocols with Apache Camel
* _Apps_ in isolated containers
* Data flow- and data usage control
* An Apache Camel component for secure communication and remote attestation between Connectors.

The _Trusted Connector_ has acquired the IDS_ready label.

![IDS_ready](https://github.com/industrial-data-space/trusted-connector-documentation/blob/master/docs/assets/img/IDS-ready-component.jpg?raw=true)

# How to build & run

Please see the [Github documentation page](https://industrial-data-space.github.io/trusted-connector-documentation/docs/dev_core/)
Expand All @@ -17,13 +23,10 @@ Please refer to the [contribution guide](https://github.com/industrial-data-spac

# Project structure

├── __karaf-assembly__ _Deployable "assembly" with runtime and all modules_<br />
├── __camel-ids__ _IDS protocol (IDSCP) as an Apache Camel component_<br />
├── __camel-influxdb__ Influx DB adapter for Apache Camel. (optional. It is not included in the assembly by default)<br />
├── __camel-multipart-processor__ _REST/MultiPart protocol as an Apache Camel component_<br />
├── __ids-acme__ _ACME 2 client for retrieving TLS certificates for the web console UI_<br />
├── __ids-api__ _Internal APIs of all IDS connector modules._<br />
├── __ids-comm__ _Communication manager, keeping track of IDSCP connections_<br />
├── __ids-container-manager__ _Management interface to the underlying container management layer (trustme or docker)_<br />
├── __ids-dataflow-control__ _LUCON data flow policy framework_<br />
├── __ids-dynamic-tls__ _Fragment bundle to allow refreshing TLS certificates in Jetty web server without restarting_<br />
Expand All @@ -32,6 +35,4 @@ Please refer to the [contribution guide](https://github.com/industrial-data-spac
├── __ids-settings__ _Manages connector configuration_<br />
├── __ids-token-manager__ _Acquires and verifies JWT tokens received from the DAPS server_<br />
├── __ids-webconsole__ _Management UI for the connector. Is contained in default assembly but could be moved out of it, if a smaller code base is desired_<br />
├── __jnr-unixsocket-wrapper__ _Helper bundle for UNIX sockets for trustme cmld connection_<br />
├── __karaf-features-ids__ _Feature definition for Apache Karaf runtime_<br />
└── __rat_repository__ _Online repository for remote attestation. Actually not part of the Core Platform_<br />
3 changes: 0 additions & 3 deletions bnd.bnd

This file was deleted.

158 changes: 77 additions & 81 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.yaml.snakeyaml.Yaml

Expand All @@ -14,35 +14,39 @@ repositories {

plugins {
java
maven
id("com.google.protobuf") version "0.8.15"
// WARNING: Versions 5.2.x onwards export java.* packages, which is not allowed in Felix OSGi Resolver!
// See http://karaf.922171.n3.nabble.com/Manifest-import-problems-td4059042.html
id("biz.aQute.bnd") version "5.1.2" apply false
id("org.jetbrains.kotlin.jvm") version "1.4.31"
id("com.github.jlouns.cpe") version "0.5.0"

// Spring Boot
id("org.springframework.boot") version "2.4.5" apply false
id("io.spring.dependency-management") version "1.0.11.RELEASE"

// Other needed plugins
id("com.moowork.node") version "1.3.1" apply false
// Latest version compiled with Java 11
id("com.benjaminsproule.swagger") version "1.0.8" apply false

// Protobuf
id("com.google.protobuf") version "0.8.12" apply false

// Kotlin specific
kotlin("jvm") version "1.4.32" apply false
kotlin("plugin.spring") version "1.4.32" apply false

id("com.diffplug.spotless") version "5.11.0"
id("com.github.jk1.dependency-license-report") version "1.16"
}

@Suppress("UNCHECKED_CAST")
val libraryVersions: Map<String, String> =
Yaml().loadAs(file("${rootDir}/libraryVersions.yaml").inputStream(), Map::class.java) as Map<String, String>
Yaml().loadAs(file("$rootDir/libraryVersions.yaml").inputStream(), Map::class.java) as Map<String, String>
extra.set("libraryVersions", libraryVersions)

licenseReport {
configurations = arrayOf("compile", "providedByFeature", "providedByBundle")
configurations = arrayOf("compile")
}

allprojects {
group = "de.fhg.aisec.ids"
version = "4.0.0"
}

tasks.build {
subprojects.filter { it.name == "karaf-assembly" }.forEach {
dependsOn(it.tasks.build)
}
version = "5.0.0"
}

subprojects {
Expand All @@ -54,66 +58,65 @@ subprojects {
maven("https://maven.iais.fraunhofer.de/artifactory/eis-ids-public/")
}

apply(plugin = "biz.aQute.bnd.builder")
apply(plugin = "java")
apply(plugin = "maven")
apply(plugin = "kotlin")

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.test {
exclude("**/*IT.*")
}

val integrationTest = tasks.register<Test>("integrationTest") {
include("**/*IT.*")
systemProperty("project.version", "$project.version")
}
apply(plugin = "java-library")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "io.spring.dependency-management")
apply(plugin = "com.diffplug.spotless")

tasks.check {
dependsOn(integrationTest)
}
configure<DependencyManagementExtension> {
imports {
mavenBom("org.springframework.boot:spring-boot-dependencies:${libraryVersions["springBoot"]}")
}

tasks.withType<Test> {
testLogging {
events("failed")
exceptionFormat = TestExceptionFormat.FULL
imports {
mavenBom("org.apache.camel.springboot:camel-spring-boot-dependencies:${libraryVersions["camel"]}")
}
}

// Configuration for dependencies that will be provided through features in the OSGi environment
val providedByFeature by configurations.creating

// Configurations for dependencies that will be provided through bundles in the OSGi environment
// Separate configurations are required when two bundles depend on different versions of the same bundle!
val providedByBundle by configurations.creating
val unixSocketBundle by configurations.creating
val infomodelBundle by configurations.creating

// Configurations for bundles grouped to dedicated features apart from the main ids feature
@Suppress("UNUSED_VARIABLE")
val influxFeature by configurations.creating
@Suppress("UNUSED_VARIABLE")
val zmqFeature by configurations.creating

// OSGi core dependencies which will just be there during runtime
val osgiCore by configurations.creating

// For artifacts that should be included as "compile" dependencies into published maven artifacts
val publishCompile by configurations.creating

configurations["compile"].extendsFrom(providedByFeature, providedByBundle, unixSocketBundle, infomodelBundle,
osgiCore, publishCompile)

dependencies {
// Logging API
providedByBundle("org.slf4j", "slf4j-simple", libraryVersions["slf4j"])
implementation("org.slf4j", "slf4j-api", libraryVersions["slf4j"])

val compileOnly by configurations

// Needed for kotlin modules, provided at runtime via kotlin-osgi-bundle in karaf-features-ids
compileOnly("org.jetbrains.kotlin", "kotlin-stdlib-jdk8", libraryVersions["kotlin"])

// Some versions are downgraded for unknown reasons, fix this here
val groupPins = mapOf(
"org.jetbrains.kotlin" to mapOf(
"*" to "kotlin"
),
"com.squareup.okhttp3" to mapOf(
"*" to "okhttp"
),
"com.google.guava" to mapOf(
"guava" to "guava"
)
)
// We need to explicitly specify the kotlin version for all kotlin dependencies,
// because otherwise something (maybe a plugin) downgrades the kotlin version,
// which produces errors in the kotlin compiler. This is really nasty.
configurations.all {
resolutionStrategy.eachDependency {
groupPins[requested.group]?.let { pins ->
pins["*"]?.let {
// Pin all names when asterisk is set
useVersion(
libraryVersions[it]
?: throw RuntimeException("Key \"$it\" not set in libraryVersions.yaml")
)
} ?: pins[requested.name]?.let { pin ->
// Pin only for specific names given in map
useVersion(
libraryVersions[pin]
?: throw RuntimeException("Key \"$pin\" not set in libraryVersions.yaml")
)
}
}
}
}
}

tasks.withType<KotlinCompile> {
Expand All @@ -126,27 +129,19 @@ subprojects {
options.encoding = "UTF-8"
options.compilerArgs.add("-Xlint:unchecked")
// options.isDeprecation = true
}

tasks.jar {
manifest {
attributes(
"Bundle-Vendor" to "Fraunhofer AISEC",
"-noee" to true
)
}
dependsOn("spotlessApply")
}
}

configure(subprojects.filter { it.name != "examples" }) {
apply(plugin = "com.diffplug.spotless")

spotless {
isEnforceCheck = false

kotlin {
ktfmt().kotlinlangStyle()
licenseHeader("""/*-
target("**/*.kt")
ktlint(libraryVersions["ktlint"])
licenseHeader(
"""/*-
* ========================LICENSE_START=================================
* ${project.name}
* %%
Expand All @@ -164,7 +159,8 @@ configure(subprojects.filter { it.name != "examples" }) {
* See the License for the specific language governing permissions and
* limitations under the License.
* =========================LICENSE_END==================================
*/""").yearSeparator(" - ")
*/"""
).yearSeparator(" - ")
}
}
}
Expand All @@ -176,4 +172,4 @@ tasks.build {
it.write(project.version.toString())
}
}
}
}
4 changes: 2 additions & 2 deletions buildx/docker-buildx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ if [ $BUILD_CONTAINER = 1 ]; then
eval "docker buildx bake build-container $*"
exit
# Check whether preconditions are fulfilled
elif [[ ! -d "../karaf-assembly/build/assembly" ]]; then
elif [[ ! -d "../ids-connector/build/libs/projectJars" ]]; then
printf "\e[31m################################################################################\n"
printf "Directory karaf-assembly/build/assembly not found, this build might fail.\n"
printf "Directory ../ids-connector/build/libs/projectJars not found, this build might fail.\n"
printf "Please build trusted connector first via \"build.sh\".\n"
printf "If build.sh cannot pull build-container, run this command first:\n%s --build-container\n" "$0"
printf "################################################################################\e[0m\n\n"
Expand Down
2 changes: 1 addition & 1 deletion buildx/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
core:
image: fraunhoferaisec/trusted-connector-core:${EXAMPLE_TAG:-develop}
build:
context: '../karaf-assembly'
context: '../ids-connector'
args:
JDK_BASE_IMAGE: fraunhoferaisec/jdk-base:${DOCKER_BUILD_TAG:-develop}

Expand Down
Loading

0 comments on commit faa35bd

Please sign in to comment.