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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sören Henning
theodolite
Commits
e4a26bc8
Commit
e4a26bc8
authored
4 years ago
by
Björn Vonheiden
Browse files
Options
Downloads
Patches
Plain Diff
integrate the atexit method in run uc py
parent
dccb6aec
No related branches found
No related tags found
2 merge requests
!42
Integerate theodolite and run uc python scripts
,
!24
run UC as python implementation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
execution/run_uc.py
+11
-4
11 additions, 4 deletions
execution/run_uc.py
with
11 additions
and
4 deletions
execution/run_uc.py
+
11
−
4
View file @
e4a26bc8
import
argparse
# parse arguments from cli
import
atexit
# used to clear resources at exit of program (e.g. ctrl-c)
from
kubernetes
import
client
,
config
# kubernetes api
from
kubernetes.stream
import
stream
import
logging
# logging
...
...
@@ -483,6 +484,7 @@ def reset_cluster(wg, app_svc, app_svc_monitor, app_jmx, app_deploy, topics):
"""
Stop the applications, delete topics, reset zookeeper and stop lag exporter.
"""
print
(
'
Reset cluster
'
)
stop_applications
(
wg
,
app_svc
,
app_svc_monitor
,
app_jmx
,
app_deploy
)
print
(
'
---------------------
'
)
delete_topics
(
topics
)
...
...
@@ -491,7 +493,6 @@ def reset_cluster(wg, app_svc, app_svc_monitor, app_jmx, app_deploy, topics):
print
(
'
---------------------
'
)
stop_lag_exporter
()
def
main
():
load_variables
()
print
(
'
---------------------
'
)
...
...
@@ -507,15 +508,20 @@ def main():
(
'
aggregation-feedback
'
,
args
.
partitions
),
(
'
configuration
'
,
1
)]
# Check for reset options
if
args
.
reset_only
:
print
(
'
Reset only cluster
'
)
# Only reset cluster an then end program
reset_cluster
(
wg
,
app_svc
,
app_svc_monitor
,
app_jmx
,
app_deploy
,
topics
)
sys
.
exit
()
if
args
.
reset
:
print
(
'
Reset cluster before execution
'
)
# Reset cluster before execution
print
(
'
Reset only mode
'
)
reset_cluster
(
wg
,
app_svc
,
app_svc_monitor
,
app_jmx
,
app_deploy
,
topics
)
print
(
'
---------------------
'
)
# Register the reset operation so that is executed at the end of program
atexit
.
register
(
reset_cluster
,
wg
,
app_svc
,
app_svc_monitor
,
app_jmx
,
app_deploy
,
topics
)
create_topics
(
topics
)
print
(
'
---------------------
'
)
...
...
@@ -532,7 +538,8 @@ def main():
wait_execution
()
print
(
'
---------------------
'
)
reset_cluster
(
wg
,
app_svc
,
app_svc_monitor
,
app_jmx
,
app_deploy
,
topics
)
# Cluster is resetted with atexit method
# reset_cluster(wg, app_svc, app_svc_monitor, app_jmx, app_deploy, topics)
if
__name__
==
'
__main__
'
:
...
...
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