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
888c9421
Commit
888c9421
authored
4 years ago
by
Björn Vonheiden
Committed by
Sören Henning
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use the streams api in run uc py to use the zookeeper-client
parent
f2d4343d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
execution/run_uc.py
+18
-19
18 additions, 19 deletions
execution/run_uc.py
with
18 additions
and
19 deletions
execution/run_uc.py
+
18
−
19
View file @
888c9421
...
@@ -370,22 +370,14 @@ def reset_zookeeper():
...
@@ -370,22 +370,14 @@ def reset_zookeeper():
print
(
'
Delete ZooKeeper configurations used for workload generation
'
)
print
(
'
Delete ZooKeeper configurations used for workload generation
'
)
delete_zoo_data_command
=
[
delete_zoo_data_command
=
[
'
kubectl
'
,
'
/bin/sh
'
,
'
exec
'
,
'
zookeeper-client
'
,
'
--
'
,
'
bash
'
,
'
-c
'
,
'
-c
'
,
'
zookeeper-shell my-confluent-cp-zookeeper:2181 deleteall
'
'
zookeeper-shell my-confluent-cp-zookeeper:2181 deleteall
'
+
'
/workload-generation
'
+
'
/workload-generation
'
]
]
check_zoo_data_command
=
[
check_zoo_data_command
=
[
'
kubectl
'
,
'
/bin/sh
'
,
'
exec
'
,
'
zookeeper-client
'
,
'
--
'
,
'
bash
'
,
'
-c
'
,
'
-c
'
,
'
zookeeper-shell my-confluent-cp-zookeeper:2181 get
'
'
zookeeper-shell my-confluent-cp-zookeeper:2181 get
'
+
'
/workload-generation
'
+
'
/workload-generation
'
...
@@ -394,18 +386,25 @@ def reset_zookeeper():
...
@@ -394,18 +386,25 @@ def reset_zookeeper():
# Wait for configuration deletion
# Wait for configuration deletion
while
True
:
while
True
:
# Delete Zookeeper configuration data
# Delete Zookeeper configuration data
output
=
subprocess
.
run
(
delete_zoo_data_command
,
resp
=
stream
(
coreApi
.
connect_get_namespaced_pod_exec
,
capture_output
=
True
,
"
zookeeper-client
"
,
text
=
True
)
'
default
'
,
logging
.
debug
(
output
.
stdout
)
command
=
delete_zoo_data_command
,
stderr
=
True
,
stdin
=
False
,
stdout
=
True
,
tty
=
False
)
logging
.
debug
(
resp
)
# Check data is deleted
# Check data is deleted
output
=
subprocess
.
run
(
check_zoo_data_command
,
client
=
stream
(
coreApi
.
connect_get_namespaced_pod_exec
,
capture_output
=
True
,
"
zookeeper-client
"
,
text
=
True
)
'
default
'
,
logging
.
debug
(
output
)
command
=
check_zoo_data_command
,
stderr
=
True
,
stdin
=
False
,
stdout
=
True
,
tty
=
False
,
_preload_content
=
False
)
# Get client for returncode
client
.
run_forever
(
timeout
=
60
)
# Start the client
if
outpu
t
.
returncode
==
1
:
# Means data not available anymore
if
clien
t
.
returncode
==
1
:
# Means data not available anymore
print
(
'
ZooKeeper reset was successful.
'
)
print
(
'
ZooKeeper reset was successful.
'
)
break
break
else
:
else
:
...
...
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