Skip to content
Snippets Groups Projects
Commit 4dd8f04b authored by Björn Vonheiden's avatar Björn Vonheiden
Browse files

Use right images in run uc python and fix some code flaws

parent 7d0bc7c8
No related branches found
No related tags found
No related merge requests found
......@@ -156,7 +156,8 @@ def start_workload_generator(wg_yaml):
wg_yaml['spec']['replicas'] = wl_instances
# TODO: acces over name of container
wg_containter = wg_yaml['spec']['template']['spec']['containers'][0]
wg_containter['image'] = 'soerenhenning/uc' + args.uc_id + '-wg:latest'
wg_containter['image'] = 'theodolite/theodolite-uc' + args.uc_id + \
+ '-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)
......@@ -204,7 +205,7 @@ def start_application(svc_yaml, svc_monitor_yaml, jmx_yaml, deploy_yaml):
group="monitoring.coreos.com",
version="v1",
namespace="default",
plural="servicemonitors", # From CustomResourceDefinition of ServiceMonitor
plural="servicemonitors", # CustomResourceDef of ServiceMonitor
body=svc_monitor_yaml,
)
print("ServiceMonitor '%s' created." % svc_monitor['metadata']['name'])
......@@ -225,7 +226,8 @@ def start_application(svc_yaml, svc_monitor_yaml, jmx_yaml, deploy_yaml):
deploy_yaml['spec']['replicas'] = args.instances
# TODO: acces over name of container
app_container = deploy_yaml['spec']['template']['spec']['containers'][0]
app_container['image'] = 'soerenhenning/uc' + args.uc_id + '-app:latest'
app_container['image'] = 'theodolite/theodolite-uc' + args.uc_id \
+ '-kstreams-app:latest'
# TODO: acces over name of attribute
app_container['env'][1]['value'] = str(args.commit_interval_ms)
app_container['resources']['limits']['memory'] = args.memory_limit
......@@ -279,6 +281,7 @@ def delete_resource(obj, del_func):
return
print('Resource deleted')
def stop_applications(wg, app_svc, app_svc_monitor, app_jmx, app_deploy):
"""Stops the applied applications and delete resources.
:param wg: The workload generator statefull set.
......@@ -324,13 +327,16 @@ def delete_topics(topics):
num_topics_command = [
'/bin/sh',
'-c',
f'kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list | sed -n -E "/^(theodolite-.*|input|output|configuration)( - marked for deletion)?$/p" | wc -l'
f'kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --list \
| sed -n -E "/^(theodolite-.*|input|output|configuration)\
( - marked for deletion)?$/p" | wc -l'
]
topics_deletion_command = [
'/bin/sh',
'-c',
f'kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --delete --topic "input|output|configuration|theodolite-.*"'
f'kafka-topics --zookeeper my-confluent-cp-zookeeper:2181 --delete \
--topic "input|output|configuration|theodolite-.*"'
]
# Wait that topics get deleted
......@@ -401,7 +407,11 @@ def main():
print('---------------------')
wg = start_workload_generator(wg)
print('---------------------')
app_svc, app_svc_monitor, app_jmx, app_deploy = start_application(app_svc, app_svc_monitor, app_jmx, app_deploy)
app_svc, app_svc_monitor, app_jmx, app_deploy = start_application(
app_svc,
app_svc_monitor,
app_jmx,
app_deploy)
print('---------------------')
wait_execution()
print('---------------------')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment