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
ffae6983
Commit
ffae6983
authored
4 years ago
by
Sören Henning
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/access-yaml-name' into 'master'
make access of yamls safer in run uc Closes
#102
See merge request
!55
parents
1eada054
c5e8a17b
No related branches found
No related tags found
1 merge request
!55
make access of yamls safer in run uc
Pipeline
#1180
passed
4 years ago
Stage: build
Stage: test
Stage: check
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
execution/run_uc.py
+26
-21
26 additions, 21 deletions
execution/run_uc.py
with
26 additions
and
21 deletions
execution/run_uc.py
+
26
−
21
View file @
ffae6983
...
...
@@ -132,18 +132,20 @@ def start_workload_generator(wg_yaml, dim_value, uc_id):
# Customize workload generator creations
wg_yaml
[
'
spec
'
][
'
replicas
'
]
=
wl_instances
# TODO: acces over name of container
# Set used use case
wg_containter
=
wg_yaml
[
'
spec
'
][
'
template
'
][
'
spec
'
][
'
containers
'
][
0
]
wg_containter
=
next
(
filter
(
lambda
x
:
x
[
'
name
'
]
==
'
workload-generator
'
,
wg_yaml
[
'
spec
'
][
'
template
'
][
'
spec
'
][
'
containers
'
]))
wg_containter
[
'
image
'
]
=
'
theodolite/theodolite-uc
'
+
uc_id
+
\
'
-workload-generator:latest
'
# TODO: acces over name of attribute
# Set environment variables
wg_containter
[
'
env
'
][
0
][
'
value
'
]
=
str
(
num_sensors
)
wg_containter
[
'
env
'
][
1
][
'
value
'
]
=
str
(
wl_instances
)
if
uc_id
==
'
2
'
:
# Special configuration for uc2
wg_containter
[
'
env
'
][
2
][
'
value
'
]
=
str
(
num_nested_groups
)
next
(
filter
(
lambda
x
:
x
[
'
name
'
]
==
'
NUM_SENSORS
'
,
wg_containter
[
'
env
'
]))[
'
value
'
]
=
str
(
num_sensors
)
next
(
filter
(
lambda
x
:
x
[
'
name
'
]
==
'
INSTANCES
'
,
wg_containter
[
'
env
'
]))[
'
value
'
]
=
str
(
wl_instances
)
if
uc_id
==
'
2
'
:
# Special configuration for uc2
next
(
filter
(
lambda
x
:
x
[
'
name
'
]
==
'
NUM_NESTED_GROUPS
'
,
wg_containter
[
'
env
'
]))[
'
value
'
]
=
str
(
num_nested_groups
)
try
:
wg_ss
=
appsApi
.
create_namespaced_deployment
(
namespace
=
namespace
,
...
...
@@ -211,12 +213,12 @@ def start_application(svc_yaml, svc_monitor_yaml, jmx_yaml, deploy_yaml, instanc
# Create deployment
deploy_yaml
[
'
spec
'
][
'
replicas
'
]
=
instances
# TODO: acces over name of contain
er
app_container
=
deploy_yaml
[
'
spec
'
][
'
template
'
][
'
spec
'
][
'
containers
'
]
[
0
]
app_container
=
next
(
filt
er
(
lambda
x
:
x
[
'
name
'
]
==
'
uc-application
'
,
deploy_yaml
[
'
spec
'
][
'
template
'
][
'
spec
'
][
'
containers
'
]
))
app_container
[
'
image
'
]
=
'
theodolite/theodolite-uc
'
+
uc_id
\
+
'
-kstreams-app:latest
'
# TODO: acces over name of attribute
app_container
[
'
env
'
][
0
][
'
value
'
]
=
str
(
commit_interval_ms
)
next
(
filter
(
lambda
x
:
x
[
'
name
'
]
==
'
COMMIT_INTERVAL_MS
'
,
app_container
[
'
env
'
]))[
'
value
'
]
=
str
(
commit_interval_ms
)
app_container
[
'
resources
'
][
'
limits
'
][
'
memory
'
]
=
memory_limit
app_container
[
'
resources
'
][
'
limits
'
][
'
cpu
'
]
=
cpu_limit
try
:
...
...
@@ -429,11 +431,13 @@ def stop_lag_exporter():
try
:
# Get lag exporter
pod_list
=
coreApi
.
list_namespaced_pod
(
namespace
=
namespace
,
label_selector
=
'
app.kubernetes.io/name=kafka-lag-exporter
'
)
pod_list
=
coreApi
.
list_namespaced_pod
(
namespace
=
namespace
,
label_selector
=
'
app.kubernetes.io/name=kafka-lag-exporter
'
)
lag_exporter_pod
=
pod_list
.
items
[
0
].
metadata
.
name
# Delete lag exporter pod
res
=
coreApi
.
delete_namespaced_pod
(
name
=
lag_exporter_pod
,
namespace
=
namespace
)
res
=
coreApi
.
delete_namespaced_pod
(
name
=
lag_exporter_pod
,
namespace
=
namespace
)
except
ApiException
as
e
:
logging
.
error
(
'
Exception while stopping lag exporter
'
)
logging
.
error
(
e
)
...
...
@@ -523,7 +527,8 @@ def main(exp_id, uc_id, dim_value, instances, partitions, cpu_limit, memory_limi
wait_execution
(
execution_minutes
)
print
(
'
---------------------
'
)
run_evaluation
(
exp_id
,
uc_id
,
dim_value
,
instances
,
execution_minutes
,
prometheus_base_url
)
run_evaluation
(
exp_id
,
uc_id
,
dim_value
,
instances
,
execution_minutes
,
prometheus_base_url
)
print
(
'
---------------------
'
)
# Reset cluster regular, therefore abort exit not needed anymore
...
...
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