Skip to content
Snippets Groups Projects
Commit c63efd14 authored by Simon Ehrenstein's avatar Simon Ehrenstein
Browse files

Merge

parents fa50200e 2d68a244
No related branches found
No related tags found
No related merge requests found
Showing
with 269 additions and 52 deletions
...@@ -92,12 +92,15 @@ spotbugs: ...@@ -92,12 +92,15 @@ spotbugs:
script: script:
- DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//') - DOCKER_TAG_NAME=$(echo $CI_COMMIT_REF_SLUG- | sed 's/^master-$//')
- docker build --pull -t $IMAGE_NAME ./$JAVA_PROJECT_NAME - docker build --pull -t $IMAGE_NAME ./$JAVA_PROJECT_NAME
- docker tag $IMAGE_NAME $DOCKERHUB_ORG/$IMAGE_NAME:${DOCKER_TAG_NAME}latest - "[ ! $CI_COMMIT_TAG ] && docker tag $IMAGE_NAME $DOCKERHUB_ORG/$IMAGE_NAME:${DOCKER_TAG_NAME}latest"
- docker tag $IMAGE_NAME $DOCKERHUB_ORG/$IMAGE_NAME:$DOCKER_TAG_NAME$CI_COMMIT_SHORT_SHA - "[ ! $CI_COMMIT_TAG ] && docker tag $IMAGE_NAME $DOCKERHUB_ORG/$IMAGE_NAME:$DOCKER_TAG_NAME$CI_COMMIT_SHORT_SHA"
- "[ $CI_COMMIT_TAG ] && docker tag $IMAGE_NAME $DOCKERHUB_ORG/$IMAGE_NAME:$CI_COMMIT_TAG"
- echo $DOCKERHUB_PW | docker login -u $DOCKERHUB_ID --password-stdin - echo $DOCKERHUB_PW | docker login -u $DOCKERHUB_ID --password-stdin
- docker push $DOCKERHUB_ORG/$IMAGE_NAME - docker push $DOCKERHUB_ORG/$IMAGE_NAME
- docker logout - docker logout
rules: rules:
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
# - $JAVA_PROJECT_NAME/**/* # hope this can be simplified soon, see #51 # - $JAVA_PROJECT_NAME/**/* # hope this can be simplified soon, see #51
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
...@@ -113,6 +116,8 @@ deploy-uc1-kstreams-app: ...@@ -113,6 +116,8 @@ deploy-uc1-kstreams-app:
IMAGE_NAME: "theodolite-uc1-kstreams-app" IMAGE_NAME: "theodolite-uc1-kstreams-app"
JAVA_PROJECT_NAME: "uc1-application" JAVA_PROJECT_NAME: "uc1-application"
rules: # hope this can be simplified soon, see #51 rules: # hope this can be simplified soon, see #51
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
- uc1-application/**/* - uc1-application/**/*
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
...@@ -128,6 +133,8 @@ deploy-uc2-kstreams-app: ...@@ -128,6 +133,8 @@ deploy-uc2-kstreams-app:
IMAGE_NAME: "theodolite-uc2-kstreams-app" IMAGE_NAME: "theodolite-uc2-kstreams-app"
JAVA_PROJECT_NAME: "uc2-application" JAVA_PROJECT_NAME: "uc2-application"
rules: # hope this can be simplified soon, see #51 rules: # hope this can be simplified soon, see #51
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
- uc2-application/**/* - uc2-application/**/*
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
...@@ -143,6 +150,8 @@ deploy-uc3-kstreams-app: ...@@ -143,6 +150,8 @@ deploy-uc3-kstreams-app:
IMAGE_NAME: "theodolite-uc3-kstreams-app" IMAGE_NAME: "theodolite-uc3-kstreams-app"
JAVA_PROJECT_NAME: "uc3-application" JAVA_PROJECT_NAME: "uc3-application"
rules: # hope this can be simplified soon, see #51 rules: # hope this can be simplified soon, see #51
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
- uc3-application/**/* - uc3-application/**/*
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
...@@ -158,6 +167,8 @@ deploy-uc4-kstreams-app: ...@@ -158,6 +167,8 @@ deploy-uc4-kstreams-app:
IMAGE_NAME: "theodolite-uc4-kstreams-app" IMAGE_NAME: "theodolite-uc4-kstreams-app"
JAVA_PROJECT_NAME: "uc4-application" JAVA_PROJECT_NAME: "uc4-application"
rules: # hope this can be simplified soon, see #51 rules: # hope this can be simplified soon, see #51
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
- uc4-application/**/* - uc4-application/**/*
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
...@@ -173,6 +184,8 @@ deploy-uc1-workload-generator: ...@@ -173,6 +184,8 @@ deploy-uc1-workload-generator:
IMAGE_NAME: "theodolite-uc1-workload-generator" IMAGE_NAME: "theodolite-uc1-workload-generator"
JAVA_PROJECT_NAME: "uc1-workload-generator" JAVA_PROJECT_NAME: "uc1-workload-generator"
rules: # hope this can be simplified soon, see #51 rules: # hope this can be simplified soon, see #51
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
- uc1-workload-generator/**/* - uc1-workload-generator/**/*
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
...@@ -188,6 +201,8 @@ deploy-uc2-workload-generator: ...@@ -188,6 +201,8 @@ deploy-uc2-workload-generator:
IMAGE_NAME: "theodolite-uc2-workload-generator" IMAGE_NAME: "theodolite-uc2-workload-generator"
JAVA_PROJECT_NAME: "uc2-workload-generator" JAVA_PROJECT_NAME: "uc2-workload-generator"
rules: # hope this can be simplified soon, see #51 rules: # hope this can be simplified soon, see #51
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
- uc2-workload-generator/**/* - uc2-workload-generator/**/*
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
...@@ -203,6 +218,8 @@ deploy-uc3-workload-generator: ...@@ -203,6 +218,8 @@ deploy-uc3-workload-generator:
IMAGE_NAME: "theodolite-uc3-workload-generator" IMAGE_NAME: "theodolite-uc3-workload-generator"
JAVA_PROJECT_NAME: "uc3-workload-generator" JAVA_PROJECT_NAME: "uc3-workload-generator"
rules: # hope this can be simplified soon, see #51 rules: # hope this can be simplified soon, see #51
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
- uc3-workload-generator/**/* - uc3-workload-generator/**/*
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
...@@ -218,6 +235,8 @@ deploy-uc4-workload-generator: ...@@ -218,6 +235,8 @@ deploy-uc4-workload-generator:
IMAGE_NAME: "theodolite-uc4-workload-generator" IMAGE_NAME: "theodolite-uc4-workload-generator"
JAVA_PROJECT_NAME: "uc4-workload-generator" JAVA_PROJECT_NAME: "uc4-workload-generator"
rules: # hope this can be simplified soon, see #51 rules: # hope this can be simplified soon, see #51
- if: "$DOCKERHUB_ORG && $DOCKERHUB_ID && $DOCKERHUB_PW && $IMAGE_NAME && $JAVA_PROJECT_NAME && $CI_COMMIT_TAG"
when: always
- changes: - changes:
- uc4-workload-generator/**/* - uc4-workload-generator/**/*
- application-kafkastreams-commons/**/* - application-kafkastreams-commons/**/*
......
...@@ -101,7 +101,7 @@ sp_cleanup.qualify_static_member_accesses_with_declaring_class=true ...@@ -101,7 +101,7 @@ sp_cleanup.qualify_static_member_accesses_with_declaring_class=true
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_modifiers=false sp_cleanup.remove_redundant_modifiers=false
sp_cleanup.remove_redundant_semicolons=false sp_cleanup.remove_redundant_semicolons=true
sp_cleanup.remove_redundant_type_arguments=true sp_cleanup.remove_redundant_type_arguments=true
sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_all=true
......
package theodolite.uc4.application; package theodolite.commons.kafkastreams;
/** /**
* Keys to access configuration parameters. * Keys to access configuration parameters.
*/ */
public final class ConfigurationKeys { public final class ConfigurationKeys {
// Common keys
public static final String APPLICATION_NAME = "application.name"; public static final String APPLICATION_NAME = "application.name";
public static final String APPLICATION_VERSION = "application.version"; public static final String APPLICATION_VERSION = "application.version";
public static final String NUM_THREADS = "num.threads";
public static final String COMMIT_INTERVAL_MS = "commit.interval.ms";
public static final String CACHE_MAX_BYTES_BUFFERING = "cache.max.bytes.buffering";
public static final String KAFKA_BOOTSTRAP_SERVERS = "kafka.bootstrap.servers"; public static final String KAFKA_BOOTSTRAP_SERVERS = "kafka.bootstrap.servers";
public static final String SCHEMA_REGISTRY_URL = "schema.registry.url";
public static final String KAFKA_INPUT_TOPIC = "kafka.input.topic"; public static final String KAFKA_INPUT_TOPIC = "kafka.input.topic";
// Additional topics
public static final String KAFKA_OUTPUT_TOPIC = "kafka.output.topic"; public static final String KAFKA_OUTPUT_TOPIC = "kafka.output.topic";
public static final String AGGREGATION_DURATION_DAYS = "aggregation.duration.days"; public static final String CONFIGURATION_KAFKA_TOPIC = "configuration.kafka.topic";
public static final String AGGREGATION_ADVANCE_DAYS = "aggregation.advance.days"; // UC2
public static final String WINDOW_SIZE_MS = "window.size.ms";
public static final String NUM_THREADS = "num.threads"; public static final String WINDOW_GRACE_MS = "window.grace.ms";
public static final String COMMIT_INTERVAL_MS = "commit.interval.ms"; // UC3
public static final String KAFKA_WINDOW_DURATION_MINUTES = "kafka.window.duration.minutes";
public static final String CACHE_MAX_BYTES_BUFFERING = "cache.max.bytes.buffering"; // UC4
public static final String AGGREGATION_DURATION_DAYS = "aggregation.duration.days";
public static final String AGGREGATION_ADVANCE_DAYS = "aggregation.advance.days";
public static final String KAFKA_WINDOW_DURATION_MINUTES = "kafka.window.duration.minutes";
private ConfigurationKeys() {} private ConfigurationKeys() {}
......
...@@ -13,6 +13,8 @@ import titan.ccp.common.kafka.streams.PropertiesBuilder; ...@@ -13,6 +13,8 @@ import titan.ccp.common.kafka.streams.PropertiesBuilder;
public abstract class KafkaStreamsBuilder { public abstract class KafkaStreamsBuilder {
// Kafkastreams application specific // Kafkastreams application specific
protected String schemaRegistryUrl; // NOPMD for use in subclass
private String applicationName; // NOPMD private String applicationName; // NOPMD
private String applicationVersion; // NOPMD private String applicationVersion; // NOPMD
private String bootstrapServers; // NOPMD private String bootstrapServers; // NOPMD
...@@ -55,6 +57,17 @@ public abstract class KafkaStreamsBuilder { ...@@ -55,6 +57,17 @@ public abstract class KafkaStreamsBuilder {
return this; return this;
} }
/**
* Sets the URL for the schema registry.
*
* @param url The URL of the schema registry.
* @return
*/
public KafkaStreamsBuilder schemaRegistry(final String url) {
this.schemaRegistryUrl = url;
return this;
}
/** /**
* Sets the Kafka Streams property for the number of threads (num.stream.threads). Can be minus * Sets the Kafka Streams property for the number of threads (num.stream.threads). Can be minus
* one for using the default. * one for using the default.
...@@ -131,9 +144,10 @@ public abstract class KafkaStreamsBuilder { ...@@ -131,9 +144,10 @@ public abstract class KafkaStreamsBuilder {
*/ */
public KafkaStreams build() { public KafkaStreams build() {
// Check for required attributes for building properties. // Check for required attributes for building properties.
Objects.requireNonNull(this.bootstrapServers, "Bootstrap server has not been set.");
Objects.requireNonNull(this.applicationName, "Application name has not been set."); Objects.requireNonNull(this.applicationName, "Application name has not been set.");
Objects.requireNonNull(this.applicationVersion, "Application version has not been set."); Objects.requireNonNull(this.applicationVersion, "Application version has not been set.");
Objects.requireNonNull(this.bootstrapServers, "Bootstrap server has not been set.");
Objects.requireNonNull(this.schemaRegistryUrl, "Schema registry has not been set.");
// Create the Kafka streams instance. // Create the Kafka streams instance.
return new KafkaStreams(this.buildTopology(), this.buildProperties()); return new KafkaStreams(this.buildTopology(), this.buildProperties());
......
...@@ -12,9 +12,10 @@ buildscript { ...@@ -12,9 +12,10 @@ buildscript {
// Variables used to distinct different subprojects // Variables used to distinct different subprojects
def useCaseProjects = subprojects.findAll {it -> it.name.matches('uc(.)*')} def useCaseProjects = subprojects.findAll {it -> it.name.matches('uc(.)*')}
def useCaseApplications = subprojects.findAll {it -> it.name.matches('uc[0-9]+-application')}
def useCaseGenerators = subprojects.findAll {it -> it.name.matches('uc[0-9]+-workload-generator*')}
def commonProjects = subprojects.findAll {it -> it.name.matches('(.)*commons(.)*')} def commonProjects = subprojects.findAll {it -> it.name.matches('(.)*commons(.)*')}
// Plugins // Plugins
allprojects { allprojects {
apply plugin: 'eclipse' apply plugin: 'eclipse'
...@@ -51,17 +52,18 @@ allprojects { ...@@ -51,17 +52,18 @@ allprojects {
maven { maven {
url "https://oss.sonatype.org/content/repositories/snapshots/" url "https://oss.sonatype.org/content/repositories/snapshots/"
} }
maven {
url 'https://packages.confluent.io/maven/'
}
} }
} }
// Dependencies for all use cases // Dependencies for all use case applications
configure(useCaseProjects) { configure(useCaseApplications) {
dependencies { dependencies {
// These dependencies are exported to consumers, that is to say found on their compile classpath.
api('org.industrial-devops:titan-ccp-common:0.0.4-SNAPSHOT') { changing = true }
// These dependencies are used internally, and not exposed to consumers on their own compile classpath. // These dependencies are used internally, and not exposed to consumers on their own compile classpath.
implementation 'org.apache.kafka:kafka-clients:2.1.0' implementation('org.industrial-devops:titan-ccp-common:0.1.0-SNAPSHOT') { changing = true }
implementation('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') { changing = true }
implementation 'com.google.guava:guava:24.1-jre' implementation 'com.google.guava:guava:24.1-jre'
implementation 'org.jctools:jctools-core:2.1.1' implementation 'org.jctools:jctools-core:2.1.1'
implementation 'org.slf4j:slf4j-simple:1.6.1' implementation 'org.slf4j:slf4j-simple:1.6.1'
...@@ -72,15 +74,31 @@ configure(useCaseProjects) { ...@@ -72,15 +74,31 @@ configure(useCaseProjects) {
} }
} }
// Dependencies for all use case generators
configure(useCaseGenerators) {
dependencies {
// These dependencies are used internally, and not exposed to consumers on their own compile classpath.
implementation('org.industrial-devops:titan-ccp-common:0.1.0-SNAPSHOT') { changing = true }
implementation('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') { changing = true }
implementation 'com.google.guava:guava:24.1-jre'
implementation 'org.jctools:jctools-core:2.1.1'
implementation 'org.slf4j:slf4j-simple:1.6.1'
// These dependencies are used for the workload-generator-commmon
implementation project(':workload-generator-commons')
// Use JUnit test framework
testImplementation 'junit:junit:4.12'
}
}
// Dependencies for all commons // Dependencies for all commons
configure(commonProjects) { configure(commonProjects) {
dependencies { dependencies {
// These dependencies is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.kafka:kafka-clients:2.4.0'
// These dependencies are used internally, and not exposed to consumers on their own compile classpath. // These dependencies are used internally, and not exposed to consumers on their own compile classpath.
implementation 'org.slf4j:slf4j-simple:1.6.1' implementation 'org.slf4j:slf4j-simple:1.6.1'
implementation('org.industrial-devops:titan-ccp-common:0.0.4-SNAPSHOT') { changing = true } implementation('org.industrial-devops:titan-ccp-common:0.1.0-SNAPSHOT') { changing = true }
implementation('org.industrial-devops:titan-ccp-common-kafka:0.1.0-SNAPSHOT') { changing = true }
// Use JUnit test framework // Use JUnit test framework
testImplementation 'junit:junit:4.12' testImplementation 'junit:junit:4.12'
......
...@@ -16,11 +16,11 @@ services: ...@@ -16,11 +16,11 @@ services:
KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 30000 KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 30000
KAFKA_CREATE_TOPICS: "input:3:1,output:3:1,configuration:3:1,aggregation-feedback:3:1,dayofweek:3:1,hourofday:3:1,hourofweek:3:1" KAFKA_CREATE_TOPICS: "input:3:1,output:3:1,configuration:3:1,aggregation-feedback:3:1,dayofweek:3:1,hourofday:3:1,hourofweek:3:1"
uc-app: uc-app:
image: benediktwetzel/uc1-app:latest image: theodolite/theodolite-uc1-kstreams-app:latest
environment: environment:
KAFKA_BOOTSTRAP_SERVERS: kafka:9092 KAFKA_BOOTSTRAP_SERVERS: kafka:9092
uc-wg: uc-wg:
image: benediktwetzel/uc1-wg:latest image: theodolite/theodolite-uc1-workload-generator:latest
environment: environment:
KAFKA_BOOTSTRAP_SERVERS: kafka:9092 KAFKA_BOOTSTRAP_SERVERS: kafka:9092
NUM_SENSORS: 1 NUM_SENSORS: 1
...@@ -16,11 +16,11 @@ services: ...@@ -16,11 +16,11 @@ services:
KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 30000 KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 30000
KAFKA_CREATE_TOPICS: "input:3:1,output:3:1,configuration:3:1,aggregation-feedback:3:1,dayofweek:3:1,hourofday:3:1,hourofweek:3:1" KAFKA_CREATE_TOPICS: "input:3:1,output:3:1,configuration:3:1,aggregation-feedback:3:1,dayofweek:3:1,hourofday:3:1,hourofweek:3:1"
uc-app: uc-app:
image: benediktwetzel/uc2-app:latest image: theodolite/theodolite-uc2-kstreams-app:latest
environment: environment:
KAFKA_BOOTSTRAP_SERVERS: kafka:9092 KAFKA_BOOTSTRAP_SERVERS: kafka:9092
uc-wg: uc-wg:
image: benediktwetzel/uc2-wg:latest image: theodolite/theodolite-uc2-workload-generator:latest
environment: environment:
KAFKA_BOOTSTRAP_SERVERS: kafka:9092 KAFKA_BOOTSTRAP_SERVERS: kafka:9092
NUM_SENSORS: 1 NUM_SENSORS: 1
\ No newline at end of file
...@@ -16,12 +16,12 @@ services: ...@@ -16,12 +16,12 @@ services:
KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 30000 KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 30000
KAFKA_CREATE_TOPICS: "input:3:1,output:3:1,configuration:3:1,aggregation-feedback:3:1,dayofweek:3:1,hourofday:3:1,hourofweek:3:1" KAFKA_CREATE_TOPICS: "input:3:1,output:3:1,configuration:3:1,aggregation-feedback:3:1,dayofweek:3:1,hourofday:3:1,hourofweek:3:1"
uc-app: uc-app:
image: benediktwetzel/uc3-app:latest image: theodolite/theodolite-uc3-kstreams-app:latest
environment: environment:
KAFKA_BOOTSTRAP_SERVERS: kafka:9092 KAFKA_BOOTSTRAP_SERVERS: kafka:9092
KAFKA_WINDOW_DURATION_MINUTES: 60 KAFKA_WINDOW_DURATION_MINUTES: 60
uc-wg: uc-wg:
image: benediktwetzel/uc3-wg:latest image: theodolite/theodolite-uc3-workload-generator:latest
environment: environment:
KAFKA_BOOTSTRAP_SERVERS: kafka:9092 KAFKA_BOOTSTRAP_SERVERS: kafka:9092
NUM_SENSORS: 1 NUM_SENSORS: 1
\ No newline at end of file
...@@ -26,11 +26,11 @@ services: ...@@ -26,11 +26,11 @@ services:
SCHEMA_REGISTRY_HOST_NAME: schema-registry SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181' SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
uc-app: uc-app:
image: soerenhenning/uc4-app:latest #TODO image: theodolite/theodolite-uc4-kstreams-app:latest
environment: environment:
KAFKA_BOOTSTRAP_SERVERS: kafka:9092 KAFKA_BOOTSTRAP_SERVERS: kafka:9092
SCHEMA_REGISTRY_URL: http://schema-registry:8081 SCHEMA_REGISTRY_URL: http://schema-registry:8081
uc-wg: uc-wg:
image: soerenhenning/uc4-wg:latest #TODO image: theodolite/theodolite-uc4-workload-generator:latest
environment: environment:
KAFKA_BOOTSTRAP_SERVERS: kafka:9092 KAFKA_BOOTSTRAP_SERVERS: kafka:9092
# Release Process
We assume that we are creating the release `v0.1.1`. Please make sure to update
to modify the following steps according to the release, you are actually
performing.
1. Create a new branch `v0.1` if not already exists. This branch will never
again be merged into master.
2. Checkout the `v0.1 branch.
3. Update all references to Theodolite Docker images to tag `v0-1-1`. These are
mainly the Kubernetes resource definitions in `execution` as well as the Docker
Compose files in `docker-test`.
4. Commit these changes.
5. Tag this commit with `v0.1.1`. The corresponding Docker images will be uploaded.
...@@ -142,10 +142,10 @@ Depending on your setup, some additional adjustments may be necessary: ...@@ -142,10 +142,10 @@ Depending on your setup, some additional adjustments may be necessary:
## Execution ## Execution
The `./run_loop.sh` is the entrypoint for all benchmark executions. Is has to be called as follows: The `./theodolite.sh` is the entrypoint for all benchmark executions. Is has to be called as follows:
```sh ```sh
./run_loop.sh <use-case> <wl-values> <instances> <partitions> <cpu-limit> <memory-limit> <commit-interval> <duration> ./theodolite.sh <use-case> <wl-values> <instances> <partitions> <cpu-limit> <memory-limit> <commit-interval> <duration>
``` ```
* `<use-case>`: Stream processing use case to be benchmarked. Has to be one of `1`, `2`, `3` or `4`. * `<use-case>`: Stream processing use case to be benchmarked. Has to be one of `1`, `2`, `3` or `4`.
......
...@@ -85,6 +85,33 @@ do ...@@ -85,6 +85,33 @@ do
done done
echo "Finish topic deletion, print topics:" echo "Finish topic deletion, print topics:"
#kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -E '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p' #kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -E '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p'
# delete zookeeper nodes used for workload generation
echo "Delete ZooKeeper configurations used for workload generation"
kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 deleteall /workload-generation"
echo "Waiting for deletion"
while [ true ]
do
IFS=', ' read -r -a array <<< $(kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 ls /" | tail -n 1 | awk -F[\]\[] '{print $2}')
found=0
for element in "${array[@]}"
do
if [ "$element" == "workload-generation" ]; then
found=1
break
fi
done
if [ $found -ne 1 ]; then
echo "ZooKeeper reset was successful."
break
else
echo "ZooKeeper reset was not successful. Retrying in 5s."
sleep 5s
fi
done
echo "Deletion finished"
echo "Exiting script" echo "Exiting script"
KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}") KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}")
......
...@@ -26,7 +26,12 @@ kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-z ...@@ -26,7 +26,12 @@ kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-z
# Start workload generator # Start workload generator
NUM_NESTED_GROUPS=$DIM_VALUE NUM_NESTED_GROUPS=$DIM_VALUE
sed "s/{{NUM_NESTED_GROUPS}}/$NUM_NESTED_GROUPS/g" uc2-workload-generator/deployment.yaml | kubectl apply -f - WL_MAX_RECORDS=150000
APPROX_NUM_SENSORS=$((4**NUM_NESTED_GROUPS))
WL_INSTANCES=$(((APPROX_NUM_SENSORS + (WL_MAX_RECORDS -1 ))/ WL_MAX_RECORDS))
WORKLOAD_GENERATOR_YAML=$(sed "s/{{NUM_NESTED_GROUPS}}/$NUM_NESTED_GROUPS/g; s/{{INSTANCES}}/$WL_INSTANCES/g" uc2-workload-generator/deployment.yaml)
echo "$WORKLOAD_GENERATOR_YAML" | kubectl apply -f -
# Start application # Start application
REPLICAS=$INSTANCES REPLICAS=$INSTANCES
...@@ -48,7 +53,8 @@ python lag_analysis.py $EXP_ID uc2 $DIM_VALUE $INSTANCES $EXECUTION_MINUTES ...@@ -48,7 +53,8 @@ python lag_analysis.py $EXP_ID uc2 $DIM_VALUE $INSTANCES $EXECUTION_MINUTES
deactivate deactivate
# Stop wl and app # Stop wl and app
kubectl delete -f uc2-workload-generator/deployment.yaml #sed "s/{{INSTANCES}}/1/g" uc2-workload-generator/deployment.yaml | kubectl delete -f -
echo "$WORKLOAD_GENERATOR_YAML" | kubectl delete -f -
kubectl delete -f uc2-application/aggregation-service.yaml kubectl delete -f uc2-application/aggregation-service.yaml
kubectl delete -f uc2-application/jmx-configmap.yaml kubectl delete -f uc2-application/jmx-configmap.yaml
kubectl delete -f uc2-application/service-monitor.yaml kubectl delete -f uc2-application/service-monitor.yaml
...@@ -78,6 +84,33 @@ do ...@@ -78,6 +84,33 @@ do
done done
echo "Finish topic deletion, print topics:" echo "Finish topic deletion, print topics:"
#kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -E '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p' #kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -E '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p'
# delete zookeeper nodes used for workload generation
echo "Delete ZooKeeper configurations used for workload generation"
kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 deleteall /workload-generation"
echo "Waiting for deletion"
while [ true ]
do
IFS=', ' read -r -a array <<< $(kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 ls /" | tail -n 1 | awk -F[\]\[] '{print $2}')
found=0
for element in "${array[@]}"
do
if [ "$element" == "workload-generation" ]; then
found=1
break
fi
done
if [ $found -ne 1 ]; then
echo "ZooKeeper reset was successful."
break
else
echo "ZooKeeper reset was not successful. Retrying in 5s."
sleep 5s
fi
done
echo "Deletion finished"
echo "Exiting script" echo "Exiting script"
KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}") KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}")
......
...@@ -86,6 +86,33 @@ do ...@@ -86,6 +86,33 @@ do
done done
echo "Finish topic deletion, print topics:" echo "Finish topic deletion, print topics:"
#kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -E '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p' #kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -E '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p'
# delete zookeeper nodes used for workload generation
echo "Delete ZooKeeper configurations used for workload generation"
kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 deleteall /workload-generation"
echo "Waiting for deletion"
while [ true ]
do
IFS=', ' read -r -a array <<< $(kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 ls /" | tail -n 1 | awk -F[\]\[] '{print $2}')
found=0
for element in "${array[@]}"
do
if [ "$element" == "workload-generation" ]; then
found=1
break
fi
done
if [ $found -ne 1 ]; then
echo "ZooKeeper reset was successful."
break
else
echo "ZooKeeper reset was not successful. Retrying in 5s."
sleep 5s
fi
done
echo "Deletion finished"
echo "Exiting script" echo "Exiting script"
KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}") KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}")
......
...@@ -26,8 +26,11 @@ kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-z ...@@ -26,8 +26,11 @@ kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-z
# Start workload generator # Start workload generator
NUM_SENSORS=$DIM_VALUE NUM_SENSORS=$DIM_VALUE
#NUM_SENSORS=xy WL_MAX_RECORDS=150000
sed "s/{{NUM_SENSORS}}/$NUM_SENSORS/g" uc4-workload-generator/deployment.yaml | kubectl apply -f - WL_INSTANCES=$(((NUM_SENSORS + (WL_MAX_RECORDS -1 ))/ WL_MAX_RECORDS))
WORKLOAD_GENERATOR_YAML=$(sed "s/{{NUM_SENSORS}}/$NUM_SENSORS/g; s/{{INSTANCES}}/$WL_INSTANCES/g" uc4-workload-generator/deployment.yaml)
echo "$WORKLOAD_GENERATOR_YAML" | kubectl apply -f -
# Start application # Start application
REPLICAS=$INSTANCES REPLICAS=$INSTANCES
...@@ -51,7 +54,8 @@ python lag_analysis.py $EXP_ID uc4 $DIM_VALUE $INSTANCES $EXECUTION_MINUTES ...@@ -51,7 +54,8 @@ python lag_analysis.py $EXP_ID uc4 $DIM_VALUE $INSTANCES $EXECUTION_MINUTES
deactivate deactivate
# Stop wl and app # Stop wl and app
kubectl delete -f uc4-workload-generator/deployment.yaml #sed "s/{{INSTANCES}}/1/g" uc4-workload-generator/deployment.yaml | kubectl delete -f -
echo "$WORKLOAD_GENERATOR_YAML" | kubectl delete -f -
kubectl delete -f uc4-application/aggregation-service.yaml kubectl delete -f uc4-application/aggregation-service.yaml
kubectl delete -f uc4-application/jmx-configmap.yaml kubectl delete -f uc4-application/jmx-configmap.yaml
kubectl delete -f uc4-application/service-monitor.yaml kubectl delete -f uc4-application/service-monitor.yaml
...@@ -81,6 +85,33 @@ do ...@@ -81,6 +85,33 @@ do
done done
echo "Finish topic deletion, print topics:" echo "Finish topic deletion, print topics:"
#kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -E '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p' #kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list" | sed -n -E '/^(titan-.*|input|output|configuration)( - marked for deletion)?$/p'
# delete zookeeper nodes used for workload generation
echo "Delete ZooKeeper configurations used for workload generation"
kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 deleteall /workload-generation"
echo "Waiting for deletion"
while [ true ]
do
IFS=', ' read -r -a array <<< $(kubectl exec zookeeper-client -- bash -c "zookeeper-shell my-confluent-cp-zookeeper:2181 ls /" | tail -n 1 | awk -F[\]\[] '{print $2}')
found=0
for element in "${array[@]}"
do
if [ "$element" == "workload-generation" ]; then
found=1
break
fi
done
if [ $found -ne 1 ]; then
echo "ZooKeeper reset was successful."
break
else
echo "ZooKeeper reset was not successful. Retrying in 5s."
sleep 5s
fi
done
echo "Deletion finished"
echo "Exiting script" echo "Exiting script"
KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}") KAFKA_LAG_EXPORTER_POD=$(kubectl get pod -l app.kubernetes.io/name=kafka-lag-exporter -o jsonpath="{.items[0].metadata.name}")
......
...@@ -15,13 +15,15 @@ spec: ...@@ -15,13 +15,15 @@ spec:
terminationGracePeriodSeconds: 0 terminationGracePeriodSeconds: 0
containers: containers:
- name: uc1-application - name: uc1-application
image: "soerenhenning/uc1-app:latest" image: "theodolite/theodolite-uc1-kstreams-app:latest"
ports: ports:
- containerPort: 5555 - containerPort: 5555
name: jmx name: jmx
env: env:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "my-confluent-cp-kafka:9092" value: "my-confluent-cp-kafka:9092"
- name: SCHEMA_REGISTRY_URL
value: "http://my-confluent-cp-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "{{KAFKA_STREAMS_COMMIT_INTERVAL_MS}}" value: "{{KAFKA_STREAMS_COMMIT_INTERVAL_MS}}"
- name: JAVA_OPTS - name: JAVA_OPTS
......
apiVersion: apps/v1 apiVersion: apps/v1
kind: StatefulSet kind: Deployment
metadata: metadata:
name: titan-ccp-load-generator name: titan-ccp-load-generator
spec: spec:
selector: selector:
matchLabels: matchLabels:
app: titan-ccp-load-generator app: titan-ccp-load-generator
serviceName: titan-ccp-load-generator
replicas: {{INSTANCES}} replicas: {{INSTANCES}}
template: template:
metadata: metadata:
...@@ -16,10 +15,16 @@ spec: ...@@ -16,10 +15,16 @@ spec:
terminationGracePeriodSeconds: 0 terminationGracePeriodSeconds: 0
containers: containers:
- name: workload-generator - name: workload-generator
image: soerenhenning/uc1-wg:latest image: theodolite/theodolite-uc1-workload-generator:latest
env: env:
- name: ZK_HOST
value: "my-confluent-cp-zookeeper"
- name: ZK_PORT
value: "2181"
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "my-confluent-cp-kafka:9092" value: "my-confluent-cp-kafka:9092"
- name: SCHEMA_REGISTRY_URL
value: "http://my-confluent-cp-schema-registry:8081"
- name: NUM_SENSORS - name: NUM_SENSORS
value: "{{NUM_SENSORS}}" value: "{{NUM_SENSORS}}"
- name: POD_NAME - name: POD_NAME
...@@ -28,4 +33,3 @@ spec: ...@@ -28,4 +33,3 @@ spec:
fieldPath: metadata.name fieldPath: metadata.name
- name: INSTANCES - name: INSTANCES
value: "{{INSTANCES}}" value: "{{INSTANCES}}"
\ No newline at end of file
...@@ -15,13 +15,15 @@ spec: ...@@ -15,13 +15,15 @@ spec:
terminationGracePeriodSeconds: 0 terminationGracePeriodSeconds: 0
containers: containers:
- name: uc2-application - name: uc2-application
image: "benediktwetzel/uc2-app:latest" image: "theodolite/theodolite-uc2-kstreams-app:latest"
ports: ports:
- containerPort: 5555 - containerPort: 5555
name: jmx name: jmx
env: env:
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "my-confluent-cp-kafka:9092" value: "my-confluent-cp-kafka:9092"
- name: SCHEMA_REGISTRY_URL
value: "http://my-confluent-cp-schema-registry:8081"
- name: COMMIT_INTERVAL_MS - name: COMMIT_INTERVAL_MS
value: "{{KAFKA_STREAMS_COMMIT_INTERVAL_MS}}" value: "{{KAFKA_STREAMS_COMMIT_INTERVAL_MS}}"
- name: JAVA_OPTS - name: JAVA_OPTS
......
...@@ -6,7 +6,7 @@ spec: ...@@ -6,7 +6,7 @@ spec:
selector: selector:
matchLabels: matchLabels:
app: titan-ccp-load-generator app: titan-ccp-load-generator
replicas: 1 replicas: {{INSTANCES}}
template: template:
metadata: metadata:
labels: labels:
...@@ -15,14 +15,23 @@ spec: ...@@ -15,14 +15,23 @@ spec:
terminationGracePeriodSeconds: 0 terminationGracePeriodSeconds: 0
containers: containers:
- name: workload-generator - name: workload-generator
image: benediktwetzel/uc2-wg:latest image: theodolite/theodolite-uc2-workload-generator:latest
env: env:
- name: ZK_HOST
value: "my-confluent-cp-zookeeper"
- name: ZK_PORT
value: "2181"
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "my-confluent-cp-kafka:9092" value: "my-confluent-cp-kafka:9092"
- name: HIERARCHY - name: SCHEMA_REGISTRY_URL
value: "full" value: "http://my-confluent-cp-schema-registry:8081"
- name: NUM_SENSORS - name: NUM_SENSORS
value: "4" value: "4"
- name: NUM_NESTED_GROUPS - name: NUM_NESTED_GROUPS
value: "{{NUM_NESTED_GROUPS}}" value: "{{NUM_NESTED_GROUPS}}"
- name: POD_NAME
\ No newline at end of file valueFrom:
fieldRef:
fieldPath: metadata.name
- name: INSTANCES
value: "{{INSTANCES}}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment