Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat-database-impro…
Browse files Browse the repository at this point in the history
…vements
  • Loading branch information
jantischhoefer committed Mar 2, 2021
2 parents a19672b + 6df7715 commit 77a3782
Show file tree
Hide file tree
Showing 56 changed files with 361 additions and 488 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/publish_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish package to GitHub Packages
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 14
- name: Publish api package
# run: git submodule update --init --recursive && chmod +x gradlew && ./gradlew publish
run: chmod +x gradlew && ./gradlew publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 TelestionGroup
Copyright (c) 2021 WüSpace e. V.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
63 changes: 14 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,57 +1,22 @@
# Telestion

This repository contains the project files which belong to the Telestion Group.
The project extensions are in an own repository (eg. telestion-d2).
Telestion is a ground station software developed by the TelestionTeam for [WüSpace](https://www.wuespace.de/) projects.
We support space related projects by providing a generic ground station for commanding the projects and managing collected
data. We help the teams during the whole project cycle starting at the development, continuing with a successful launch
and ending with recovery and post flight analysis.

## Contributing
The ground station is based on a generic modular backend which is provided in this repository.
The backend handles the data streams, holds the connection and provides interfaces to the experiments.
The modular system is extended for the requirements of the experiments (e.g.
[RocketSound](https://github.com/TelestionTeam/telestion-rocketsound).

Always create a new branch and a pull request to implement a new feature.
Because of the free plan we can't protect the master branch for now.
But we will revert all direct changes to the master branch.
The frontend for visualising the data and commanding the experiment is located in the
[client repository](https://github.com/TelestionTeam/telestion-client).

## Project Overview
## Contributors

The project consists of multiple submodules.
Thank you to all contributors of this repository:

### Core
[![Contributors](https://contrib.rocks/image?repo=TelestionTeam/telestion)](https://github.com/TelestionTeam/telestion/graphs/contributors)

* [telestion-api](https://github.com/TelestionGroup/telestion/issues/2) The public api which is visible to other partners.

* [telestion-core](https://github.com/TelestionGroup/telestion/issues/1) The core classes like utils, factories, common messages, ...

* [telestion-launcher](https://github.com/TelestionGroup/telestion/issues/3) The launcher of the telestion software.

* [telestion-updater](https://github.com/TelestionGroup/telestion/issues/4) The updater of the telestion software.

* [telestion-tcp-adapter](https://github.com/TelestionGroup/telestion/issues/5)

* [telestion-widget-adapter](https://github.com/TelestionGroup/telestion/issues/14) Contains the bridge to the gui widgets

### Extensions

* [telestion-mavlink-adapter](https://github.com/TelestionGroup/telestion/issues/8) Encodes and decodes MavLink-Messages.

* [telestion-iridium-adapter](https://github.com/TelestionGroup/telestion/issues/9) Decodes Iridium-Messages.

* [telestion-lora-adapter]() Decodes LoRa-Messages.

* [telestion-message-dumper](https://github.com/TelestionGroup/telestion/issues/13) Writes messages of a certain kind to a file.

### Extensions - REXUS

* [telestion-rx-wind-importer](https://github.com/TelestionGroup/telestion/issues/12) Imports wind data provided by SNSC.


### Connectors

Connectors are small applications, which are executed on an edge computer. They provide connections to other programms or devices.
The received data is forwarded via a TCP connection to the core application.

* [telestion-uart-connector](https://github.com/TelestionGroup/telestion/issues/6) This connector reads and writes from/to a uart devices which is connected to the edge computer. The data is send to the core application via a tcp stream.

* [telestion-matlab-connector](https://github.com/TelestionGroup/telestion/issues/7) This connector reads and writes Matlab structs to the tcp connection of the core application.

### Test-Dummies

* [telestion-mavlink-dummy](https://github.com/TelestionGroup/telestion/issues/10) A dummy providing MavLink-Packages to a TCP-Connection
* [telestion-iridium-dummy](https://github.com/TelestionGroup/telestion/issues/11) A dummy providing Iridium-Packages to a TCP-Connection
Made with [contributors-img](https://contrib.rocks).
10 changes: 7 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
plugins {
id 'com.palantir.git-version' version '0.12.3'
}

allprojects {
repositories {
jcenter()
}
}

subprojects {
version = '1.0-SNAPSHOT'
def details = versionDetails()
version = details.lastTag + (details.commitDistance.toString() != '0' ? ('-' + details.commitDistance) : '')
//version = gitVersion()
group 'org.telestion'



tasks.withType(JavaExec) {
systemProperties System.properties
systemProperties "hazelcast.logging.type":"slf4j"
Expand Down
29 changes: 26 additions & 3 deletions modules/telestion-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'java'
id 'application'
id 'maven-publish'
}

sourceCompatibility = gradle.sourceCompatibility
Expand All @@ -11,6 +12,28 @@ application {
mainClassName = 'org.telestion.application.Application'
}

publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/TelestionTeam/telestion"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId = 'io.github.telestionteam'
artifactId = 'telestion-api'
//version = '1.1'

from components.java
}
}
}

//TODO we should create a proper manifest like here. This needs some testing...
/*task createJar(type: Jar) {
archiveName = "GradleJarProject.jar"
Expand All @@ -31,8 +54,8 @@ task publishApi(type: Copy) {

dependencies {
implementation 'com.google.guava:guava:30.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.1'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation "org.mockito:mockito-core:2.+"
Expand All @@ -41,7 +64,7 @@ dependencies {
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
implementation group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: '6.6'

implementation "io.vertx:vertx-core:4.0.0"
implementation "io.vertx:vertx-core:4.0.2"
}

test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.telestion.core.config;
package org.telestion.api.config;

import io.vertx.core.json.JsonObject;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.telestion.api.message;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonEncoding;
import io.vertx.core.Handler;
import io.vertx.core.eventbus.Message;
import io.vertx.core.json.JsonObject;
Expand Down
37 changes: 30 additions & 7 deletions modules/telestion-application/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
plugins {
id 'java'
id 'application'
id 'maven-publish'
}


publishing {
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/TelestionTeam/telestion"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
groupId = 'io.github.telestionteam'
artifactId = 'telestion-app'
//version = '1.1'

from components.java
}
}
}

application {
Expand All @@ -14,12 +38,12 @@ targetCompatibility = gradle.targetCompatibility

dependencies {
implementation project(':modules:telestion-core')
implementation project(':modules:telestion-launcher')
implementation project(':modules:telestion-example')
//implementation project(':modules:telestion-launcher')
//implementation project(':modules:telestion-example')

implementation 'com.google.guava:guava:30.1-jre'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.1'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation "org.mockito:mockito-core:2.+"
Expand All @@ -28,9 +52,8 @@ dependencies {
implementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.3'
implementation group: 'net.logstash.logback', name: 'logstash-logback-encoder', version: '6.6'

implementation "io.vertx:vertx-core:4.0.0"
implementation "io.vertx:vertx-circuit-breaker:4.0.0"
implementation "io.vertx:vertx-config:4.0.0"
implementation "io.vertx:vertx-core:4.0.2"
implementation "io.vertx:vertx-config:4.0.2"
}

test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import org.telestion.core.message.Address;
import org.telestion.core.monitoring.MessageLogger;
import org.telestion.core.web.WebServer;
import org.telestion.example.RandomPositionPublisher;
import org.telestion.launcher.Launcher;
//import org.telestion.example.RandomPositionPublisher;
//import org.telestion.launcher.Launcher;

/**
* Starts the Telestion-Project as a standalone Application.
Expand All @@ -25,13 +25,13 @@ public class Application {
* @param args <em>unused at the moment</em>
*/
public static void main(String[] args) {
Launcher.start(new MessageLogger(), new RandomPositionPublisher(),
/*Launcher.start(new MessageLogger(), new RandomPositionPublisher(),
new EventbusTcpBridge("localhost", 9870,
Collections.singletonList(Address.incoming(DataService.class, "find")),
Collections.singletonList(Address.outgoing(RandomPositionPublisher.class, "MockPos"))),
new WebServer(8080),
new DataService(),
new MongoDatabaseService("raketenpraktikum", "raketenpraktikumPool"));
new MongoDatabaseService("raketenpraktikum", "raketenpraktikumPool"));*/
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.telestion.application;

import de.jvpichowski.rocketsound.MockRocketPublisher;
//import de.jvpichowski.rocketsound.MockRocketPublisher;
//import de.jvpichowski.rocketsound.messages.base.GpsData;
//import de.jvpichowski.rocketsound.messages.base.Position;
import java.util.Collections;
import java.util.List;
import org.telestion.core.connection.EventbusTcpBridge;
Expand All @@ -9,15 +11,18 @@
import org.telestion.core.database.MongoDatabaseService;
import org.telestion.core.message.Address;
import org.telestion.core.monitoring.MessageLogger;
import org.telestion.launcher.Launcher;
//import org.telestion.launcher.Launcher;

public class RocketSound {

public static void main(String[] args) {
//For now use this approach please. I will add a deployment mechanism with a config later.
//Have a look at the MockRocketPublisher implementation to see how we use configurations.
//var dataTypeMap = new HashMap<String, Class<?>>();
//dataTypeMap.put("gpsposition", GpsData.class);
//dataTypeMap.put("position", Position.class);

Launcher.start(
/*Launcher.start(
new MessageLogger(),
new MockRocketPublisher(Address.outgoing(MockRocketPublisher.class, "pub")),
new EventbusTcpBridge(
Expand All @@ -33,6 +38,8 @@ public static void main(String[] args) {
Address.outgoing(MongoDatabaseService.class, "save")
)),
new MongoDatabaseService("raketenpraktikum", "raketenpraktikumPool"),
new DataService(dataTypeMap, Collections.emptyMap())
);*/
new DataService(Collections.emptyMap()),
new DataListener(
List.of(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.telestion.application;

import io.vertx.circuitbreaker.CircuitBreaker;
import io.vertx.circuitbreaker.CircuitBreakerOptions;
import io.vertx.config.ConfigRetriever;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.DeploymentOptions;
Expand Down Expand Up @@ -32,29 +30,21 @@ public static void main(String[] args) {
}

@Override
public void start(Promise<Void> startPromise) throws Exception {
var breaker = CircuitBreaker.create(Telestion.class.getSimpleName(), vertx,
new CircuitBreakerOptions().setMaxFailures(2).setMaxRetries(5).setTimeout(2000).setResetTimeout(10000));

var deployer = CircuitBreaker.create(Telestion.class.getSimpleName() + "#deployVerticle", vertx,
new CircuitBreakerOptions().setMaxRetries(3).setMaxFailures(1).setTimeout(2000).setResetTimeout(10000));

public void start(Promise<Void> startPromise) {
ConfigRetriever retriever = ConfigRetriever.create(vertx);
retriever.getConfig(configRes -> {
if (configRes.failed()) {
logger.error("Failed to load config", configRes.cause());
startPromise.fail(configRes.cause());
return;
}
breaker.execute(future -> {
var conf = configRes.result().getJsonObject("org.telestion.configuration").mapTo(Configuration.class);
conf.verticles().stream().flatMap(c -> Collections.nCopies(c.magnitude(), c).stream()).forEach(v -> {
logger.info("Deploying {}", v.name());
deployer.<String>execute(f -> vertx.deployVerticle(v.verticle(),
new DeploymentOptions().setConfig(v.jsonConfig()), f));
});
future.complete();
}, startPromise);
var conf = configRes.result().getJsonObject("org.telestion.configuration").mapTo(Configuration.class);
conf.verticles().stream().flatMap(c -> Collections.nCopies(c.magnitude(), c).stream()).forEach(v -> {
logger.info("Deploying {}", v.name());
var future = vertx.deployVerticle(v.verticle(), new DeploymentOptions().setConfig(v.jsonConfig()));
future.onFailure(Throwable::printStackTrace);
});
startPromise.complete();
});
}

Expand Down
Loading

0 comments on commit 77a3782

Please sign in to comment.