diff --git a/execution/run_uc.py b/execution/run_uc.py index b19692b0f36a32ea93adecbf53dc3f2dee300a27..04d38eea7133780ad8ae1c41f60a36d79a8bdca1 100644 --- a/execution/run_uc.py +++ b/execution/run_uc.py @@ -147,6 +147,7 @@ def start_workload_generator(wg_yaml): the yaml object. """ print('Start workload generator') + num_sensors = args.dim_value wl_max_records = 150000 # TODO: How is this calculation done? @@ -157,20 +158,20 @@ def start_workload_generator(wg_yaml): # TODO: acces over name of container wg_containter = wg_yaml['spec']['template']['spec']['containers'][0] wg_containter['image'] = 'theodolite/theodolite-uc' + args.uc_id + \ - + '-workload-generator:latest' + '-workload-generator:latest' # TODO: acces over name of attribute wg_containter['env'][1]['value'] = str(num_sensors) wg_containter['env'][2]['value'] = str(wl_instances) try: - wg_ss = appsApi.create_namespaced_stateful_set( + wg_ss = appsApi.create_namespaced_deployment( namespace="default", body=wg_yaml ) - print("StatefulSet '%s' created." % wg_ss.metadata.name) + print("Deployment '%s' created." % wg_ss.metadata.name) return wg_ss except client.rest.ApiException as e: - print("StatefulSet creation error: %s" % e.reason) + print("Deployment creation error: %s" % e.reason) return wg_yaml @@ -277,7 +278,7 @@ def delete_resource(obj, del_func): del_func(obj['metadata']['name'], 'default') except Exception as e: print("Error deleting resource") - log.error(e) + logging.error(e) return print('Resource deleted') @@ -293,7 +294,7 @@ def stop_applications(wg, app_svc, app_svc_monitor, app_jmx, app_deploy): print('Stop use case application and workload generator') print('Delete workload generator') - delete_resource(wg, appsApi.delete_namespaced_stateful_set) + delete_resource(wg, appsApi.delete_namespaced_deployment) print('Delete app service') delete_resource(app_svc, coreApi.delete_namespaced_service) @@ -392,6 +393,11 @@ def stop_lag_exporter(): print(output) return +# def start(): +# +# +# def stop(): +# def main(): load_variables() @@ -400,6 +406,7 @@ def main(): print('---------------------') topics = [('input', args.partitions), ('output', args.partitions), + ('aggregation-feedback', args.partitions), ('configuration', 1)] create_topics(topics) print('---------------------') diff --git a/execution/run_uc1.sh b/execution/run_uc1.sh index 9ab082a523e2deed3e872dc24e4624d328c8fa2f..b6dae93aaec32305b5ee5b5e24c5a2c020644cbe 100755 --- a/execution/run_uc1.sh +++ b/execution/run_uc1.sh @@ -31,7 +31,7 @@ WL_INSTANCES=$(((NUM_SENSORS + (WL_MAX_RECORDS -1 ))/ WL_MAX_RECORDS)) cat <<EOF >uc-workload-generator/overlay/uc1-workload-generator/set_paramters.yaml apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: titan-ccp-load-generator spec: diff --git a/execution/run_uc2.sh b/execution/run_uc2.sh index 741acaa89e84b3e58ee0bfaceddd4cca08081f20..7ba3c3960359bc0739ae0999474112542c310873 100755 --- a/execution/run_uc2.sh +++ b/execution/run_uc2.sh @@ -32,7 +32,7 @@ WL_INSTANCES=$(((APPROX_NUM_SENSORS + (WL_MAX_RECORDS -1 ))/ WL_MAX_RECORDS)) cat <<EOF >uc-workload-generator/overlay/uc2-workload-generator/set_paramters.yaml apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: titan-ccp-load-generator spec: diff --git a/execution/run_uc3.sh b/execution/run_uc3.sh index ff61e7587557e54e7f2af2cdba9f1a0983231c6a..5066ee9ef4fafa722b7b55313eaf77de3194215e 100755 --- a/execution/run_uc3.sh +++ b/execution/run_uc3.sh @@ -31,7 +31,7 @@ WL_INSTANCES=$(((NUM_SENSORS + (WL_MAX_RECORDS -1 ))/ WL_MAX_RECORDS)) cat <<EOF >uc-workload-generator/overlay/uc3-workload-generator/set_paramters.yaml apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: titan-ccp-load-generator spec: diff --git a/execution/run_uc4.sh b/execution/run_uc4.sh index 4d558dca3beab211475bf787f9293b13411c33e0..673c6cb00f23094d77e6274524ed75325a25fea8 100755 --- a/execution/run_uc4.sh +++ b/execution/run_uc4.sh @@ -31,7 +31,7 @@ WL_INSTANCES=$(((NUM_SENSORS + (WL_MAX_RECORDS -1 ))/ WL_MAX_RECORDS)) cat <<EOF >uuc-workload-generator/overlay/uc4-workload-generator/set_paramters.yaml apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: titan-ccp-load-generator spec: diff --git a/execution/uc-workload-generator/base/workloadGenerator.yaml b/execution/uc-workload-generator/base/workloadGenerator.yaml index 1f21776c7f33bb4348decf8099f6f97669d33047..794468b18dc74ca09872577b5b3c115605bd4620 100644 --- a/execution/uc-workload-generator/base/workloadGenerator.yaml +++ b/execution/uc-workload-generator/base/workloadGenerator.yaml @@ -6,7 +6,6 @@ spec: selector: matchLabels: app: titan-ccp-load-generator - serviceName: titan-ccp-load-generator replicas: 1 template: metadata: @@ -16,8 +15,15 @@ spec: terminationGracePeriodSeconds: 0 containers: - name: workload-generator - image: uc-workload-generator:latest + image: workload-generator:latest env: + # Order need to be preserved for run_uc.py + - name: NUM_SENSORS + value: "25000" + - name: INSTANCES + value: "1" + - name: NUM_NESTED_GROUPS + value: "5" - name: ZK_HOST value: "my-confluent-cp-zookeeper" - name: ZK_PORT @@ -26,10 +32,6 @@ spec: value: "my-confluent-cp-kafka:9092" - name: SCHEMA_REGISTRY_URL value: "http://my-confluent-cp-schema-registry:8081" - - name: NUM_SENSORS - value: "25000" - - name: INSTANCES - value: "1" - name: POD_NAME valueFrom: fieldRef: diff --git a/execution/uc-workload-generator/overlay/uc1-workload-generator/set_paramters.yaml b/execution/uc-workload-generator/overlay/uc1-workload-generator/set_paramters.yaml index a63afa46fe0ecc4602ace583cc4fa0a7e4943366..b275607c27723b1e7e5e7e2b5c02942731bed809 100644 --- a/execution/uc-workload-generator/overlay/uc1-workload-generator/set_paramters.yaml +++ b/execution/uc-workload-generator/overlay/uc1-workload-generator/set_paramters.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: titan-ccp-load-generator spec: diff --git a/execution/uc-workload-generator/overlay/uc2-workload-generator/set_paramters.yaml b/execution/uc-workload-generator/overlay/uc2-workload-generator/set_paramters.yaml index 9fdac91cba8e31f36cf9778c5114a123a8868f35..187cb4717195537288e58035dcdda5f34fc9ceed 100644 --- a/execution/uc-workload-generator/overlay/uc2-workload-generator/set_paramters.yaml +++ b/execution/uc-workload-generator/overlay/uc2-workload-generator/set_paramters.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: titan-ccp-load-generator spec: diff --git a/execution/uc-workload-generator/overlay/uc3-workload-generator/set_paramters.yaml b/execution/uc-workload-generator/overlay/uc3-workload-generator/set_paramters.yaml index a63afa46fe0ecc4602ace583cc4fa0a7e4943366..b275607c27723b1e7e5e7e2b5c02942731bed809 100644 --- a/execution/uc-workload-generator/overlay/uc3-workload-generator/set_paramters.yaml +++ b/execution/uc-workload-generator/overlay/uc3-workload-generator/set_paramters.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: titan-ccp-load-generator spec: diff --git a/execution/uc-workload-generator/overlay/uc4-workload-generator/set_paramters.yaml b/execution/uc-workload-generator/overlay/uc4-workload-generator/set_paramters.yaml index a63afa46fe0ecc4602ace583cc4fa0a7e4943366..b275607c27723b1e7e5e7e2b5c02942731bed809 100644 --- a/execution/uc-workload-generator/overlay/uc4-workload-generator/set_paramters.yaml +++ b/execution/uc-workload-generator/overlay/uc4-workload-generator/set_paramters.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: titan-ccp-load-generator spec: