Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
theodolite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
4dd8f04b
Commit
4dd8f04b
authored
4 years ago
by
Björn Vonheiden
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
execution/run_uc.py
+22
-12
22 additions, 12 deletions
execution/run_uc.py
with
22 additions
and
12 deletions
execution/run_uc.py
+
22
−
12
View file @
4dd8f04b
...
...
@@ -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
CustomResourceDef
inition
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
(
'
---------------------
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment