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
d945fc13
Commit
d945fc13
authored
4 years ago
by
Björn Vonheiden
Committed by
Sören Henning
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Get prometheus url in run uc for the lag analysis
parent
888c9421
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
execution/lib/cli_parser.py
+4
-0
4 additions, 0 deletions
execution/lib/cli_parser.py
execution/run_uc.py
+11
-6
11 additions, 6 deletions
execution/run_uc.py
with
15 additions
and
6 deletions
execution/lib/cli_parser.py
+
4
−
0
View file @
d945fc13
...
@@ -50,6 +50,10 @@ def default_parser(description):
...
@@ -50,6 +50,10 @@ def default_parser(description):
parser
.
add_argument
(
'
--reset-only
'
,
parser
.
add_argument
(
'
--reset-only
'
,
action
=
"
store_true
"
,
action
=
"
store_true
"
,
help
=
'
Only resets the environment. Ignores all other parameters
'
)
help
=
'
Only resets the environment. Ignores all other parameters
'
)
parser
.
add_argument
(
'
--prometheus
'
,
metavar
=
'
<URL>
'
,
default
=
os
.
environ
.
get
(
'
PROMETHEUS_BASE_URL
'
),
help
=
'
Defines where to find the prometheus instance
'
)
return
parser
return
parser
def
benchmark_parser
(
description
):
def
benchmark_parser
(
description
):
...
...
This diff is collapsed.
Click to expand it.
execution/run_uc.py
+
11
−
6
View file @
d945fc13
...
@@ -4,7 +4,7 @@ from kubernetes import client, config # kubernetes api
...
@@ -4,7 +4,7 @@ from kubernetes import client, config # kubernetes api
from
kubernetes.stream
import
stream
from
kubernetes.stream
import
stream
import
lag_analysis
import
lag_analysis
import
logging
# logging
import
logging
# logging
from
os
import
path
# path utilities
from
os
import
path
,
environ
# path utilities
from
lib.cli_parser
import
execution_parser
from
lib.cli_parser
import
execution_parser
import
subprocess
# execute bash commands
import
subprocess
# execute bash commands
import
sys
# for exit of program
import
sys
# for exit of program
...
@@ -244,7 +244,7 @@ def wait_execution(execution_minutes):
...
@@ -244,7 +244,7 @@ def wait_execution(execution_minutes):
return
return
def
run_evaluation
(
exp_id
,
uc_id
,
dim_value
,
instances
,
execution_minutes
):
def
run_evaluation
(
exp_id
,
uc_id
,
dim_value
,
instances
,
execution_minutes
,
prometheus_base_url
=
None
):
"""
"""
Runs the evaluation function
Runs the evaluation function
:param string exp_id: ID of the experiment.
:param string exp_id: ID of the experiment.
...
@@ -254,7 +254,12 @@ def run_evaluation(exp_id, uc_id, dim_value, instances, execution_minutes):
...
@@ -254,7 +254,12 @@ def run_evaluation(exp_id, uc_id, dim_value, instances, execution_minutes):
:param int execution_minutes: How long the use case where executed.
:param int execution_minutes: How long the use case where executed.
"""
"""
print
(
'
Run evaluation function
'
)
print
(
'
Run evaluation function
'
)
if
prometheus_base_url
is
None
and
environ
.
get
(
'
PROMETHEUS_BASE_URL
'
)
is
None
:
lag_analysis
.
main
(
exp_id
,
f
'
uc
{
uc_id
}
'
,
dim_value
,
instances
,
execution_minutes
)
lag_analysis
.
main
(
exp_id
,
f
'
uc
{
uc_id
}
'
,
dim_value
,
instances
,
execution_minutes
)
elif
prometheus_base_url
is
not
None
:
lag_analysis
.
main
(
exp_id
,
f
'
uc
{
uc_id
}
'
,
dim_value
,
instances
,
execution_minutes
,
prometheus_base_url
)
else
:
lag_analysis
.
main
(
exp_id
,
f
'
uc
{
uc_id
}
'
,
dim_value
,
instances
,
execution_minutes
,
environ
.
get
(
'
PROMETHEUS_BASE_URL
'
))
return
return
...
@@ -449,7 +454,7 @@ def reset_cluster(wg, app_svc, app_svc_monitor, app_jmx, app_deploy, topics):
...
@@ -449,7 +454,7 @@ def reset_cluster(wg, app_svc, app_svc_monitor, app_jmx, app_deploy, topics):
stop_lag_exporter
()
stop_lag_exporter
()
def
main
(
exp_id
,
uc_id
,
dim_value
,
instances
,
partitions
,
cpu_limit
,
memory_limit
,
commit_interval_ms
,
execution_minutes
,
reset
,
reset_only
):
def
main
(
exp_id
,
uc_id
,
dim_value
,
instances
,
partitions
,
cpu_limit
,
memory_limit
,
commit_interval_ms
,
execution_minutes
,
prometheus_base_url
=
None
,
reset
=
False
,
reset_only
=
False
):
"""
"""
Main method to execute one time the benchmark for a given use case.
Main method to execute one time the benchmark for a given use case.
Start workload generator/application -> execute -> analyse -> stop all
Start workload generator/application -> execute -> analyse -> stop all
...
@@ -514,7 +519,7 @@ def main(exp_id, uc_id, dim_value, instances, partitions, cpu_limit, memory_limi
...
@@ -514,7 +519,7 @@ def main(exp_id, uc_id, dim_value, instances, partitions, cpu_limit, memory_limi
wait_execution
(
execution_minutes
)
wait_execution
(
execution_minutes
)
print
(
'
---------------------
'
)
print
(
'
---------------------
'
)
run_evaluation
(
exp_id
,
uc_id
,
dim_value
,
instances
,
execution_minutes
)
run_evaluation
(
exp_id
,
uc_id
,
dim_value
,
instances
,
execution_minutes
,
prometheus_base_url
)
print
(
'
---------------------
'
)
print
(
'
---------------------
'
)
# Reset cluster regular, therefore abort exit not needed anymore
# Reset cluster regular, therefore abort exit not needed anymore
...
@@ -528,5 +533,5 @@ if __name__ == '__main__':
...
@@ -528,5 +533,5 @@ if __name__ == '__main__':
print
(
'
---------------------
'
)
print
(
'
---------------------
'
)
main
(
args
.
exp_id
,
args
.
uc
,
args
.
load
,
args
.
instances
,
main
(
args
.
exp_id
,
args
.
uc
,
args
.
load
,
args
.
instances
,
args
.
partitions
,
args
.
cpu_limit
,
args
.
memory_limit
,
args
.
partitions
,
args
.
cpu_limit
,
args
.
memory_limit
,
args
.
commit_ms
,
args
.
duration
,
args
.
reset
,
args
.
commit_ms
,
args
.
duration
,
args
.
prometheus
,
args
.
reset
,
args
.
reset_only
)
args
.
reset_only
)
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