From b385d5be1276dc583c1fe74d58b250438a4e094b Mon Sep 17 00:00:00 2001 From: perdelt Date: Wed, 14 Feb 2024 17:39:42 +0100 Subject: [PATCH 001/121] TPC-H: Show RAM cached in summary --- bexhoma/experiments.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 9b0573f24..7ef7e150a 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1420,14 +1420,21 @@ def show_summary(self): df2 = pd.DataFrame(df) df2.columns = ["SUT - Max RAM of Execution [Gb]"] ########## - if not df1.empty or not df2.empty: + df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df3 = pd.DataFrame(df) + df3.columns = ["SUT - Max RAM of Execution Cached [Gb]"] + ########## + if not df1.empty or not df2.empty or not df3.empty: print("\n### Execution") - if not df1.empty and not df2.empty: - print(pd.concat([df1, df2], axis=1).round(2)) + if not df1.empty and not df2.empty and not df3.empty: + print(pd.concat([df1, df2, df3], axis=1).round(2)) elif not df1.empty: print(df1.round(2)) elif not df2.empty: print(df2.round(2)) + elif not df3.empty: + print(df2.round(2)) """ From 85043e48dee67e11c0e5e0373bce3792b621e1a0 Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 15 Feb 2024 07:59:25 +0100 Subject: [PATCH 002/121] Bexhoma: monitor_cluster_exists --- bexhoma/clusters.py | 1 + bexhoma/configurations.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index f4fb091ea..6ed111108 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -107,6 +107,7 @@ def __init__(self, clusterconfig='cluster.config', experiments_configfolder='exp self.port = self.contextdata['port'] self.monitoring_active = True self.monitor_cluster_active = False + self.monitor_cluster_exists = favorites_table # True, if there are cAdvisors and a Prometheus server independent from bexhoma # k8s: self.namespace = self.contextdata['namespace'] self.appname = self.config['credentials']['k8s']['appname'] diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 2ddcc3823..15fd84430 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -713,7 +713,7 @@ def start_monitoring(self, app='', component='monitoring', experiment='', config :param experiment: Unique identifier of the experiment :param configuration: Name of the dbms configuration """ - if not self.experiment.monitoring_active: + if not self.experiment.monitoring_active or self.experiment.cluster.monitor_cluster_exists: return if len(app) == 0: app = self.appname @@ -1195,7 +1195,7 @@ def start_sut(self, app='', component='sut', experiment='', configuration=''): dep['spec']['selector']['experiment'] = experiment dep['spec']['selector']['dbms'] = self.docker dep['spec']['selector']['volume'] = self.volume - if not self.monitoring_active: + if not self.monitoring_active or self.experiment.cluster.monitor_cluster_exists: for i, ports in reversed(list(enumerate(dep['spec']['ports']))): # remove monitoring ports if 'name' in ports and ports['name'] != 'port-dbms': @@ -1216,7 +1216,7 @@ def start_sut(self, app='', component='sut', experiment='', configuration=''): dep['spec']['selector']['volume'] = self.volume dep['metadata']['name'] = name self.service = dep['metadata']['name'] - if not self.monitoring_active: + if not self.monitoring_active or self.experiment.cluster.monitor_cluster_exists: for i, ports in reversed(list(enumerate(dep['spec']['ports']))): # remove monitoring ports if 'name' in ports and ports['name'] != 'port-dbms': @@ -1257,7 +1257,7 @@ def start_sut(self, app='', component='sut', experiment='', configuration=''): result[key]['spec']['template']['spec']['containers'][i]['image'] = self.dockerimage else: self.dockerimage = result[key]['spec']['template']['spec']['containers'][i]['image'] - elif not self.monitoring_active or self.experiment.cluster.monitor_cluster_active: + elif not self.monitoring_active or self.experiment.cluster.monitor_cluster_active or self.experiment.cluster.monitor_cluster_exists: # remove monitoring containers if container['name'] == 'cadvisor': del result[key]['spec']['template']['spec']['containers'][i] From f689f7e38e4d750433cdcf69075a47a4c498abfb Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 15 Feb 2024 08:01:50 +0100 Subject: [PATCH 003/121] Bexhoma: monitor_cluster_exists --- bexhoma/clusters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 6ed111108..498cef80d 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -107,7 +107,7 @@ def __init__(self, clusterconfig='cluster.config', experiments_configfolder='exp self.port = self.contextdata['port'] self.monitoring_active = True self.monitor_cluster_active = False - self.monitor_cluster_exists = favorites_table # True, if there are cAdvisors and a Prometheus server independent from bexhoma + self.monitor_cluster_exists = False # True, if there are cAdvisors and a Prometheus server independent from bexhoma # k8s: self.namespace = self.contextdata['namespace'] self.appname = self.config['credentials']['k8s']['appname'] From 61d088ad57e5d1eb06039474fd98fff4b68b360f Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 15 Feb 2024 08:06:03 +0100 Subject: [PATCH 004/121] Bexhoma: monitor_cluster_exists --- bexhoma/configurations.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 15fd84430..9cb5cfd79 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -527,6 +527,8 @@ def monitoring_is_running(self): :return: True, if monitoring is running """ + if self.experiment.cluster.monitor_cluster_exists: + return True app = self.appname component = 'monitoring' configuration = self.configuration From 788825e9f94cc636ac76ca3325a87ee173abe3f7 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 10:44:30 +0100 Subject: [PATCH 005/121] Bexhoma: monitor_cluster_exists --- bexhoma/clusters.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 498cef80d..a04c8ce81 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1318,6 +1318,8 @@ def start_monitoring_cluster(self, app='', component='monitoring'): :param component: Component name, should be 'monitoring' typically """ self.monitor_cluster_active = True + if self.monitor_cluster_exists: + return endpoints = self.get_service_endpoints(service_name="bexhoma-service-monitoring-default") if len(endpoints) > 0: # monitoring exists From ed71d0877957d29f89387c3062fa54972361ef1e Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 11:55:07 +0100 Subject: [PATCH 006/121] TPC-H: More details about monitoring in summary --- bexhoma/experiments.py | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 7ef7e150a..2a7eb38ae 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1390,25 +1390,33 @@ def show_summary(self): print(df_benchmark) ##################### if (self.monitoring_active or self.cluster.monitor_cluster_active): + df_monitoring = list() ##################### df = evaluate.get_loading_metrics('total_cpu_util_s') df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df1 = pd.DataFrame(df) - df1.columns = ["SUT - CPU of Ingestion (via counter) [CPUs]"] + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["SUT - CPU [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) ########## df = evaluate.get_loading_metrics('total_cpu_memory')/1024 df = df.T.max().sort_index() - df2 = pd.DataFrame(df).round(2) - df2.columns = ["SUT - Max RAM of Ingestion [Gb]"] + df_cleaned = pd.DataFrame(df).round(2) + df_cleaned.columns = ["SUT - Max RAM [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) ########## - if not df1.empty or not df2.empty: + df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["SUT - Max RAM Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + if len(df_monitoring) > 0: print("\n### Ingestion") - if not df1.empty and not df2.empty: - print(pd.concat([df1, df2], axis=1).round(2)) - elif not df1.empty: - print(df1.round(2)) - elif not df2.empty: - print(df2.round(2)) + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) ##################### df = evaluate.get_streaming_metrics('total_cpu_util_s') df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter From d61aeac65fde770e50df25b164f6916a97d59a0d Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 11:58:16 +0100 Subject: [PATCH 007/121] TPC-H: More details about monitoring in summary --- bexhoma/experiments.py | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 2a7eb38ae..fbad19c38 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1390,6 +1390,7 @@ def show_summary(self): print(df_benchmark) ##################### if (self.monitoring_active or self.cluster.monitor_cluster_active): + ##################### df_monitoring = list() ##################### df = evaluate.get_loading_metrics('total_cpu_util_s') @@ -1418,31 +1419,33 @@ def show_summary(self): df = pd.concat(df_monitoring, axis=1).round(2) print(df) ##################### + df_monitoring = list() + ##################### df = evaluate.get_streaming_metrics('total_cpu_util_s') df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df1 = pd.DataFrame(df) - df1.columns = ["SUT - CPU of Execution (via counter) [CPUs]"] + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["SUT - CPU of Execution (via counter) [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) ########## df = evaluate.get_streaming_metrics('total_cpu_memory')/1024 df = df.T.max().sort_index() - df2 = pd.DataFrame(df) - df2.columns = ["SUT - Max RAM of Execution [Gb]"] + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["SUT - Max RAM of Execution [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) ########## df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 df = df.T.max().sort_index() - df3 = pd.DataFrame(df) - df3.columns = ["SUT - Max RAM of Execution Cached [Gb]"] + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["SUT - Max RAM of Execution Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) ########## - if not df1.empty or not df2.empty or not df3.empty: + if len(df_monitoring) > 0: print("\n### Execution") - if not df1.empty and not df2.empty and not df3.empty: - print(pd.concat([df1, df2, df3], axis=1).round(2)) - elif not df1.empty: - print(df1.round(2)) - elif not df2.empty: - print(df2.round(2)) - elif not df3.empty: - print(df2.round(2)) + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) """ From 5d19a2d21829b6de7e505443346a747415793b6a Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 12:01:50 +0100 Subject: [PATCH 008/121] TPC-H: More details about monitoring in summary --- bexhoma/experiments.py | 72 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index fbad19c38..1ea3ed45f 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1396,26 +1396,54 @@ def show_summary(self): df = evaluate.get_loading_metrics('total_cpu_util_s') df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["SUT - CPU [CPUs]"] + df_cleaned.columns = ["CPU [CPUs]"] if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## df = evaluate.get_loading_metrics('total_cpu_memory')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df).round(2) - df_cleaned.columns = ["SUT - Max RAM [Gb]"] + df_cleaned.columns = ["Max RAM [Gb]"] if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["SUT - Max RAM Cached [Gb]"] + df_cleaned.columns = ["Max RAM Cached [Gb]"] if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## if len(df_monitoring) > 0: - print("\n### Ingestion") + print("\n### Ingestion - SUT") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) + ##################### + df_monitoring = list() + ##################### + df = evaluate.get_loader_metrics('total_cpu_util_s') + df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["CPU [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_loader_metrics('total_cpu_memory')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df).round(2) + df_cleaned.columns = ["Max RAM [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_loader_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + if len(df_monitoring) > 0: + print("\n### Ingestion - Loader") df = pd.concat(df_monitoring, axis=1).round(2) print(df) ##################### @@ -1424,26 +1452,54 @@ def show_summary(self): df = evaluate.get_streaming_metrics('total_cpu_util_s') df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["SUT - CPU of Execution (via counter) [CPUs]"] + df_cleaned.columns = ["CPU [CPUs]"] if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## df = evaluate.get_streaming_metrics('total_cpu_memory')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["SUT - Max RAM of Execution [Gb]"] + df_cleaned.columns = ["Max RAM [Gb]"] if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["SUT - Max RAM of Execution Cached [Gb]"] + df_cleaned.columns = ["Max RAM Cached [Gb]"] if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## if len(df_monitoring) > 0: - print("\n### Execution") + print("\n### Execution - SUT") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) + ##################### + df_monitoring = list() + ##################### + df = evaluate.get_benchmarker_metrics('total_cpu_util_s') + df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["CPU [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_benchmarker_metrics('total_cpu_memory')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_benchmarker_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + if len(df_monitoring) > 0: + print("\n### Execution - Benchmarker") df = pd.concat(df_monitoring, axis=1).round(2) print(df) From 20936484914554da452941192e8445b2ff1cc476 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 12:09:00 +0100 Subject: [PATCH 009/121] DBMSBenchmarker: Current dev version v0.13.7 --- build.sh | 4 ++-- images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py | 2 +- images/evaluator_dbmsbenchmarker/create_Dockerfiles.py | 2 +- k8s/deploymenttemplate-bexhoma-dashboard.yml | 4 ++-- k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build.sh b/build.sh index c4ee3b22f..bff8eefa1 100644 --- a/build.sh +++ b/build.sh @@ -8,14 +8,14 @@ cd evaluator_dbmsbenchmarker python create_Dockerfiles.py #docker build -f Dockerfile_v0.13.6 -t bexhoma/evaluator_dbmsbenchmarker:v0.13.6 --no-cache . #docker build -f Dockerfile_v0.13.6 -t bexhoma/evaluator_dbmsbenchmarker:v0.13.6 . -docker push bexhoma/evaluator_dbmsbenchmarker:v0.13.6 & +docker push bexhoma/evaluator_dbmsbenchmarker:v0.13.7 & cd .. cd benchmarker_dbmsbenchmarker python create_Dockerfiles.py #docker build -f Dockerfile_v0.13.6 -t bexhoma/benchmarker_dbmsbenchmarker:v0.13.6 --no-cache . #docker build -f Dockerfile_v0.13.6 -t bexhoma/benchmarker_dbmsbenchmarker:v0.13.6 . -docker push bexhoma/benchmarker_dbmsbenchmarker:v0.13.6 & +docker push bexhoma/benchmarker_dbmsbenchmarker:v0.13.7 & cd .. ########### diff --git a/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py b/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py index 693b13a2e..bdca4be93 100644 --- a/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py +++ b/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py @@ -1,7 +1,7 @@ import subprocess #versions = ['v0.12.1','v0.12.2','v0.12.3','v0.12.4','v0.12.5'] -versions = ['v0.13.6'] +versions = ['v0.13.7'] with open('Dockerfile_template', 'r') as file: dockerfile = file.read() diff --git a/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py b/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py index 725f00095..aec78e48a 100644 --- a/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py +++ b/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py @@ -1,7 +1,7 @@ import subprocess #versions = ['v0.12.1','v0.12.2','v0.12.3','v0.12.4','v0.12.5'] -versions = ['v0.13.6'] +versions = ['v0.13.7'] with open('Dockerfile_template', 'r') as file: dockerfile = file.read() diff --git a/k8s/deploymenttemplate-bexhoma-dashboard.yml b/k8s/deploymenttemplate-bexhoma-dashboard.yml index 1a3249d4a..d7d2b29c3 100644 --- a/k8s/deploymenttemplate-bexhoma-dashboard.yml +++ b/k8s/deploymenttemplate-bexhoma-dashboard.yml @@ -33,7 +33,7 @@ spec: # effect: "NoSchedule" containers: - name: dashboard - image: bexhoma/evaluator_dbmsbenchmarker:v0.13.6 + image: bexhoma/evaluator_dbmsbenchmarker:v0.13.7 imagePullPolicy: IfNotPresent #imagePullPolicy: Always env: @@ -57,7 +57,7 @@ spec: - name: bexhoma-results mountPath: /results - name: jupyter - image: bexhoma/evaluator_dbmsbenchmarker:v0.13.6 + image: bexhoma/evaluator_dbmsbenchmarker:v0.13.7 imagePullPolicy: IfNotPresent env: - {name: MPLCONFIGDIR, value: '/tmp/'} diff --git a/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml b/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml index f8e2cc3b2..b26a50ca7 100644 --- a/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml +++ b/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml @@ -20,7 +20,7 @@ spec: effect: "NoSchedule" containers: - name: dbmsbenchmarker - image: bexhoma/benchmarker_dbmsbenchmarker:v0.13.6 + image: bexhoma/benchmarker_dbmsbenchmarker:v0.13.7 imagePullPolicy: Always #imagePullPolicy: IfNotPresent env: From d3a86ed0af318cfddc76711304dce0fd71cf13e9 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 17:05:59 +0100 Subject: [PATCH 010/121] TPC-H: More details about monitoring in summary --- bexhoma/experiments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 1ea3ed45f..c69d660f4 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1176,7 +1176,7 @@ def end_benchmarking(self, jobname, config=None): # get metrics of benchmarker components # only if general monitoring is on endpoints_cluster = self.cluster.get_service_endpoints(service_name="bexhoma-service-monitoring-default") - if len(endpoints_cluster)>0: + if len(endpoints_cluster)>0 or monitor_cluster_exists: print("{:30s}: collecting metrics of benchmarker".format(connection)) cmd['fetch_benchmarker_metrics'] = 'python metrics.py -r /results/ -db -ct benchmarker -cn dbmsbenchmarker -c {} -cf {} -f {} -e {} -ts {} -te {}'.format(connection, connection+'.config', '/results/'+self.code, self.code, start_time, end_time) #cmd['fetch_loading_metrics'] = 'python metrics.py -r /results/ -db -ct loading -c {} -cf {} -f {} -e {} -ts {} -te {}'.format(connection, c['name']+'.config', '/results/'+self.code, self.code, self.timeLoadingStart, self.timeLoadingEnd) @@ -1407,7 +1407,7 @@ def show_summary(self): if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## - df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 + df = evaluate.get_loading_metrics('total_cpu_memory_cached')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df) df_cleaned.columns = ["Max RAM Cached [Gb]"] From 0bac1f323c926babe2c80611ce71efca2b0fa9a3 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 17:21:20 +0100 Subject: [PATCH 011/121] TPC-H: More details about monitoring in summary --- bexhoma/experiments.py | 2 +- docs/Monitoring.md | 194 +++++++++++++++++------------------------ 2 files changed, 81 insertions(+), 115 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index c69d660f4..3735988b6 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1176,7 +1176,7 @@ def end_benchmarking(self, jobname, config=None): # get metrics of benchmarker components # only if general monitoring is on endpoints_cluster = self.cluster.get_service_endpoints(service_name="bexhoma-service-monitoring-default") - if len(endpoints_cluster)>0 or monitor_cluster_exists: + if len(endpoints_cluster)>0 or self.cluster.monitor_cluster_exists: print("{:30s}: collecting metrics of benchmarker".format(connection)) cmd['fetch_benchmarker_metrics'] = 'python metrics.py -r /results/ -db -ct benchmarker -cn dbmsbenchmarker -c {} -cf {} -f {} -e {} -ts {} -te {}'.format(connection, connection+'.config', '/results/'+self.code, self.code, start_time, end_time) #cmd['fetch_loading_metrics'] = 'python metrics.py -r /results/ -db -ct loading -c {} -cf {} -f {} -e {} -ts {} -te {}'.format(connection, c['name']+'.config', '/results/'+self.code, self.code, self.timeLoadingStart, self.timeLoadingEnd) diff --git a/docs/Monitoring.md b/docs/Monitoring.md index a241d63d4..07f01c77f 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -1,133 +1,99 @@ # Monitoring -To include monitoring you will need -* a Prometheus server scraping a fixed IP / Port -* a Grafana server collecting metrics from the Prometheus server -* some [configuration](#configuration) what metrics to collect +Monitoring refers to automatical observation of resource consumption of components. -This document contains information about the -* [Concept](#concept) -* [Installation](#installation) -* [Configuration](#configuration) +Bexhoma basically offers two variants +* Monitor only the system-under-test (SUT) with `-m` +* Monitor all components with `-mc` -## Concept - -

- -

- -There is -* an Experiment Host - this needs Prometheus exporters -* a Monitor - this needs a Prometheus server and a Grafana server scraping the Experiment Host -* a Manager - this needs a configuration (which metrics to collect and where from) - -## Installation - -To be documented - -### Kubernetes - -* Experiment Host: Exporters are part of the [deployments](Deployments.html) -* Monitor: Servers are deployed using Docker images, fixed on a separate monitoring instance -* Manager: See [configuration](#configuration) - -### AWS - -* Experiment Host: Exporters are deployed using Docker images, fixed on the benchmarked instance -* Monitor: Servers are deployed using Docker images, fixed on a separate monitoring instance -* Manager: See [configuration](#configuration) ## Configuration -We insert information about -* the Grafana server - * access token - * URL -* the collection - * extension of measure intervals - * time shift -* metrics definitions - -into the cluster configuration. -This is handed over to the [DBMS configuration](https://github.com/Beuth-Erdelt/DBMS-Benchmarker/blob/master/docs/Options.html#connection-file) of the [benchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker/blob/master/docs/Concept.html#monitoring-hardware-metrics) in a [monitoring section](https://github.com/Beuth-Erdelt/DBMS-Benchmarker/blob/master/docs/Options.html#monitoring). +This is handed over to the [DBMS configuration](https://dbmsbenchmarker.readthedocs.io/en/docs/Options.html#connection-file) of [DBMSBenchmarker](https://dbmsbenchmarker.readthedocs.io/en/docs/Concept.html#monitoring-hardware-metrics) for collecting metrics and . -### Example +Deployment +* `cadvisor` -The details of the metrics correspond to the YAML configuration of the [deployments](Deployments.html): +Prometheus * `job="monitor-node"` * `container_name="dbms"` +Example metrics, c.f. [config file](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s-cluster.config): ``` 'monitor': { - 'grafanatoken': 'Bearer ABCDE==', - 'grafanaurl': 'http://localhost:3000/api/datasources/proxy/1/api/v1/', - 'grafanaextend': 20, - 'grafanashift': 0, - 'prometheus_url': 'http://localhost:9090/api/v1/', + 'service_monitoring': 'http://{service}.{namespace}.svc.cluster.local:9090/api/v1/', + 'extend': 20, + 'shift': 0, 'metrics': { - 'total_cpu_memory': { - 'query': 'container_memory_working_set_bytes{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}}', - 'title': 'CPU Memory [MiB]' - }, - 'total_cpu_memory_cached': { - 'query': 'container_memory_usage_bytes{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}}', - 'title': 'CPU Memory Cached [MiB]' - }, - 'total_cpu_util': { - 'query': 'sum(irate(container_cpu_usage_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}}[1m]))', - 'title': 'CPU Util [%]' - }, - 'total_cpu_throttled': { - 'query': 'sum(irate(container_cpu_cfs_throttled_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}}[1m]))', - 'title': 'CPU Throttle [%]' - }, - 'total_cpu_util_others': { - 'query': 'sum(irate(container_cpu_usage_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name!="dbms",id!="/"}}[1m]))', - 'title': 'CPU Util Others [%]' - }, - 'total_cpu_util_s': { - 'query': 'sum(container_cpu_usage_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})', - 'title': 'CPU Util [s]' - }, - 'total_cpu_throttled_s': { - 'query': 'sum(container_cpu_cfs_throttled_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})', - 'title': 'CPU Throttle [s]' - }, - 'total_cpu_util_others_s': { - 'query': 'sum(container_cpu_usage_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name!="dbms",id!="/"}})', - 'title': 'CPU Util Others [s]' - }, - 'total_network_rx': { - 'query': 'sum(container_network_receive_bytes_total{{container_label_app="dbmsbenchmarker", job="monitor-node"}})', - 'title': 'Net Rx [b]' - }, - 'total_network_tx': { - 'query': 'sum(container_network_transmit_bytes_total{{container_label_app="dbmsbenchmarker", job="monitor-node"}})', - 'title': 'Net Tx [b]' - }, - 'total_fs_read': { - 'query': 'sum(container_fs_reads_bytes_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})', - 'title': 'FS Read [b]' - }, - 'total_fs_write': { - 'query': 'sum(container_fs_writes_bytes_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})', - 'title': 'FS Write [b]' - }, - 'total_gpu_util': { - 'query': 'sum(DCGM_FI_DEV_GPU_UTIL{{UUID=~"{gpuid}"}})', - 'title': 'GPU Util [%]' - }, - 'total_gpu_power': { - 'query': 'sum(DCGM_FI_DEV_POWER_USAGE{{UUID=~"{gpuid}"}})', - 'title': 'GPU Power Usage [W]' - }, - 'total_gpu_memory': { - 'query': 'sum(DCGM_FI_DEV_FB_USED{{UUID=~"{gpuid}"}})', - 'title': 'GPU Memory [MiB]' - }, - } -} +'total_cpu_memory': { + 'query': '(sum(max(container_memory_working_set_bytes{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}}) by (instance)))/1024/1024', + 'title': 'CPU Memory [MiB]' +}, +'total_cpu_memory_cached': { + 'query': '(sum(max(container_memory_usage_bytes{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}}) by (instance)))/1024/1024', + 'title': 'CPU Memory Cached [MiB]' +}, +'total_cpu_util': { + 'query': 'sum(irate(container_cpu_usage_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}}[1m]))', + 'title': 'CPU Util [%]' +}, +'total_cpu_throttled': { + 'query': 'sum(irate(container_cpu_cfs_throttled_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}}[1m]))', + 'title': 'CPU Throttle [%]' +}, +'total_cpu_util_others': { + 'query': 'sum(irate(container_cpu_usage_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name!="dbms",id!="/"}}[1m]))', + 'title': 'CPU Util Others [%]' +}, +'total_cpu_util_s': { + 'query': 'sum(container_cpu_usage_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}})', + 'title': 'CPU Util [s]' +}, +'total_cpu_util_user_s': { + 'query': 'sum(container_cpu_user_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}})', + 'title': 'CPU Util User [s]' +}, +'total_cpu_util_sys_s': { + 'query': 'sum(container_cpu_system_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}})', + 'title': 'CPU Util Sys [s]' +}, +'total_cpu_throttled_s': { + 'query': 'sum(container_cpu_cfs_throttled_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}})', + 'title': 'CPU Throttle [s]' +}, +'total_cpu_util_others_s': { + 'query': 'sum(container_cpu_usage_seconds_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name!="dbms",id!="/"}})', + 'title': 'CPU Util Others [s]' +}, +'total_network_rx': { + 'query': 'sum(container_network_receive_bytes_total{{container_label_app="bexhoma", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)"}})/1024/1024', + 'title': 'Net Rx [MiB]' +}, +'total_network_tx': { + 'query': 'sum(container_network_transmit_bytes_total{{container_label_app="bexhoma", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)"}})/1024/1024', + 'title': 'Net Tx [MiB]' +}, +'total_fs_read': { + 'query': 'sum(container_fs_reads_bytes_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}})/1024/1024', + 'title': 'FS Read [MiB]' +}, +'total_fs_write': { + 'query': 'sum(container_fs_writes_bytes_total{{container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_pod_name=~"(.*){configuration}-{experiment}(.*)", container_label_io_kubernetes_container_name="dbms"}})/1024/1024', + 'title': 'FS Write [MiB]' +}, +'total_gpu_util': { + 'query': 'sum(DCGM_FI_DEV_GPU_UTIL{{UUID=~"{gpuid}"}})', + 'title': 'GPU Util [%]' +}, +'total_gpu_power': { + 'query': 'sum(DCGM_FI_DEV_POWER_USAGE{{UUID=~"{gpuid}"}})', + 'title': 'GPU Power Usage [W]' +}, +'total_gpu_memory': { + 'query': 'sum(DCGM_FI_DEV_FB_USED{{UUID=~"{gpuid}"}})', + 'title': 'GPU Memory [MiB]' +}, ``` #### Fine Tuning From 432b2c6c56c982b49f4bdaccc71c5aac9c5a6720 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 17:40:23 +0100 Subject: [PATCH 012/121] TPC-H: More details about monitoring in summary --- docs/Monitoring.md | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/docs/Monitoring.md b/docs/Monitoring.md index 07f01c77f..f4324eb6c 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -6,17 +6,23 @@ Bexhoma basically offers two variants * Monitor only the system-under-test (SUT) with `-m` * Monitor all components with `-mc` +Moreover bexhoma expects the cluster to be prepared, i.e. a daemonset of cAdvisors (exporters) is running and there is a Prometheus server (collector) we can connect to. +However bexhoma can optionally install these components if missing. ## Configuration -This is handed over to the [DBMS configuration](https://dbmsbenchmarker.readthedocs.io/en/docs/Options.html#connection-file) of [DBMSBenchmarker](https://dbmsbenchmarker.readthedocs.io/en/docs/Concept.html#monitoring-hardware-metrics) for collecting metrics and . +Monitoring can be configured. +Probably you won't have to change much. +If there is a Prometheus server running in your cluster, make sure to adjust `service_monitoring`. +If there is no Prometheus server running in your cluster, make sure to leave the template in `service_monitoring` as is. -Deployment -* `cadvisor` +* `service_monitoring`: a DNS name of the Prometheus server +* `extend`: number of seconds each interval of observations should be extended + i.g., an interval [t,t'] will be extended to [t-e, t'+e] +* `shift`: number of seconds each interval of observations should be shifted + i.g., an interval [t,t'] will be shifted to [t+s, t'+s] +* `metrics`: a dict of informations about metrics to be collected, see below -Prometheus -* `job="monitor-node"` -* `container_name="dbms"` Example metrics, c.f. [config file](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s-cluster.config): @@ -96,9 +102,18 @@ Example metrics, c.f. [config file](https://github.com/Beuth-Erdelt/Benchmark-Ex }, ``` -#### Fine Tuning +This is handed over to the [DBMS configuration](https://dbmsbenchmarker.readthedocs.io/en/docs/Options.html#connection-file) of [DBMSBenchmarker](https://dbmsbenchmarker.readthedocs.io/en/docs/Concept.html#monitoring-hardware-metrics) for collecting metrics and . + -If the Grafana server has metrics coming from general Prometheus server, that is it scrapes more exporters than just the bexhoma related, we will need to specify further which metrics we are interested in. +### Fine Tuning There is a placeholder `{gpuid}` that is substituted automatically by a list of GPUs present in the pod. +## Installation + +Deployment +* `cadvisor` + +Prometheus +* `job="monitor-node"` +* `container_name="dbms"` From fe91ee5ca5f73d8cef74611958f05b86f517d64e Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 18:05:53 +0100 Subject: [PATCH 013/121] TPC-H: More details about monitoring in summary --- bexhoma/experiments.py | 32 ++++++++++++++++++++++++++++++-- docs/Monitoring.md | 9 +++++++-- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 3735988b6..cb0414bb0 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1392,7 +1392,7 @@ def show_summary(self): if (self.monitoring_active or self.cluster.monitor_cluster_active): ##################### df_monitoring = list() - ##################### + ########## df = evaluate.get_loading_metrics('total_cpu_util_s') df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter df_cleaned = pd.DataFrame(df) @@ -1400,6 +1400,13 @@ def show_summary(self): if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## + df = evaluate.get_loading_metrics('total_cpu_util') + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## df = evaluate.get_loading_metrics('total_cpu_memory')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df).round(2) @@ -1420,7 +1427,7 @@ def show_summary(self): print(df) ##################### df_monitoring = list() - ##################### + ########## df = evaluate.get_loader_metrics('total_cpu_util_s') df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter df_cleaned = pd.DataFrame(df) @@ -1428,6 +1435,13 @@ def show_summary(self): if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## + df = evaluate.get_loader_metrics('total_cpu_util') + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## df = evaluate.get_loader_metrics('total_cpu_memory')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df).round(2) @@ -1456,6 +1470,13 @@ def show_summary(self): if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## + df = evaluate.get_streaming_metrics('total_cpu_util') + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## df = evaluate.get_streaming_metrics('total_cpu_memory')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df) @@ -1484,6 +1505,13 @@ def show_summary(self): if not df_cleaned.empty: df_monitoring.append(df_cleaned.copy()) ########## + df = evaluate.get_benchmarker_metrics('total_cpu_util') + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## df = evaluate.get_benchmarker_metrics('total_cpu_memory')/1024 df = df.T.max().sort_index() df_cleaned = pd.DataFrame(df) diff --git a/docs/Monitoring.md b/docs/Monitoring.md index f4324eb6c..a140f8cdb 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -102,12 +102,17 @@ Example metrics, c.f. [config file](https://github.com/Beuth-Erdelt/Benchmark-Ex }, ``` -This is handed over to the [DBMS configuration](https://dbmsbenchmarker.readthedocs.io/en/docs/Options.html#connection-file) of [DBMSBenchmarker](https://dbmsbenchmarker.readthedocs.io/en/docs/Concept.html#monitoring-hardware-metrics) for collecting metrics and . +This is handed over to the [DBMS configuration](https://dbmsbenchmarker.readthedocs.io/en/docs/Options.html#connection-file) of [DBMSBenchmarker](https://dbmsbenchmarker.readthedocs.io/en/docs/Concept.html#monitoring-hardware-metrics) for the collection of the metrics. -### Fine Tuning +### Explanation There is a placeholder `{gpuid}` that is substituted automatically by a list of GPUs present in the pod. +There is a placeholder `{configuration}` that is substituted automatically by the name of the current configuration of the SUT. +There is a placeholder `{experiment}` that is substituted automatically by the name (identifier) of the current experiment. + +Moreover the is automatical substituion of +* `container_label_io_kubernetes_container_name="dbms"`: ## Installation From 939171292dc395c2f3b2e45e77e9110ddefddb4a Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 15 Feb 2024 18:10:47 +0100 Subject: [PATCH 014/121] TPC-H: More details about monitoring in summary --- docs/Monitoring.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/Monitoring.md b/docs/Monitoring.md index a140f8cdb..c91923899 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -114,6 +114,8 @@ There is a placeholder `{experiment}` that is substituted automatically by the n Moreover the is automatical substituion of * `container_label_io_kubernetes_container_name="dbms"`: +Summation over all matching components. + ## Installation Deployment From 61eec2fd3cd8374a6dc45f88c8e645360881a130 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 14:49:10 +0100 Subject: [PATCH 015/121] Bexhoma: test_if_monitoring_healthy() --- bexhoma/clusters.py | 25 +++++++++++++++++++++++++ docs/Monitoring.md | 2 ++ 2 files changed, 27 insertions(+) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index a04c8ce81..54a79f28e 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -43,6 +43,8 @@ import json import ast import copy +import urllib.request +import urllib.parse from dbmsbenchmarker import * from bexhoma import experiments @@ -1309,6 +1311,29 @@ def start_dashboard(self, app='', component='dashboard'): self.wait(10, silent=True) print("done") return + def test_if_monitoring_healthy(self): + """ + Tests if query_range?query=node_memory_MemTotal_bytes&start=1&end=2&step=1 at service_monitoring returns status code of 200. + This is for testing if Prometheus is up and running. + + :return: True if Prometheus returns status code 200 + """ + config_K8s = self.config['credentials']['k8s'] + if 'service_monitoring' in config_K8s['monitor']: + url = config_K8s['monitor']['service_monitoring'].format(namespace=self.contextdata['namespace']) + query = "node_memory_MemTotal_bytes" + safe_query = urllib.parse.quote_plus(query) + try: + code= urllib.request.urlopen(url+"query_range?query="+safe_query+"&start=1&end=2&step=1").getcode() + if code == 200: + print("{:30s}: is running".format("Prometheus")) + return True + else: + print("{:30s}: is not running".format("Prometheus")) + return False + except Exception as e: + print("{:30s}: is not running".format("Prometheus")) + return False def start_monitoring_cluster(self, app='', component='monitoring'): """ Starts the monitoring component and its service. diff --git a/docs/Monitoring.md b/docs/Monitoring.md index c91923899..4bb05c986 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -15,6 +15,8 @@ Monitoring can be configured. Probably you won't have to change much. If there is a Prometheus server running in your cluster, make sure to adjust `service_monitoring`. If there is no Prometheus server running in your cluster, make sure to leave the template in `service_monitoring` as is. +Bexhoma checks at the beginning of an experiment if the URL provided is reachable. +it opens a socket using `urllib.request` to test if `query_range?query=node_memory_MemTotal_bytes&start=1&end=2&step=1` has a return status of 200. * `service_monitoring`: a DNS name of the Prometheus server * `extend`: number of seconds each interval of observations should be extended From 443f0800d564868270ac31855b3ac16c36f3731a Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 14:55:14 +0100 Subject: [PATCH 016/121] Bexhoma: test_if_monitoring_healthy() --- bexhoma/clusters.py | 8 +++++--- cluster.py | 6 ++++++ docs/Monitoring.md | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 54a79f28e..7f349dd9e 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1318,21 +1318,23 @@ def test_if_monitoring_healthy(self): :return: True if Prometheus returns status code 200 """ + self.logger.debug('testbed.test_if_monitoring_healthy()') config_K8s = self.config['credentials']['k8s'] if 'service_monitoring' in config_K8s['monitor']: url = config_K8s['monitor']['service_monitoring'].format(namespace=self.contextdata['namespace']) query = "node_memory_MemTotal_bytes" safe_query = urllib.parse.quote_plus(query) try: + self.logger.debug('Test URL {}'.format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1")) code= urllib.request.urlopen(url+"query_range?query="+safe_query+"&start=1&end=2&step=1").getcode() if code == 200: - print("{:30s}: is running".format("Prometheus")) + #print("{:30s}: is running".format("Prometheus")) return True else: - print("{:30s}: is not running".format("Prometheus")) + #print("{:30s}: is not running".format("Prometheus")) return False except Exception as e: - print("{:30s}: is not running".format("Prometheus")) + #print("{:30s}: is not running".format("Prometheus")) return False def start_monitoring_cluster(self, app='', component='monitoring'): """ diff --git a/cluster.py b/cluster.py index eeb14f8bb..c75fb88c3 100644 --- a/cluster.py +++ b/cluster.py @@ -116,6 +116,12 @@ print("Result Directory: {}".format("Running")) else: print("Result Directory: {}".format("Missing")) + # get cluster monitoring Prometheus + monitoring_running = cluster.test_if_monitoring_healthy() + if monitoring_running: + print("Cluster Prometheus: {}".format("Running")) + else: + print("Cluster Prometheus: {}".format("Missing")) # get all storage volumes pvcs = cluster.get_pvc(app=app, component='storage', experiment='', configuration='') #print("PVCs", pvcs) diff --git a/docs/Monitoring.md b/docs/Monitoring.md index 4bb05c986..8d7af525c 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -15,7 +15,7 @@ Monitoring can be configured. Probably you won't have to change much. If there is a Prometheus server running in your cluster, make sure to adjust `service_monitoring`. If there is no Prometheus server running in your cluster, make sure to leave the template in `service_monitoring` as is. -Bexhoma checks at the beginning of an experiment if the URL provided is reachable. +Bexhoma checks at the beginning of an experiment if the URL provided is reachable; it opens a socket using `urllib.request` to test if `query_range?query=node_memory_MemTotal_bytes&start=1&end=2&step=1` has a return status of 200. * `service_monitoring`: a DNS name of the Prometheus server From c4c61f17e84d6c4d874d09e08e63dba5bf47e439 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:05:17 +0100 Subject: [PATCH 017/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/clusters.py | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 7f349dd9e..fc5a87570 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1326,13 +1326,33 @@ def test_if_monitoring_healthy(self): safe_query = urllib.parse.quote_plus(query) try: self.logger.debug('Test URL {}'.format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1")) - code= urllib.request.urlopen(url+"query_range?query="+safe_query+"&start=1&end=2&step=1").getcode() - if code == 200: - #print("{:30s}: is running".format("Prometheus")) - return True + #code= urllib.request.urlopen(url+"query_range?query="+safe_query+"&start=1&end=2&step=1").getcode() + # curl -ILs www.welt.de | head -n 1|cut -d$' ' -f2 + cmd = {} + command = "curl -ILs {} | head -n 1|cut -d$' ' -f2".format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1") + #fullcommand = 'kubectl exec '+self.pod_sut+' --container=dbms -- bash -c "'+command+'"' + #cores = os.popen(fullcommand).read() + stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) + status = stdout#os.popen(fullcommand).read() + if len(status)>0: + #return int(status) + print(int(status)) + if int(status) == 200: + return True + else: + return False else: - #print("{:30s}: is not running".format("Prometheus")) return False + #except Exception as e: + # logging.error(e) + # return 0 + # curl -I http://www.example.org + #if code == 200: + # #print("{:30s}: is running".format("Prometheus")) + # return True + #else: + # #print("{:30s}: is not running".format("Prometheus")) + # return False except Exception as e: #print("{:30s}: is not running".format("Prometheus")) return False From 7dfdfdf513cefac6501a4607ec426e09046d61a0 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:10:17 +0100 Subject: [PATCH 018/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/clusters.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index fc5a87570..ca32b6548 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1328,11 +1328,12 @@ def test_if_monitoring_healthy(self): self.logger.debug('Test URL {}'.format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1")) #code= urllib.request.urlopen(url+"query_range?query="+safe_query+"&start=1&end=2&step=1").getcode() # curl -ILs www.welt.de | head -n 1|cut -d$' ' -f2 + pod_dashboard = self.get_dashboard_pod_name() cmd = {} command = "curl -ILs {} | head -n 1|cut -d$' ' -f2".format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1") #fullcommand = 'kubectl exec '+self.pod_sut+' --container=dbms -- bash -c "'+command+'"' #cores = os.popen(fullcommand).read() - stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) + stdin, stdout, stderr = self.execute_command_in_pod_sut(pod=pod_dashboard, command=command) status = stdout#os.popen(fullcommand).read() if len(status)>0: #return int(status) From 595ef03cf1404930e28a00b45f799528b595a28a Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:12:27 +0100 Subject: [PATCH 019/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/clusters.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index ca32b6548..4bbf552da 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1329,8 +1329,10 @@ def test_if_monitoring_healthy(self): #code= urllib.request.urlopen(url+"query_range?query="+safe_query+"&start=1&end=2&step=1").getcode() # curl -ILs www.welt.de | head -n 1|cut -d$' ' -f2 pod_dashboard = self.get_dashboard_pod_name() + self.logger.debug('Inside pod {}'.format(pod_dashboard)) cmd = {} command = "curl -ILs {} | head -n 1|cut -d$' ' -f2".format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1") + self.logger.debug('Command {}'.format(command)) #fullcommand = 'kubectl exec '+self.pod_sut+' --container=dbms -- bash -c "'+command+'"' #cores = os.popen(fullcommand).read() stdin, stdout, stderr = self.execute_command_in_pod_sut(pod=pod_dashboard, command=command) From 69f753be936af0d8e52acb2dff19ca1515507494 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:15:37 +0100 Subject: [PATCH 020/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/clusters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 4bbf552da..79266eebd 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1331,7 +1331,7 @@ def test_if_monitoring_healthy(self): pod_dashboard = self.get_dashboard_pod_name() self.logger.debug('Inside pod {}'.format(pod_dashboard)) cmd = {} - command = "curl -ILs {} | head -n 1|cut -d$' ' -f2".format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1") + command = "curl -is {} | head -n 1|cut -d$' ' -f2".format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1") self.logger.debug('Command {}'.format(command)) #fullcommand = 'kubectl exec '+self.pod_sut+' --container=dbms -- bash -c "'+command+'"' #cores = os.popen(fullcommand).read() From bc4dc0ceda0e257c8728379d48a5beb7d54eaaab Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:16:39 +0100 Subject: [PATCH 021/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/clusters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 79266eebd..1fee269d2 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1331,7 +1331,7 @@ def test_if_monitoring_healthy(self): pod_dashboard = self.get_dashboard_pod_name() self.logger.debug('Inside pod {}'.format(pod_dashboard)) cmd = {} - command = "curl -is {} | head -n 1|cut -d$' ' -f2".format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1") + command = "curl -is '{}' | head -n 1|cut -d$' ' -f2".format(url+"query_range?query="+safe_query+"&start=1&end=2&step=1") self.logger.debug('Command {}'.format(command)) #fullcommand = 'kubectl exec '+self.pod_sut+' --container=dbms -- bash -c "'+command+'"' #cores = os.popen(fullcommand).read() From 5097740913e9bd23cdcb59dbb74f5fcfd2196720 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:26:58 +0100 Subject: [PATCH 022/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/clusters.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 1fee269d2..955d55901 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1336,6 +1336,7 @@ def test_if_monitoring_healthy(self): #fullcommand = 'kubectl exec '+self.pod_sut+' --container=dbms -- bash -c "'+command+'"' #cores = os.popen(fullcommand).read() stdin, stdout, stderr = self.execute_command_in_pod_sut(pod=pod_dashboard, command=command) + print("Return", stdout, stderr) status = stdout#os.popen(fullcommand).read() if len(status)>0: #return int(status) @@ -1358,6 +1359,7 @@ def test_if_monitoring_healthy(self): # return False except Exception as e: #print("{:30s}: is not running".format("Prometheus")) + print(e) return False def start_monitoring_cluster(self, app='', component='monitoring'): """ From 7e0bc95c3c3645f105bf9e0e55f15a5e880d9d5b Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:28:44 +0100 Subject: [PATCH 023/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/clusters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 955d55901..8c0c08037 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1335,7 +1335,7 @@ def test_if_monitoring_healthy(self): self.logger.debug('Command {}'.format(command)) #fullcommand = 'kubectl exec '+self.pod_sut+' --container=dbms -- bash -c "'+command+'"' #cores = os.popen(fullcommand).read() - stdin, stdout, stderr = self.execute_command_in_pod_sut(pod=pod_dashboard, command=command) + stdin, stdout, stderr = self.execute_command_in_pod(pod=pod_dashboard, command=command) print("Return", stdout, stderr) status = stdout#os.popen(fullcommand).read() if len(status)>0: From 3fb14dd82362bd1a8051449fa3c6f9660b1648e3 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:29:42 +0100 Subject: [PATCH 024/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/clusters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 8c0c08037..aec97fad7 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1335,12 +1335,12 @@ def test_if_monitoring_healthy(self): self.logger.debug('Command {}'.format(command)) #fullcommand = 'kubectl exec '+self.pod_sut+' --container=dbms -- bash -c "'+command+'"' #cores = os.popen(fullcommand).read() - stdin, stdout, stderr = self.execute_command_in_pod(pod=pod_dashboard, command=command) - print("Return", stdout, stderr) + stdin, stdout, stderr = self.execute_command_in_pod(pod=pod_dashboard, command=command, container="dashboard") + #print("Return", stdout, stderr) status = stdout#os.popen(fullcommand).read() if len(status)>0: #return int(status) - print(int(status)) + #print(int(status)) if int(status) == 200: return True else: From ad633c679316d0a23b859a7952218e99611205fe Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:42:56 +0100 Subject: [PATCH 025/121] Bexhoma: test_if_monitoring_healthy() with cURL --- bexhoma/experiments.py | 5 +++++ bexhoma/scripts/experimentsmanager.py | 6 ++++++ cluster.py | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index cb0414bb0..4e10c0d96 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -727,6 +727,11 @@ def work_benchmark_list(self, intervals=30, stop=True): :param intervals: Seconds to wait before checking change of status :param stop: Tells if SUT should be removed when all benchmarking has finished. Set to False if we want to have loaded SUTs for inspection. """ + # test if there is a Pometheus server running in the cluster + if self.cluster.test_if_monitoring_healthy(): + self.cluster.monitor_cluster_exists = True + else: + self.cluster.monitor_cluster_exists = False do = True while do: #time.sleep(intervals) diff --git a/bexhoma/scripts/experimentsmanager.py b/bexhoma/scripts/experimentsmanager.py index 39d18f1cb..36eb78b55 100644 --- a/bexhoma/scripts/experimentsmanager.py +++ b/bexhoma/scripts/experimentsmanager.py @@ -115,6 +115,12 @@ def manage(): print("Result directory: {}".format("Running")) else: print("Result directory: {}".format("Missing")) + # get cluster monitoring Prometheus + monitoring_running = cluster.test_if_monitoring_healthy() + if monitoring_running: + print("Cluster Prometheus: {}".format("Running")) + else: + print("Cluster Prometheus: {}".format("Not running")) # get all storage volumes pvcs = cluster.get_pvc(app=app, component='storage', experiment='', configuration='') #print("PVCs", pvcs) diff --git a/cluster.py b/cluster.py index c75fb88c3..9f3a1938d 100644 --- a/cluster.py +++ b/cluster.py @@ -121,7 +121,7 @@ if monitoring_running: print("Cluster Prometheus: {}".format("Running")) else: - print("Cluster Prometheus: {}".format("Missing")) + print("Cluster Prometheus: {}".format("Not running")) # get all storage volumes pvcs = cluster.get_pvc(app=app, component='storage', experiment='', configuration='') #print("PVCs", pvcs) From 7ff9c1a6fa1c1906ff476df2562f130c4ccfa6ac Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 15:51:02 +0100 Subject: [PATCH 026/121] Bexhoma: Monitoring docs --- docs/Monitoring.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/Monitoring.md b/docs/Monitoring.md index 8d7af525c..33fd69d7a 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -9,16 +9,28 @@ Bexhoma basically offers two variants Moreover bexhoma expects the cluster to be prepared, i.e. a daemonset of cAdvisors (exporters) is running and there is a Prometheus server (collector) we can connect to. However bexhoma can optionally install these components if missing. -## Configuration +## Configuration and Options Monitoring can be configured. Probably you won't have to change much. If there is a Prometheus server running in your cluster, make sure to adjust `service_monitoring`. If there is no Prometheus server running in your cluster, make sure to leave the template in `service_monitoring` as is. Bexhoma checks at the beginning of an experiment if the URL provided is reachable; -it opens a socket using `urllib.request` to test if `query_range?query=node_memory_MemTotal_bytes&start=1&end=2&step=1` has a return status of 200. +it uses cURL inside the dashboard pod to test if `query_range?query=node_memory_MemTotal_bytes&start=1&end=2&step=1` has a return status of 200. -* `service_monitoring`: a DNS name of the Prometheus server +If there is no preinstalled Prometheus in the cluster, bexhoma will in case of +* Monitor only the system-under-test (SUT) with `-m` + * install a cAdvisor per SUT + * install a Prometheus server per experiment +* Monitor all components with `-mc` + * install a cAdvisor per node as a daemonset + * install a Prometheus server per experiment + +Bexhoma will also make sure all components know of eachother. + +Configuration takes place in `cluster.config`: +* `service_monitoring`: a DNS name of the Prometheus server + the placeholders `service` and `namespace` are replaced by the service of the monitoring component of the experiment and the namespace inside the cluster config resp. * `extend`: number of seconds each interval of observations should be extended i.g., an interval [t,t'] will be extended to [t-e, t'+e] * `shift`: number of seconds each interval of observations should be shifted From 1e318f556ae4fb5fea6d804f481e62d1cc73a569 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 16:16:06 +0100 Subject: [PATCH 027/121] Bexhoma: Monitoring docs --- docs/Monitoring.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/Monitoring.md b/docs/Monitoring.md index 33fd69d7a..166fbf472 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -20,7 +20,7 @@ it uses cURL inside the dashboard pod to test if `query_range?query=node_memory_ If there is no preinstalled Prometheus in the cluster, bexhoma will in case of * Monitor only the system-under-test (SUT) with `-m` - * install a cAdvisor per SUT + * install a cAdvisor sidecar container per SUT * install a Prometheus server per experiment * Monitor all components with `-mc` * install a cAdvisor per node as a daemonset @@ -125,16 +125,17 @@ There is a placeholder `{gpuid}` that is substituted automatically by a list of There is a placeholder `{configuration}` that is substituted automatically by the name of the current configuration of the SUT. There is a placeholder `{experiment}` that is substituted automatically by the name (identifier) of the current experiment. -Moreover the is automatical substituion of -* `container_label_io_kubernetes_container_name="dbms"`: +Moreover the is an automatical substituion of `container_label_io_kubernetes_container_name="dbms"`; the `dbms` refers to the sut. For other containers it is replaced by `datagenerator`, `sensor` and `dbmsbenchmarker`. -Summation over all matching components. +Note that the metrics make a summation over all matching components (containers, CPU cores etc). -## Installation +### Installation Templates -Deployment -* `cadvisor` +cAdvisor +* container `cadvisor` and a service with `port-monitoring` 9300 +* example per SUT: `k8s/deploymenttemplate-PostgreSQL.yml` +* example per node: `k8s/daemonsettemplate-monitoring.yml` Prometheus -* `job="monitor-node"` -* `container_name="dbms"` +* container with a service with `port-prometheus` 9090 +* `k8s/deploymenttemplate-bexhoma-prometheus.yml` From 99e3d27414f5efaf183ff83727dd17d1aa2808c3 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 16:59:41 +0100 Subject: [PATCH 028/121] Bexhoma: Also mount bexhoma-data in dashboard --- k8s/deploymenttemplate-bexhoma-dashboard.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/k8s/deploymenttemplate-bexhoma-dashboard.yml b/k8s/deploymenttemplate-bexhoma-dashboard.yml index d7d2b29c3..aa8c7aee7 100644 --- a/k8s/deploymenttemplate-bexhoma-dashboard.yml +++ b/k8s/deploymenttemplate-bexhoma-dashboard.yml @@ -82,7 +82,10 @@ spec: volumeMounts: - name: bexhoma-results mountPath: /results + - name: benchmark-data-volume + mountPath: /data volumes: - name: bexhoma-results - persistentVolumeClaim: - claimName: bexhoma-results + persistentVolumeClaim: {claimName: bexhoma-results} + - name: benchmark-data-volume + persistentVolumeClaim: {claimName: bexhoma-data} From 768d5325b0ef1bdcd9762397d9758002ae8ec60d Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 17:16:24 +0100 Subject: [PATCH 029/121] Bexhoma: Show content of result folder as CLI tool --- requirements.txt | 2 ++ show_resultfolder.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 show_resultfolder.py diff --git a/requirements.txt b/requirements.txt index d03e278c3..f502a0573 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,3 +18,5 @@ Werkzeug>=3.0.1 fonttools>=4.43.0 # not directly required, pinned by Snyk to avoid a vulnerability dash>=2.15.0 # not directly required, pinned by Snyk to avoid a vulnerability pyarrow>=14.0.2 +prettytable + diff --git a/show_resultfolder.py b/show_resultfolder.py new file mode 100644 index 000000000..df618e9da --- /dev/null +++ b/show_resultfolder.py @@ -0,0 +1,42 @@ +""" +:Date: 2024-02-16 +:Version: 1.0 +:Authors: Patrick K. Erdelt + +Show infos about results of bexhoma. +""" +import argparse +from dbmsbenchmarker import * +from prettytable import PrettyTable, ALL + +if __name__ == '__main__': + description = """Show infos about results of bexhoma.""" + # argparse + parser = argparse.ArgumentParser(description=description) + parser.add_argument('-r', '--resultfolder', help='result folder of bexhoma', default='./') + # evaluate args + args = parser.parse_args() + + # path of folder containing experiment results + resultfolder = args.resultfolder# "/home/perdelt/benchmarks/" + + # create evaluation object for result folder + evaluate = inspector.inspector(resultfolder) + + # dataframe of experiments + df = evaluate.get_experiments_preview().sort_values('time') + df['info'] = df['info'].str.replace('. ', '.\n') + + # Create a PrettyTable object + pt = PrettyTable() + pt.field_names = df.columns + pt.align['info'] = 'r' # 'r' for right alignment + pt.hrules=ALL + + + # Add rows to the PrettyTable + for _, row in df.iterrows(): + pt.add_row(row) + + # Display the PrettyTable + print(pt) From 5987a107ad927c308e1b650d278e3bbb6035cb67 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 17:52:50 +0100 Subject: [PATCH 030/121] Docs: Config --- docs/Config.md | 198 ++++++++------------------------------------- docs/DBMS.md | 91 +++++++-------------- k8s-cluster.config | 4 +- 3 files changed, 68 insertions(+), 225 deletions(-) diff --git a/docs/Config.md b/docs/Config.md index 7d0f98d31..2bee05541 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -39,200 +39,72 @@ The rest probably can stay as is. ``` 'credentials': { 'k8s': { - 'appname': 'bexhoma', # K8s: To find corresponding deployments etc + 'appname': 'bexhoma', 'context': { - 'my_context': { # K8s: Name of context of cluster - 'namespace': 'my_namespace', # K8s: Namespace of User - 'clustername': 'my_cluster', # K8s: Name of Cluster (just for annotation) + 'my_context': { + 'namespace': 'my_namespace', + 'clustername': 'BHT', 'service_sut': '{service}.{namespace}.svc.cluster.local', - 'port': 9091, # K8s: Local port for connecting via JDBC after port forwarding + 'port': 9091, # K8s: Local port for connecting via JDBC after port forwarding }, - }, ``` * `my_context`: Context (name) of the cluster. Repeat this section for every K8s cluster you want to use. This also allows to useand compare several Clouds. -* `namespace`: Namespace in the cluster. -* `port`: Arbitrary (free) local port that is used to ping running DBMS. +* `my_namespace`: Namespace in the cluster. -### (Hardware) Monitoring - -This defines where to scrape the Prometheus metrics and is defined per context (cluster). -The services and the monitoring pods can be installed automatically by bexhoma. - -``` - 'monitor': { - 'service_monitoring': 'http://{service}.{namespace}.svc.cluster.local:9090/api/v1/', - 'extend': 20, - 'shift': 0, -``` - -* `extend`: Number of seconds the scraping interval should be extended (at both ends). -* `shift`: Number of seconds the scraping interval should be shifted (into future). - - -#### (Hardware) Metrics +## (Hardware) Monitoring It follows a dict of hardware metrics that should be collected per DBMS. +This probably can stay as is. The attributes are set by bexhoms automatically so that corresponding pods can be identified. The host is found using the service of the DBMS. +See [monitoring section](https://bexhoma.readthedocs.io/en/latest/Monitoring.html) for more details. -``` - 'metrics': { - 'total_cpu_memory': { - 'query': 'container_memory_working_set_bytes{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}}/1024/1024', - 'title': 'CPU Memory [MiB]' - }, - 'total_cpu_memory_cached': { - 'query': 'container_memory_usage_bytes{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}}/1024/1024', - 'title': 'CPU Memory Cached [MiB]' - }, - 'total_cpu_util': { - 'query': 'sum(irate(container_cpu_usage_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}}[1m]))', - 'title': 'CPU Util [%]' - }, - 'total_cpu_throttled': { - 'query': 'sum(irate(container_cpu_cfs_throttled_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}}[1m]))', - 'title': 'CPU Throttle [%]' - }, - 'total_cpu_util_others': { - 'query': 'sum(irate(container_cpu_usage_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name!="dbms",id!="/"}}[1m]))', - 'title': 'CPU Util Others [%]' - }, - 'total_cpu_util_s': { - 'query': 'sum(container_cpu_usage_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})', - 'title': 'CPU Util [s]' - }, - 'total_cpu_util_user_s': { - 'query': 'sum(container_cpu_user_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})', - 'title': 'CPU Util User [s]' - }, - 'total_cpu_util_sys_s': { - 'query': 'sum(container_cpu_system_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})', - 'title': 'CPU Util Sys [s]' - }, - 'total_cpu_throttled_s': { - 'query': 'sum(container_cpu_cfs_throttled_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})', - 'title': 'CPU Throttle [s]' - }, - 'total_cpu_util_others_s': { - 'query': 'sum(container_cpu_usage_seconds_total{{job="monitor-node", container_label_io_kubernetes_container_name!="dbms",id!="/"}})', - 'title': 'CPU Util Others [s]' - }, - 'total_network_rx': { - 'query': 'sum(container_network_receive_bytes_total{{container_label_app="bexhoma", job="monitor-node"}})/1024/1024', - 'title': 'Net Rx [MiB]' - }, - 'total_network_tx': { - 'query': 'sum(container_network_transmit_bytes_total{{container_label_app="bexhoma", job="monitor-node"}})/1024/1024', - 'title': 'Net Tx [MiB]' - }, - 'total_fs_read': { - 'query': 'sum(container_fs_reads_bytes_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})/1024/1024', - 'title': 'FS Read [MiB]' - }, - 'total_fs_write': { - 'query': 'sum(container_fs_writes_bytes_total{{job="monitor-node", container_label_io_kubernetes_container_name="dbms"}})/1024/1024', - 'title': 'FS Write [MiB]' - }, - 'total_gpu_util': { - 'query': 'sum(DCGM_FI_DEV_GPU_UTIL{{UUID=~"{gpuid}"}})', - 'title': 'GPU Util [%]' - }, - 'total_gpu_power': { - 'query': 'sum(DCGM_FI_DEV_POWER_USAGE{{UUID=~"{gpuid}"}})', - 'title': 'GPU Power Usage [W]' - }, - 'total_gpu_memory': { - 'query': 'sum(DCGM_FI_DEV_FB_USED{{UUID=~"{gpuid}"}})', - 'title': 'GPU Memory [MiB]' - }, - } - }, - } -}, -``` - -### Data Sources +## Data Sources Data sources and imports can be adressed using a key. -This is organized as follows: +This probably can stay as is. +It is organized as follows: ``` 'volumes': { 'tpch': { 'initscripts': { - 'SF1': [ + 'Schema': [ 'initschema-tpch.sql', - 'initdata-tpch-SF1.sql', - 'initdata-tpch-SF1.sh' ], - 'SF1-index': [ - 'initschema-tpch.sql', - 'initdata-tpch-SF1.sql', - 'initdata-tpch-SF1.sh', + 'Schema_dummy': [ + 'initschemadummy-tpch.sql', + ], + 'Index': [ 'initindexes-tpch.sql', ], - 'SF10': [ - 'initschema-tpch.sql', - 'initdata-tpch-SF10.sql', - 'initdata-tpch-SF10.sh' + 'Index_and_Constraints': [ + 'initindexes-tpch.sql', + 'initconstraints-tpch.sql', ], - 'SF10-index': [ - 'initschema-tpch.sql', - 'initdata-tpch-SF10.sql', - 'initdata-tpch-SF10.sh', + 'Index_and_Constraints_and_Statistics': [ 'initindexes-tpch.sql', + 'initconstraints-tpch.sql', + 'initstatistics-tpch.sql', + ], + 'SF1': [ + 'initschema-tpch.sql', + 'initdata-tpch-SF1.sql', + 'initdata-tpch-SF1.sh' ], } } }, ``` -* `tpch`: Name of the data source. -* `initscripts`: Dict of scripts to load the data source into a database. -It consists of - * a name, for example `SF1-index`, +* `tpch`: Name of the data source (addressed by the corresponding experiments) +* `initscripts`: Dict of scripts to prepare the database, ingest data, create indexes etc. + It consists of + * a name, for example `Index_and_Constraints`, * a list of script names. - The scripts `.sql` are sent to the command line tool of the DBMS (`loadData` - see below) and the files `.sh` are executed as shell scripts. + The scripts `.sql` are sent to the command line tool of the DBMS (`loadData` parameter in the DBMS configuration) and the files `.sh` are executed as shell scripts. The scripts must be present in a [config folder](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch), say `experiments/tpch/`. -The data itself must reside on a persistent volume within the cluster, that will be mounted into the DBMS container. -The examples above refer to `/data/tpch/SF1/` for example. - - -### DBMS - -DBMS can be adressed using a key. -We have to define some data per key, for example for the key `MonetDB` we use: - -``` -'dockers': { - 'MonetDB': { - 'loadData': 'cd /home/monetdb;mclient demo < {scriptname}', - 'template': { - 'version': '11.37.11', - 'alias': 'Columnwise', - 'docker_alias': 'Columnwise', - 'JDBC': { - 'auth': ['monetdb', 'monetdb'], - 'driver': 'nl.cwi.monetdb.jdbc.MonetDriver', - 'jar': 'monetdb-jdbc-2.29.jar', - 'url': 'jdbc:monetdb://{serverip}:9091/demo?so_timeout=0' - } - }, - 'logfile': '/tmp/monetdb5/dbfarm/merovingian.log', - 'datadir': '/var/monetdb5/', - 'priceperhourdollar': 0.0, - }, -} -``` - -This includes -* `loadData`: A command to run a script inside of the DBMS. This will run inside of the container of the DBMS and is used to load data. `{scriptname}` is a placeholder for the script name inside the container. -* `template`: [DBMS](https://dbmsbenchmarker.readthedocs.io/en/latest/DBMS.html) JDBC connection info that will be handed over to the benchmarker, c.f. [example](https://dbmsbenchmarker.readthedocs.io/en/latest/Options.html#connection-file). -Some of the data in the reference, like `hostsystem`, will be added by bexhoma automatically. -The JDBC driver jar must be locally available inside the container. -Some placeholders in the URL are: `serverip` (set automatically to match the corresponding pod), `dbname`, `DBNAME`, `timout_s`, `timeout_ms` (name of the database in lower and upper case, timeout in seconds and miliseconds) -* `logfile` and `datadir` that contain information about where the DBMS stores logs and databases resp. -* an optional `priceperhourdollar` that is currently ignored. - +The data itself is expected to be stored in a shared disk, that will be mounted into the DBMS container as `/data/`. +The examples scripts above (like `initdata-tpch-SF1.sql` for example) refer to `/data/tpch/SF1/` for example. diff --git a/docs/DBMS.md b/docs/DBMS.md index 4327589ad..4a7073517 100644 --- a/docs/DBMS.md +++ b/docs/DBMS.md @@ -12,47 +12,48 @@ To include a DBMS in a Kubernetes-based experiment you will need This document contains examples for * [MariaDB](#mariadb) * [MonetDB](#monetdb) -* [OmniSci](#omnisci) * [PostgreSQL](#postgresql) +* [MySQL](#mysql) ## Example Explained -### Deployment - -See documentation of [deployments](Deployments.html). - ### Configuration +DBMS can be adressed using a key. +We have to define some data per key, for example for the key `PostgreSQL` we use: + ``` -'dockers': { - 'OmniSci': { - 'loadData': 'bin/omnisql -u admin -pHyperInteractive < {scriptname}', # DBMS: Command to Login and Run Scripts - 'template': { # Template for Benchmark Tool - 'version': 'CE v5.4', - 'alias': 'GPU', - 'docker_alias': 'GPU', - 'JDBC': { - 'driver': 'com.omnisci.jdbc.OmniSciDriver', - 'url': 'jdbc:omnisci:{serverip}:9091:omnisci', - 'auth': {'user': 'admin', 'password': 'HyperInteractive'}, - 'jar': './omnisci-jdbc-4.7.1.jar' # DBMS: Local Path to JDBC Jar - } - }, - 'logfile': '/omnisci-storage/data/mapd_log/omnisci_server.INFO', # DBMS: Path to Log File on Server - 'datadir': '/omnisci-storage/data/mapd_data/', # DBMS: Path to directory containing data storage - 'priceperhourdollar': 0.0, # DBMS: Price per hour in USD if DBMS is rented - } -} +'PostgreSQL': { + 'loadData': 'psql -U postgres < {scriptname}', + 'delay_prepare': 60, + 'template': { + 'version': 'v11.4', + 'alias': 'General-B', + 'docker_alias': 'GP-B', + 'JDBC': { + 'driver': "org.postgresql.Driver", + 'auth': ["postgres", ""], + 'url': 'jdbc:postgresql://{serverip}:9091/postgres?reWriteBatchedInserts=true', + 'jar': 'postgresql-42.5.0.jar' + } + }, + 'logfile': '/usr/local/data/logfile', + 'datadir': '/var/lib/postgresql/data/', + 'priceperhourdollar': 0.0, +}, ``` This has * a base name for the DBMS -* a placeholder `template` for the [benchmark tool](https://github.com/Beuth-Erdelt/DBMS-Benchmarker/blob/master/docs/Options.html#connection-file) -* the JDBC driver jar locally available -* a command `loadData` for running the init scripts with `{scriptname}` as a placeholder for the script name inside the container -* `{serverip}` as a placeholder for the host address (localhost for k8s, an Elastic IP for AWS) +* a `delay_prepare` in seconds to wait before system is considered ready +* a placeholder `template` for the [benchmark tool DBMSBenchmarker](https://dbmsbenchmarker.readthedocs.io/en/latest/Options.html#connection-file) + Some of the data in the reference, like `hostsystem`, will be added by bexhoma automatically. +* assumed to have the JDBC driver jar locally available inside the benchmarking tool +* a command `loadData` for running the init scripts + Some placeholders in the URL are: `serverip` (set automatically to match the corresponding pod), `dbname`, `DBNAME`, `timout_s`, `timeout_ms` (name of the database in lower and upper case, timeout in seconds and miliseconds) +* `{serverip}` as a placeholder for the host address * `{dbname}` as a placeholder for the db name -* an optional `priceperhourdollar` +* an optional `priceperhourdollar` (currently ignored) * an optional name of a `logfile` that is downloaded after the benchmark * name of the `datadir` of the DBMS. It's size is measured using `du` after data loading has been finished. @@ -120,37 +121,6 @@ https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8 Example for * [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch/MonetDB) -## OmniSci - -**Deployment** - -https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s/deploymenttemplate-OmniSci.yml - -**Configuration** -``` - 'OmniSci': { - 'loadData': 'bin/omnisql -u admin -pHyperInteractive < {scriptname}', - 'template': { - 'version': 'CE v4.7', - 'alias': 'GPU A', - 'docker_alias': 'GPU A', - 'JDBC': { - 'driver': 'com.omnisci.jdbc.OmniSciDriver', - 'url': 'jdbc:omnisci:{serverip}:9091:omnisci', - 'auth': {'user': 'admin', 'password': 'HyperInteractive'}, - 'jar': './omnisci-jdbc-4.7.1.jar' - } - }, - 'logfile': '/omnisci-storage/data/mapd_log/omnisci_server.INFO', - 'datadir': '/omnisci-storage/', - 'priceperhourdollar': 0.0, - }, -``` - -***DDL Scripts*** - -Example for [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch/OmniSci) - ## PostgreSQL **Deployment** @@ -305,3 +275,4 @@ This is because configuring InnoDB takes a while and the server might restart du Example for * [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch/MySQL) * [YCSB](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/ycsb/MySQL) + diff --git a/k8s-cluster.config b/k8s-cluster.config index 9c7568257..8ce19a1a4 100644 --- a/k8s-cluster.config +++ b/k8s-cluster.config @@ -311,7 +311,7 @@ 'dockers': { 'PostgreSQL': { 'loadData': 'psql -U postgres < {scriptname}', - 'delay_prepare': 300, + 'delay_prepare': 60, 'template': { 'version': 'v11.4', 'alias': 'General-B', @@ -329,7 +329,7 @@ }, 'MySQL': { 'loadData': 'mysql --local-infile < {scriptname}', - 'delay_prepare': 300, + 'delay_prepare': 60, 'template': { 'version': 'CE 8.0.36', 'alias': 'General-C', From 0adcef71fea68a74dd24eb21b5c256c029be6ad7 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 16 Feb 2024 18:22:04 +0100 Subject: [PATCH 031/121] Docs: Config --- docs/Config.md | 2 +- docs/DBMS.md | 43 +++++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 1 - 3 files changed, 44 insertions(+), 2 deletions(-) diff --git a/docs/Config.md b/docs/Config.md index 2bee05541..1bb27e837 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -1,4 +1,4 @@ -# How to configure an experiment setup +# Configurations We need * a [config file](#clusterconfig) containing cluster information , say `cluster.config` diff --git a/docs/DBMS.md b/docs/DBMS.md index 4a7073517..5e60549ee 100644 --- a/docs/DBMS.md +++ b/docs/DBMS.md @@ -57,6 +57,49 @@ This has * an optional name of a `logfile` that is downloaded after the benchmark * name of the `datadir` of the DBMS. It's size is measured using `du` after data loading has been finished. +### Deployment Manifests + +Every DBMS that is deployed by bexhoma needs a YAML manifest. +See for example https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s/deploymenttemplate-PostgreSQL.yml + +You may want to pay attention to name of the secret: +``` + imagePullSecrets: + - {name: dockerhub} +``` +Another section that might be interesting is +``` + tolerations: +``` + +#### Parametrize Templates + +Some parameters can be changed per DBMS or per experiment in Python, for example +``` +experiment.set_resources( + requests = { + 'cpu': cpu, + 'memory': memory, + 'gpu': 0 + }, + limits = { + 'cpu': 0, + 'memory': 0 + }, + nodeSelector = { + 'cpu': cpu_type, + 'gpu': '', + }) +experiment.set_resources( + nodeSelector = { + 'cpu': cpu_type, + 'gpu': '', + 'kubernetes.io/hostname': request_node_name + }) +``` + +The parameters can be set via CLI (see for example `tpch.py`). + ## MariaDB **Deployment** diff --git a/docs/index.rst b/docs/index.rst index 49739cbd4..059fa59d5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,7 +18,6 @@ ./Concept.md ./Config.md ./DBMS.md - ./Deployments.md ./Monitoring.md ./CONTRIBUTING.md ./bexhoma From 878596bc09c0940a83f64b412a3bd144c21a541b Mon Sep 17 00:00:00 2001 From: perdelt Date: Fri, 16 Feb 2024 20:54:02 +0100 Subject: [PATCH 032/121] Bexhoma: Improved output and docs --- docs/Config.md | 9 ------- docs/Example-YCSB.md | 8 +++--- docs/Example-custom.md | 10 ++++++++ tpch.py | 52 +++++++++++++++++++-------------------- ycsb.py | 55 +++++++++++++++++++----------------------- 5 files changed, 64 insertions(+), 70 deletions(-) diff --git a/docs/Config.md b/docs/Config.md index 1bb27e837..161d87cb2 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -1,14 +1,5 @@ # Configurations -We need -* a [config file](#clusterconfig) containing cluster information , say `cluster.config` -* a [config folder](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch), say `experiments/tpch/`, containing - * a [config file](https://dbmsbenchmarker.readthedocs.io/en/latest/Options.html) `queries.config` for the workload - * folders for DDL scripts (per DBMS) -* a python script managing the experimental workflow, say `tpch.py`, see [example](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/tpch.py) - -To use the predefined examples you will only have to change the context and namespace of the Kubernetes cluster - see below. - ## Cluster-Config The configuration of the cluster, that is the possible host and experiment settings, consists of these parts (see also [example](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s-cluster.config) config file): diff --git a/docs/Example-YCSB.md b/docs/Example-YCSB.md index a83b7da6b..014cc133b 100644 --- a/docs/Example-YCSB.md +++ b/docs/Example-YCSB.md @@ -9,7 +9,7 @@ References: For performing the experiment we can run the [ycsb file](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/ycsb.py). -Example: `python ycsb.py -ms 1 -dbms PostgreSQL -workload a -tr run` +Example: `python ycsb.py -ms 1 -dbms PostgreSQL --workload a -tr run` This * loops over `n` in [1,8] and `t` in [1,2,3,4,5,6,7,8] @@ -24,7 +24,7 @@ This * imports it into the DBMS * runs `n` parallel streams of YCSB queries per DBMS * 1.000.000 operations - * workload A = 50% read / 50% write (`-workload`) + * workload A = 50% read / 50% write (`--workload`) * target throughput is `t` * 16384 * with a maximum of 1 DBMS per time (`-ms`) * tests if results match workflow (`-tr`) @@ -279,7 +279,7 @@ We might only want to benchmark the workloads of YCSB in different configuration For performing the experiment we can run the [ycsb file](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/ycsb.py). -Example: `python ycsb.py -ms 1 -m -workload a -tr -nlp 1 -dbms PostgreSQL -ne 1,2 -nc 2 -ltf 2 run` +Example: `python ycsb.py -ms 1 -m --workload a -tr -nlp 1 -dbms PostgreSQL -ne 1,2 -nc 2 -ltf 2 run` This loads a YCSB data set with 1 pod (`-lnp`) of 64 threads. There are two executions (`-ne`) run against the database, the first with 1 driver and the second with two drivers. @@ -308,7 +308,7 @@ PostgreSQL-64-1-32768-2-2 2 128 65536 2 The default behaviour of bexhoma is that the database is stored inside the ephemeral storage of the Docker container. If your cluster allows dynamic provisioning of volumes, you might request a persistent storage of a certain type (storageClass) and size. -Example: `python ycsb.py -ms 1 -m -dbms MySQL -workload a -tr -nc 2 -rst local-hdd -rss 50Gi run` +Example: `python ycsb.py -ms 1 -m -dbms MySQL --workload a -tr -nc 2 -rst local-hdd -rss 50Gi run` The following status shows we have two volumes of type `local-hdd`. Every experiment running YCSB of SF=1, if it's MySQL or PostgreSQL, will take the databases from these volumes and skip loading. In this example `-nc` is set to two, that is the complete experiment is repeated twice for statistical confidence. diff --git a/docs/Example-custom.md b/docs/Example-custom.md index 9d3cfe097..4983b737d 100644 --- a/docs/Example-custom.md +++ b/docs/Example-custom.md @@ -1,5 +1,15 @@ # Example: Run a custom SQL workload + +We need +* a [config file](#clusterconfig) containing cluster information , say `cluster.config` +* a [config folder](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/example), say `experiments/example/`, containing + * a [config file](https://dbmsbenchmarker.readthedocs.io/en/latest/Options.html) `queries.config` for the workload + * folders for DDL scripts (per DBMS) +* a python script managing the experimental workflow, say `example.py`, see [example](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/example.py) + +To use the predefined examples you will only have to change the context and namespace of the Kubernetes cluster - see below. + ## Preparation * clone repository diff --git a/tpch.py b/tpch.py index 059dbaae1..2193e7f75 100644 --- a/tpch.py +++ b/tpch.py @@ -37,39 +37,37 @@ parser = argparse.ArgumentParser(description=description) parser.add_argument('mode', help='profile the import or run the TPC-H queries', choices=['profiling', 'run', 'start', 'load', 'empty', 'summary']) parser.add_argument('-aws', '--aws', help='fix components to node groups at AWS', action='store_true', default=False) - parser.add_argument('-dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MonetDB', 'MySQL'], default=[]) + parser.add_argument('-dbms','--dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MonetDB', 'MySQL'], default=[]) parser.add_argument('-lit', '--limit-import-table', help='limit import to one table, name of this table', default='') - parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') - parser.add_argument('-cx', '--context', help='context of Kubernetes (for a multi cluster environment), default is current context', default=None) - parser.add_argument('-e', '--experiment', help='sets experiment code for continuing started experiment', default=None) - parser.add_argument('-d', '--detached', help='puts most of the experiment workflow inside the cluster', action='store_true') - parser.add_argument('-m', '--monitoring', help='activates monitoring', action='store_true') - parser.add_argument('-mc', '--monitoring-cluster', help='activates monitoring for all nodes of cluster', action='store_true', default=False) - parser.add_argument('-ms', '--max-sut', help='maximum number of parallel DBMS configurations, default is no limit', default=None) - parser.add_argument('-dt', '--datatransfer', help='activates datatransfer', action='store_true', default=False) - parser.add_argument('-md', '--monitoring-delay', help='time to wait [s] before execution of the runs of a query', default=10) - parser.add_argument('-nr', '--num-run', help='number of runs per query', default=1) - parser.add_argument('-nc', '--num-config', help='number of runs per configuration', default=1) - parser.add_argument('-ne', '--num-query-executors', help='comma separated list of number of parallel clients', default="1") + parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') + parser.add_argument('-cx', '--context', help='context of Kubernetes (for a multi cluster environment), default is current context', default=None) + parser.add_argument('-e', '--experiment', help='sets experiment code for continuing started experiment', default=None) + parser.add_argument('-m', '--monitoring', help='activates monitoring', action='store_true') + parser.add_argument('-mc', '--monitoring-cluster', help='activates monitoring for all nodes of cluster', action='store_true', default=False) + parser.add_argument('-ms', '--max-sut', help='maximum number of parallel DBMS configurations, default is no limit', default=None) + parser.add_argument('-dt', '--datatransfer', help='activates transfer of data per query (not only execution)', action='store_true', default=False) + parser.add_argument('-nr', '--num-run', help='number of runs per query', default=1) + parser.add_argument('-nc', '--num-config', help='number of runs per configuration', default=1) + parser.add_argument('-ne', '--num-query-executors', help='comma separated list of number of parallel clients', default="1") parser.add_argument('-nls', '--num-loading-split', help='portion of loaders that should run in parallel', default="1") parser.add_argument('-nlp', '--num-loading-pods', help='total number of loaders per configuration', default="1") parser.add_argument('-nlt', '--num-loading-threads', help='total number of threads per loading process', default="1") - parser.add_argument('-sf', '--scaling-factor', help='scaling factor (SF)', default=1) - parser.add_argument('-t', '--timeout', help='timeout for a run of a query', default=600) - parser.add_argument('-rr', '--request-ram', help='request ram', default='16Gi') - parser.add_argument('-rc', '--request-cpu', help='request cpus', default='4') - parser.add_argument('-rct', '--request-cpu-type', help='request node having node label cpu=', default='') - parser.add_argument('-rg', '--request-gpu', help='request number of gpus', default=1) - parser.add_argument('-rgt', '--request-gpu-type', help='request node having node label gpu=', default='a100') + parser.add_argument('-sf', '--scaling-factor', help='scaling factor (SF)', default=1) + parser.add_argument('-t', '--timeout', help='timeout for a run of a query', default=600) + parser.add_argument('-rr', '--request-ram', help='request ram for sut, default 16Gi', default='16Gi') + parser.add_argument('-rc', '--request-cpu', help='request cpus for sut, default 4', default='4') + parser.add_argument('-rct', '--request-cpu-type', help='request node for sut to have node label cpu=', default='') + parser.add_argument('-rg', '--request-gpu', help='request number of gpus for sut', default=1) + parser.add_argument('-rgt', '--request-gpu-type', help='request node for sut to have node label gpu=', default='') parser.add_argument('-rst', '--request-storage-type', help='request persistent storage of certain type', default=None, choices=[None, '', 'local-hdd', 'shared']) parser.add_argument('-rss', '--request-storage-size', help='request persistent storage of certain size', default='10Gi') - parser.add_argument('-rnn', '--request-node-name', help='request a specific node', default=None) - parser.add_argument('-rnl', '--request-node-loading', help='request a specific node', default=None) - parser.add_argument('-rnb', '--request-node-benchmarking', help='request a specific node', default=None) - parser.add_argument('-tr', '--test-result', help='test if result fulfills some basic requirements', action='store_true', default=False) - parser.add_argument('-ii', '--init-indexes', help='adds indexes to tables after ingestion', action='store_true', default=False) - parser.add_argument('-ic', '--init-constraints', help='adds constraints to tables after ingestion', action='store_true', default=False) - parser.add_argument('-is', '--init-statistics', help='recomputes statistics of tables after ingestion', action='store_true', default=False) + parser.add_argument('-rnn', '--request-node-name', help='request a specific node for sut', default=None) + parser.add_argument('-rnl', '--request-node-loading', help='request a specific node for loading pods', default=None) + parser.add_argument('-rnb', '--request-node-benchmarking', help='request a specific node for benchmarking pods', default=None) + parser.add_argument('-tr', '--test-result', help='test if result fulfills some basic requirements', action='store_true', default=False) + parser.add_argument('-ii', '--init-indexes', help='adds indexes to tables after ingestion', action='store_true', default=False) + parser.add_argument('-ic', '--init-constraints', help='adds constraints to tables after ingestion', action='store_true', default=False) + parser.add_argument('-is', '--init-statistics', help='recomputes statistics of tables after ingestion', action='store_true', default=False) parser.add_argument('-rcp', '--recreate-parameter', help='recreate parameter for randomized queries', action='store_true', default=False) parser.add_argument('-shq', '--shuffle-queries', help='have different orderings per stream', action='store_true', default=False) # evaluate args diff --git a/ycsb.py b/ycsb.py index adceb19be..0e09f2ec2 100644 --- a/ycsb.py +++ b/ycsb.py @@ -28,40 +28,36 @@ parser = argparse.ArgumentParser(description=description) parser.add_argument('mode', help='import YCSB data or run YCSB queries', choices=['run', 'start', 'load', 'summary'], default='run') parser.add_argument('-aws', '--aws', help='fix components to node groups at AWS', action='store_true', default=False) - parser.add_argument('-dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MySQL'], default=[]) - parser.add_argument('-workload', help='YCSB default workload', choices=['a', 'b', 'c', 'd', 'e', 'f'], default='a') - parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') - parser.add_argument('-cx', '--context', help='context of Kubernetes (for a multi cluster environment), default is current context', default=None) - parser.add_argument('-e', '--experiment', help='sets experiment code for continuing started experiment', default=None) - parser.add_argument('-d', '--detached', help='puts most of the experiment workflow inside the cluster', action='store_true') - parser.add_argument('-m', '--monitoring', help='activates monitoring for sut', action='store_true') - parser.add_argument('-mc', '--monitoring-cluster', help='activates monitoring for all nodes of cluster', action='store_true', default=False) - parser.add_argument('-ms', '--max-sut', help='maximum number of parallel DBMS configurations, default is no limit', default=None) - parser.add_argument('-dt', '--datatransfer', help='activates datatransfer', action='store_true', default=False) - parser.add_argument('-md', '--monitoring-delay', help='time to wait [s] before execution of the runs of a query', default=10) - parser.add_argument('-nr', '--num-run', help='number of runs per query', default=1) - parser.add_argument('-nc', '--num-config', help='number of runs per configuration', default=1) - parser.add_argument('-ne', '--num-query-executors', help='comma separated list of number of parallel clients', default="") - parser.add_argument('-nl', '--num-loading', help='number of parallel loaders per configuration', default=1) + parser.add_argument('-dbms','--dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MySQL'], default=[]) + parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') + parser.add_argument('-cx', '--context', help='context of Kubernetes (for a multi cluster environment), default is current context', default=None) + parser.add_argument('-e', '--experiment', help='sets experiment code for continuing started experiment', default=None) + parser.add_argument('-m', '--monitoring', help='activates monitoring for sut', action='store_true') + parser.add_argument('-mc', '--monitoring-cluster', help='activates monitoring for all nodes of cluster', action='store_true', default=False) + parser.add_argument('-ms', '--max-sut', help='maximum number of parallel DBMS configurations, default is no limit', default=None) + parser.add_argument('-nc', '--num-config', help='number of runs per configuration', default=1) + parser.add_argument('-ne', '--num-query-executors', help='comma separated list of number of parallel clients', default="") + parser.add_argument('-nl', '--num-loading', help='number of parallel loaders per configuration', default=1) parser.add_argument('-nlp', '--num-loading-pods', help='total number of loaders per configuration', default="1,8") - parser.add_argument('-sf', '--scaling-factor', help='scaling factor (SF) = number of rows in millions', default=1) - parser.add_argument('-sfo', '--scaling-factor-operations', help='scaling factor (SF) = number of operations in millions (=SF if not set)', default=None) - parser.add_argument('-su', '--scaling-users', help='scaling factor = number of total threads', default=64) + parser.add_argument('-wl', '--workload', help='YCSB default workload', choices=['a', 'b', 'c', 'e', 'f'], default='a') + parser.add_argument('-sf', '--scaling-factor', help='scaling factor (SF) = number of rows in millions', default=1) + parser.add_argument('-sfo', '--scaling-factor-operations', help='scaling factor = number of operations in millions (=SF if not set)', default=None) + parser.add_argument('-su', '--scaling-users', help='scaling factor = number of total threads', default=64) parser.add_argument('-sbs', '--scaling-batchsize', help='batch size', default="") parser.add_argument('-ltf', '--list-target-factors', help='comma separated list of factors of 16384 ops as target - default range(1,9)', default="1,2,3,4,5,6,7,8") - parser.add_argument('-tb', '--target-base', help='ops as target, base for factors - default 16384 = 2**14', default="16384") - parser.add_argument('-t', '--timeout', help='timeout for a run of a query', default=180) - parser.add_argument('-rr', '--request-ram', help='request ram', default='16Gi') - parser.add_argument('-rc', '--request-cpu', help='request cpus', default='4') - parser.add_argument('-rct', '--request-cpu-type', help='request node having node label cpu=', default='') - parser.add_argument('-rg', '--request-gpu', help='request number of gpus', default=1) - parser.add_argument('-rgt', '--request-gpu-type', help='request node having node label gpu=', default='a100') + parser.add_argument('-tb', '--target-base', help='ops as target, base for factors - default 16384 = 2**14', default="16384") + parser.add_argument('-t', '--timeout', help='timeout for a run of a query', default=180) + parser.add_argument('-rr', '--request-ram', help='request ram for sut, default 16Gi', default='16Gi') + parser.add_argument('-rc', '--request-cpu', help='request cpus for sut, default 4', default='4') + parser.add_argument('-rct', '--request-cpu-type', help='request node for sut to have node label cpu=', default='') + parser.add_argument('-rg', '--request-gpu', help='request number of gpus for sut', default=1) + parser.add_argument('-rgt', '--request-gpu-type', help='request node for sut to have node label gpu=', default='') parser.add_argument('-rst', '--request-storage-type', help='request persistent storage of certain type', default=None, choices=[None, '', 'local-hdd', 'shared']) parser.add_argument('-rss', '--request-storage-size', help='request persistent storage of certain size', default='10Gi') - parser.add_argument('-rnn', '--request-node-name', help='request a specific node', default=None) - parser.add_argument('-rnl', '--request-node-loading', help='request a specific node', default=None) - parser.add_argument('-rnb', '--request-node-benchmarking', help='request a specific node', default=None) - parser.add_argument('-tr', '--test-result', help='test if result fulfills some basic requirements', action='store_true', default=False) + parser.add_argument('-rnn', '--request-node-name', help='request a specific node for sut', default=None) + parser.add_argument('-rnl', '--request-node-loading', help='request a specific node for loading pods', default=None) + parser.add_argument('-rnb', '--request-node-benchmarking', help='request a specific node for benchmarking pods', default=None) + parser.add_argument('-tr', '--test-result', help='test if result fulfills some basic requirements', action='store_true', default=False) # evaluate args args = parser.parse_args() if args.debug: @@ -107,7 +103,6 @@ request_node_name = args.request_node_name request_node_loading = args.request_node_loading request_node_benchmarking = args.request_node_benchmarking - datatransfer = args.datatransfer test_result = args.test_result code = args.experiment # set cluster From 86b5eceffd968792256942b1d6a77848e502bcd2 Mon Sep 17 00:00:00 2001 From: perdelt Date: Fri, 16 Feb 2024 21:02:15 +0100 Subject: [PATCH 033/121] Bexhoma: Improved output and docs --- docs/Config.md | 4 ++++ docs/Example-TPC-H.md | 31 ++++++++++++++++--------------- docs/Example-YCSB.md | 41 ++++++++++++++++++----------------------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/docs/Config.md b/docs/Config.md index 161d87cb2..5044f1680 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -97,5 +97,9 @@ It is organized as follows: The scripts `.sql` are sent to the command line tool of the DBMS (`loadData` parameter in the DBMS configuration) and the files `.sh` are executed as shell scripts. The scripts must be present in a [config folder](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch), say `experiments/tpch/`. +Example: For TPC-H the script `tpch.py` may run (depending on the CLI parameters) +* `Schema` before ingestion - this runs the script `initschema-tpch.sql` +* `Index_and_Constraints` after ingestion - this runs the script `initindexes-tpch.sql` and `initconstraints-tpch.sql` + The data itself is expected to be stored in a shared disk, that will be mounted into the DBMS container as `/data/`. The examples scripts above (like `initdata-tpch-SF1.sql` for example) refer to `/data/tpch/SF1/` for example. diff --git a/docs/Example-TPC-H.md b/docs/Example-TPC-H.md index 29a502085..f08849cad 100644 --- a/docs/Example-TPC-H.md +++ b/docs/Example-TPC-H.md @@ -267,20 +267,20 @@ The Dockerfiles for the components can be found in https://github.com/Beuth-Erde You maybe want to adjust some of the parameters that are set in the file: `python tpch.py -h` ```bash -usage: tpch.py [-h] [-aws] [-dbms {PostgreSQL,MonetDB,MySQL}] [-lit LIMIT_IMPORT_TABLE] [-db] [-cx CONTEXT] [-e EXPERIMENT] [-d] [-m] [-mc] [-ms MAX_SUT] [-dt] [-md MONITORING_DELAY] [-nr NUM_RUN] [-nc NUM_CONFIG] [-ne NUM_QUERY_EXECUTORS] [-nls NUM_LOADING_SPLIT] [-nlp NUM_LOADING_PODS] [-nlt NUM_LOADING_THREADS] - [-sf SCALING_FACTOR] [-t TIMEOUT] [-rr REQUEST_RAM] [-rc REQUEST_CPU] [-rct REQUEST_CPU_TYPE] [-rg REQUEST_GPU] [-rgt REQUEST_GPU_TYPE] [-rst {None,,local-hdd,shared}] [-rss REQUEST_STORAGE_SIZE] [-rnn REQUEST_NODE_NAME] [-tr] [-ii] [-ic] [-is] [-rcp] [-shq] - {profiling,run,start,load,empty} +usage: tpch.py [-h] [-aws] [-dbms {PostgreSQL,MonetDB,MySQL}] [-lit LIMIT_IMPORT_TABLE] [-db] [-cx CONTEXT] [-e EXPERIMENT] [-m] [-mc] [-ms MAX_SUT] [-dt] [-nr NUM_RUN] [-nc NUM_CONFIG] [-ne NUM_QUERY_EXECUTORS] [-nls NUM_LOADING_SPLIT] [-nlp NUM_LOADING_PODS] [-nlt NUM_LOADING_THREADS] [-sf SCALING_FACTOR] + [-t TIMEOUT] [-rr REQUEST_RAM] [-rc REQUEST_CPU] [-rct REQUEST_CPU_TYPE] [-rg REQUEST_GPU] [-rgt REQUEST_GPU_TYPE] [-rst {None,,local-hdd,shared}] [-rss REQUEST_STORAGE_SIZE] [-rnn REQUEST_NODE_NAME] [-rnl REQUEST_NODE_LOADING] [-rnb REQUEST_NODE_BENCHMARKING] [-tr] [-ii] [-ic] [-is] [-rcp] [-shq] + {profiling,run,start,load,empty,summary} Performs a TPC-H experiment. Data is generated and imported into a DBMS from a distributed filesystem (shared disk). positional arguments: - {profiling,run,start,load,empty} + {profiling,run,start,load,empty,summary} profile the import or run the TPC-H queries options: -h, --help show this help message and exit -aws, --aws fix components to node groups at AWS - -dbms {PostgreSQL,MonetDB,MySQL} + -dbms {PostgreSQL,MonetDB,MySQL}, --dbms {PostgreSQL,MonetDB,MySQL} DBMS to load the data -lit LIMIT_IMPORT_TABLE, --limit-import-table LIMIT_IMPORT_TABLE limit import to one table, name of this table @@ -289,15 +289,12 @@ options: context of Kubernetes (for a multi cluster environment), default is current context -e EXPERIMENT, --experiment EXPERIMENT sets experiment code for continuing started experiment - -d, --detached puts most of the experiment workflow inside the cluster -m, --monitoring activates monitoring -mc, --monitoring-cluster activates monitoring for all nodes of cluster -ms MAX_SUT, --max-sut MAX_SUT maximum number of parallel DBMS configurations, default is no limit - -dt, --datatransfer activates datatransfer - -md MONITORING_DELAY, --monitoring-delay MONITORING_DELAY - time to wait [s] before execution of the runs of a query + -dt, --datatransfer activates transfer of data per query (not only execution) -nr NUM_RUN, --num-run NUM_RUN number of runs per query -nc NUM_CONFIG, --num-config NUM_CONFIG @@ -315,21 +312,25 @@ options: -t TIMEOUT, --timeout TIMEOUT timeout for a run of a query -rr REQUEST_RAM, --request-ram REQUEST_RAM - request ram + request ram for sut, default 16Gi -rc REQUEST_CPU, --request-cpu REQUEST_CPU - request cpus + request cpus for sut, default 4 -rct REQUEST_CPU_TYPE, --request-cpu-type REQUEST_CPU_TYPE - request node having node label cpu= + request node for sut to have node label cpu= -rg REQUEST_GPU, --request-gpu REQUEST_GPU - request number of gpus + request number of gpus for sut -rgt REQUEST_GPU_TYPE, --request-gpu-type REQUEST_GPU_TYPE - request node having node label gpu= + request node for sut to have node label gpu= -rst {None,,local-hdd,shared}, --request-storage-type {None,,local-hdd,shared} request persistent storage of certain type -rss REQUEST_STORAGE_SIZE, --request-storage-size REQUEST_STORAGE_SIZE request persistent storage of certain size -rnn REQUEST_NODE_NAME, --request-node-name REQUEST_NODE_NAME - request a specific node + request a specific node for sut + -rnl REQUEST_NODE_LOADING, --request-node-loading REQUEST_NODE_LOADING + request a specific node for loading pods + -rnb REQUEST_NODE_BENCHMARKING, --request-node-benchmarking REQUEST_NODE_BENCHMARKING + request a specific node for benchmarking pods -tr, --test-result test if result fulfills some basic requirements -ii, --init-indexes adds indexes to tables after ingestion -ic, --init-constraints diff --git a/docs/Example-YCSB.md b/docs/Example-YCSB.md index 014cc133b..5c26bcb3c 100644 --- a/docs/Example-YCSB.md +++ b/docs/Example-YCSB.md @@ -143,39 +143,32 @@ The Dockerfiles for the components can be found in https://github.com/Beuth-Erde You maybe want to adjust some of the parameters that are set in the file: `python ycsb.py -h` ```bash -usage: ycsb.py [-h] [-aws] [-dbms {PostgreSQL,MySQL}] [-workload {a,b,c,d,e,f}] [-db] [-cx CONTEXT] [-e EXPERIMENT] [-d] [-m] [-mc] [-ms MAX_SUT] [-dt] [-md MONITORING_DELAY] [-nr NUM_RUN] [-nc NUM_CONFIG] [-ne NUM_QUERY_EXECUTORS] [-nl NUM_LOADING] [-nlp NUM_LOADING_PODS] [-sf SCALING_FACTOR] - [-sfo SCALING_FACTOR_OPERATIONS] [-su SCALING_USERS] [-sbs SCALING_BATCHSIZE] [-ltf LIST_TARGET_FACTORS] [-tb TARGET_BASE] [-t TIMEOUT] [-rr REQUEST_RAM] [-rc REQUEST_CPU] [-rct REQUEST_CPU_TYPE] [-rg REQUEST_GPU] [-rgt REQUEST_GPU_TYPE] [-rst {None,,local-hdd,shared}] [-rss REQUEST_STORAGE_SIZE] - [-rnn REQUEST_NODE_NAME] [-rnl REQUEST_NODE_LOADING] [-rnb REQUEST_NODE_BENCHMARKING] [-tr] - {run,start,load} +usage: ycsb.py [-h] [-aws] [-dbms {PostgreSQL,MySQL}] [-db] [-cx CONTEXT] [-e EXPERIMENT] [-m] [-mc] [-ms MAX_SUT] [-nc NUM_CONFIG] [-ne NUM_QUERY_EXECUTORS] [-nl NUM_LOADING] [-nlp NUM_LOADING_PODS] [-wl {a,b,c,e,f}] [-sf SCALING_FACTOR] [-sfo SCALING_FACTOR_OPERATIONS] [-su SCALING_USERS] + [-sbs SCALING_BATCHSIZE] [-ltf LIST_TARGET_FACTORS] [-tb TARGET_BASE] [-t TIMEOUT] [-rr REQUEST_RAM] [-rc REQUEST_CPU] [-rct REQUEST_CPU_TYPE] [-rg REQUEST_GPU] [-rgt REQUEST_GPU_TYPE] [-rst {None,,local-hdd,shared}] [-rss REQUEST_STORAGE_SIZE] [-rnn REQUEST_NODE_NAME] [-rnl REQUEST_NODE_LOADING] + [-rnb REQUEST_NODE_BENCHMARKING] [-tr] + {run,start,load,summary} Perform YCSB benchmarks in a Kubernetes cluster. Number of rows and operations is SF*1,000,000. This installs a clean copy for each target and split of the driver. Optionally monitoring is activated. positional arguments: - {run,start,load} import YCSB data or run YCSB queries + {run,start,load,summary} + import YCSB data or run YCSB queries options: -h, --help show this help message and exit -aws, --aws fix components to node groups at AWS - -dbms {PostgreSQL,MySQL} + -dbms {PostgreSQL,MySQL}, --dbms {PostgreSQL,MySQL} DBMS to load the data - -workload {a,b,c,d,e,f} - YCSB default workload -db, --debug dump debug informations -cx CONTEXT, --context CONTEXT context of Kubernetes (for a multi cluster environment), default is current context -e EXPERIMENT, --experiment EXPERIMENT sets experiment code for continuing started experiment - -d, --detached puts most of the experiment workflow inside the cluster -m, --monitoring activates monitoring for sut -mc, --monitoring-cluster activates monitoring for all nodes of cluster -ms MAX_SUT, --max-sut MAX_SUT maximum number of parallel DBMS configurations, default is no limit - -dt, --datatransfer activates datatransfer - -md MONITORING_DELAY, --monitoring-delay MONITORING_DELAY - time to wait [s] before execution of the runs of a query - -nr NUM_RUN, --num-run NUM_RUN - number of runs per query -nc NUM_CONFIG, --num-config NUM_CONFIG number of runs per configuration -ne NUM_QUERY_EXECUTORS, --num-query-executors NUM_QUERY_EXECUTORS @@ -184,10 +177,12 @@ options: number of parallel loaders per configuration -nlp NUM_LOADING_PODS, --num-loading-pods NUM_LOADING_PODS total number of loaders per configuration + -wl {a,b,c,e,f}, --workload {a,b,c,e,f} + YCSB default workload -sf SCALING_FACTOR, --scaling-factor SCALING_FACTOR scaling factor (SF) = number of rows in millions -sfo SCALING_FACTOR_OPERATIONS, --scaling-factor-operations SCALING_FACTOR_OPERATIONS - scaling factor (SF) = number of operations in millions (=SF if not set) + scaling factor = number of operations in millions (=SF if not set) -su SCALING_USERS, --scaling-users SCALING_USERS scaling factor = number of total threads -sbs SCALING_BATCHSIZE, --scaling-batchsize SCALING_BATCHSIZE @@ -199,25 +194,25 @@ options: -t TIMEOUT, --timeout TIMEOUT timeout for a run of a query -rr REQUEST_RAM, --request-ram REQUEST_RAM - request ram + request ram for sut, default 16Gi -rc REQUEST_CPU, --request-cpu REQUEST_CPU - request cpus + request cpus for sut, default 4 -rct REQUEST_CPU_TYPE, --request-cpu-type REQUEST_CPU_TYPE - request node having node label cpu= + request node for sut to have node label cpu= -rg REQUEST_GPU, --request-gpu REQUEST_GPU - request number of gpus + request number of gpus for sut -rgt REQUEST_GPU_TYPE, --request-gpu-type REQUEST_GPU_TYPE - request node having node label gpu= + request node for sut to have node label gpu= -rst {None,,local-hdd,shared}, --request-storage-type {None,,local-hdd,shared} request persistent storage of certain type -rss REQUEST_STORAGE_SIZE, --request-storage-size REQUEST_STORAGE_SIZE request persistent storage of certain size -rnn REQUEST_NODE_NAME, --request-node-name REQUEST_NODE_NAME - request a specific node + request a specific node for sut -rnl REQUEST_NODE_LOADING, --request-node-loading REQUEST_NODE_LOADING - request a specific node + request a specific node for loading pods -rnb REQUEST_NODE_BENCHMARKING, --request-node-benchmarking REQUEST_NODE_BENCHMARKING - request a specific node + request a specific node for benchmarking pods -tr, --test-result test if result fulfills some basic requirements ``` From 00fb0551b8bea663a2fd8fd9a2c2d84dc2fb311b Mon Sep 17 00:00:00 2001 From: perdelt Date: Fri, 16 Feb 2024 21:51:44 +0100 Subject: [PATCH 034/121] Bexhoma: Improved output and docs --- test.sh | 6 +++--- ycsb.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test.sh b/test.sh index a606b8925..19de12bc6 100644 --- a/test.sh +++ b/test.sh @@ -13,7 +13,7 @@ BEXHOMA_NODE_BENCHMARK="cl-worker19" # SF = 1 # PostgreSQL 1 and 8 loader # [1,2,3,4,5,6,7,8] times 16384 = target -nohup python ycsb.py -ms 1 -m -workload a -tr \ +nohup python ycsb.py -ms 1 -m --workload a -tr \ -dbms PostgreSQL \ -rnn $BEXHOMA_NODE_SUT -rnl $BEXHOMA_NODE_LOAD -rnb $BEXHOMA_NODE_BENCHMARK \ run &>logs/test_ycsb_1.log & @@ -32,7 +32,7 @@ sleep 5 # run twice # [1,2] execute # persistent storage of class shared -nohup python ycsb.py -ms 1 -m -workload a -tr \ +nohup python ycsb.py -ms 1 -m --workload a -tr \ -nlp 8 \ -dbms PostgreSQL \ -rnn $BEXHOMA_NODE_SUT -rnl $BEXHOMA_NODE_LOAD -rnb $BEXHOMA_NODE_BENCHMARK \ @@ -54,7 +54,7 @@ sleep 5 # PostgreSQL 1 loader # 2x(1,2) benchmarker # persistent storage of class shared -nohup python ycsb.py -ms 1 -m -workload a -tr \ +nohup python ycsb.py -ms 1 -m --workload a -tr \ -nlp 1 \ -dbms PostgreSQL \ -rnn $BEXHOMA_NODE_SUT -rnl $BEXHOMA_NODE_LOAD -rnb $BEXHOMA_NODE_BENCHMARK \ diff --git a/ycsb.py b/ycsb.py index 0e09f2ec2..38f3769fc 100644 --- a/ycsb.py +++ b/ycsb.py @@ -84,7 +84,6 @@ list_target_factors = [int(x) for x in list_target_factors] batchsize = args.scaling_batchsize timeout = int(args.timeout) - numRun = int(args.num_run) num_experiment_to_apply = int(args.num_config) num_loading = int(args.num_loading) #num_loading_pods = int(args.num_loading_pods) From 1c075a61219d6b0d778e0e61a633cb556a117f18 Mon Sep 17 00:00:00 2001 From: perdelt Date: Fri, 16 Feb 2024 23:16:58 +0100 Subject: [PATCH 035/121] Bexhoma: Improved output and docs --- docs/Concept.md | 30 ++++++++++++++++++++++++++++++ docs/Config.md | 33 +++++++++++++++++---------------- docs/DBMS.md | 20 ++++++++++---------- 3 files changed, 57 insertions(+), 26 deletions(-) diff --git a/docs/Concept.md b/docs/Concept.md index 50407c947..e6010e6a6 100644 --- a/docs/Concept.md +++ b/docs/Concept.md @@ -39,3 +39,33 @@ In more detail this means 1. **Stop Experiment** 1. **Clean Experiment** 1. Delete deployment and services + + +## References + +You can find much more details about the concepts in the following articles. +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: + +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 + +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 diff --git a/docs/Config.md b/docs/Config.md index 5044f1680..551e5f686 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -1,13 +1,9 @@ -# Configurations +# Cluster-Config -## Cluster-Config +The configuration of the cluster, that is the possible host and experiment settings, is set in a file `cluster.config` and consists of these parts (see also [example](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s-cluster.config) config file): -The configuration of the cluster, that is the possible host and experiment settings, consists of these parts (see also [example](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s-cluster.config) config file): - -### Config of the Benchmark tool - -You probably can leave this as is. +## Basic settings ``` 'benchmarker': { @@ -16,13 +12,10 @@ You probably can leave this as is. }, ``` -* `resultfolder`: Where the benchmarker puts it's result folders -* `jarfolder`: Where the benchmarker expects the JDBC jar files - -Both folders are used to correspond with the Docker containers of the benchmarker and must match the settings inside of the image. - +* `resultfolder`: Where the benchmarker puts it's result folders. Make sure this is an existing folder bexhoma can write to. +* `jarfolder`: Where the benchmarker expects the JDBC jar files. You probably should leave this as is. -### Credentials of the Cluster +## Credentials of the Cluster You will have to adjust the name of the namespace `my_namespace`. The rest probably can stay as is. @@ -34,13 +27,14 @@ The rest probably can stay as is. 'context': { 'my_context': { 'namespace': 'my_namespace', - 'clustername': 'BHT', + 'clustername': 'My Cluster', 'service_sut': '{service}.{namespace}.svc.cluster.local', 'port': 9091, # K8s: Local port for connecting via JDBC after port forwarding }, ``` -* `my_context`: Context (name) of the cluster. Repeat this section for every K8s cluster you want to use. This also allows to useand compare several Clouds. -* `my_namespace`: Namespace in the cluster. +* `my_context`: Context (name) of the cluster. Repeat this section for every K8s cluster you want to use. This also allows to use and compare several clouds. +* `my_namespace`: Namespace in the cluster. Make sure you have access to that namespace. +* `clustername`: Customize the cluster name for your convenience. ## (Hardware) Monitoring @@ -103,3 +97,10 @@ Example: For TPC-H the script `tpch.py` may run (depending on the CLI parameters The data itself is expected to be stored in a shared disk, that will be mounted into the DBMS container as `/data/`. The examples scripts above (like `initdata-tpch-SF1.sql` for example) refer to `/data/tpch/SF1/` for example. + +## DBMS + +Database systems are described in the `docker` section. +Please see [DBMS section](https://bexhoma.readthedocs.io/en/latest/DBMS.html) for more informations. + + diff --git a/docs/DBMS.md b/docs/DBMS.md index 5e60549ee..d68878d99 100644 --- a/docs/DBMS.md +++ b/docs/DBMS.md @@ -102,7 +102,7 @@ The parameters can be set via CLI (see for example `tpch.py`). ## MariaDB -**Deployment** +### Deployment https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s/deploymenttemplate-MariaDB.yml @@ -128,13 +128,13 @@ https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8 }, ``` -***DDL Scripts*** +### DDL Scripts Example for [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch/MariaDB) ## MonetDB -**Deployment** +### Deployment https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s/deploymenttemplate-MonetDB.yml @@ -159,14 +159,14 @@ https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8 }, ``` -***DDL Scripts*** +### DDL Scripts Example for * [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch/MonetDB) ## PostgreSQL -**Deployment** +### Deployment https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s/deploymenttemplate-PostgreSQL.yml @@ -212,7 +212,7 @@ As of bexhoma version `v0.7.0` this contains ``` as default settings. -**Configuration** +### Configuration ``` 'PostgreSQL': { @@ -234,7 +234,7 @@ as default settings. }, ``` -***DDL Scripts*** +### DDL Scripts Example for * [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch/PostgreSQL) @@ -242,7 +242,7 @@ Example for ## MySQL -**Deployment** +### Deployment https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s/deploymenttemplate-MySQL.yml @@ -286,7 +286,7 @@ As of bexhoma version `v0.7.0` this contains ``` as default settings. -**Configuration** +### Configuration ``` 'MySQL': { @@ -313,7 +313,7 @@ as default settings. This uses `delay_prepare` to make bexhoma wait 5 minutes before starting to query the dbms. This is because configuring InnoDB takes a while and the server might restart during that period. -***DDL Scripts*** +### DDL Scripts Example for * [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch/MySQL) From e8a16fca45f88ec00929c33ed9ebd86b7ecca80a Mon Sep 17 00:00:00 2001 From: perdelt Date: Sat, 17 Feb 2024 08:58:17 +0100 Subject: [PATCH 036/121] PostgreSQL: More time for shutdown --- k8s/deploymenttemplate-PostgreSQL.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/deploymenttemplate-PostgreSQL.yml b/k8s/deploymenttemplate-PostgreSQL.yml index 22f48cb82..066191d98 100644 --- a/k8s/deploymenttemplate-PostgreSQL.yml +++ b/k8s/deploymenttemplate-PostgreSQL.yml @@ -42,7 +42,7 @@ spec: tolerations: #- key: "nvidia.com/gpu" # effect: "NoSchedule" - terminationGracePeriodSeconds: 60 + terminationGracePeriodSeconds: 120 containers: - name: dbms image: postgres:16.1 From 25d0686d6fff4e9dbea11f4019eace52b8e12fa5 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 07:54:39 +0100 Subject: [PATCH 037/121] Bexhoma: Restarting SUT waits for its removal first --- bexhoma/configurations.py | 13 +++++++++++++ bexhoma/experiments.py | 7 +++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 9cb5cfd79..98c4ceecc 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -486,6 +486,19 @@ def sut_is_running(self): if status == "Running": return True return False + def sut_is_existing(self): + """ + Returns True, iff system-under-test (dbms) is existing in cluster (no matter what state). + + :return: True, if dbms is existing + """ + app = self.appname + component = 'sut' + configuration = self.configuration + pods = self.experiment.cluster.get_pods(app, component, self.experiment.code, configuration) + if len(pods) > 0: + return True + return False def maintaining_is_running(self): """ Returns True, iff maintaining is running. diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 4e10c0d96..d82b591ef 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -888,17 +888,20 @@ def work_benchmark_list(self, intervals=30, stop=True): config.stop_sut() config.num_experiment_to_apply_done = config.num_experiment_to_apply_done + 1 if config.num_experiment_to_apply_done < config.num_experiment_to_apply: + while config.sut_is_existing(): + print("{:30s}: still being removed".format(config.configuration)) + self.wait(30) print("{:30s}: starts again".format(config.configuration)) config.benchmark_list = config.benchmark_list_template.copy() # wait for PV to be gone completely - self.wait(60) + #self.wait(60) config.reset_sut() config.start_sut() self.wait(10) else: config.experiment_done = True else: - print("{} can be stopped, be we leave it running".format(config.configuration)) + print("{} can be stopped, but we leave it running".format(config.configuration)) else: print("{:30s}: is loading".format(config.configuration)) # all jobs of configuration - benchmarker From 44f09f700d0fe2e3d61756576c977938e727b7f5 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 08:08:36 +0100 Subject: [PATCH 038/121] PostgreSQL: lifecycle user rights issue --- k8s/deploymenttemplate-PostgreSQL.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/k8s/deploymenttemplate-PostgreSQL.yml b/k8s/deploymenttemplate-PostgreSQL.yml index 066191d98..f5e3a1c57 100644 --- a/k8s/deploymenttemplate-PostgreSQL.yml +++ b/k8s/deploymenttemplate-PostgreSQL.yml @@ -51,10 +51,11 @@ spec: value: trust - name: PGDATA value: /var/lib/postgresql/data/pgdata - lifecycle: - preStop: - exec: - command: ["/bin/sh", "-c", "pg_ctl stop -D /var/lib/postgresql/data -m fast"] + # pg_ctl: cannot be run as root + #lifecycle: + # preStop: + # exec: + # command: ["/bin/sh", "-c", "pg_ctl stop -D /var/lib/postgresql/data -m fast"] ports: - {containerPort: 5432} securityContext: From e38f1501dcb73a6f48da88ba82ded7271c56f9bc Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 11:01:09 +0100 Subject: [PATCH 039/121] Bexhoma: Label PV with usage information --- bexhoma/configurations.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 98c4ceecc..6a6c0dd1f 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -1481,6 +1481,27 @@ def check_DBMS_connection(self, ip, port): finally: s.close() return found + def get_host_volume(self): + """ + Returns information about the sut's mounted volumes. + Basically this calls + size: df -h | grep volumes | awk -F ' ' '{print $2}' + used: df -h | grep volumes | awk -F ' ' '{print $3}' + + :return: (size, used) + """ + self.logger.debug('configuration.get_host_volume()') + try: + command = "df -h | grep volumes | awk -F ' ' '{print $2}'" + stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) + size = stdout + command = "df -h | grep volumes | awk -F ' ' '{print $3}'" + stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) + used = stdout + return size, used + except Exception as e: + logging.error(e) + return "", "" def get_host_memory(self): """ Returns information about the sut's host RAM. @@ -1722,6 +1743,9 @@ def get_host_all(self): server['node'] = self.get_host_node() server['disk'] = self.get_host_diskspace_used() server['datadisk'] = self.get_host_diskspace_used_data() + size, used = self.get_host_volume() + server['volume_size'] = size + server['volume_used'] = used server['cuda'] = self.get_host_cuda() return server def set_metric_of_config(self, metric, host, gpuid): @@ -1773,6 +1797,20 @@ def get_connection_config(self, connection, alias='', dialect='', serverip='loca self.pod_sut = pods[0] pod_sut = self.pod_sut c['hostsystem'] = self.get_host_all() + # add volume labels to PV + use_storage = self.use_storage() + if use_storage: + if self.storage['storageConfiguration']: + name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.storage['storageConfiguration']) + else: + name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.configuration) + volume = name_pvc + else: + volume = '' + if volume: + fullcommand = 'label pvc {} --overwrite volume_size="{}" volume_used="{}"'.format(volume, c['hostsystem']['volume_size'], c['hostsystem']['volume_used']) + #print(fullcommand) + self.experiment.cluster.kubectl(fullcommand) # get worker information c['worker'] = [] pods = self.experiment.cluster.get_pods(component='worker', configuration=self.configuration, experiment=self.code) From e362fdf659e63ae620868da646601ac3d05cbdda Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 11:10:09 +0100 Subject: [PATCH 040/121] Bexhoma: Label PV with usage information --- bexhoma/configurations.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 6a6c0dd1f..16a1c12e7 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -1797,20 +1797,6 @@ def get_connection_config(self, connection, alias='', dialect='', serverip='loca self.pod_sut = pods[0] pod_sut = self.pod_sut c['hostsystem'] = self.get_host_all() - # add volume labels to PV - use_storage = self.use_storage() - if use_storage: - if self.storage['storageConfiguration']: - name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.storage['storageConfiguration']) - else: - name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.configuration) - volume = name_pvc - else: - volume = '' - if volume: - fullcommand = 'label pvc {} --overwrite volume_size="{}" volume_used="{}"'.format(volume, c['hostsystem']['volume_size'], c['hostsystem']['volume_used']) - #print(fullcommand) - self.experiment.cluster.kubectl(fullcommand) # get worker information c['worker'] = [] pods = self.experiment.cluster.get_pods(component='worker', configuration=self.configuration, experiment=self.code) @@ -1949,6 +1935,21 @@ def run_benchmarker_pod(self, c['hostsystem']['loading_timespans'] = self.loading_timespans c['hostsystem']['benchmarking_timespans'] = self.benchmarking_timespans #print(c) + # add volume labels to PV + use_storage = self.use_storage() + if use_storage: + if self.storage['storageConfiguration']: + name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.storage['storageConfiguration']) + else: + name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.configuration) + volume = name_pvc + else: + volume = '' + if volume: + fullcommand = 'label pvc {} --overwrite volume_size="{}" volume_used="{}"'.format(volume, c['hostsystem']['volume_size'], c['hostsystem']['volume_used']) + #print(fullcommand) + self.experiment.cluster.kubectl(fullcommand) + # add config jarfolder #print(self.experiment.cluster.config['benchmarker']['jarfolder']) if isinstance(c['JDBC']['jar'], list): for i, j in enumerate(c['JDBC']['jar']): From a670eb209ca512a5f06e270a165780194c0395b9 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 11:32:04 +0100 Subject: [PATCH 041/121] Bexhoma: Label PV with usage information --- bexhoma/experiments.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index d82b591ef..076bf3186 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -730,6 +730,7 @@ def work_benchmark_list(self, intervals=30, stop=True): # test if there is a Pometheus server running in the cluster if self.cluster.test_if_monitoring_healthy(): self.cluster.monitor_cluster_exists = True + print("{:30s}: is running".format("Cluster monitoring")) else: self.cluster.monitor_cluster_exists = False do = True From efca19c5e815448b4d8144a04a787bc897114dc1 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 12:18:00 +0100 Subject: [PATCH 042/121] Bexhoma: Label PV with usage information --- bexhoma/configurations.py | 15 +++++++------ docs/Example-custom.md | 45 +++++++++++---------------------------- 2 files changed, 21 insertions(+), 39 deletions(-) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 16a1c12e7..1180d8935 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -1484,7 +1484,7 @@ def check_DBMS_connection(self, ip, port): def get_host_volume(self): """ Returns information about the sut's mounted volumes. - Basically this calls + Basically this calls something equivalent to size: df -h | grep volumes | awk -F ' ' '{print $2}' used: df -h | grep volumes | awk -F ' ' '{print $3}' @@ -1492,12 +1492,15 @@ def get_host_volume(self): """ self.logger.debug('configuration.get_host_volume()') try: - command = "df -h | grep volumes | awk -F ' ' '{print $2}'" + #command = "df -h | grep volumes | awk -F ' ' '{print $2}'" + command = "df -h | grep volumes" stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) - size = stdout - command = "df -h | grep volumes | awk -F ' ' '{print $3}'" - stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) - used = stdout + parts = stdout.split(" ") + parts = [x for x in parts if x != ''] + size = parts[1] + #command = "df -h | grep volumes | awk -F ' ' '{print $3}'" + #stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) + used = parts[2] return size, used except Exception as e: logging.error(e) diff --git a/docs/Example-custom.md b/docs/Example-custom.md index 4983b737d..bef69a9d4 100644 --- a/docs/Example-custom.md +++ b/docs/Example-custom.md @@ -1,36 +1,15 @@ # Example: Run a custom SQL workload +This example assumes you have +* a DBMS installed outside of bexhoma +* a database loaded +* a sequence of SQL queries you want to run against the database -We need -* a [config file](#clusterconfig) containing cluster information , say `cluster.config` -* a [config folder](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/example), say `experiments/example/`, containing - * a [config file](https://dbmsbenchmarker.readthedocs.io/en/latest/Options.html) `queries.config` for the workload - * folders for DDL scripts (per DBMS) -* a python script managing the experimental workflow, say `example.py`, see [example](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/example.py) +## Prerequisites -To use the predefined examples you will only have to change the context and namespace of the Kubernetes cluster - see below. +### Dummy DBMS -## Preparation - -* clone repository -* pip install requirements -* rename `k8s-cluster.config` to `cluster.config` -* replace inside that file where to store the results locally -``` - 'resultfolder': '/home/myself/benchmarks', -``` -* replace `namespace` of your K8s context here -``` - 'context': { - 'dummy': { - 'namespace': 'dummy', - 'clustername': 'Dummy', - 'service_sut': '{service}.{namespace}.svc.cluster.local', - 'port': 9091, # K8s: Local port for connecting via JDBC after port forwarding - }, - }, -``` -* add inside `docker` section infos how to connect to DBMS (keep key `Dummy` here, adjust all the rest) +Inside `docker` section infos how to connect to DBMS (keep key `Dummy` here, adjust all the rest) ``` 'Dummy': { 'loadData': '', @@ -51,8 +30,11 @@ To use the predefined examples you will only have to change the context and name 'priceperhourdollar': 0.0, }, ``` -* overwrite file `queries.config` in `experiments/example` with custom file -* cluster needs a PV `bexhoma-results` created via `k8s/pvc-bexhoma-results.yml` or similarly + +### Queries File + +Overwrite the file `queries.config` in `experiments/example` with a custom file. + ## Run Experiment @@ -60,11 +42,8 @@ Example: Run `python example.py run -dbms Dummy -ne 5` to run experiment with 5 ## Background Information -1. The script installs a `dashboard` container (if not already installed). This connects to a PV `bexhoma-results`. Measurements are stored, merged and aggregated there. -1. The script installs a `messagequeue` container (if not already installed). Components are synched to start at the same second using a Redis queue inside that container. 1. The script installs a Dummy DBMS according to `k8s/deploymenttemplate-Dummy.yml`. This is just a lightweight busybox container running an endless sleep. Bexhoma writes status information about the components to the benchmarked DBMS container. If the DBMS is not managed by bexhoma, we need such a Dummy container otherwise. The container will be removed automatically after experiment has finished. - The DBMSBenchmarker Docker container needs to have the required JDBC driver included. Currently, the image contains the following: From 5d5a0c6b734d9e09042be6befaa43c6c0934e70d Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 13:48:17 +0100 Subject: [PATCH 043/121] PostgreSQL: lifecycle tests with gosu --- k8s/deploymenttemplate-PostgreSQL.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/k8s/deploymenttemplate-PostgreSQL.yml b/k8s/deploymenttemplate-PostgreSQL.yml index f5e3a1c57..dd3335fe3 100644 --- a/k8s/deploymenttemplate-PostgreSQL.yml +++ b/k8s/deploymenttemplate-PostgreSQL.yml @@ -52,10 +52,10 @@ spec: - name: PGDATA value: /var/lib/postgresql/data/pgdata # pg_ctl: cannot be run as root - #lifecycle: - # preStop: - # exec: - # command: ["/bin/sh", "-c", "pg_ctl stop -D /var/lib/postgresql/data -m fast"] + lifecycle: + preStop: + exec: + command: ["/bin/sh", "gosu postgres", "pg_ctl stop -D /var/lib/postgresql/data -m fast"] ports: - {containerPort: 5432} securityContext: From f830b07d1a2ae00ea8bc31d2675901f91b2c2a74 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 14:05:34 +0100 Subject: [PATCH 044/121] PostgreSQL: lifecycle tests with gosu --- k8s/deploymenttemplate-PostgreSQL.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/deploymenttemplate-PostgreSQL.yml b/k8s/deploymenttemplate-PostgreSQL.yml index dd3335fe3..1a859dd75 100644 --- a/k8s/deploymenttemplate-PostgreSQL.yml +++ b/k8s/deploymenttemplate-PostgreSQL.yml @@ -55,7 +55,7 @@ spec: lifecycle: preStop: exec: - command: ["/bin/sh", "gosu postgres", "pg_ctl stop -D /var/lib/postgresql/data -m fast"] + command: ["/bin/sh", "-c", "gosu postgres pg_ctl stop -D /var/lib/postgresql/data -m fast"] ports: - {containerPort: 5432} securityContext: From cfb7866123663aea62c418c4e4f345d580e89429 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 14:11:06 +0100 Subject: [PATCH 045/121] Bexhoma: Show volume infos in status --- bexhoma/scripts/experimentsmanager.py | 8 ++++++++ cluster.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/bexhoma/scripts/experimentsmanager.py b/bexhoma/scripts/experimentsmanager.py index 36eb78b55..429493466 100644 --- a/bexhoma/scripts/experimentsmanager.py +++ b/bexhoma/scripts/experimentsmanager.py @@ -148,6 +148,14 @@ def manage(): pvcs_status = cluster.get_pvc_status(app=app, component='storage', experiment='', configuration='', pvc=pvc) #print("PVCsStatus", pvcs_status) volumes[pvc]['status'] = pvcs_status[0].phase + if 'volume_size' in pvc_labels: + volumes[pvc]['size'] = pvc_labels['volume_size'] + else: + volumes[pvc]['size'] = "" + if 'volume_used' in pvc_labels: + volumes[pvc]['used'] = pvc_labels['volume_used'] + else: + volumes[pvc]['used'] = "" #print(volumes) if len(volumes) > 0: df = pd.DataFrame(volumes).T diff --git a/cluster.py b/cluster.py index 9f3a1938d..269ce76ee 100644 --- a/cluster.py +++ b/cluster.py @@ -149,6 +149,14 @@ pvcs_status = cluster.get_pvc_status(app=app, component='storage', experiment='', configuration='', pvc=pvc) #print("PVCsStatus", pvcs_status) volumes[pvc]['status'] = pvcs_status[0].phase + if 'volume_size' in pvc_labels: + volumes[pvc]['size'] = pvc_labels['volume_size'] + else: + volumes[pvc]['size'] = "" + if 'volume_used' in pvc_labels: + volumes[pvc]['used'] = pvc_labels['volume_used'] + else: + volumes[pvc]['used'] = "" #print(volumes) if len(volumes) > 0: df = pd.DataFrame(volumes).T From 3f5544b6050e099b3118dea299a2ca65e69c8b6c Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 14:16:13 +0100 Subject: [PATCH 046/121] PostgreSQL: lifecycle tests with gosu --- k8s/deploymenttemplate-PostgreSQL.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/k8s/deploymenttemplate-PostgreSQL.yml b/k8s/deploymenttemplate-PostgreSQL.yml index 1a859dd75..0e71df8ff 100644 --- a/k8s/deploymenttemplate-PostgreSQL.yml +++ b/k8s/deploymenttemplate-PostgreSQL.yml @@ -55,7 +55,8 @@ spec: lifecycle: preStop: exec: - command: ["/bin/sh", "-c", "gosu postgres pg_ctl stop -D /var/lib/postgresql/data -m fast"] + #command: ["/bin/sh", "-c", "gosu postgres pg_ctl stop -D /var/lib/postgresql/data -m fast"] + command: ["/bin/sh", "-c", "gosu postgres pg_ctl stop -m fast"] ports: - {containerPort: 5432} securityContext: From 4544f7503f0ee913165a300f6aec4d7417c8e5da Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 18:09:12 +0100 Subject: [PATCH 047/121] Bexhoma: Ceil() loading times --- bexhoma/configurations.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 1180d8935..2789e45c3 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -44,6 +44,7 @@ import threading from io import StringIO import hiyapyco +from math import ceil from dbmsbenchmarker import * @@ -2407,10 +2408,10 @@ def check_load_data(self): self.timeSchema = self.timeLoading if total_time > 0: # this sets the loading time to the max span of pods - self.timeLoading = total_time + self.timeLoading + self.timeLoading = ceil(total_time + self.timeLoading) else: # this sets the loading time to the span until "now" (including waiting and starting overhead) - self.timeLoading = int(self.timeLoadingEnd) - int(self.timeLoadingStart) + self.timeLoading + self.timeLoading = ceil(int(self.timeLoadingEnd) - int(self.timeLoadingStart) + self.timeLoading) self.timeGenerating = generator_time self.timeIngesting = loader_time self.experiment.cluster.logger.debug("LOADING LABELS") @@ -3400,7 +3401,7 @@ def kubectl(command, context): time_scriptgroup_end = default_timer() time_now = str(datetime.now()) timeLoadingEnd = int(datetime.timestamp(datetime.strptime(time_now,'%Y-%m-%d %H:%M:%S.%f'))) - timeLoading = time_scriptgroup_end - time_scriptgroup_start + time_offset + timeLoading = ceil(time_scriptgroup_end - time_scriptgroup_start + time_offset) logger.debug("#### time_scriptgroup_end: "+str(time_scriptgroup_end)) logger.debug("#### timeLoadingEnd: "+str(timeLoadingEnd)) logger.debug("#### timeLoading after scrips: "+str(timeLoading)) @@ -3411,11 +3412,11 @@ def kubectl(command, context): # store infos in labels of sut pod and it's pvc labels = dict() labels[script_type] = 'True' - labels['time_{script_type}'.format(script_type=script_type)] = (time_scriptgroup_end - time_scriptgroup_start) + labels['time_{script_type}'.format(script_type=script_type)] = ceil(time_scriptgroup_end - time_scriptgroup_start) #labels['timeLoadingEnd'] = time_now_int # is float, so needs "" labels['timeLoading'] = timeLoading for subscript_type, time_subscript_type in times_script.items(): - labels['time_{script_type}'.format(script_type=subscript_type)] = time_subscript_type + labels['time_{script_type}'.format(script_type=subscript_type)] = ceil(time_subscript_type) fullcommand = 'label pods {pod_sut} --overwrite timeLoadingEnd="{timeLoadingEnd}" '.format(pod_sut=pod_sut, timeLoadingEnd=timeLoadingEnd) for key, value in labels.items(): fullcommand = fullcommand + " {key}={value}".format(key=key, value=value) From 307f21de450cf9a03da59c1f4cc82964dbd3edc2 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 18:49:52 +0100 Subject: [PATCH 048/121] YCSB: Show connection infos in summary --- bexhoma/experiments.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 076bf3186..6d7bb1fcb 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -42,6 +42,7 @@ import pandas as pd import pickle import json +import ast from bexhoma import evaluators @@ -1859,6 +1860,11 @@ def show_summary(self): pd.set_option('display.width', 1000) resultfolder = self.cluster.config['benchmarker']['resultfolder'] code = self.code + with open(resultfolder+"/"+code+"/connections.config",'r') as inf: + connections = ast.literal_eval(inf.read()) + pretty_connections = json.dumps(connections, indent=2) + print(pretty_connections) + #print("found", len(connections), "connections") #evaluate = inspector.inspector(resultfolder) # no evaluation cube #evaluate.load_experiment(code=code, silent=False) evaluation = evaluators.ycsb(code=code, path=resultfolder) From c4597db8aa3a1eb5b584a6962514e8f868d59db8 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 18:52:57 +0100 Subject: [PATCH 049/121] Bexhoma: Show code in results table --- show_resultfolder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/show_resultfolder.py b/show_resultfolder.py index df618e9da..8f367c693 100644 --- a/show_resultfolder.py +++ b/show_resultfolder.py @@ -25,6 +25,7 @@ # dataframe of experiments df = evaluate.get_experiments_preview().sort_values('time') + df = df.reset_index() df['info'] = df['info'].str.replace('. ', '.\n') # Create a PrettyTable object From 3282fc568be8810fc58f1aa6ad426e88f62f2df8 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 19:06:30 +0100 Subject: [PATCH 050/121] YCSB: Show connection infos --- bexhoma/experiments.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 6d7bb1fcb..946eb1b5a 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1863,7 +1863,15 @@ def show_summary(self): with open(resultfolder+"/"+code+"/connections.config",'r') as inf: connections = ast.literal_eval(inf.read()) pretty_connections = json.dumps(connections, indent=2) - print(pretty_connections) + #print(pretty_connections) + connections_sorted = sorted(connections, key=lambda c: c['name']) + for c in connections_sorted: + print(c['name'], + "uses docker image", + c['parameter']['dockerimage']) + infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key] + for info in infos: + print(info) #print("found", len(connections), "connections") #evaluate = inspector.inspector(resultfolder) # no evaluation cube #evaluate.load_experiment(code=code, silent=False) From a1644eb4cdce37ede3989d7d7f94fff6c40b310e Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 20:14:48 +0100 Subject: [PATCH 051/121] Bexhoma: show_summary_monitoring() --- bexhoma/experiments.py | 331 +++++++++++++++++++---------------------- 1 file changed, 150 insertions(+), 181 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 946eb1b5a..4e7578de8 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1211,7 +1211,152 @@ def end_loading(self, jobname): def show_summary(self): self.cluster.logger.debug('default.show_summary()') pass - + def show_summary_monitoring(self): + resultfolder = self.cluster.config['benchmarker']['resultfolder'] + code = self.code + evaluate = inspector.inspector(resultfolder) + evaluate.load_experiment(code=code, silent=True) + if (self.monitoring_active or self.cluster.monitor_cluster_active): + ##################### + df_monitoring = list() + ########## + df = evaluate.get_loading_metrics('total_cpu_util_s') + df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["CPU [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_loading_metrics('total_cpu_util') + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_loading_metrics('total_cpu_memory')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df).round(2) + df_cleaned.columns = ["Max RAM [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_loading_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + if len(df_monitoring) > 0: + print("\n### Ingestion - SUT") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) + ##################### + df_monitoring = list() + ########## + df = evaluate.get_loader_metrics('total_cpu_util_s') + df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["CPU [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_loader_metrics('total_cpu_util') + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_loader_metrics('total_cpu_memory')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df).round(2) + df_cleaned.columns = ["Max RAM [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_loader_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + if len(df_monitoring) > 0: + print("\n### Ingestion - Loader") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) + ##################### + df_monitoring = list() + ##################### + df = evaluate.get_streaming_metrics('total_cpu_util_s') + df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["CPU [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_streaming_metrics('total_cpu_util') + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_streaming_metrics('total_cpu_memory')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + if len(df_monitoring) > 0: + print("\n### Execution - SUT") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) + ##################### + df_monitoring = list() + ##################### + df = evaluate.get_benchmarker_metrics('total_cpu_util_s') + df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["CPU [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_benchmarker_metrics('total_cpu_util') + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_benchmarker_metrics('total_cpu_memory')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_benchmarker_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + if len(df_monitoring) > 0: + print("\n### Execution - Benchmarker") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) @@ -1399,147 +1544,8 @@ def show_summary(self): df_benchmark.rename_axis(index_names, inplace=True) print(df_benchmark) ##################### - if (self.monitoring_active or self.cluster.monitor_cluster_active): - ##################### - df_monitoring = list() - ########## - df = evaluate.get_loading_metrics('total_cpu_util_s') - df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["CPU [CPUs]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loading_metrics('total_cpu_util') - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max CPU"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loading_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df).round(2) - df_cleaned.columns = ["Max RAM [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loading_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM Cached [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - if len(df_monitoring) > 0: - print("\n### Ingestion - SUT") - df = pd.concat(df_monitoring, axis=1).round(2) - print(df) - ##################### - df_monitoring = list() - ########## - df = evaluate.get_loader_metrics('total_cpu_util_s') - df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["CPU [CPUs]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loader_metrics('total_cpu_util') - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max CPU"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loader_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df).round(2) - df_cleaned.columns = ["Max RAM [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loader_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM Cached [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - if len(df_monitoring) > 0: - print("\n### Ingestion - Loader") - df = pd.concat(df_monitoring, axis=1).round(2) - print(df) - ##################### - df_monitoring = list() - ##################### - df = evaluate.get_streaming_metrics('total_cpu_util_s') - df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["CPU [CPUs]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_streaming_metrics('total_cpu_util') - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max CPU"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_streaming_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM Cached [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - if len(df_monitoring) > 0: - print("\n### Execution - SUT") - df = pd.concat(df_monitoring, axis=1).round(2) - print(df) - ##################### - df_monitoring = list() - ##################### - df = evaluate.get_benchmarker_metrics('total_cpu_util_s') - df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["CPU [CPUs]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_benchmarker_metrics('total_cpu_util') - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max CPU"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_benchmarker_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_benchmarker_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM Cached [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - if len(df_monitoring) > 0: - print("\n### Execution - Benchmarker") - df = pd.concat(df_monitoring, axis=1).round(2) - print(df) + self.show_summary_monitoring() + """ @@ -1905,45 +1911,8 @@ def show_summary(self): print(df_aggregated_reduced) #evaluation = evaluators.ycsb(code=code, path=path) ##################### - if (self.monitoring_active or self.cluster.monitor_cluster_active): - ##################### - evaluation.transform_monitoring_results(component="loading") - ##################### - df = evaluation.get_monitoring_metric('total_cpu_util_s', component='loading').max() - evaluation.get_monitoring_metric('total_cpu_util_s', component='loading').min() - df1 = pd.DataFrame(df) - df1.columns = ["SUT - CPU of Ingestion (via counter) [CPUs]"] - ########## - df = evaluation.get_monitoring_metric('total_cpu_memory', component='loading').max()/1024 - df2 = pd.DataFrame(df) - df2.columns = ["SUT - Max RAM of Ingestion [Gb]"] - ########## - if not df1.empty or not df2.empty: - print("\n### Ingestion") - if not df1.empty and not df2.empty: - print(pd.concat([df1, df2], axis=1).round(2)) - elif not df1.empty: - print(df1.round(2)) - elif not df2.empty: - print(df2.round(2)) - ##################### - evaluation.transform_monitoring_results(component="stream") - ##################### - df = evaluation.get_monitoring_metric('total_cpu_util_s', component='stream').max() - evaluation.get_monitoring_metric('total_cpu_util_s', component='stream').min() - df1 = pd.DataFrame(df) - df1.columns = ["SUT - CPU of Execution (via counter) [CPUs]"] - ########## - df = evaluation.get_monitoring_metric('total_cpu_memory', component='stream').max()/1024 - df2 = pd.DataFrame(df) - df2.columns = ["SUT - Max RAM of Execution [Gb]"] - ########## - if not df1.empty or not df2.empty: - print("\n### Execution") - if not df1.empty and not df2.empty: - print(pd.concat([df1, df2], axis=1).round(2)) - elif not df1.empty: - print(df1.round(2)) - elif not df2.empty: - print(df2.round(2)) + self.show_summary_monitoring() + """ From 09672d0f37b0b8eb331a9610502e9f9a54c49fcf Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 18 Feb 2024 20:18:04 +0100 Subject: [PATCH 052/121] Bexhoma: show_summary_monitoring() --- bexhoma/experiments.py | 44 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 4e7578de8..fff1e7167 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1912,7 +1912,49 @@ def show_summary(self): #evaluation = evaluators.ycsb(code=code, path=path) ##################### self.show_summary_monitoring() - + def show_summary_monitoring(self): + resultfolder = self.cluster.config['benchmarker']['resultfolder'] + code = self.code + evaluation = evaluators.ycsb(code=code, path=resultfolder) + if (self.monitoring_active or self.cluster.monitor_cluster_active): + ##################### + evaluation.transform_monitoring_results(component="loading") + ##################### + df = evaluation.get_monitoring_metric('total_cpu_util_s', component='loading').max() - evaluation.get_monitoring_metric('total_cpu_util_s', component='loading').min() + df1 = pd.DataFrame(df) + df1.columns = ["SUT - CPU of Ingestion (via counter) [CPUs]"] + ########## + df = evaluation.get_monitoring_metric('total_cpu_memory', component='loading').max()/1024 + df2 = pd.DataFrame(df) + df2.columns = ["SUT - Max RAM of Ingestion [Gb]"] + ########## + if not df1.empty or not df2.empty: + print("\n### Ingestion") + if not df1.empty and not df2.empty: + print(pd.concat([df1, df2], axis=1).round(2)) + elif not df1.empty: + print(df1.round(2)) + elif not df2.empty: + print(df2.round(2)) + ##################### + evaluation.transform_monitoring_results(component="stream") + ##################### + df = evaluation.get_monitoring_metric('total_cpu_util_s', component='stream').max() - evaluation.get_monitoring_metric('total_cpu_util_s', component='stream').min() + df1 = pd.DataFrame(df) + df1.columns = ["SUT - CPU of Execution (via counter) [CPUs]"] + ########## + df = evaluation.get_monitoring_metric('total_cpu_memory', component='stream').max()/1024 + df2 = pd.DataFrame(df) + df2.columns = ["SUT - Max RAM of Execution [Gb]"] + ########## + if not df1.empty or not df2.empty: + print("\n### Execution") + if not df1.empty and not df2.empty: + print(pd.concat([df1, df2], axis=1).round(2)) + elif not df1.empty: + print(df1.round(2)) + elif not df2.empty: + print(df2.round(2)) """ From 9bfd1f3fe4d0c0decc4772a0ff5805242835b56b Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 14:51:13 +0100 Subject: [PATCH 053/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index fff1e7167..b9bd3f19f 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1220,7 +1220,7 @@ def show_summary_monitoring(self): ##################### df_monitoring = list() ########## - df = evaluate.get_loading_metrics('total_cpu_util_s') + df = evaluate.get_monitoring_metric(metric='total_cpu_util_s', component="loading") df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter df_cleaned = pd.DataFrame(df) df_cleaned.columns = ["CPU [CPUs]"] From 5104fdcd7185a310a30b3ce48e4d032826c9c7dc Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 14:56:13 +0100 Subject: [PATCH 054/121] Bexhoma: config.check_volumes() --- bexhoma/configurations.py | 38 ++++++++++++++++++++++++-------------- bexhoma/experiments.py | 1 + 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 2789e45c3..7f8f5e00a 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -1730,6 +1730,29 @@ def get_host_diskspace_used(self): # pipe to awk sometimes does not work #return int(disk.split('\t')[0]) return 0 + def check_volumes(self): + """ + Calls all `get_host_x()` methods. + Returns information about the sut's host as a dict. + + :return: Dict of informations about the host + """ + # add volume labels to PV + app = self.appname + use_storage = self.use_storage() + if use_storage: + if self.storage['storageConfiguration']: + name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.storage['storageConfiguration']) + else: + name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.configuration) + volume = name_pvc + else: + volume = '' + if volume: + size, used = self.get_host_volume() + fullcommand = 'label pvc {} --overwrite volume_size="{}" volume_used="{}"'.format(volume, size, used) + #print(fullcommand) + self.experiment.cluster.kubectl(fullcommand) def get_host_all(self): """ Calls all `get_host_x()` methods. @@ -1939,20 +1962,7 @@ def run_benchmarker_pod(self, c['hostsystem']['loading_timespans'] = self.loading_timespans c['hostsystem']['benchmarking_timespans'] = self.benchmarking_timespans #print(c) - # add volume labels to PV - use_storage = self.use_storage() - if use_storage: - if self.storage['storageConfiguration']: - name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.storage['storageConfiguration']) - else: - name_pvc = self.generate_component_name(app=app, component='storage', experiment=self.storage_label, configuration=self.configuration) - volume = name_pvc - else: - volume = '' - if volume: - fullcommand = 'label pvc {} --overwrite volume_size="{}" volume_used="{}"'.format(volume, c['hostsystem']['volume_size'], c['hostsystem']['volume_used']) - #print(fullcommand) - self.experiment.cluster.kubectl(fullcommand) + self.check_volumes() # add config jarfolder #print(self.experiment.cluster.config['benchmarker']['jarfolder']) if isinstance(c['JDBC']['jar'], list): diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index b9bd3f19f..b85de4dd5 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -971,6 +971,7 @@ def work_benchmark_list(self, intervals=30, stop=True): # self.cluster.delete_pod(p) self.end_benchmarking(job, config) self.cluster.delete_job(job) + config.check_volumes() if len(pods) == 0 and len(jobs) == 0: do = False for config in self.configurations: From 7ba912a4f9f4e11e8796af4d01d3a66b8e69c178 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 14:59:24 +0100 Subject: [PATCH 055/121] TPC-H: Too many pods test for generator --- images/tpch/generator/generator.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/images/tpch/generator/generator.sh b/images/tpch/generator/generator.sh index 3398ca32e..944d5a801 100644 --- a/images/tpch/generator/generator.sh +++ b/images/tpch/generator/generator.sh @@ -41,6 +41,10 @@ then then echo "OK" break + elif test "$PODS_RUNNING" -gt $NUM_PODS + then + echo "Too many pods! Restart occured?" + exit 0 else echo "We have to wait" sleep 1 From 4119be71536f06d69880d2e39e9e9a732dda44c7 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:33:21 +0100 Subject: [PATCH 056/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 65 +++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 29 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index b85de4dd5..f6aca90bb 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1212,6 +1212,41 @@ def end_loading(self, jobname): def show_summary(self): self.cluster.logger.debug('default.show_summary()') pass + def show_summary_monitoring_table(self, evaluate, component): + df_monitoring = list() + ########## + df = evaluate.get_monitoring_metric(metric='total_cpu_util_s', component=component) + df = df.max() - df.min() # compute difference of counter + #df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["CPU [CPUs]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_monitoring_metric(metric='total_cpu_util', component=component) + #df = evaluate.get_loading_metrics('total_cpu_util') + df = df.max() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max CPU"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_monitoring_metric(metric='total_cpu_memory', component=component)/1024 + #df = evaluate.get_loading_metrics('total_cpu_memory')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df).round(2) + df_cleaned.columns = ["Max RAM [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + ########## + df = evaluate.get_monitoring_metric(metric='total_cpu_memory_cached', component=component)/1024 + #df = evaluate.get_loading_metrics('total_cpu_memory_cached')/1024 + df = df.T.max().sort_index() + df_cleaned = pd.DataFrame(df) + df_cleaned.columns = ["Max RAM Cached [Gb]"] + if not df_cleaned.empty: + df_monitoring.append(df_cleaned.copy()) + return df_monitoring def show_summary_monitoring(self): resultfolder = self.cluster.config['benchmarker']['resultfolder'] code = self.code @@ -1219,35 +1254,7 @@ def show_summary_monitoring(self): evaluate.load_experiment(code=code, silent=True) if (self.monitoring_active or self.cluster.monitor_cluster_active): ##################### - df_monitoring = list() - ########## - df = evaluate.get_monitoring_metric(metric='total_cpu_util_s', component="loading") - df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["CPU [CPUs]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loading_metrics('total_cpu_util') - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max CPU"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loading_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df).round(2) - df_cleaned.columns = ["Max RAM [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loading_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM Cached [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) + df_monitoring = self.show_summary_monitoring_table(evaluate, "loading") ########## if len(df_monitoring) > 0: print("\n### Ingestion - SUT") From b15449d8280742c4badf06aef5dfdb2e9cc02344 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:34:19 +0100 Subject: [PATCH 057/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index f6aca90bb..7d3ed5abc 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1216,7 +1216,7 @@ def show_summary_monitoring_table(self, evaluate, component): df_monitoring = list() ########## df = evaluate.get_monitoring_metric(metric='total_cpu_util_s', component=component) - df = df.max() - df.min() # compute difference of counter + df = df.max().sort_index() - df.min().sort_index() # compute difference of counter #df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter df_cleaned = pd.DataFrame(df) df_cleaned.columns = ["CPU [CPUs]"] @@ -1225,7 +1225,7 @@ def show_summary_monitoring_table(self, evaluate, component): ########## df = evaluate.get_monitoring_metric(metric='total_cpu_util', component=component) #df = evaluate.get_loading_metrics('total_cpu_util') - df = df.max() + df = df.max().sort_index() df_cleaned = pd.DataFrame(df) df_cleaned.columns = ["Max CPU"] if not df_cleaned.empty: @@ -1233,7 +1233,7 @@ def show_summary_monitoring_table(self, evaluate, component): ########## df = evaluate.get_monitoring_metric(metric='total_cpu_memory', component=component)/1024 #df = evaluate.get_loading_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() + df = df.max().sort_index() df_cleaned = pd.DataFrame(df).round(2) df_cleaned.columns = ["Max RAM [Gb]"] if not df_cleaned.empty: @@ -1241,7 +1241,7 @@ def show_summary_monitoring_table(self, evaluate, component): ########## df = evaluate.get_monitoring_metric(metric='total_cpu_memory_cached', component=component)/1024 #df = evaluate.get_loading_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() + df = df.max().sort_index() df_cleaned = pd.DataFrame(df) df_cleaned.columns = ["Max RAM Cached [Gb]"] if not df_cleaned.empty: From f0618f3070e47a702ed1b69a2e0ba48afa7fbffa Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:35:58 +0100 Subject: [PATCH 058/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 90 ++---------------------------------------- 1 file changed, 3 insertions(+), 87 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 7d3ed5abc..a15261a59 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1261,105 +1261,21 @@ def show_summary_monitoring(self): df = pd.concat(df_monitoring, axis=1).round(2) print(df) ##################### - df_monitoring = list() - ########## - df = evaluate.get_loader_metrics('total_cpu_util_s') - df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["CPU [CPUs]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loader_metrics('total_cpu_util') - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max CPU"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loader_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df).round(2) - df_cleaned.columns = ["Max RAM [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_loader_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM Cached [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) + df_monitoring = self.show_summary_monitoring_table(evaluate, "loader") ########## if len(df_monitoring) > 0: print("\n### Ingestion - Loader") df = pd.concat(df_monitoring, axis=1).round(2) print(df) ##################### - df_monitoring = list() - ##################### - df = evaluate.get_streaming_metrics('total_cpu_util_s') - df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["CPU [CPUs]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_streaming_metrics('total_cpu_util') - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max CPU"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_streaming_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_streaming_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM Cached [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) + df_monitoring = self.show_summary_monitoring_table(evaluate, "stream") ########## if len(df_monitoring) > 0: print("\n### Execution - SUT") df = pd.concat(df_monitoring, axis=1).round(2) print(df) ##################### - df_monitoring = list() - ##################### - df = evaluate.get_benchmarker_metrics('total_cpu_util_s') - df = df.T.max().sort_index() - df.T.min().sort_index() # compute difference of counter - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["CPU [CPUs]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_benchmarker_metrics('total_cpu_util') - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max CPU"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_benchmarker_metrics('total_cpu_memory')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) - ########## - df = evaluate.get_benchmarker_metrics('total_cpu_memory_cached')/1024 - df = df.T.max().sort_index() - df_cleaned = pd.DataFrame(df) - df_cleaned.columns = ["Max RAM Cached [Gb]"] - if not df_cleaned.empty: - df_monitoring.append(df_cleaned.copy()) + df_monitoring = self.show_summary_monitoring_table(evaluate, "benchmarker") ########## if len(df_monitoring) > 0: print("\n### Execution - Benchmarker") From b3ab0e8500502f65c166961ab3083b3b6328eb50 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:39:16 +0100 Subject: [PATCH 059/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 55 ++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index a15261a59..a0c93a440 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1842,43 +1842,34 @@ def show_summary_monitoring(self): evaluation = evaluators.ycsb(code=code, path=resultfolder) if (self.monitoring_active or self.cluster.monitor_cluster_active): ##################### - evaluation.transform_monitoring_results(component="loading") - ##################### - df = evaluation.get_monitoring_metric('total_cpu_util_s', component='loading').max() - evaluation.get_monitoring_metric('total_cpu_util_s', component='loading').min() - df1 = pd.DataFrame(df) - df1.columns = ["SUT - CPU of Ingestion (via counter) [CPUs]"] - ########## - df = evaluation.get_monitoring_metric('total_cpu_memory', component='loading').max()/1024 - df2 = pd.DataFrame(df) - df2.columns = ["SUT - Max RAM of Ingestion [Gb]"] + df_monitoring = self.show_summary_monitoring_table(evaluation, "loading") ########## - if not df1.empty or not df2.empty: - print("\n### Ingestion") - if not df1.empty and not df2.empty: - print(pd.concat([df1, df2], axis=1).round(2)) - elif not df1.empty: - print(df1.round(2)) - elif not df2.empty: - print(df2.round(2)) + if len(df_monitoring) > 0: + print("\n### Ingestion - SUT") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) ##################### - evaluation.transform_monitoring_results(component="stream") + df_monitoring = self.show_summary_monitoring_table(evaluation, "loader") + ########## + if len(df_monitoring) > 0: + print("\n### Ingestion - Loader") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) ##################### - df = evaluation.get_monitoring_metric('total_cpu_util_s', component='stream').max() - evaluation.get_monitoring_metric('total_cpu_util_s', component='stream').min() - df1 = pd.DataFrame(df) - df1.columns = ["SUT - CPU of Execution (via counter) [CPUs]"] + df_monitoring = self.show_summary_monitoring_table(evaluation, "stream") ########## - df = evaluation.get_monitoring_metric('total_cpu_memory', component='stream').max()/1024 - df2 = pd.DataFrame(df) - df2.columns = ["SUT - Max RAM of Execution [Gb]"] + if len(df_monitoring) > 0: + print("\n### Execution - SUT") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) + ##################### + df_monitoring = self.show_summary_monitoring_table(evaluation, "benchmarker") ########## - if not df1.empty or not df2.empty: - print("\n### Execution") - if not df1.empty and not df2.empty: - print(pd.concat([df1, df2], axis=1).round(2)) - elif not df1.empty: - print(df1.round(2)) - elif not df2.empty: - print(df2.round(2)) + if len(df_monitoring) > 0: + print("\n### Execution - Benchmarker") + df = pd.concat(df_monitoring, axis=1).round(2) + print(df) + """ From f3a39088b261c69f234848550ea681778b1fe946 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:41:53 +0100 Subject: [PATCH 060/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index a0c93a440..d92e54f34 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1388,6 +1388,18 @@ def show_summary(self): pd.set_option('display.width', 1000) resultfolder = self.cluster.config['benchmarker']['resultfolder'] code = self.code + with open(resultfolder+"/"+code+"/connections.config",'r') as inf: + connections = ast.literal_eval(inf.read()) + pretty_connections = json.dumps(connections, indent=2) + #print(pretty_connections) + connections_sorted = sorted(connections, key=lambda c: c['name']) + for c in connections_sorted: + print(c['name'], + "uses docker image", + c['parameter']['dockerimage']) + infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key] + for info in infos: + print(info) evaluate = inspector.inspector(resultfolder) evaluate.load_experiment(code=code, silent=False) ##################### From 96cc62882befaae758382b43cf76cba6bbd72fb3 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:43:03 +0100 Subject: [PATCH 061/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index d92e54f34..3ce3a03d6 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1397,7 +1397,7 @@ def show_summary(self): print(c['name'], "uses docker image", c['parameter']['dockerimage']) - infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key] + infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key and not info=="" and not str(info)=="0" and not len(info)==0] for info in infos: print(info) evaluate = inspector.inspector(resultfolder) From c255c00d9e9d148eb9f7e9eafb9135d62f8a8965 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:44:00 +0100 Subject: [PATCH 062/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 3ce3a03d6..7f90347bd 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1397,7 +1397,7 @@ def show_summary(self): print(c['name'], "uses docker image", c['parameter']['dockerimage']) - infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key and not info=="" and not str(info)=="0" and not len(info)==0] + infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key and not info=="" and not str(info)=="0" and not info==[]] for info in infos: print(info) evaluate = inspector.inspector(resultfolder) From 3b307876f589ada162bc48f3b86ac133ed69aee3 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:44:40 +0100 Subject: [PATCH 063/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 7f90347bd..61043ffac 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1811,7 +1811,7 @@ def show_summary(self): print(c['name'], "uses docker image", c['parameter']['dockerimage']) - infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key] + infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key and not info=="" and not str(info)=="0" and not info==[]] for info in infos: print(info) #print("found", len(connections), "connections") From af20619a0c2eff6db5d142776a4e843a1a59f920 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 16:55:02 +0100 Subject: [PATCH 064/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 61043ffac..fd0a65e5b 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1250,7 +1250,7 @@ def show_summary_monitoring_table(self, evaluate, component): def show_summary_monitoring(self): resultfolder = self.cluster.config['benchmarker']['resultfolder'] code = self.code - evaluate = inspector.inspector(resultfolder) + evaluate = inspector.inspector(resultfolder, silent=True) evaluate.load_experiment(code=code, silent=True) if (self.monitoring_active or self.cluster.monitor_cluster_active): ##################### @@ -1400,8 +1400,8 @@ def show_summary(self): infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key and not info=="" and not str(info)=="0" and not info==[]] for info in infos: print(info) - evaluate = inspector.inspector(resultfolder) - evaluate.load_experiment(code=code, silent=False) + evaluate = inspector.inspector(resultfolder, silent=True) + evaluate.load_experiment(code=code, silent=True) ##################### print("\n### Errors") print(evaluate.get_total_errors().T) From 800914856816f9b5d79727cd5ce76c7c8faefae1 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 17:07:06 +0100 Subject: [PATCH 065/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index fd0a65e5b..60fd0db77 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1250,7 +1250,7 @@ def show_summary_monitoring_table(self, evaluate, component): def show_summary_monitoring(self): resultfolder = self.cluster.config['benchmarker']['resultfolder'] code = self.code - evaluate = inspector.inspector(resultfolder, silent=True) + evaluate = inspector.inspector(resultfolder) evaluate.load_experiment(code=code, silent=True) if (self.monitoring_active or self.cluster.monitor_cluster_active): ##################### From 45234610452e9e378930c80d5991dd31d3249a90 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 17:07:37 +0100 Subject: [PATCH 066/121] Bexhoma: Test for unified monitoring summary --- bexhoma/experiments.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 60fd0db77..31406567d 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1400,7 +1400,7 @@ def show_summary(self): infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key and not info=="" and not str(info)=="0" and not info==[]] for info in infos: print(info) - evaluate = inspector.inspector(resultfolder, silent=True) + evaluate = inspector.inspector(resultfolder) evaluate.load_experiment(code=code, silent=True) ##################### print("\n### Errors") From 0585c6fed5dfc65cd96b15053f0335fcb61fb339 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 17:15:52 +0100 Subject: [PATCH 067/121] Bexhoma: Show infos about workload in summary --- bexhoma/experiments.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 31406567d..b2c4c8ead 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1388,6 +1388,11 @@ def show_summary(self): pd.set_option('display.width', 1000) resultfolder = self.cluster.config['benchmarker']['resultfolder'] code = self.code + with open(resultfolder+"/"+code+"/queries.config",'r') as inp: + workload_properties = ast.literal_eval(inp.read()) + print(workload_properties['name']) + print(workload_properties['info']) + print(workload_properties['intro']) with open(resultfolder+"/"+code+"/connections.config",'r') as inf: connections = ast.literal_eval(inf.read()) pretty_connections = json.dumps(connections, indent=2) From a04443f42f904ea50f5cbba926ca09bf95d7c306 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 17:18:06 +0100 Subject: [PATCH 068/121] Bexhoma: Show infos about workload in summary --- bexhoma/experiments.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index b2c4c8ead..fc76c98e4 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1390,9 +1390,9 @@ def show_summary(self): code = self.code with open(resultfolder+"/"+code+"/queries.config",'r') as inp: workload_properties = ast.literal_eval(inp.read()) - print(workload_properties['name']) - print(workload_properties['info']) - print(workload_properties['intro']) + print("\n### Workload\n "+workload_properties['name']) + print(" "+workload_properties['intro']) + print(" "+workload_properties['info']) with open(resultfolder+"/"+code+"/connections.config",'r') as inf: connections = ast.literal_eval(inf.read()) pretty_connections = json.dumps(connections, indent=2) @@ -1807,6 +1807,11 @@ def show_summary(self): pd.set_option('display.width', 1000) resultfolder = self.cluster.config['benchmarker']['resultfolder'] code = self.code + with open(resultfolder+"/"+code+"/queries.config",'r') as inp: + workload_properties = ast.literal_eval(inp.read()) + print("\n### Workload\n "+workload_properties['name']) + print(" "+workload_properties['intro']) + print(" "+workload_properties['info']) with open(resultfolder+"/"+code+"/connections.config",'r') as inf: connections = ast.literal_eval(inf.read()) pretty_connections = json.dumps(connections, indent=2) From 8a910d612c147f90d4aa86c3a234902cc3581da4 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 17:19:23 +0100 Subject: [PATCH 069/121] Bexhoma: Show infos about workload in summary --- bexhoma/experiments.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index fc76c98e4..986623e08 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1393,6 +1393,7 @@ def show_summary(self): print("\n### Workload\n "+workload_properties['name']) print(" "+workload_properties['intro']) print(" "+workload_properties['info']) + print("\n### Connections") with open(resultfolder+"/"+code+"/connections.config",'r') as inf: connections = ast.literal_eval(inf.read()) pretty_connections = json.dumps(connections, indent=2) @@ -1812,6 +1813,7 @@ def show_summary(self): print("\n### Workload\n "+workload_properties['name']) print(" "+workload_properties['intro']) print(" "+workload_properties['info']) + print("\n### Connections") with open(resultfolder+"/"+code+"/connections.config",'r') as inf: connections = ast.literal_eval(inf.read()) pretty_connections = json.dumps(connections, indent=2) From ff82b4b1bca1a6bdca44d88cacc57f36acbe0eac Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 20:19:26 +0100 Subject: [PATCH 070/121] Bexhoma: Also mount bexhoma-data in dashboard --- k8s/deploymenttemplate-bexhoma-dashboard.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/deploymenttemplate-bexhoma-dashboard.yml b/k8s/deploymenttemplate-bexhoma-dashboard.yml index aa8c7aee7..e554fb866 100644 --- a/k8s/deploymenttemplate-bexhoma-dashboard.yml +++ b/k8s/deploymenttemplate-bexhoma-dashboard.yml @@ -56,6 +56,8 @@ spec: volumeMounts: - name: bexhoma-results mountPath: /results + - name: benchmark-data-volume + mountPath: /data - name: jupyter image: bexhoma/evaluator_dbmsbenchmarker:v0.13.7 imagePullPolicy: IfNotPresent @@ -82,8 +84,6 @@ spec: volumeMounts: - name: bexhoma-results mountPath: /results - - name: benchmark-data-volume - mountPath: /data volumes: - name: bexhoma-results persistentVolumeClaim: {claimName: bexhoma-results} From 648ee0861a0c0d81f503db253a72abad13e64ee1 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 20:26:03 +0100 Subject: [PATCH 071/121] Bexhoma: show localresults --- cluster.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/cluster.py b/cluster.py index 269ce76ee..da2463be1 100644 --- a/cluster.py +++ b/cluster.py @@ -27,6 +27,7 @@ from tabulate import tabulate from datetime import datetime import multiprocessing as mp +from prettytable import PrettyTable, ALL urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) @@ -37,7 +38,7 @@ """ # argparse parser = argparse.ArgumentParser(description=description) - parser.add_argument('mode', help='manage experiments: stop, get status, connect to dbms or connect to dashboard', choices=['stop','status','dashboard','localdashboard','jupyter','master']) + parser.add_argument('mode', help='manage experiments: stop, get status, connect to dbms or connect to dashboard', choices=['stop','status','dashboard','localdashboard','localresults','jupyter','master']) parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') parser.add_argument('-e', '--experiment', help='code of experiment', default=None) parser.add_argument('-c', '--connection', help='name of DBMS', default=None) @@ -84,6 +85,26 @@ sys.argv.remove('localdashboard') from dbmsbenchmarker.scripts import dashboardcli dashboardcli.startup() + elif args.mode == 'localresults': + cluster = clusters.kubernetes(clusterconfig, context=args.context) + # path of folder containing experiment results + resultfolder = cluster.resultfolder + # create evaluation object for result folder + evaluate = inspector.inspector(resultfolder) + # dataframe of experiments + df = evaluate.get_experiments_preview().sort_values('time') + df = df.reset_index() + df['info'] = df['info'].str.replace('. ', '.\n') + # Create a PrettyTable object + pt = PrettyTable() + pt.field_names = df.columns + pt.align['info'] = 'r' # 'r' for right alignment + pt.hrules=ALL + # Add rows to the PrettyTable + for _, row in df.iterrows(): + pt.add_row(row) + # Display the PrettyTable + print(pt) elif args.mode == 'jupyter': import subprocess cmd = ["jupyter","notebook","--notebook-dir","images/evaluator_dbmsbenchmarker/notebooks","--NotebookApp.ip","0.0.0.0","--no-browser","--NotebookApp.allow_origin","*"] From 698347b2307e4d77f20471183a50f5ab1954039c Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 20:28:59 +0100 Subject: [PATCH 072/121] Bexhoma: show localresults --- bexhoma/scripts/experimentsmanager.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/bexhoma/scripts/experimentsmanager.py b/bexhoma/scripts/experimentsmanager.py index 429493466..11fe15061 100644 --- a/bexhoma/scripts/experimentsmanager.py +++ b/bexhoma/scripts/experimentsmanager.py @@ -36,7 +36,7 @@ def manage(): print(description) # argparse parser = argparse.ArgumentParser(description=description) - parser.add_argument('mode', help='manage experiments: stop, get status, connect to dbms or connect to dashboard', choices=['stop','status','dashboard','localdashboard','jupyter','master']) + parser.add_argument('mode', help='manage experiments: stop, get status, connect to dbms or connect to dashboard', choices=['stop','status','dashboard','localdashboard','localresults','jupyter','master']) parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') parser.add_argument('-e', '--experiment', help='code of experiment', default=None) parser.add_argument('-c', '--connection', help='name of DBMS', default=None) @@ -83,6 +83,26 @@ def manage(): sys.argv.remove('localdashboard') from dbmsbenchmarker.scripts import dashboardcli dashboardcli.startup() + elif args.mode == 'localresults': + cluster = clusters.kubernetes(clusterconfig, context=args.context) + # path of folder containing experiment results + resultfolder = cluster.resultfolder + # create evaluation object for result folder + evaluate = inspector.inspector(resultfolder) + # dataframe of experiments + df = evaluate.get_experiments_preview().sort_values('time') + df = df.reset_index() + df['info'] = df['info'].str.replace('. ', '.\n') + # Create a PrettyTable object + pt = PrettyTable() + pt.field_names = df.columns + pt.align['info'] = 'r' # 'r' for right alignment + pt.hrules=ALL + # Add rows to the PrettyTable + for _, row in df.iterrows(): + pt.add_row(row) + # Display the PrettyTable + print(pt) elif args.mode == 'jupyter': import subprocess cmd = ["jupyter","notebook","--notebook-dir","images/evaluator_dbmsbenchmarker/notebooks","--NotebookApp.ip","0.0.0.0","--no-browser","--NotebookApp.allow_origin","*"] From 79cc8a230821d0e15e7d6bd2d193452744e90959 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 20:34:20 +0100 Subject: [PATCH 073/121] Bexhoma: Do not start daemonset if monitoring in cluster exists --- bexhoma/clusters.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index aec97fad7..2950e3af9 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1370,6 +1370,7 @@ def start_monitoring_cluster(self, app='', component='monitoring'): :param component: Component name, should be 'monitoring' typically """ self.monitor_cluster_active = True + self.monitor_cluster_exists = self.cluster.test_if_monitoring_healthy(): if self.monitor_cluster_exists: return endpoints = self.get_service_endpoints(service_name="bexhoma-service-monitoring-default") From 4392ca66e96e3cf3fa4dc0ffd4b2a661cb53372d Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 20:36:12 +0100 Subject: [PATCH 074/121] Bexhoma: Do not start daemonset if monitoring in cluster exists --- bexhoma/clusters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 2950e3af9..547542bcf 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1370,7 +1370,7 @@ def start_monitoring_cluster(self, app='', component='monitoring'): :param component: Component name, should be 'monitoring' typically """ self.monitor_cluster_active = True - self.monitor_cluster_exists = self.cluster.test_if_monitoring_healthy(): + self.monitor_cluster_exists = self.cluster.test_if_monitoring_healthy() if self.monitor_cluster_exists: return endpoints = self.get_service_endpoints(service_name="bexhoma-service-monitoring-default") From 2b99e6a36d5d354c0f9ad01b7f59dd9d1cc62e06 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 20:38:33 +0100 Subject: [PATCH 075/121] Bexhoma: Do not start daemonset if monitoring in cluster exists --- bexhoma/clusters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 547542bcf..2c013489e 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1370,7 +1370,7 @@ def start_monitoring_cluster(self, app='', component='monitoring'): :param component: Component name, should be 'monitoring' typically """ self.monitor_cluster_active = True - self.monitor_cluster_exists = self.cluster.test_if_monitoring_healthy() + self.monitor_cluster_exists = self.test_if_monitoring_healthy() if self.monitor_cluster_exists: return endpoints = self.get_service_endpoints(service_name="bexhoma-service-monitoring-default") From d3d2279c1390bc1f8768f44bcefca96a68b43c69 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 21:06:17 +0100 Subject: [PATCH 076/121] Bexhoma: show data dir content in tool --- cluster.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cluster.py b/cluster.py index da2463be1..2c4a14009 100644 --- a/cluster.py +++ b/cluster.py @@ -105,6 +105,12 @@ pt.add_row(row) # Display the PrettyTable print(pt) + elif args.mode == 'data': + cluster = clusters.kubernetes(clusterconfig, context=args.context) + cmd = {} + cmd['get_data_dir'] = 'du -h /data/' + stdin, stdout, stderr = cluster.execute_command_in_pod(cmd['get_data_dir'], container='dashboard') + print(stdout) elif args.mode == 'jupyter': import subprocess cmd = ["jupyter","notebook","--notebook-dir","images/evaluator_dbmsbenchmarker/notebooks","--NotebookApp.ip","0.0.0.0","--no-browser","--NotebookApp.allow_origin","*"] From af5ff412dee45ac274d4c9362229575b1dbdaa20 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 21:06:54 +0100 Subject: [PATCH 077/121] Bexhoma: show data dir content in tool --- cluster.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster.py b/cluster.py index 2c4a14009..3fb15df5e 100644 --- a/cluster.py +++ b/cluster.py @@ -38,7 +38,7 @@ """ # argparse parser = argparse.ArgumentParser(description=description) - parser.add_argument('mode', help='manage experiments: stop, get status, connect to dbms or connect to dashboard', choices=['stop','status','dashboard','localdashboard','localresults','jupyter','master']) + parser.add_argument('mode', help='manage experiments: stop, get status, connect to dbms or connect to dashboard', choices=['stop','status','dashboard','localdashboard','localresults','jupyter','master','data']) parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') parser.add_argument('-e', '--experiment', help='code of experiment', default=None) parser.add_argument('-c', '--connection', help='name of DBMS', default=None) From 1f5eb422241e887ff2640c280d5bc73f171641de Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 21:08:05 +0100 Subject: [PATCH 078/121] Bexhoma: show data dir content in tool --- cluster.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cluster.py b/cluster.py index 3fb15df5e..69a23b93a 100644 --- a/cluster.py +++ b/cluster.py @@ -107,10 +107,12 @@ print(pt) elif args.mode == 'data': cluster = clusters.kubernetes(clusterconfig, context=args.context) - cmd = {} - cmd['get_data_dir'] = 'du -h /data/' - stdin, stdout, stderr = cluster.execute_command_in_pod(cmd['get_data_dir'], container='dashboard') - print(stdout) + dashboard_name = cluster.get_dashboard_pod_name() + if len(dashboard_name) > 0: + cmd = {} + cmd['get_data_dir'] = 'du -h /data/' + stdin, stdout, stderr = cluster.execute_command_in_pod(cmd['get_data_dir'], pod=dashboard_name, container='dashboard') + print(stdout) elif args.mode == 'jupyter': import subprocess cmd = ["jupyter","notebook","--notebook-dir","images/evaluator_dbmsbenchmarker/notebooks","--NotebookApp.ip","0.0.0.0","--no-browser","--NotebookApp.allow_origin","*"] From 716faaad265dbe0f6195db48e6de4488641322a7 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 19 Feb 2024 21:11:25 +0100 Subject: [PATCH 079/121] Bexhoma: show data dir content in tool --- bexhoma/scripts/experimentsmanager.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bexhoma/scripts/experimentsmanager.py b/bexhoma/scripts/experimentsmanager.py index 11fe15061..e3ca59e81 100644 --- a/bexhoma/scripts/experimentsmanager.py +++ b/bexhoma/scripts/experimentsmanager.py @@ -36,7 +36,7 @@ def manage(): print(description) # argparse parser = argparse.ArgumentParser(description=description) - parser.add_argument('mode', help='manage experiments: stop, get status, connect to dbms or connect to dashboard', choices=['stop','status','dashboard','localdashboard','localresults','jupyter','master']) + parser.add_argument('mode', help='manage experiments: stop, get status, connect to dbms or connect to dashboard', choices=['stop','status','dashboard','localdashboard','localresults','jupyter','master','data']) parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') parser.add_argument('-e', '--experiment', help='code of experiment', default=None) parser.add_argument('-c', '--connection', help='name of DBMS', default=None) @@ -103,6 +103,14 @@ def manage(): pt.add_row(row) # Display the PrettyTable print(pt) + elif args.mode == 'data': + cluster = clusters.kubernetes(clusterconfig, context=args.context) + dashboard_name = cluster.get_dashboard_pod_name() + if len(dashboard_name) > 0: + cmd = {} + cmd['get_data_dir'] = 'du -h /data/' + stdin, stdout, stderr = cluster.execute_command_in_pod(cmd['get_data_dir'], pod=dashboard_name, container='dashboard') + print(stdout) elif args.mode == 'jupyter': import subprocess cmd = ["jupyter","notebook","--notebook-dir","images/evaluator_dbmsbenchmarker/notebooks","--NotebookApp.ip","0.0.0.0","--no-browser","--NotebookApp.allow_origin","*"] From 7c139e93c13fa3c61a0d9ebd7f2b2d26571c58ca Mon Sep 17 00:00:00 2001 From: perdelt Date: Tue, 20 Feb 2024 07:51:01 +0100 Subject: [PATCH 080/121] Bexhoma: Loader metrics also for cluster monitoring exists --- bexhoma/configurations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 7f8f5e00a..5afbfaf49 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -2141,7 +2141,7 @@ def run_benchmarker_pod(self, # get metrics of loader components # only if general monitoring is on endpoints_cluster = self.experiment.cluster.get_service_endpoints(service_name="bexhoma-service-monitoring-default") - if len(endpoints_cluster)>0: + if len(endpoints_cluster)>0 or self.cluster.monitor_cluster_exists: # data generator container print("{:30s}: collecting metrics of data generator".format(connection)) cmd['fetch_loader_metrics'] = 'python metrics.py -r /results/ -db -ct datagenerator -cn datagenerator -c {} -cf {} -f {} -e {} -ts {} -te {}'.format( From 467a821f31eabf79ae7edf2dad80ab5d9f8a8955 Mon Sep 17 00:00:00 2001 From: perdelt Date: Tue, 20 Feb 2024 20:17:48 +0100 Subject: [PATCH 081/121] Bexhoma: Improved output and docs --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b5b8b147f..fe98f713e 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,9 @@ [![Documentation Status](https://readthedocs.org/projects/bexhoma/badge/?version=latest)](https://bexhoma.readthedocs.io/en/latest/?badge=latest) # Benchmark Experiment Host Manager (Bexhoma) + +## Orchstrating Cloud-Native Benchmarking Experiments with Kubernetes + This Python tools helps **managing benchmark experiments of Database Management Systems (DBMS) in a Kubernetes-based High-Performance-Computing (HPC) cluster environment**. It enables users to configure hardware / software setups for easily repeating tests over varying configurations. From 042fc204b9182c51c76c9859b143c733c02326e2 Mon Sep 17 00:00:00 2001 From: perdelt Date: Tue, 20 Feb 2024 20:25:56 +0100 Subject: [PATCH 082/121] TPC-H: MariaDB --- .../tpch/MariaDB/initconstraints-tpch.sql | 35 +++ experiments/tpch/MariaDB/initschema-tpch.sql | 33 --- images/tpch/loader_mariadb/Dockerfile | 33 +++ images/tpch/loader_mariadb/README.md | 16 ++ images/tpch/loader_mariadb/loader.sh | 210 ++++++++++++++++++ k8s/deploymenttemplate-MariaDB.yml | 111 +++++++++ k8s/jobtemplate-loading-tpch-MariaDB.yml | 90 ++++++++ tpch.py | 26 +++ 8 files changed, 521 insertions(+), 33 deletions(-) create mode 100644 images/tpch/loader_mariadb/Dockerfile create mode 100644 images/tpch/loader_mariadb/README.md create mode 100644 images/tpch/loader_mariadb/loader.sh create mode 100644 k8s/deploymenttemplate-MariaDB.yml create mode 100644 k8s/jobtemplate-loading-tpch-MariaDB.yml diff --git a/experiments/tpch/MariaDB/initconstraints-tpch.sql b/experiments/tpch/MariaDB/initconstraints-tpch.sql index c296d3405..1e284829a 100644 --- a/experiments/tpch/MariaDB/initconstraints-tpch.sql +++ b/experiments/tpch/MariaDB/initconstraints-tpch.sql @@ -1,6 +1,41 @@ -- sccsid: @(#)dss.ri 2.1.8.1 -- tpcd benchmark version 8.0 + +-- for table region +alter table tpch.region +add primary key (r_regionkey); + +-- for table nation +alter table tpch.nation +add primary key (n_nationkey); + +-- for table part +alter table tpch.part +add primary key (p_partkey); + +-- for table supplier +alter table tpch.supplier +add primary key (s_suppkey); + +-- for table partsupp +alter table tpch.partsupp +add primary key (ps_partkey,ps_suppkey); + +-- for table customer +alter table tpch.customer +add primary key (c_custkey); + +-- for table lineitem +alter table tpch.lineitem +add primary key (l_orderkey,l_linenumber); + +-- for table orders +alter table tpch.orders +add primary key (o_orderkey); + + + -- for table nation alter table tpch.nation add foreign key (n_regionkey) references tpch.region(r_regionkey); diff --git a/experiments/tpch/MariaDB/initschema-tpch.sql b/experiments/tpch/MariaDB/initschema-tpch.sql index 287b62e40..c1ea927a1 100644 --- a/experiments/tpch/MariaDB/initschema-tpch.sql +++ b/experiments/tpch/MariaDB/initschema-tpch.sql @@ -69,36 +69,3 @@ create table tpch.lineitem ( l_orderkey integer not null, l_shipinstruct char(25) not null, l_shipmode char(10) not null, l_comment varchar(44) not null); - --- for table region -alter table tpch.region -add primary key (r_regionkey); - --- for table nation -alter table tpch.nation -add primary key (n_nationkey); - --- for table part -alter table tpch.part -add primary key (p_partkey); - --- for table supplier -alter table tpch.supplier -add primary key (s_suppkey); - --- for table partsupp -alter table tpch.partsupp -add primary key (ps_partkey,ps_suppkey); - --- for table customer -alter table tpch.customer -add primary key (c_custkey); - --- for table lineitem -alter table tpch.lineitem -add primary key (l_orderkey,l_linenumber); - --- for table orders -alter table tpch.orders -add primary key (o_orderkey); - diff --git a/images/tpch/loader_mariadb/Dockerfile b/images/tpch/loader_mariadb/Dockerfile new file mode 100644 index 000000000..8a8d6bc4a --- /dev/null +++ b/images/tpch/loader_mariadb/Dockerfile @@ -0,0 +1,33 @@ +FROM debian:stable-20221004-slim + +RUN apt-get -y update && apt-get clean all + +RUN apt-get install -y build-essential +RUN apt-get install -y wget +RUN wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && cp src/redis-cli /usr/local/bin/ && chmod 755 /usr/local/bin/redis-cli + +RUN apt-get update && apt install -y mariadb-client + +ENV NUM_PODS=4 +ENV CHILD=1 +ENV BEXHOMA_HOST="www.example.com" +ENV BEXHOMA_PORT 50000 +ENV BEXHOMA_CONNECTION="monetdb" +ENV BEXHOMA_EXPERIMENT="12345" +ENV DATABASE tpch +ENV STORE_RAW_DATA=0 +ENV BEXHOMA_SYNCH_LOAD 0 +ENV MYSQL_LOADING_FROM "LOCAL" + +WORKDIR /tmp + +RUN mkdir -p /tmp/tpch + +#COPY ./*.dat /tmp/ + +COPY ./loader.sh /tmp/loader.sh +RUN ["chmod", "+x", "/tmp/loader.sh"] + + +CMD ["/bin/bash", "-c", "/tmp/loader.sh"] +#CMD ["/bin/bash", "-c", "while true; do sleep 2; done"] diff --git a/images/tpch/loader_mariadb/README.md b/images/tpch/loader_mariadb/README.md new file mode 100644 index 000000000..599e3697e --- /dev/null +++ b/images/tpch/loader_mariadb/README.md @@ -0,0 +1,16 @@ +# Loader for TPC-H data into MariaDB + +The following parameter (ENV) have been added: + +* `NUM_PODS`: +* `CHILD`: +* `BEXHOMA_HOST`: +* `BEXHOMA_PORT`: +* `BEXHOMA_CONNECTION`: +* `BEXHOMA_EXPERIMENT`: +* `DATABASE`: +* `STORE_RAW_DATA`: +* `BEXHOMA_SYNCH_LOAD`: +* `BEXHOMA_USER`: + +This folder contains the Dockerfile for a loader, that loads data into MariaDB via `mysql LOAD DATA`. diff --git a/images/tpch/loader_mariadb/loader.sh b/images/tpch/loader_mariadb/loader.sh new file mode 100644 index 000000000..d30c0297e --- /dev/null +++ b/images/tpch/loader_mariadb/loader.sh @@ -0,0 +1,210 @@ +#!/bin/bash + +######################## Start timing ######################## +DATEANDTIME=$(date '+%d.%m.%Y %H:%M:%S'); +echo "NOW: $DATEANDTIME" +SECONDS_START_SCRIPT=$SECONDS + +######################## Show general parameters ######################## +echo "BEXHOMA_CONNECTION:$BEXHOMA_CONNECTION" +echo "BEXHOMA_EXPERIMENT_RUN:$BEXHOMA_EXPERIMENT_RUN" +echo "BEXHOMA_CONFIGURATION:$BEXHOMA_CONFIGURATION" +echo "BEXHOMA_CLIENT:$BEXHOMA_CLIENT" + +######################## Show more parameters ######################## +CHILD=$(cat /tmp/tpch/CHILD ) +echo "CHILD $CHILD" +echo "NUM_PODS $NUM_PODS" +echo "SF $SF" + +######################## Destination of raw data ######################## +if test $STORE_RAW_DATA -gt 0 +then + # store in (distributed) file system + if test $NUM_PODS -gt 1 + then + destination_raw=/data/tpch/SF$SF/$NUM_PODS/$CHILD + else + destination_raw=/data/tpch/SF$SF + fi +else + # only store locally + destination_raw=/tmp/tpch/SF$SF/$NUM_PODS/$CHILD +fi +echo "destination_raw $destination_raw" +cd $destination_raw + +######################## Show generated files ######################## +echo "Found these files:" +ls $destination_raw/*tbl* -lh + +######################## Wait until all pods of job are ready ######################## +if test $BEXHOMA_SYNCH_LOAD -gt 0 +then + echo "Querying counter bexhoma-loader-podcount-$BEXHOMA_CONNECTION-$BEXHOMA_EXPERIMENT" + # add this pod to counter + redis-cli -h 'bexhoma-messagequeue' incr "bexhoma-loader-podcount-$BEXHOMA_CONNECTION-$BEXHOMA_EXPERIMENT" + # wait for number of pods to be as expected + while : ; do + PODS_RUNNING="$(redis-cli -h 'bexhoma-messagequeue' get bexhoma-loader-podcount-$BEXHOMA_CONNECTION-$BEXHOMA_EXPERIMENT)" + echo "Found $PODS_RUNNING / $NUM_PODS running pods" + if test "$PODS_RUNNING" == $NUM_PODS + then + echo "OK" + break + elif test "$PODS_RUNNING" -gt $NUM_PODS + then + echo "Too many pods! Restart occured?" + exit 0 + else + echo "We have to wait" + sleep 1 + fi + done +fi + +######################## Start measurement of time ######################## +bexhoma_start_epoch=$(date -u +%s) +SECONDS_START=$SECONDS +echo "Start $SECONDS_START seconds" + +######################## Execute loading ################### +# shuffled +#for i in `ls *tbl* | shuf`; do +# ordered +for i in *tbl*; do + basename=${i%.tbl*} + wordcount=($(wc -l $i)) + lines=${wordcount[0]} + # skip table if limit to other table is set + if [ -z "${TPCH_TABLE}" ] + then + echo "table limit not set" + elif [ "${TPCH_TABLE}" == "$basename" ] + then + echo "limit import to this table $TPCH_TABLE" + else + echo "skipping $basename, import is limited to other table ($TPCH_TABLE)" + continue + fi + if [[ $basename == "nation" ]] + then + if test $CHILD -gt 1 + then + continue + fi + fi + if [[ $basename == "region" ]] + then + if test $CHILD -gt 1 + then + continue + fi + fi + if [[ $basename == "customer" ]] + then + COMMAND="LOAD DATA $MYSQL_LOADING_FROM INFILE '$i' INTO TABLE tpch.$basename FIELDS TERMINATED BY '|' + (@c_custkey, @c_name, @c_address, @c_nationkey, @c_phone, @c_acctbal, @c_mktsegment, @c_comment) SET c_custkey=NULLIF(@c_custkey,''), c_name=NULLIF(@c_name,''), c_address=NULLIF(@c_address,''), c_nationkey=NULLIF(@c_nationkey,''), c_phone=NULLIF(@c_phone,''), c_acctbal=NULLIF(@c_acctbal,''), c_mktsegment=NULLIF(@c_mktsegment,''), c_comment=NULLIF(@c_comment,'')" + fi + if [[ $basename == "lineitem" ]] + then + COMMAND="LOAD DATA $MYSQL_LOADING_FROM INFILE '$i' INTO TABLE tpch.$basename FIELDS TERMINATED BY '|' + (@l_orderkey, @l_partkey, @l_suppkey, @l_linenumber, @l_quantity, @l_extendedprice, @l_discount, @l_tax, @l_returnflag, @l_linestatus, @l_shipdate, @l_commitdate, @l_receiptdate, @l_shipinstruct, @l_shipmode, @l_comment) SET l_orderkey=NULLIF(@l_orderkey,''), l_partkey=NULLIF(@l_partkey,''), l_suppkey=NULLIF(@l_suppkey,''), l_linenumber=NULLIF(@l_linenumber,''), l_quantity=NULLIF(@l_quantity,''), l_extendedprice=NULLIF(@l_extendedprice,''), l_discount=NULLIF(@l_discount,''), l_tax=NULLIF(@l_tax,''), l_returnflag=NULLIF(@l_returnflag,''), l_linestatus=NULLIF(@l_linestatus,''), l_shipdate=NULLIF(@l_shipdate,''), l_commitdate=NULLIF(@l_commitdate,''), l_receiptdate=NULLIF(@l_receiptdate,''), l_shipinstruct=NULLIF(@l_shipinstruct,''), l_shipmode=NULLIF(@l_shipmode,''), l_comment=NULLIF(@l_comment,'')" + fi + if [[ $basename == "nation" ]] + then + COMMAND="LOAD DATA $MYSQL_LOADING_FROM INFILE '$i' INTO TABLE tpch.$basename FIELDS TERMINATED BY '|' + (@n_nationkey, @n_name, @n_regionkey, @n_comment) SET n_nationkey=NULLIF(@n_nationkey,''), n_name=NULLIF(@n_name,''), n_regionkey=NULLIF(@n_regionkey,''), n_comment=NULLIF(@n_comment,'')" + fi + if [[ $basename == "orders" ]] + then + COMMAND="LOAD DATA $MYSQL_LOADING_FROM INFILE '$i' INTO TABLE tpch.$basename FIELDS TERMINATED BY '|' + (@o_orderkey, @o_custkey, @o_orderstatus, @o_totalprice, @o_orderdate, @o_orderpriority, @o_clerk, @o_shippriority, @o_comment) SET o_orderkey=NULLIF(@o_orderkey,''), o_custkey=NULLIF(@o_custkey,''), o_orderstatus=NULLIF(@o_orderstatus,''), o_totalprice=NULLIF(@o_totalprice,''), o_orderdate=NULLIF(@o_orderdate,''), o_orderpriority=NULLIF(@o_orderpriority,''), o_clerk=NULLIF(@o_clerk,''), o_shippriority=NULLIF(@o_shippriority,''), o_comment=NULLIF(@o_comment,'')" + fi + if [[ $basename == "part" ]] + then + COMMAND="LOAD DATA $MYSQL_LOADING_FROM INFILE '$i' INTO TABLE tpch.$basename FIELDS TERMINATED BY '|' + (@p_partkey, @p_name, @p_mfgr, @p_brand, @p_type, @p_size, @p_container, @p_retailprice, @p_comment) SET p_partkey=NULLIF(@p_partkey,''), p_name=NULLIF(@p_name,''), p_mfgr=NULLIF(@p_mfgr,''), p_brand=NULLIF(@p_brand,''), p_type=NULLIF(@p_type,''), p_size=NULLIF(@p_size,''), p_container=NULLIF(@p_container,''), p_retailprice=NULLIF(@p_retailprice,''), p_comment=NULLIF(@p_comment,'')" + fi + if [[ $basename == "partsupp" ]] + then + COMMAND="LOAD DATA $MYSQL_LOADING_FROM INFILE '$i' INTO TABLE tpch.$basename FIELDS TERMINATED BY '|' + (@ps_partkey, @ps_suppkey, @ps_availqty, @ps_supplycost, @ps_comment) SET ps_partkey=NULLIF(@ps_partkey,''), ps_suppkey=NULLIF(@ps_suppkey,''), ps_availqty=NULLIF(@ps_availqty,''), ps_supplycost=NULLIF(@ps_supplycost,''), ps_comment=NULLIF(@ps_comment,'')" + fi + if [[ $basename == "region" ]] + then + COMMAND="LOAD DATA $MYSQL_LOADING_FROM INFILE '$i' INTO TABLE tpch.$basename FIELDS TERMINATED BY '|' + (@r_regionkey, @r_name, @r_comment) SET r_regionkey=NULLIF(@r_regionkey,''), r_name=NULLIF(@r_name,''), r_comment=NULLIF(@r_comment,'')" + fi + if [[ $basename == "supplier" ]] + then + COMMAND="LOAD DATA $MYSQL_LOADING_FROM INFILE '$i' INTO TABLE tpch.$basename FIELDS TERMINATED BY '|' + (@s_suppkey, @s_name, @s_address, @s_nationkey, @s_phone, @s_acctbal, @s_comment) SET s_suppkey=NULLIF(@s_suppkey,''), s_name=NULLIF(@s_name,''), s_address=NULLIF(@s_address,''), s_nationkey=NULLIF(@s_nationkey,''), s_phone=NULLIF(@s_phone,''), s_acctbal=NULLIF(@s_acctbal,''), s_comment=NULLIF(@s_comment,'')" + fi + #COMMAND="COPY $lines RECORDS INTO $basename FROM STDIN USING DELIMITERS '|','\\n','\"' NULL AS ''" + #COMMAND="COPY $lines RECORDS INTO $basename FROM STDIN USING DELIMITERS '|' NULL AS ''" + echo "============================" + echo "$COMMAND" + #OUTPUT="$(mclient --host $BEXHOMA_HOST --database $DATABASE --port $BEXHOMA_PORT -s \"COPY $lines RECORDS INTO $basename FROM STDIN USING DELIMITERS '|' NULL AS ''\" - < $i)" + + #FAILED=0 # everything ok + #FAILED=1 # known error + #FAILED=2 # unknown error + FAILED=1 + while [ $FAILED == 1 ] + do + FAILED=2 + SECONDS_START=$SECONDS + echo "==========" + time mysql --host $BEXHOMA_HOST --database $DATABASE --port $BEXHOMA_PORT -e "$COMMAND" &> /tmp/OUTPUT.txt + echo "Start $SECONDS_START seconds" + SECONDS_END=$SECONDS + echo "End $SECONDS_END seconds" + DURATION=$((SECONDS_END-SECONDS_START)) + echo "Duration $DURATION seconds" + #mclient --host $BEXHOMA_HOST --database $DATABASE --port $BEXHOMA_PORT -E UTF-8 -L import.log -s "$COMMAND" - < $i &>OUTPUT.txt + #mclient --host $BEXHOMA_HOST --database $DATABASE --port $BEXHOMA_PORT -s "COPY $lines RECORDS INTO $basename FROM STDIN USING DELIMITERS '|','\\n','\"' NULL AS ''" - < $i &>OUTPUT.txt + #cat import.log + OUTPUT=$(cat /tmp/OUTPUT.txt ) + echo "$OUTPUT" + FAILED=0 + # everything worked well ("row" and "rows" string checked) + if [[ $OUTPUT == *"$lines affected row"* ]]; then echo "Import ok"; FAILED=0; fi + # rollback, we have to do it again (?) + if [[ $OUTPUT == *"ROLLBACK"* ]]; then echo "ROLLBACK occured"; FAILED=1; fi + # no thread left, we have to do it again (?) + #if [[ $OUTPUT == *"failed to start worker thread"* ]]; then echo "No worker thread"; FAILED=1; fi + #if [[ $OUTPUT == *"failed to start producer thread"* ]]; then echo "No producer thread"; FAILED=1; fi + #if [[ $OUTPUT == *"Challenge string is not valid, it is empty"* ]]; then echo "No Login possible"; FAILED=1; fi + # something else - what? + if [[ $OUTPUT == 2 ]]; then echo "Something unexpected happend"; fi + echo "FAILED = $FAILED at $basename" + if [[ $FAILED != 0 ]]; then echo "Wait 1s before retrying"; sleep 1; fi + done + #echo "COPY $lines RECORDS INTO $basename FROM '/tmp/$i' ON CLIENT DELIMITERS '|' NULL AS '';" >> load.sql +done + +######################## End measurement of time ######################## +bexhoma_end_epoch=$(date -u +%s) +SECONDS_END=$SECONDS +echo "End $SECONDS_END seconds" + +DURATION=$((SECONDS_END-SECONDS_START)) +echo "Duration $DURATION seconds" + +######################## Show timing information ################### +echo "Loading done" + +DATEANDTIME=$(date '+%d.%m.%Y %H:%M:%S'); +echo "NOW: $DATEANDTIME" + +SECONDS_END_SCRIPT=$SECONDS +DURATION_SCRIPT=$((SECONDS_END_SCRIPT-SECONDS_START_SCRIPT)) +echo "Duration $DURATION_SCRIPT seconds (script total)" +echo "BEXHOMA_DURATION:$DURATION_SCRIPT" +echo "BEXHOMA_START:$bexhoma_start_epoch" +echo "BEXHOMA_END:$bexhoma_end_epoch" + +######################## Exit successfully ################### +# while true; do sleep 2; done +exit 0 diff --git a/k8s/deploymenttemplate-MariaDB.yml b/k8s/deploymenttemplate-MariaDB.yml new file mode 100644 index 000000000..21490aaea --- /dev/null +++ b/k8s/deploymenttemplate-MariaDB.yml @@ -0,0 +1,111 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: {app: bexhoma, component: sut, configuration: default, experiment: default} + name: bexhoma-storage +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 20Gi + storageClassName: shared +--- +apiVersion: v1 +kind: Service +metadata: + labels: {app: bexhoma, component: sut, configuration: default, experiment: default} + name: bexhoma-service +spec: + ports: + - {port: 9091, protocol: TCP, name: port-dbms, targetPort: 3306} + - {port: 9300, protocol: TCP, name: port-monitoring, targetPort: 9300} + selector: {app: bexhoma, component: sut, configuration: default, experiment: default} +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: {app: bexhoma, component: sut, configuration: default, experiment: default} + name: bexhoma-deployment-mariadb +spec: + replicas: 1 + selector: + matchLabels: {app: bexhoma, component: sut, configuration: default, experiment: default} + template: + metadata: + labels: {app: bexhoma, component: sut, configuration: default, experiment: default} + spec: + automountServiceAccountToken: false + imagePullSecrets: + - {name: dockerhub} + nodeSelector: + tolerations: + - key: "nvidia.com/gpu" + effect: "NoSchedule" + containers: + - name: dbms + image: mariadb:11.2.3 + #image: mariadb:10.5.8 + #args: ["--innodb_log_buffer_size", "17179869184", "--innodb-write-io-threads", "16", "--innodb-log-file-size", "4294967296", "--LimitMEMLOCK", "16M"] + args: ["--innodb_log_buffer_size", "17179869184", "--innodb-write-io-threads", "16", "--innodb-log-file-size", "4294967296"] + env: + - {name: MYSQL_ALLOW_EMPTY_PASSWORD, value: 'yes'} + ports: + - {containerPort: 3306} + - {containerPort: 9000} + resources: + limits: {cpu: 16000m, memory: 128Gi} + requests: {cpu: 16000m, memory: 128Gi} + #, ephemeral-storage: "1536Gi"} + volumeMounts: + - {mountPath: /data, name: benchmark-data-volume} + - {mountPath: /var/lib/mysql, name: benchmark-storage-volume} + - name: cadvisor + #image: k8s.gcr.io/cadvisor:v0.30.2 + image: gcr.io/cadvisor/cadvisor:v0.47.0 + args: ["--port", "9300", "--storage_duration", "20m0s", "--docker_only", "true", "--disable_metrics", "disk,network,tcp,advtcp,udp,sched,process,hugetlb", "--application_metrics_count_limit", "30", "--housekeeping_interval", "5s"] + ports: + - containerPort: 9300 + #hostPort: 9300 + name: http + protocol: TCP + resources: + requests: + cpu: 150m + memory: 200Mi + volumeMounts: + - name: rootfs + mountPath: /rootfs + readOnly: true + - name: var-run + mountPath: /var/run + readOnly: true + - name: sys + mountPath: /sys + readOnly: true + - name: docker + mountPath: /var/lib/docker + readOnly: true + - name: disk + mountPath: /dev/disk + readOnly: true + volumes: + - name: benchmark-data-volume + persistentVolumeClaim: {claimName: bexhoma-data} + - name: benchmark-storage-volume + persistentVolumeClaim: {claimName: bexhoma-storage} + - name: rootfs + hostPath: + path: / + - name: var-run + hostPath: + path: /var/run + - name: sys + hostPath: + path: /sys + - name: docker + hostPath: + path: /var/lib/docker + - name: disk + hostPath: + path: /dev/disk diff --git a/k8s/jobtemplate-loading-tpch-MariaDB.yml b/k8s/jobtemplate-loading-tpch-MariaDB.yml new file mode 100644 index 000000000..044a87ec6 --- /dev/null +++ b/k8s/jobtemplate-loading-tpch-MariaDB.yml @@ -0,0 +1,90 @@ +apiVersion: batch/v1 +kind: Job +metadata: + labels: {app: bexhoma, component: loading, configuration: default, experiment: default, client: default} + name: bexhoma-sensor +spec: + backoffLimit: 4 + completions: 4 + parallelism: 4 + template: + metadata: + labels: {app: bexhoma, component: loading, configuration: default, experiment: default, client: default} + spec: + automountServiceAccountToken: false + imagePullSecrets: + - name: dockerhub + nodeSelector: + tolerations: + - key: "nvidia.com/gpu" + effect: "NoSchedule" + initContainers: + - name: datagenerator + image: bexhoma/generator_tpch:latest + imagePullPolicy: Always + #imagePullPolicy: IfNotPresent + #securityContext: + # allowPrivilegeEscalation: false + # runAsNonRoot: true + # runAsUser: 1000 + # runAsGroup: 1000 + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + env: + - {name: BEXHOMA_HOST, value: 'bexhoma-sut-mariadb-aws-1234567890'} + - {name: BEXHOMA_PORT, value: '9091'} + - {name: BEXHOMA_CONNECTION, value: 'mariadb'} + - {name: BEXHOMA_EXPERIMENT, value: '1234567890'} + - {name: PARALLEL, value: '24'} + - {name: CHILD, value: '1'} + - {name: SF, value: '500'} + - {name: RNGSEED, value: '123'} + resources: + #limits: {cpu: 1000m, memory: 16Gi} + #requests: {cpu: 1000m, memory: 16Gi} + volumeMounts: + - name: datadir + mountPath: "/tmp/tpch/" + - {mountPath: /data, name: benchmark-data-volume} + containers: + - name: sensor + image: bexhoma/loader_tpch_mariadb:latest + imagePullPolicy: Always + #imagePullPolicy: IfNotPresent + #securityContext: + # allowPrivilegeEscalation: false + # runAsNonRoot: true + # runAsUser: 1000 + # runAsGroup: 1000 + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + env: + - {name: BEXHOMA_HOST, value: 'bexhoma-sut-mariadb-aws-1658676533'} + - {name: BEXHOMA_PORT, value: '9091'} + - {name: BEXHOMA_CONNECTION, value: 'mariadb'} + - {name: BEXHOMA_EXPERIMENT, value: '1234'} + - {name: PARALLEL, value: '24'} + - {name: CHILD, value: '1'} + - {name: SF, value: '500'} + - {name: RNGSEED, value: '123'} + resources: + #limits: {cpu: 1000m, memory: 16Gi} + #requests: {cpu: 1000m, memory: 16Gi} + securityContext: + privileged: true + volumeMounts: + - name: datadir + mountPath: "/tmp/tpch/" + - {mountPath: /data, name: benchmark-data-volume} + restartPolicy: Never + volumes: + - name: datadir + emptyDir: + medium: Memory + #sizeLimit: 10Gi + - name: benchmark-data-volume + persistentVolumeClaim: {claimName: bexhoma-data} diff --git a/tpch.py b/tpch.py index 2193e7f75..35d022725 100644 --- a/tpch.py +++ b/tpch.py @@ -334,6 +334,32 @@ DBMSBENCHMARKER_DEV = debugging, ) config.set_loading(parallel=split_portion, num_pods=loading_pods_total) + if (args.dbms == "MariaDB" or len(args.dbms) == 0): + # MonetDB + name_format = 'MariaDB-{cluster}-{pods}' + config = configurations.default(experiment=experiment, docker='MariaDB', configuration=name_format.format(cluster=cluster_name, pods=loading_pods_total, split=split_portion), dialect='MySQL', alias='DBMS A1') + config.set_storage( + storageConfiguration = 'monetdb' + ) + config.jobtemplate_loading = "jobtemplate-loading-tpch-MariaDB.yml" + config.set_loading_parameters( + SF = SF, + PODS_TOTAL = str(loading_pods_total), + PODS_PARALLEL = str(split_portion), + STORE_RAW_DATA = 1, + STORE_RAW_DATA_RECREATE = 0, + BEXHOMA_SYNCH_LOAD = 1, + BEXHOMA_SYNCH_GENERATE = 1, + TRANSFORM_RAW_DATA = 1, + TPCH_TABLE = limit_import_table, + ) + config.set_benchmarking_parameters( + SF = SF, + DBMSBENCHMARKER_RECREATE_PARAMETER = recreate_parameter, + DBMSBENCHMARKER_SHUFFLE_QUERIES = shuffle_queries, + DBMSBENCHMARKER_DEV = debugging, + ) + config.set_loading(parallel=split_portion, num_pods=loading_pods_total) if (args.dbms == "MySQL" or len(args.dbms) == 0): # MySQL for threads in list_loading_threads: From ca8b4af18bc0cc716ad6e84f52635017ad3eaef2 Mon Sep 17 00:00:00 2001 From: perdelt Date: Tue, 20 Feb 2024 20:37:22 +0100 Subject: [PATCH 083/121] Bexhoma: Improved output and docs --- images/README.md | 27 +++++++++++++++++++++------ k8s/README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 k8s/README.md diff --git a/images/README.md b/images/README.md index 0f206c5fa..233c0bc09 100644 --- a/images/README.md +++ b/images/README.md @@ -1,6 +1,6 @@ # Benchmark Experiment Host Manager -In this folder is a collection of useful Docker images. +In this folder is a collection of useful Docker images for the components of the benchmarking experiments. ## Orchestration of Benchmarking Experiments @@ -8,19 +8,34 @@ In this folder is a collection of useful Docker images.

-For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). It also uses the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker) as query executor [2] and evaluator [1]. +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. ## References -[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) > Erdelt P.K. (2021) > A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. > In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. > Lecture Notes in Computer Science, vol 12752. Springer, Cham. > https://doi.org/10.1007/978-3-030-84924-5_6 - -[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://www.researchgate.net/publication/353236865_Orchestrating_DBMS_Benchmarking_in_the_Cloud_with_Kubernetes) - +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 diff --git a/k8s/README.md b/k8s/README.md new file mode 100644 index 000000000..2a989bdaa --- /dev/null +++ b/k8s/README.md @@ -0,0 +1,41 @@ +# Benchmark Experiment Host Manager + +In this folder is a collection of useful manifests for the components of the benchmarking experiments. + +## Orchestration of Benchmarking Experiments + +

+ +

+ +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. + + +## References + +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: + +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 + +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 From bc1509567fd9c3b39af63212b35163f6f0b2c466 Mon Sep 17 00:00:00 2001 From: perdelt Date: Tue, 20 Feb 2024 20:38:52 +0100 Subject: [PATCH 084/121] Bexhoma: Improved output and docs --- experiments/README.md | 41 +++++++++++++ experiments/benchbase/README.md | 41 ++++++++++++- experiments/tpcc/README.md | 42 +++++++++++++ experiments/tpch/README.md | 105 ++++++++++---------------------- experiments/ycsb/README.md | 42 +++++++++++++ 5 files changed, 196 insertions(+), 75 deletions(-) create mode 100644 experiments/README.md create mode 100644 experiments/tpcc/README.md create mode 100644 experiments/ycsb/README.md diff --git a/experiments/README.md b/experiments/README.md new file mode 100644 index 000000000..78f393bfe --- /dev/null +++ b/experiments/README.md @@ -0,0 +1,41 @@ +# Benchmark Experiment Host Manager + +In this folder is a collection of workload and schema files for benchmarking experiments. + +## Orchestration of Benchmarking Experiments + +

+ +

+ +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. + + +## References + +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: + +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 + +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 diff --git a/experiments/benchbase/README.md b/experiments/benchbase/README.md index 29c321cfc..517878542 100644 --- a/experiments/benchbase/README.md +++ b/experiments/benchbase/README.md @@ -1,3 +1,42 @@ -# Benchbase +# Benchmark Experiment Host Manager - Benchbase Experiments +The folder contains subfolders with DDL scripts and a query file for multiple DBMSs. +These are used for Benchbase experiments. +## Orchestration of Benchmarking Experiments + +

+ +

+ +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. + + +## References + +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: + +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 + +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 diff --git a/experiments/tpcc/README.md b/experiments/tpcc/README.md new file mode 100644 index 000000000..695b9b239 --- /dev/null +++ b/experiments/tpcc/README.md @@ -0,0 +1,42 @@ +# Benchmark Experiment Host Manager - HammerDB Experiments + +The folder contains subfolders with DDL scripts and a query file for multiple DBMSs. +These are used for HammerDB's TPROC-C experiments. + +## Orchestration of Benchmarking Experiments + +

+ +

+ +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. + + +## References + +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: + +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 + +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 diff --git a/experiments/tpch/README.md b/experiments/tpch/README.md index 2c5bd0a40..ee2acf7de 100644 --- a/experiments/tpch/README.md +++ b/experiments/tpch/README.md @@ -1,85 +1,42 @@ -# Command Line Tool for TPC-H +# Benchmark Experiment Host Manager - TPC-H Experiments -The folder contains DDL scripts and a query file for some DBMS. +The folder contains subfolders with DDL scripts and a query file for multiple DBMSs. +These are used for TPC-H experiments. -The tool `tpch` helps perform some tasks related to TPC-H benchmark. -It installs MonetDB and PostgreSQL, loads the data, profiles loading or runs the reading queries. -It also starts an evaluation dashboard. +## Orchestration of Benchmarking Experiments -Recommended settings: `tpch run -sf 1 -t 30 -dt` +

+ +

-For more detail about options. +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. -## Tutorials -### Install Data +## References -### Start a DBMS +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: -### Start a DBMS and Load Data +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 -### Start a DBMS and Load Data and Connect +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 -## Options +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 -``` -usage: tpch.py [-h] [-db] [-c CONNECTION] [-cx CONTEXT] [-e EXPERIMENT] [-d] [-m] [-ms MAX_SUT] [-dt] - [-md MONITORING_DELAY] [-nr NUM_RUN] [-nc NUM_CONFIG] [-ne NUM_QUERY_EXECUTORS] [-sf SCALING_FACTOR] - [-t TIMEOUT] [-rr REQUEST_RAM] [-rc REQUEST_CPU] [-rct REQUEST_CPU_TYPE] [-rg REQUEST_GPU] - [-rgt REQUEST_GPU_TYPE] [-rst {None,,local-hdd,shared}] [-rss REQUEST_STORAGE_SIZE] - [-rnn REQUEST_NODE_NAME] - {profiling,run,start,load} - -Perform TPC-H inspired benchmarks in a Kubernetes cluster. This either profiles the imported data in several DBMS and -compares some statistics, or runs the TPC-H queries. Optionally monitoring is actived. User can choose to detach the -componenten of the benchmarking system, so that as much as possible is run inside a Kubernetes (K8s) cluster. User can -also choose some parameters like number of runs per query and configuration and request some resources. - -positional arguments: - {profiling,run,start,load} - profile the import of TPC-H data, or run the TPC-H queries, or start DBMS and load data, or - just start the DBMS - -optional arguments: - -h, --help show this help message and exit - -db, --debug dump debug informations - -c CONNECTION, --connection CONNECTION - name of DBMS - -cx CONTEXT, --context CONTEXT - context of Kubernetes (for a multi cluster environment), default is current context - -e EXPERIMENT, --experiment EXPERIMENT - sets experiment code for continuing started experiment - -d, --detached puts most of the experiment workflow inside the cluster - -m, --monitoring activates monitoring - -ms MAX_SUT, --max-sut MAX_SUT - maximum number of parallel DBMS configurations, default is no limit - -dt, --datatransfer activates datatransfer - -md MONITORING_DELAY, --monitoring-delay MONITORING_DELAY - time to wait [s] before execution of the runs of a query - -nr NUM_RUN, --num-run NUM_RUN - number of runs per query - -nc NUM_CONFIG, --num-config NUM_CONFIG - number of runs per configuration - -ne NUM_QUERY_EXECUTORS, --num-query-executors NUM_QUERY_EXECUTORS - comma separated list of number of parallel clients - -sf SCALING_FACTOR, --scaling-factor SCALING_FACTOR - scaling factor (SF) - -t TIMEOUT, --timeout TIMEOUT - timeout for a run of a query - -rr REQUEST_RAM, --request-ram REQUEST_RAM - request ram - -rc REQUEST_CPU, --request-cpu REQUEST_CPU - request cpus - -rct REQUEST_CPU_TYPE, --request-cpu-type REQUEST_CPU_TYPE - request node having node label cpu= - -rg REQUEST_GPU, --request-gpu REQUEST_GPU - request number of gpus - -rgt REQUEST_GPU_TYPE, --request-gpu-type REQUEST_GPU_TYPE - request node having node label gpu= - -rst {None,,local-hdd,shared}, --request-storage-type {None,,local-hdd,shared} - request persistent storage of certain type - -rss REQUEST_STORAGE_SIZE, --request-storage-size REQUEST_STORAGE_SIZE - request persistent storage of certain size - -rnn REQUEST_NODE_NAME, --request-node-name REQUEST_NODE_NAME - request a specific node -``` +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 diff --git a/experiments/ycsb/README.md b/experiments/ycsb/README.md new file mode 100644 index 000000000..d1b4270ca --- /dev/null +++ b/experiments/ycsb/README.md @@ -0,0 +1,42 @@ +# Benchmark Experiment Host Manager - YCSB Experiments + +The folder contains subfolders with DDL scripts and a query file for multiple DBMSs. +These are used for YCSB experiments. + +## Orchestration of Benchmarking Experiments + +

+ +

+ +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. + + +## References + +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: + +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 + +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 From beac0e12acfc1ad7066728770a7a284129ee2d31 Mon Sep 17 00:00:00 2001 From: perdelt Date: Tue, 20 Feb 2024 20:56:16 +0100 Subject: [PATCH 085/121] Bexhoma: Improved output and docs --- experiments/example/README.md | 42 +++++++++++++++++++++++++++++++++++ experiments/tpcds/README.md | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 experiments/example/README.md create mode 100644 experiments/tpcds/README.md diff --git a/experiments/example/README.md b/experiments/example/README.md new file mode 100644 index 000000000..e737d5417 --- /dev/null +++ b/experiments/example/README.md @@ -0,0 +1,42 @@ +# Benchmark Experiment Host Manager - Example for Experiments + +The folder contains a dummy query file. +It must be adjusted for experiments running a custom SQL workload against existing databases. + +## Orchestration of Benchmarking Experiments + +

+ +

+ +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. + + +## References + +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: + +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 + +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 diff --git a/experiments/tpcds/README.md b/experiments/tpcds/README.md new file mode 100644 index 000000000..9b95ee64b --- /dev/null +++ b/experiments/tpcds/README.md @@ -0,0 +1,42 @@ +# Benchmark Experiment Host Manager - TPC-DS Experiments + +The folder contains subfolders with DDL scripts and a query file for multiple DBMSs. +These are used for TPC-DS experiments. + +## Orchestration of Benchmarking Experiments + +

+ +

+ +For full power, use this tool as an orchestrator as in [2]. It also starts a monitoring container using [Prometheus](https://prometheus.io/) and a metrics collector container using [cAdvisor](https://github.com/google/cadvisor). For analytical use cases, the Python package [dbmsbenchmarker](https://github.com/Beuth-Erdelt/DBMS-Benchmarker), [3], is used as query executor and evaluator as in [1,2]. +For transactional use cases, HammerDB's TPC-C, Benchbase's TPC-C and YCSB are used as drivers for generating and loading data and for running the workload as in [4]. + + +## References + +If you use Bexhoma in work contributing to a scientific publication, we kindly ask that you cite our application note [2] or [1]: + +[1] [A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking](https://doi.org/10.1007/978-3-030-84924-5_6) +> Erdelt P.K. (2021) +> A Framework for Supporting Repetition and Evaluation in the Process of Cloud-Based DBMS Performance Benchmarking. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2020. +> Lecture Notes in Computer Science, vol 12752. Springer, Cham. +> https://doi.org/10.1007/978-3-030-84924-5_6 + +[2] [Orchestrating DBMS Benchmarking in the Cloud with Kubernetes](https://doi.org/10.1007/978-3-030-94437-7_6) +> Erdelt P.K. (2022) +> Orchestrating DBMS Benchmarking in the Cloud with Kubernetes. +> In: Nambiar R., Poess M. (eds) Performance Evaluation and Benchmarking. TPCTC 2021. +> Lecture Notes in Computer Science, vol 13169. Springer, Cham. +> https://doi.org/10.1007/978-3-030-94437-7_6 + +[3] [DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python](https://doi.org/10.21105/joss.04628) +> Erdelt P.K., Jestel J. (2022). +> DBMS-Benchmarker: Benchmark and Evaluate DBMS in Python. +> Journal of Open Source Software, 7(79), 4628 +> https://doi.org/10.21105/joss.04628 + +[4] [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) +> Erdelt P.K. (2023) +> http://dx.doi.org/10.13140/RG.2.2.29866.18880 From 327941a7cd2f4d37f3ed6f648692f14782c66560 Mon Sep 17 00:00:00 2001 From: perdelt Date: Wed, 21 Feb 2024 06:14:45 +0100 Subject: [PATCH 086/121] Bexhoma: Improved output and docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fe98f713e..a3ac5be9a 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ # Benchmark Experiment Host Manager (Bexhoma) -## Orchstrating Cloud-Native Benchmarking Experiments with Kubernetes +## Orchestrating Cloud-Native Benchmarking Experiments with Kubernetes This Python tools helps **managing benchmark experiments of Database Management Systems (DBMS) in a Kubernetes-based High-Performance-Computing (HPC) cluster environment**. It enables users to configure hardware / software setups for easily repeating tests over varying configurations. From 5e62f9ebfebb7403ac810a209e5ad68fa3a75004 Mon Sep 17 00:00:00 2001 From: perdelt Date: Wed, 21 Feb 2024 07:12:19 +0100 Subject: [PATCH 087/121] Example custom SQL workload --- docs/DBMS.md | 43 ++++++++++++++++++++++++++++-- docs/Example-custom.md | 33 ++++------------------- experiments/example/queries.config | 4 +-- k8s/deploymenttemplate-Dummy.yml | 1 - k8s/deploymenttemplate-MariaDB.yml | 7 +++-- ycsb.py | 2 +- 6 files changed, 52 insertions(+), 38 deletions(-) diff --git a/docs/DBMS.md b/docs/DBMS.md index d68878d99..2c0de0401 100644 --- a/docs/DBMS.md +++ b/docs/DBMS.md @@ -106,7 +106,18 @@ The parameters can be set via CLI (see for example `tpch.py`). https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s/deploymenttemplate-MariaDB.yml -**Configuration** +As of bexhoma version `v0.7.1` this contains +``` + args: [ + "--innodb_log_buffer_size", "17179869184", + "--innodb-write-io-threads", "16", + "--innodb-log-file-size", "4294967296" + ] +``` +as default settings. + +### Configuration + ``` 'MariaDB': { 'loadData': 'mysql < {scriptname}', @@ -138,7 +149,8 @@ Example for [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Ma https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/blob/master/k8s/deploymenttemplate-MonetDB.yml -**Configuration** +### Configuration + ``` 'MonetDB': { 'loadData': 'cd /home/monetdb;echo "user=monetdb\npassword=monetdb" > .monetdb;mclient demo < {scriptname}', @@ -319,3 +331,30 @@ Example for * [TPC-H](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/tpch/MySQL) * [YCSB](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/experiments/ycsb/MySQL) + +## Add a new DBMS + +Suppose you want to add a new DBMS called `newDBMS`. + +You will need to +* add a corresponding section to the dockers part in `cluster.config`. +* add a YAML template for the DBMS component called `k8s/deploymenttemplate-NewDBMS.yml` (just copy `k8s/deploymenttemplate-Dummy.yml`) +* add schema scripts for the DBMS in a subfolder of `experiments/` +* add a section to the Python management script, e.g., `example.py`. Look for +``` + # add configs + if args.dbms == "Dummy": + # Dummy DBMS + name_format = 'Dummy-{cluster}' + config = configurations.default(experiment=experiment, docker='Dummy', configuration=name_format.format(cluster=cluster_name), dialect='PostgreSQL', alias='DBMS A1') + config.loading_finished = True +``` +The parameter `docker='Dummy'` refers to the key in the dockers section in `cluster.config` and the name of the file in `k8s/`. +You may add several DBMS by this way to the same experiment for comparison. +Note that `example.py` contains a line +``` +parser.add_argument('-dbms', help='DBMS to run the experiment on', choices=['Dummy']) +``` +which filters command line arguments and restricts to adding only one DBMS (you may want to ignore `args.dbms` instead). + +If you need a JDBC driver different from the above, please raise an issue: https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/issues diff --git a/docs/Example-custom.md b/docs/Example-custom.md index bef69a9d4..e62be7d54 100644 --- a/docs/Example-custom.md +++ b/docs/Example-custom.md @@ -7,9 +7,11 @@ This example assumes you have ## Prerequisites +We need a dummy to mimick the existence of a DBMS managed by bexhoma and a query file in a certain format. + ### Dummy DBMS -Inside `docker` section infos how to connect to DBMS (keep key `Dummy` here, adjust all the rest) +Inside the `docker` section of the `cluster.config` we define infos how to connect to a DBMS (keep key `Dummy` here, adjust all the rest): ``` 'Dummy': { 'loadData': '', @@ -34,11 +36,12 @@ Inside `docker` section infos how to connect to DBMS (keep key `Dummy` here, adj ### Queries File Overwrite the file `queries.config` in `experiments/example` with a custom file. +For more details about the format see https://dbmsbenchmarker.readthedocs.io/en/latest/Options.html#query-file ## Run Experiment -Example: Run `python example.py run -dbms Dummy -ne 5` to run experiment with 5 parallel benchmarkers. +Example: Run `python example.py run -dbms Dummy -ne 5 -nr 100` to run experiment with 5 parallel benchmarkers and repeat each query 100 times. ## Background Information @@ -184,29 +187,3 @@ Dummy-BHT-1-1-1-18 time_start:1691160821 time_end:1691160823 ``` - -## Add new DBMS - -Suppose you want to add a new DBMS called `newDBMS`. - -You will need to -* add a corresponding section to the dockers part in `cluster.config`. -* add a YAML template for the DBMS component called `k8s/deploymenttemplate-NewDBMS.yml` (just copy `k8s/deploymenttemplate-Dummy.yml`) -* add a section to `example.py`. Look for -``` - # add configs - if args.dbms == "Dummy": - # Dummy DBMS - name_format = 'Dummy-{cluster}' - config = configurations.default(experiment=experiment, docker='Dummy', configuration=name_format.format(cluster=cluster_name), dialect='PostgreSQL', alias='DBMS A1') - config.loading_finished = True -``` -The parameter `docker='Dummy'` refers to the key in the dockers section in `cluster.config` and the name of the file in `k8s/`. -You may add several DBMS by this way to the same experiment for comparison. -Note that `example.py` contains a line -``` -parser.add_argument('-dbms', help='DBMS to run the experiment on', choices=['Dummy']) -``` -which filters command line arguments and restricts to adding only one DBMS (you may want to ignore `args.dbms` instead). - -If you need a JDBC driver different from the above, please raise an issue: https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/issues diff --git a/experiments/example/queries.config b/experiments/example/queries.config index b68f04125..2176ef0f2 100644 --- a/experiments/example/queries.config +++ b/experiments/example/queries.config @@ -9,8 +9,8 @@ 'queries': [ { - 'title': "Get constant", - 'query': "SELECT 1", + 'title': "Get constant depending on number of run", + 'query': "SELECT {numRun} AS result", 'active': True, 'numRun': 10, 'timer': diff --git a/k8s/deploymenttemplate-Dummy.yml b/k8s/deploymenttemplate-Dummy.yml index 596e22da4..1f2c4ec55 100644 --- a/k8s/deploymenttemplate-Dummy.yml +++ b/k8s/deploymenttemplate-Dummy.yml @@ -42,7 +42,6 @@ spec: requests: {cpu: 100m, memory: 100Mi} volumeMounts: - {mountPath: /data, name: benchmark-data-volume} - - {mountPath: /dev/shm, name: dshm} - name: cadvisor image: gcr.io/cadvisor/cadvisor:v0.47.0 args: ["--port", "9300", "--storage_duration", "20m0s", "--docker_only", "true", "--disable_metrics", "disk,network,tcp,advtcp,udp,sched,process,hugetlb", "--application_metrics_count_limit", "30", "--housekeeping_interval", "5s"] diff --git a/k8s/deploymenttemplate-MariaDB.yml b/k8s/deploymenttemplate-MariaDB.yml index 21490aaea..d52256193 100644 --- a/k8s/deploymenttemplate-MariaDB.yml +++ b/k8s/deploymenttemplate-MariaDB.yml @@ -40,8 +40,8 @@ spec: - {name: dockerhub} nodeSelector: tolerations: - - key: "nvidia.com/gpu" - effect: "NoSchedule" + #- key: "nvidia.com/gpu" + # effect: "NoSchedule" containers: - name: dbms image: mariadb:11.2.3 @@ -55,13 +55,12 @@ spec: - {containerPort: 9000} resources: limits: {cpu: 16000m, memory: 128Gi} - requests: {cpu: 16000m, memory: 128Gi} + requests: {cpu: 1000m, memory: 1Gi} #, ephemeral-storage: "1536Gi"} volumeMounts: - {mountPath: /data, name: benchmark-data-volume} - {mountPath: /var/lib/mysql, name: benchmark-storage-volume} - name: cadvisor - #image: k8s.gcr.io/cadvisor:v0.30.2 image: gcr.io/cadvisor/cadvisor:v0.47.0 args: ["--port", "9300", "--storage_duration", "20m0s", "--docker_only", "true", "--disable_metrics", "disk,network,tcp,advtcp,udp,sched,process,hugetlb", "--application_metrics_count_limit", "30", "--housekeeping_interval", "5s"] ports: diff --git a/ycsb.py b/ycsb.py index 38f3769fc..dc142f72a 100644 --- a/ycsb.py +++ b/ycsb.py @@ -28,7 +28,7 @@ parser = argparse.ArgumentParser(description=description) parser.add_argument('mode', help='import YCSB data or run YCSB queries', choices=['run', 'start', 'load', 'summary'], default='run') parser.add_argument('-aws', '--aws', help='fix components to node groups at AWS', action='store_true', default=False) - parser.add_argument('-dbms','--dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MySQL'], default=[]) + parser.add_argument('-dbms','--dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MySQL', 'MariaDB'], default=[]) parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') parser.add_argument('-cx', '--context', help='context of Kubernetes (for a multi cluster environment), default is current context', default=None) parser.add_argument('-e', '--experiment', help='sets experiment code for continuing started experiment', default=None) From 6115a164c57591fd62532d83c4cabd84bee46e98 Mon Sep 17 00:00:00 2001 From: perdelt Date: Wed, 21 Feb 2024 13:08:15 +0100 Subject: [PATCH 088/121] Bexhoma: List of DBMS per experiment --- tpch.py | 13 +++++++------ ycsb.py | 45 ++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/tpch.py b/tpch.py index 35d022725..113d357cb 100644 --- a/tpch.py +++ b/tpch.py @@ -37,7 +37,7 @@ parser = argparse.ArgumentParser(description=description) parser.add_argument('mode', help='profile the import or run the TPC-H queries', choices=['profiling', 'run', 'start', 'load', 'empty', 'summary']) parser.add_argument('-aws', '--aws', help='fix components to node groups at AWS', action='store_true', default=False) - parser.add_argument('-dbms','--dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MonetDB', 'MySQL'], default=[]) + parser.add_argument('-dbms','--dbms', help='DBMS', choices=['PostgreSQL', 'MonetDB', 'MySQL'], default=[], action='append') parser.add_argument('-lit', '--limit-import-table', help='limit import to one table, name of this table', default='') parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') parser.add_argument('-cx', '--context', help='context of Kubernetes (for a multi cluster environment), default is current context', default=None) @@ -282,7 +282,7 @@ continue # how many in parallel? split_portion = int(loading_pods_total/loading_pods_split) - if (args.dbms == "PostgreSQL" or len(args.dbms) == 0): + if ("PostgreSQL" in args.dbms or len(args.dbms) == 0): # PostgreSQL name_format = 'PostgreSQL-{cluster}-{pods}' config = configurations.default(experiment=experiment, docker='PostgreSQL', configuration=name_format.format(cluster=cluster_name, pods=loading_pods_total, split=split_portion), dialect='PostgreSQL', alias='DBMS A2') @@ -308,7 +308,7 @@ DBMSBENCHMARKER_DEV = debugging, ) config.set_loading(parallel=split_portion, num_pods=loading_pods_total) - if (args.dbms == "MonetDB" or len(args.dbms) == 0): + if ("MonetDB" in args.dbms or len(args.dbms) == 0): # MonetDB name_format = 'MonetDB-{cluster}-{pods}' config = configurations.default(experiment=experiment, docker='MonetDB', configuration=name_format.format(cluster=cluster_name, pods=loading_pods_total, split=split_portion), dialect='MonetDB', alias='DBMS A1') @@ -334,12 +334,12 @@ DBMSBENCHMARKER_DEV = debugging, ) config.set_loading(parallel=split_portion, num_pods=loading_pods_total) - if (args.dbms == "MariaDB" or len(args.dbms) == 0): + if ("MariaDB" in args.dbms or len(args.dbms) == 0): # MonetDB name_format = 'MariaDB-{cluster}-{pods}' config = configurations.default(experiment=experiment, docker='MariaDB', configuration=name_format.format(cluster=cluster_name, pods=loading_pods_total, split=split_portion), dialect='MySQL', alias='DBMS A1') config.set_storage( - storageConfiguration = 'monetdb' + storageConfiguration = 'mariadb' ) config.jobtemplate_loading = "jobtemplate-loading-tpch-MariaDB.yml" config.set_loading_parameters( @@ -352,6 +352,7 @@ BEXHOMA_SYNCH_GENERATE = 1, TRANSFORM_RAW_DATA = 1, TPCH_TABLE = limit_import_table, + MYSQL_LOADING_FROM = "LOCAL", ) config.set_benchmarking_parameters( SF = SF, @@ -360,7 +361,7 @@ DBMSBENCHMARKER_DEV = debugging, ) config.set_loading(parallel=split_portion, num_pods=loading_pods_total) - if (args.dbms == "MySQL" or len(args.dbms) == 0): + if ("MySQL" in args.dbms or len(args.dbms) == 0): # MySQL for threads in list_loading_threads: name_format = 'MySQL-{cluster}-{pods}-{threads}' diff --git a/ycsb.py b/ycsb.py index dc142f72a..47b1ecdaa 100644 --- a/ycsb.py +++ b/ycsb.py @@ -28,7 +28,7 @@ parser = argparse.ArgumentParser(description=description) parser.add_argument('mode', help='import YCSB data or run YCSB queries', choices=['run', 'start', 'load', 'summary'], default='run') parser.add_argument('-aws', '--aws', help='fix components to node groups at AWS', action='store_true', default=False) - parser.add_argument('-dbms','--dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MySQL', 'MariaDB'], default=[]) + parser.add_argument('-dbms','--dbms', help='DBMS to load the data', choices=['PostgreSQL', 'MySQL', 'MariaDB'], default=[], action='append') parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') parser.add_argument('-cx', '--context', help='context of Kubernetes (for a multi cluster environment), default is current context', default=None) parser.add_argument('-e', '--experiment', help='sets experiment code for continuing started experiment', default=None) @@ -276,11 +276,11 @@ if len(list_clients) > 0: # we want several benchmarking instances per installation benchmarking_pods = list_clients - if (args.dbms == "PostgreSQL" or len(args.dbms) == 0): + if ("PostgreSQL" in args.dbms or len(args.dbms) == 0): # PostgreSQL #name_format = 'PostgreSQL-{}-{}-{}-{}'.format(cluster_name, pods, worker, target) name_format = 'PostgreSQL-{threads}-{pods}-{target}' - config = configurations.ycsb(experiment=experiment, docker='PostgreSQL', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS D') + config = configurations.ycsb(experiment=experiment, docker='PostgreSQL', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS A') config.set_storage( storageConfiguration = 'postgresql' ) @@ -311,11 +311,11 @@ YCSB_BATCHSIZE = batchsize, ) config.add_benchmark_list(benchmarking_pods) - if (args.dbms == "MySQL" or len(args.dbms) == 0): + if ("MySQL" in args.dbms or len(args.dbms) == 0): # MySQL #name_format = 'PostgreSQL-{}-{}-{}-{}'.format(cluster_name, pods, worker, target) name_format = 'MySQL-{threads}-{pods}-{target}' - config = configurations.ycsb(experiment=experiment, docker='MySQL', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS D') + config = configurations.ycsb(experiment=experiment, docker='MySQL', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS B') config.set_storage( storageConfiguration = 'mysql' ) @@ -346,6 +346,41 @@ YCSB_BATCHSIZE = batchsize, ) config.add_benchmark_list(benchmarking_pods) + if ("MariaDB" in args.dbms or len(args.dbms) == 0): + # MariaDB + #name_format = 'PostgreSQL-{}-{}-{}-{}'.format(cluster_name, pods, worker, target) + name_format = 'MariaDB-{threads}-{pods}-{target}' + config = configurations.ycsb(experiment=experiment, docker='MariaDB', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS C') + config.set_storage( + storageConfiguration = 'mariadb' + ) + config.set_loading_parameters( + PARALLEL = str(pods), + SF = SF, + BEXHOMA_SYNCH_LOAD = 1, + YCSB_THREADCOUNT = threads_per_pod, + YCSB_TARGET = target_per_pod, + YCSB_STATUS = 1, + YCSB_WORKLOAD = args.workload, + YCSB_ROWS = ycsb_rows, + YCSB_OPERATIONS = ycsb_operations_per_pod, + YCSB_BATCHSIZE = batchsize, + ) + config.set_loading(parallel=pods, num_pods=pods) + #config.set_loading(parallel=num_loading, num_pods=num_loading_pods) + config.set_benchmarking_parameters( + #PARALLEL = str(pods), + SF = SF, + BEXHOMA_SYNCH_LOAD = 1, + YCSB_THREADCOUNT = threads_per_pod, + YCSB_TARGET = target_per_pod, + YCSB_STATUS = 1, + YCSB_WORKLOAD = args.workload, + YCSB_ROWS = ycsb_rows, + YCSB_OPERATIONS = ycsb_operations_per_pod, + YCSB_BATCHSIZE = batchsize, + ) + config.add_benchmark_list(benchmarking_pods) # wait for necessary nodegroups to have planned size if aws: #cluster.wait_for_nodegroups(node_sizes) From 28e0a74732bb0da050d128e59b21b8f385add96c Mon Sep 17 00:00:00 2001 From: perdelt Date: Wed, 21 Feb 2024 14:39:36 +0100 Subject: [PATCH 089/121] YCSB: Implement YugaByteDB again --- k8s-cluster.config | 18 +++++++++++++ k8s/deploymenttemplate-YugabyteDB.yml | 10 +------ ycsb.py | 38 ++++++++++++++++++++++----- 3 files changed, 50 insertions(+), 16 deletions(-) diff --git a/k8s-cluster.config b/k8s-cluster.config index 8ce19a1a4..e7bb13219 100644 --- a/k8s-cluster.config +++ b/k8s-cluster.config @@ -363,5 +363,23 @@ 'datadir': '/var/monetdb5/', 'priceperhourdollar': 0.0, }, + 'YugabyteDB': { + 'loadData': 'psql -U yugabyte --host yb-tserver-service.perdelt.svc.cluster.local --port 5433 < {scriptname}', + #'loadData': 'ysqlsh --username=yugabyte --host {service_name} --port 5433 < {scriptname}', + 'template': { + 'version': 'v11.4', + 'alias': 'General-B', + 'docker_alias': 'GP-B', + 'JDBC': { + 'driver': "com.yugabyte.Driver", + 'auth': ["yugabyte", ""], + 'url': 'jdbc:yugabytedb://yb-tserver-service.perdelt.svc.cluster.local:5433/yugabyte?load-balance=true',#/{dbname}', + 'jar': 'jdbc-yugabytedb-42.3.5-yb-2.jar' + } + }, + 'logfile': '/usr/local/data/logfile', + 'datadir': '/var/lib/postgresql/data/', + 'priceperhourdollar': 0.0, + }, }, } diff --git a/k8s/deploymenttemplate-YugabyteDB.yml b/k8s/deploymenttemplate-YugabyteDB.yml index 157482797..53aaf83b2 100644 --- a/k8s/deploymenttemplate-YugabyteDB.yml +++ b/k8s/deploymenttemplate-YugabyteDB.yml @@ -19,7 +19,6 @@ metadata: spec: ports: - {port: 9091, protocol: TCP, name: port-dbms, targetPort: 5432} - #- {port: 9091, protocol: TCP, name: port-dbms, targetPort: 5433} - {port: 9300, protocol: TCP, name: port-monitoring, targetPort: 9300} selector: {app: bexhoma, component: sut, configuration: default, experiment: default} --- @@ -43,6 +42,7 @@ spec: tolerations: - key: "nvidia.com/gpu" effect: "NoSchedule" + terminationGracePeriodSeconds: 120 containers: - name: dbms #image: yugabytedb/yugabyte:2.17.1.0-b439 @@ -54,14 +54,6 @@ spec: value: /var/lib/postgresql/data/pgdata ports: - {containerPort: 5432} - #- {containerPort: 5433} - #env: - #command: ["bin/yugabyted", "start"] - #ports: #-p7000:7000 -p9000:9000 -p5433:5433 -p9042:9042\ - #- {containerPort: 7000} - #- {containerPort: 9000} - #- {containerPort: 5433} - #- {containerPort: 9042} resources: limits: {cpu: 1000m, memory: 1Gi} requests: {cpu: 1000m, memory: 1Gi} diff --git a/ycsb.py b/ycsb.py index 47b1ecdaa..4b8c3b6aa 100644 --- a/ycsb.py +++ b/ycsb.py @@ -278,7 +278,6 @@ benchmarking_pods = list_clients if ("PostgreSQL" in args.dbms or len(args.dbms) == 0): # PostgreSQL - #name_format = 'PostgreSQL-{}-{}-{}-{}'.format(cluster_name, pods, worker, target) name_format = 'PostgreSQL-{threads}-{pods}-{target}' config = configurations.ycsb(experiment=experiment, docker='PostgreSQL', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS A') config.set_storage( @@ -297,7 +296,6 @@ YCSB_BATCHSIZE = batchsize, ) config.set_loading(parallel=pods, num_pods=pods) - #config.set_loading(parallel=num_loading, num_pods=num_loading_pods) config.set_benchmarking_parameters( #PARALLEL = str(pods), SF = SF, @@ -313,7 +311,6 @@ config.add_benchmark_list(benchmarking_pods) if ("MySQL" in args.dbms or len(args.dbms) == 0): # MySQL - #name_format = 'PostgreSQL-{}-{}-{}-{}'.format(cluster_name, pods, worker, target) name_format = 'MySQL-{threads}-{pods}-{target}' config = configurations.ycsb(experiment=experiment, docker='MySQL', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS B') config.set_storage( @@ -332,9 +329,7 @@ YCSB_BATCHSIZE = batchsize, ) config.set_loading(parallel=pods, num_pods=pods) - #config.set_loading(parallel=num_loading, num_pods=num_loading_pods) config.set_benchmarking_parameters( - #PARALLEL = str(pods), SF = SF, BEXHOMA_SYNCH_LOAD = 1, YCSB_THREADCOUNT = threads_per_pod, @@ -348,7 +343,6 @@ config.add_benchmark_list(benchmarking_pods) if ("MariaDB" in args.dbms or len(args.dbms) == 0): # MariaDB - #name_format = 'PostgreSQL-{}-{}-{}-{}'.format(cluster_name, pods, worker, target) name_format = 'MariaDB-{threads}-{pods}-{target}' config = configurations.ycsb(experiment=experiment, docker='MariaDB', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS C') config.set_storage( @@ -369,7 +363,6 @@ config.set_loading(parallel=pods, num_pods=pods) #config.set_loading(parallel=num_loading, num_pods=num_loading_pods) config.set_benchmarking_parameters( - #PARALLEL = str(pods), SF = SF, BEXHOMA_SYNCH_LOAD = 1, YCSB_THREADCOUNT = threads_per_pod, @@ -381,6 +374,37 @@ YCSB_BATCHSIZE = batchsize, ) config.add_benchmark_list(benchmarking_pods) + if ("YugabyteDB" in args.dbms or len(args.dbms) == 0): + # YugabyteDB + name_format = 'YugabyteDB-{threads}-{pods}-{target}' + config = configurations.ycsb(experiment=experiment, docker='YugabyteDB', configuration=name_format.format(threads=threads, pods=pods, target=target), alias='DBMS D') + config.servicename_sut = "yb-tserver-service" # fix service name of SUT, because it is not managed by bexhoma + config.set_loading_parameters( + PARALLEL = str(pods), + SF = SF, + YCSB_THREADCOUNT = threads_per_pod, + YCSB_TARGET = target_per_pod, + YCSB_STATUS = 1, + BEXHOMA_SYNCH_LOAD = 1, + YCSB_WORKLOAD = args.workload, + ROWS = ycsb_rows, + OPERATIONS = ycsb_operations_per_pod, + YCSB_BATCHSIZE = batchsize, + ) + config.set_loading(parallel=pods, num_pods=pods) + config.set_benchmarking_parameters( + SF = SF, + YCSB_THREADCOUNT = threads_per_pod, + YCSB_TARGET = target_per_pod, + YCSB_STATUS = 1, + BEXHOMA_SYNCH_LOAD = 1, + YCSB_WORKLOAD = args.workload, + ROWS = ycsb_rows, + OPERATIONS = ycsb_operations_per_pod, + YCSB_BATCHSIZE = batchsize, + ) + config.add_benchmark_list(benchmarking_pods) + cluster.max_sut = 1 # can only run 1 in same cluster because of fixed service # wait for necessary nodegroups to have planned size if aws: #cluster.wait_for_nodegroups(node_sizes) From 91f1fc7914b21530aafd9c7b922320ad447fcedf Mon Sep 17 00:00:00 2001 From: perdelt Date: Wed, 21 Feb 2024 15:26:31 +0100 Subject: [PATCH 090/121] Bexhoma: Allow placeholder namespace in JDBC connection string and in script commands --- bexhoma/clusters.py | 2 +- bexhoma/configurations.py | 45 +++++++++++++++++++++++++++++++++------ k8s-cluster.config | 4 ++-- 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index 2c013489e..f5a4ffd29 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -969,7 +969,7 @@ def copyInits(self): scriptfolder = '/data/{experiment}/{docker}/'.format(experiment=self.experiments_configfolder, docker=self.d) i = 0 for script in self.initscript: - cmd['copy_init_scripts'] = 'cp {scriptname}'.format(scriptname=scriptfolder+script)+' /data/'+str(self.code)+'/'+self.connection+'_init_'+str(i)+'.log' + cmd['copy_init_scripts'] = 'cp {scriptname}'.format(scriptname=scriptfolder+script, namespace=self.namespace)+' /data/'+str(self.code)+'/'+self.connection+'_init_'+str(i)+'.log' stdin, stdout, stderr = self.execute_command_in_pod(cmd['copy_init_scripts'], container='dbms') i = i + 1 def pod_log(self, pod, container=''): diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 5afbfaf49..28a0ba41e 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -1881,7 +1881,14 @@ def get_connection_config(self, connection, alias='', dialect='', serverip='loca c['monitoring']['metrics'][metricname] = metricdata.copy() #c['monitoring']['metrics'][metricname]['query'] = c['monitoring']['metrics'][metricname]['query'].format(host=node, gpuid=gpuid, configuration=self.configuration.lower(), experiment=self.code) c['monitoring']['metrics'][metricname]['query'] = self.set_metric_of_config(metric=c['monitoring']['metrics'][metricname]['query'], host=node, gpuid=gpuid) - c['JDBC']['url'] = c['JDBC']['url'].format(serverip=serverip, dbname=self.experiment.volume, DBNAME=self.experiment.volume.upper(), timout_s=c['connectionmanagement']['timeout'], timeout_ms=c['connectionmanagement']['timeout']*1000) + c['JDBC']['url'] = c['JDBC']['url'].format( + serverip=serverip, + dbname=self.experiment.volume, + DBNAME=self.experiment.volume.upper(), + timout_s=c['connectionmanagement']['timeout'], + timeout_ms=c['connectionmanagement']['timeout']*1000, + namespace=self.experiment.cluster.namespace + ) #print(c) return c#.copy() def run_benchmarker_pod(self, @@ -2563,9 +2570,26 @@ def load_data(self, scripts, time_offset=0, time_start_int=0, script_type='loade else: volume = '' print("{:30s}: start asynch loading scripts of type {}".format(self.configuration, script_type)) - self.logger.debug("load_data_asynch(app="+self.appname+", component='sut', experiment="+self.code+", configuration="+self.configuration+", pod_sut="+self.pod_sut+", scriptfolder="+scriptfolder+", commands="+str(commands)+", loadData="+self.dockertemplate['loadData']+", path="+self.experiment.path+", volume="+volume+", context="+self.experiment.cluster.context+", service_name="+service_name+", time_offset="+str(time_offset)+", time_start_int="+str(time_start_int)+", script_type="+str(script_type)+")") + self.logger.debug("load_data_asynch(app="+self.appname+", component='sut', experiment="+self.code+", configuration="+self.configuration+", pod_sut="+self.pod_sut+", scriptfolder="+scriptfolder+", commands="+str(commands)+", loadData="+self.dockertemplate['loadData']+", path="+self.experiment.path+", volume="+volume+", context="+self.experiment.cluster.context+", service_name="+service_name+", time_offset="+str(time_offset)+", time_start_int="+str(time_start_int)+", script_type="+str(script_type)+", namespace="+self.experiment.cluster.namespace+")") #result = load_data_asynch(app=self.appname, component='sut', experiment=self.code, configuration=self.configuration, pod_sut=self.pod_sut, scriptfolder=scriptfolder, commands=commands, loadData=self.dockertemplate['loadData'], path=self.experiment.path) - thread_args = {'app':self.appname, 'component':'sut', 'experiment':self.code, 'configuration':self.configuration, 'pod_sut':self.pod_sut, 'scriptfolder':scriptfolder, 'commands':commands, 'loadData':self.dockertemplate['loadData'], 'path':self.experiment.path, 'volume':volume, 'context':self.experiment.cluster.context, 'service_name':service_name, 'time_offset':time_offset, 'script_type':script_type, 'time_start_int':time_start_int} + thread_args = { + 'app':self.appname, + 'component':'sut', + 'experiment':self.code, + 'configuration':self.configuration, + 'pod_sut':self.pod_sut, + 'scriptfolder':scriptfolder, + 'commands':commands, + 'loadData':self.dockertemplate['loadData'], + 'path':self.experiment.path, + 'volume':volume, + 'context':self.experiment.cluster.context, + 'service_name':service_name, + 'time_offset':time_offset, + 'script_type':script_type, + 'time_start_int':time_start_int, + 'namespace':self.experiment.cluster.namespace + } thread = threading.Thread(target=load_data_asynch, kwargs=thread_args) thread.start() return @@ -2649,7 +2673,14 @@ def create_manifest_job(self, app='', component='benchmarker', experiment='', co c['connectionmanagement']['timeout'] = self.connectionmanagement['timeout'] c['connectionmanagement']['singleConnection'] = self.connectionmanagement['singleConnection'] if 'singleConnection' in self.connectionmanagement else True env_default = dict() - env_default['BEXHOMA_URL'] = c['JDBC']['url'].format(serverip=servicename, dbname=self.experiment.volume, DBNAME=self.experiment.volume.upper(), timout_s=c['connectionmanagement']['timeout'], timeout_ms=c['connectionmanagement']['timeout']*1000) + env_default['BEXHOMA_URL'] = c['JDBC']['url'].format( + serverip=servicename, + dbname=self.experiment.volume, + DBNAME=self.experiment.volume.upper(), + timout_s=c['connectionmanagement']['timeout'], + timeout_ms=c['connectionmanagement']['timeout']*1000, + namespace=self.experiment.cluster.namespace + ) env_default['BEXHOMA_USER'] = c['JDBC']['auth'][0] env_default['BEXHOMA_PASSWORD'] = c['JDBC']['auth'][1] env_default['BEXHOMA_DRIVER'] = c['JDBC']['driver'] @@ -3307,7 +3338,7 @@ def get_worker_endpoints(self): #@fire_and_forget -def load_data_asynch(app, component, experiment, configuration, pod_sut, scriptfolder, commands, loadData, path, volume, context, service_name, time_offset=0, time_start_int=0, script_type='loaded'): +def load_data_asynch(app, component, experiment, configuration, pod_sut, scriptfolder, commands, loadData, path, volume, context, service_name, time_offset=0, time_start_int=0, script_type='loaded', namespace): logger = logging.getLogger('load_data_asynch') #with open('asynch.test.log','w') as file: # file.write('started') @@ -3376,7 +3407,7 @@ def kubectl(command, context): #time_scrip_start = int(datetime.timestamp(datetime.strptime(time_now,'%Y-%m-%d %H:%M:%S.%f'))) filename, file_extension = os.path.splitext(c) if file_extension.lower() == '.sql': - stdin, stdout, stderr = execute_command_in_pod_sut(loadData.format(scriptname=scriptfolder+c, service_name=service_name), pod_sut, context) + stdin, stdout, stderr = execute_command_in_pod_sut(loadData.format(scriptname=scriptfolder+c, service_name=service_name, namespace=namespace), pod_sut, context) filename_log = path+'/load-sut-{configuration}-{filename}{extension}.log'.format(configuration=configuration, filename=filename, extension=file_extension.lower()) #print(filename_log) if len(stdout) > 0: @@ -3388,7 +3419,7 @@ def kubectl(command, context): with open(filename_log,'w') as file: file.write(stderr) elif file_extension.lower() == '.sh': - stdin, stdout, stderr = execute_command_in_pod_sut(shellcommand.format(scriptname=scriptfolder+c, service_name=service_name), pod_sut, context) + stdin, stdout, stderr = execute_command_in_pod_sut(shellcommand.format(scriptname=scriptfolder+c, service_name=service_name, namespace=namespace), pod_sut, context) filename_log = path+'/load-sut-{configuration}-{filename}{extension}.log'.format(configuration=configuration, filename=filename, extension=file_extension.lower()) #print(filename_log) if len(stdout) > 0: diff --git a/k8s-cluster.config b/k8s-cluster.config index e7bb13219..679a07401 100644 --- a/k8s-cluster.config +++ b/k8s-cluster.config @@ -364,7 +364,7 @@ 'priceperhourdollar': 0.0, }, 'YugabyteDB': { - 'loadData': 'psql -U yugabyte --host yb-tserver-service.perdelt.svc.cluster.local --port 5433 < {scriptname}', + 'loadData': 'psql -U yugabyte --host yb-tserver-service.{namespace}.svc.cluster.local --port 5433 < {scriptname}', #'loadData': 'ysqlsh --username=yugabyte --host {service_name} --port 5433 < {scriptname}', 'template': { 'version': 'v11.4', @@ -373,7 +373,7 @@ 'JDBC': { 'driver': "com.yugabyte.Driver", 'auth': ["yugabyte", ""], - 'url': 'jdbc:yugabytedb://yb-tserver-service.perdelt.svc.cluster.local:5433/yugabyte?load-balance=true',#/{dbname}', + 'url': 'jdbc:yugabytedb://yb-tserver-service.{namespace}.svc.cluster.local:5433/yugabyte?load-balance=true',#/{dbname}', 'jar': 'jdbc-yugabytedb-42.3.5-yb-2.jar' } }, From e2f21a9c78420845152312c0f3767beb706b9afe Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Sun, 24 Mar 2024 16:37:53 +0100 Subject: [PATCH 091/121] fix: requirements.txt to reduce vulnerabilities (#279) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-3180412 Co-authored-by: snyk-bot From eb703523bdec7e0d97588c15e3fca9d6ef1d9db1 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 4 Apr 2024 13:17:54 +0200 Subject: [PATCH 092/121] fix: requirements.txt to reduce vulnerabilities (#281) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-PILLOW-6514866 Co-authored-by: snyk-bot --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f502a0573..d10c18828 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ HiYaPyCo==0.5.1 mistune>=2.0.3 # not directly required, pinned by Snyk to avoid a vulnerability numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability -pillow>=10.2.0 # not directly required, pinned by Snyk to avoid a vulnerability +pillow>=10.3.0 # not directly required, pinned by Snyk to avoid a vulnerability Werkzeug>=3.0.1 fonttools>=4.43.0 # not directly required, pinned by Snyk to avoid a vulnerability dash>=2.15.0 # not directly required, pinned by Snyk to avoid a vulnerability From fe77357fe5e82e6c3ecc9d26ec997b297f480938 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Tue, 20 Feb 2024 15:45:54 +0100 Subject: [PATCH 093/121] Bexhoma: Default summary for DBMSBenchmarker follows TPC-H --- bexhoma/experiments.py | 217 +++++++++-------- bexhoma/scripts/experimentsmanager.py | 2 + docs/Example-Result-TPC-H-MonetDB.md | 321 ++++++++++++++++++++++++++ 3 files changed, 430 insertions(+), 110 deletions(-) create mode 100644 docs/Example-Result-TPC-H-MonetDB.md diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 986623e08..19287d60a 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1211,7 +1211,113 @@ def end_loading(self, jobname): self.evaluator.end_loading(jobname) def show_summary(self): self.cluster.logger.debug('default.show_summary()') - pass + print("\n## Show Summary") + pd.set_option("display.max_rows", None) + pd.set_option('display.max_colwidth', None) + pd.set_option('display.max_rows', 500) + pd.set_option('display.max_columns', 500) + pd.set_option('display.width', 1000) + resultfolder = self.cluster.config['benchmarker']['resultfolder'] + code = self.code + with open(resultfolder+"/"+code+"/queries.config",'r') as inp: + workload_properties = ast.literal_eval(inp.read()) + print("\n### Workload\n "+workload_properties['name']) + print(" "+workload_properties['intro']) + print(" "+workload_properties['info']) + print("\n### Connections") + with open(resultfolder+"/"+code+"/connections.config",'r') as inf: + connections = ast.literal_eval(inf.read()) + pretty_connections = json.dumps(connections, indent=2) + #print(pretty_connections) + connections_sorted = sorted(connections, key=lambda c: c['name']) + for c in connections_sorted: + print(c['name'], + "uses docker image", + c['parameter']['dockerimage']) + infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key and not info=="" and not str(info)=="0" and not info==[]] + for info in infos: + print(info) + evaluate = inspector.inspector(resultfolder) + evaluate.load_experiment(code=code, silent=True) + ##################### + print("\n### Errors") + print(evaluate.get_total_errors().T) + ##################### + print("\n### Warnings") + print(evaluate.get_total_warnings().T) + ##################### + print("\n### Latency of Timer Execution [ms]") + df = evaluate.get_aggregated_query_statistics(type='latency', name='execution', query_aggregate='Mean') + if not df is None: + print(df.sort_index().T.round(2)) + ##################### + print("\n### Loading [s]") + times = {} + for c, connection in evaluate.benchmarks.dbms.items(): + times[c]={} + if 'timeGenerate' in connection.connectiondata: + times[c]['timeGenerate'] = connection.connectiondata['timeGenerate'] + if 'timeIngesting' in connection.connectiondata: + times[c]['timeIngesting'] = connection.connectiondata['timeIngesting'] + if 'timeSchema' in connection.connectiondata: + times[c]['timeSchema'] = connection.connectiondata['timeSchema'] + if 'timeIndex' in connection.connectiondata: + times[c]['timeIndex'] = connection.connectiondata['timeIndex'] + if 'timeLoad' in connection.connectiondata: + times[c]['timeLoad'] = connection.connectiondata['timeLoad'] + df = pd.DataFrame(times) + df = df.reindex(sorted(df.columns), axis=1) + print(df.round(2).T) + ##################### + print("\n### Geometric Mean of Medians of Timer Run [s]") + df = evaluate.get_aggregated_experiment_statistics(type='timer', name='run', query_aggregate='Median', total_aggregate='Geo') + df = (df/1000.0).sort_index() + df.columns = ['Geo Times [s]'] + print(df.round(2)) + ##################### + print("\n### Power@Size") + df = evaluate.get_aggregated_experiment_statistics(type='timer', name='execution', query_aggregate='Median', total_aggregate='Geo') + df = (df/1000.0).sort_index().astype('float') + df = float(parameter.defaultParameters['SF'])*3600./df + df.columns = ['Power@Size [~Q/h]'] + print(df.round(2)) + ##################### + # aggregate time and throughput for parallel pods + print("\n### Throughput@Size") + df_merged_time = pd.DataFrame() + for connection_nr, connection in evaluate.benchmarks.dbms.items(): + df_time = pd.DataFrame() + c = connection.connectiondata + connection_name = c['name'] + orig_name = c['orig_name'] + eva = evaluate.get_experiment_connection_properties(c['name']) + df_time.index = [connection_name] + #df_time['SF'] = int(SF) + #print(c) + df_time['orig_name'] = orig_name + df_time['SF'] = int(c['parameter']['connection_parameter']['loading_parameters']['SF']) + df_time['pods'] = int(c['parameter']['connection_parameter']['loading_parameters']['PODS_PARALLEL']) + #df_time['threads'] = int(c['parameter']['connection_parameter']['loading_parameters']['MYSQL_LOADING_THREADS']) + df_time['num_experiment'] = int(c['parameter']['numExperiment']) + df_time['num_client'] = int(c['parameter']['client']) + df_time['benchmark_start'] = eva['times']['total'][c['name']]['time_start'] + df_time['benchmark_end'] = eva['times']['total'][c['name']]['time_end'] + df_merged_time = pd.concat([df_merged_time, df_time]) + df_time = df_merged_time.sort_index() + benchmark_start = df_time.groupby(['orig_name', 'SF', 'num_experiment', 'num_client']).min('benchmark_start') + benchmark_end = df_time.groupby(['orig_name', 'SF', 'num_experiment', 'num_client']).max('benchmark_end') + df_benchmark = pd.DataFrame(benchmark_end['benchmark_end'] - benchmark_start['benchmark_start']) + df_benchmark.columns = ['time [s]'] + benchmark_count = df_time.groupby(['orig_name', 'SF', 'num_experiment', 'num_client']).count() + df_benchmark['count'] = benchmark_count['benchmark_end'] + df_benchmark['SF'] = df_benchmark.index.map(lambda x: x[1]) + df_benchmark['Throughput@Size [~GB/h]'] = (22*3600*df_benchmark['count']/df_benchmark['time [s]']*df_benchmark['SF']).round(2) + index_names = list(df_benchmark.index.names) + index_names[0] = "DBMS" + df_benchmark.rename_axis(index_names, inplace=True) + print(df_benchmark) + ##################### + self.show_summary_monitoring() def show_summary_monitoring_table(self, evaluate, component): df_monitoring = list() ########## @@ -1378,115 +1484,6 @@ def set_queries_full(self): self.set_queryfile('queries-tpch.config') def set_queries_profiling(self): self.set_queryfile('queries-tpch-profiling.config') - def show_summary(self): - self.cluster.logger.debug('tpch.show_summary()') - print("\n## Show Summary") - pd.set_option("display.max_rows", None) - pd.set_option('display.max_colwidth', None) - pd.set_option('display.max_rows', 500) - pd.set_option('display.max_columns', 500) - pd.set_option('display.width', 1000) - resultfolder = self.cluster.config['benchmarker']['resultfolder'] - code = self.code - with open(resultfolder+"/"+code+"/queries.config",'r') as inp: - workload_properties = ast.literal_eval(inp.read()) - print("\n### Workload\n "+workload_properties['name']) - print(" "+workload_properties['intro']) - print(" "+workload_properties['info']) - print("\n### Connections") - with open(resultfolder+"/"+code+"/connections.config",'r') as inf: - connections = ast.literal_eval(inf.read()) - pretty_connections = json.dumps(connections, indent=2) - #print(pretty_connections) - connections_sorted = sorted(connections, key=lambda c: c['name']) - for c in connections_sorted: - print(c['name'], - "uses docker image", - c['parameter']['dockerimage']) - infos = [" {}:{}".format(key,info) for key, info in c['hostsystem'].items() if not 'timespan' in key and not info=="" and not str(info)=="0" and not info==[]] - for info in infos: - print(info) - evaluate = inspector.inspector(resultfolder) - evaluate.load_experiment(code=code, silent=True) - ##################### - print("\n### Errors") - print(evaluate.get_total_errors().T) - ##################### - print("\n### Warnings") - print(evaluate.get_total_warnings().T) - ##################### - print("\n### Latency of Timer Execution [ms]") - df = evaluate.get_aggregated_query_statistics(type='latency', name='execution', query_aggregate='Mean') - if not df is None: - print(df.sort_index().T.round(2)) - ##################### - print("\n### Loading [s]") - times = {} - for c, connection in evaluate.benchmarks.dbms.items(): - times[c]={} - if 'timeGenerate' in connection.connectiondata: - times[c]['timeGenerate'] = connection.connectiondata['timeGenerate'] - if 'timeIngesting' in connection.connectiondata: - times[c]['timeIngesting'] = connection.connectiondata['timeIngesting'] - if 'timeSchema' in connection.connectiondata: - times[c]['timeSchema'] = connection.connectiondata['timeSchema'] - if 'timeIndex' in connection.connectiondata: - times[c]['timeIndex'] = connection.connectiondata['timeIndex'] - if 'timeLoad' in connection.connectiondata: - times[c]['timeLoad'] = connection.connectiondata['timeLoad'] - df = pd.DataFrame(times) - df = df.reindex(sorted(df.columns), axis=1) - print(df.round(2).T) - ##################### - print("\n### Geometric Mean of Medians of Timer Run [s]") - df = evaluate.get_aggregated_experiment_statistics(type='timer', name='run', query_aggregate='Median', total_aggregate='Geo') - df = (df/1000.0).sort_index() - df.columns = ['Geo Times [s]'] - print(df.round(2)) - ##################### - print("\n### TPC-H Power@Size") - df = evaluate.get_aggregated_experiment_statistics(type='timer', name='execution', query_aggregate='Median', total_aggregate='Geo') - df = (df/1000.0).sort_index().astype('float') - df = float(parameter.defaultParameters['SF'])*3600./df - df.columns = ['Power@Size [~Q/h]'] - print(df.round(2)) - ##################### - # aggregate time and throughput for parallel pods - print("\n### TPC-H Throughput@Size") - df_merged_time = pd.DataFrame() - for connection_nr, connection in evaluate.benchmarks.dbms.items(): - df_time = pd.DataFrame() - c = connection.connectiondata - connection_name = c['name'] - orig_name = c['orig_name'] - eva = evaluate.get_experiment_connection_properties(c['name']) - df_time.index = [connection_name] - #df_time['SF'] = int(SF) - #print(c) - df_time['orig_name'] = orig_name - df_time['SF'] = int(c['parameter']['connection_parameter']['loading_parameters']['SF']) - df_time['pods'] = int(c['parameter']['connection_parameter']['loading_parameters']['PODS_PARALLEL']) - #df_time['threads'] = int(c['parameter']['connection_parameter']['loading_parameters']['MYSQL_LOADING_THREADS']) - df_time['num_experiment'] = int(c['parameter']['numExperiment']) - df_time['num_client'] = int(c['parameter']['client']) - df_time['benchmark_start'] = eva['times']['total'][c['name']]['time_start'] - df_time['benchmark_end'] = eva['times']['total'][c['name']]['time_end'] - df_merged_time = pd.concat([df_merged_time, df_time]) - df_time = df_merged_time.sort_index() - benchmark_start = df_time.groupby(['orig_name', 'SF', 'num_experiment', 'num_client']).min('benchmark_start') - benchmark_end = df_time.groupby(['orig_name', 'SF', 'num_experiment', 'num_client']).max('benchmark_end') - df_benchmark = pd.DataFrame(benchmark_end['benchmark_end'] - benchmark_start['benchmark_start']) - df_benchmark.columns = ['time [s]'] - benchmark_count = df_time.groupby(['orig_name', 'SF', 'num_experiment', 'num_client']).count() - df_benchmark['count'] = benchmark_count['benchmark_end'] - df_benchmark['SF'] = df_benchmark.index.map(lambda x: x[1]) - df_benchmark['Throughput@Size [~GB/h]'] = (22*3600*df_benchmark['count']/df_benchmark['time [s]']*df_benchmark['SF']).round(2) - index_names = list(df_benchmark.index.names) - index_names[0] = "DBMS" - df_benchmark.rename_axis(index_names, inplace=True) - print(df_benchmark) - ##################### - self.show_summary_monitoring() diff --git a/bexhoma/scripts/experimentsmanager.py b/bexhoma/scripts/experimentsmanager.py index e3ca59e81..ee12fcb31 100644 --- a/bexhoma/scripts/experimentsmanager.py +++ b/bexhoma/scripts/experimentsmanager.py @@ -26,6 +26,8 @@ import pandas as pd from tabulate import tabulate from datetime import datetime +from prettytable import PrettyTable, ALL + urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) diff --git a/docs/Example-Result-TPC-H-MonetDB.md b/docs/Example-Result-TPC-H-MonetDB.md new file mode 100644 index 000000000..84d6dfb45 --- /dev/null +++ b/docs/Example-Result-TPC-H-MonetDB.md @@ -0,0 +1,321 @@ +# Example Result: MonetDB running TPC-H at SF=100 + + + +This example shows how to run Q1-Q22 derived from TPC-H in MonetDB at SF=100. +It covers the power and the throughput test. +The refresh stream is not included. + +> The query file is derived from the TPC-H and as such is not comparable to published TPC-H results, as the query file results do not comply with the TPC-H Specification. + +Official TPC-H benchmark - http://www.tpc.org/tpch + +**The results are not official benchmark results. The exact performance depends on a collection of parameters. +The purpose of this example is to illustrate the usage of bexhoma and to show how to evaluate results.** + + + +## Generate and Load Data + +At first we generate TPC-H data at SF=100 (`-sf`) with 8 parallel generators (`-nlp`). +The generated data is stored at the shared disk `data`. +Moreover the data is loaded into an instance of MonetDB using again 8 parallel loaders. +Afterwards the script creates contraints (`-ic`) and indexes (`-ii`) and updates table statistics (`-is`). +The database is located in another shared disk of storageClass shared (`-rst`) and of size 300Gi (`-rss`). + +The script also runs a power test (`-ne` set to 1) with timeout 1200s (`-t`) and data transfer activated (`-dt`) once (`-nc` set to 1). +To avoid conflicts with other experiments we set a maximum of 1 DBMS per time (`-ms`). +Monitoring is activated (`-m`) for all components (`-mc`). +The components, that is the SUT (`-rnn`) and the loader (`-rnl`) and the benchmark driver (`-rnb`), are fixed to specific nodes in the cluster. + +```bash +mkdir -p ./logs/ + +BEXHOMA_NODE_SUT="cl-worker11" +BEXHOMA_NODE_LOAD="cl-worker19" +BEXHOMA_NODE_BENCHMARK="cl-worker19" + +nohup python tpch.py -ms 1 \ + -m -mc \ + -sf 100 \ + -ii -ic -is \ + -nlp 8 -nlt 8 \ + -nc 1 -ne 1 \ + -rnn $BEXHOMA_NODE_SUT -rnl $BEXHOMA_NODE_LOAD -rnb $BEXHOMA_NODE_BENCHMARK \ + -dbms MonetDB \ + -t 1200 -dt \ + -rst shared -rss 300Gi \ + run &>logs/test_tpch_monetdb_1.log & +``` + +### Status Data Disk + +You can watch the status of the data disk via `bexperiments data`. + +In the following example output we see we have generated TPC-H at SF=100 using 8 generators. +The data set is split into 8 parts, each of about 14G size. +In total the data set has a size of 106G. + +``` +14G /data/tpch/SF100/8/8 +14G /data/tpch/SF100/8/3 +14G /data/tpch/SF100/8/2 +14G /data/tpch/SF100/8/4 +14G /data/tpch/SF100/8/1 +14G /data/tpch/SF100/8/5 +14G /data/tpch/SF100/8/7 +14G /data/tpch/SF100/8/6 +106G /data/tpch/SF100/8 +106G /data/tpch/SF100 +``` + +### Status Database and Benchmark + +You can watch the status of experiments via `bexperiments status` + +In the following example output we see all components of bexhoma are up and running. +The cluster stores a MonetDB database corresponding to TPC-H of SF=100. +The disk is of storageClass shared and of size 300Gi and 210G of that space is used. +It took about 7000s to build this database. +Currently no DBMS is running. + +``` +Dashboard: Running +Message Queue: Running +Data directory: Running +Result directory: Running +Cluster Prometheus: Running ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| Volumes | configuration | experiment | loaded [s] | timeLoading [s] | dbms | storage_class_name | storage | status | size | used | ++====================================+=================+==============+==============+===================+============+======================+===========+==========+========+========+ +| bexhoma-storage-monetdb-tpch-100 | monetdb | tpch-100 | True | 7061 | MonetDB | shared | 300Gi | Bound | 300G | 210G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +``` + +### Summary of Results + +At the end of a benchmark you will see a summary like + +```bash +## Show Summary +Read results +Connections: +MonetDB-BHT-8-1-1 +MySQL-BHT-8-8-1-1 +PostgreSQL-BHT-8-1-1 +Queries: +0: Q1 = Pricing Summary Report (TPC-H Q1) +1: Q2 = Minimum Cost Supplier Query (TPC-H Q2) +2: Q3 = Shipping Priority (TPC-H Q3) +3: Q4 = Order Priority Checking Query (TPC-H Q4) +4: Q5 = Local Supplier Volume (TPC-H Q5) +5: Q6 = Forecasting Revenue Change (TPC-H Q6) +6: Q7 = Forecasting Revenue Change (TPC-H Q7) +7: Q8 = National Market Share (TPC-H Q8) +8: Q9 = Product Type Profit Measure (TPC-H Q9) +9: Q10 = Forecasting Revenue Change (TPC-H Q10) +10: Q11 = Important Stock Identification (TPC-H Q11) +11: Q12 = Shipping Modes and Order Priority (TPC-H Q12) +12: Q13 = Customer Distribution (TPC-H Q13) +13: Q14 = Forecasting Revenue Change (TPC-H Q14) +14: Q15 = Top Supplier Query (TPC-H Q15) +15: Q16 = Parts/Supplier Relationship (TPC-H Q16) +16: Q17 = Small-Quantity-Order Revenue (TPC-H Q17) +17: Q18 = Large Volume Customer (TPC-H Q18) +18: Q19 = Discounted Revenue (TPC-H Q19) +19: Q20 = Potential Part Promotion (TPC-H Q20) +20: Q21 = Suppliers Who Kept Orders Waiting Query (TPC-H Q21) +21: Q22 = Global Sales Opportunity Query (TPC-H Q22) +Load Evaluation + +### Errors + MonetDB-BHT-8-1-1 MySQL-BHT-8-8-1-1 PostgreSQL-BHT-8-1-1 +Q1 False False False +Q2 False False False +Q3 False False False +Q4 False False False +Q5 False False False +Q6 False False False +Q7 False False False +Q8 False False False +Q9 False False False +Q10 False False False +Q11 False False False +Q12 False False False +Q13 False False False +Q14 False False False +Q15 False False False +Q16 False False False +Q17 False False False +Q18 False False False +Q19 False False False +Q20 False False False +Q21 False False False +Q22 False False False + +### Warnings + MonetDB-BHT-8-1-1 MySQL-BHT-8-8-1-1 PostgreSQL-BHT-8-1-1 +Q1 False False False +Q2 False False False +Q3 False False False +Q4 False False False +Q5 False False False +Q6 False False False +Q7 False False False +Q8 False False False +Q9 False False False +Q10 False False False +Q11 False False False +Q12 False False False +Q13 False False False +Q14 False False False +Q15 False False False +Q16 False False False +Q17 False False False +Q18 False False False +Q19 False False False +Q20 False False False +Q21 False False False +Q22 False False False + +### Latency of Timer Execution [ms] +DBMS MonetDB-BHT-8-1-1 MySQL-BHT-8-8-1-1 PostgreSQL-BHT-8-1-1 +Q1 2404.64 33934.30 2612.67 +Q2 30.12 361.71 441.01 +Q3 151.54 3897.70 794.99 +Q4 52.34 1882.83 1311.89 +Q5 73.99 3639.32 698.28 +Q6 33.68 4465.72 539.06 +Q7 95.63 7349.12 810.43 +Q8 449.77 6828.98 656.06 +Q9 111.96 5704.00 1145.25 +Q10 175.70 3128.08 1321.12 +Q11 31.90 363.01 258.32 +Q12 67.53 7294.59 1069.99 +Q13 555.90 8787.78 2008.54 +Q14 41.45 5265.07 596.09 +Q15 60.05 22688.57 583.01 +Q16 116.17 1057.91 591.68 +Q17 72.47 799.00 2024.25 +Q18 964.94 6488.35 7099.96 +Q19 91.28 387.99 1595.01 +Q20 97.20 586.58 668.23 +Q21 3185.97 16793.11 932.27 +Q22 67.00 512.73 253.11 + +### Loading [s] + timeGenerate timeIngesting timeSchema timeIndex timeLoad +MonetDB-BHT-8-1-1 1.0 22.0 8.80 34.36 102.16 +MySQL-BHT-8-8-1-1 1.0 435.0 3.78 1793.84 2262.63 +PostgreSQL-BHT-8-1-1 1.0 25.0 0.61 88.96 139.58 + +### Geometric Mean of Medians of Timer Run [s] + Geo Times [s] +DBMS +MonetDB-BHT-8-1-1 0.16 +MySQL-BHT-8-8-1-1 3.11 +PostgreSQL-BHT-8-1-1 0.95 + +### TPC-H Power@Size + Power@Size [~Q/h] +DBMS +MonetDB-BHT-8-1-1 27011.62 +MySQL-BHT-8-8-1-1 1187.97 +PostgreSQL-BHT-8-1-1 3924.04 + +### TPC-H Throughput@Size + time [s] count SF Throughput@Size [~GB/h] +DBMS SF num_experiment num_client +MonetDB-BHT-8-1 1 1 1 13 1 1 6092.31 +MySQL-BHT-8-8-1 1 1 1 147 1 1 538.78 +PostgreSQL-BHT-8-1 1 1 1 33 1 1 2400.00 + +### Ingestion + SUT - CPU of Ingestion (via counter) [CPUs] SUT - Max RAM of Ingestion [Gb] +DBMS +MonetDB-BHT-8-1 139.25 1.23 +MySQL-BHT-8-8-1 3015.80 47.16 +PostgreSQL-BHT-8-1 150.89 3.74 + +### Execution + SUT - CPU of Execution (via counter) [CPUs] SUT - Max RAM of Execution [Gb] +DBMS +MonetDB-BHT-8-1 17.13 1.57 +MySQL-BHT-8-8-1 130.73 47.31 +PostgreSQL-BHT-8-1 63.62 3.78 +``` + + +### Status Data Disk + +To see the summary of experiment `1708411664` again you can simply call `python tpch.py -e 1708411664 summary`. + +You can inspect a preview list of results via `bexperiments localresults`. + +``` ++------------+----------------------+------------------------------------------------------------------------------------------------+---------------------------------------------------+---------+-------------+---------------------+ +| index | name | info | intro | queries | connections | time | ++------------+----------------------+------------------------------------------------------------------------------------------------+---------------------------------------------------+---------+-------------+---------------------+ +| 1708411664 | TPC-H Queries SF=100 | This experiment compares run time and resource consumption of TPC-H queries in different DBMS. | This includes the reading queries of TPC-H. | 22 | 28 | 2024-02-20 11:37:30 | +| | | TPC-H data is loaded from a filesystem using several processes. | | | | | +| | | Import is limited to DBMS MonetDB. | | | | | +| | | Import is handled by 1 processes. | | | | | +| | | Loading is fixed to cl-worker19. | | | | | +| | | Benchmarking is fixed to cl-worker19. | | | | | ++------------+----------------------+------------------------------------------------------------------------------------------------+---------------------------------------------------+---------+-------------+---------------------+ +``` + +## Perform Benchmark - Power Test + +We now start a new instance of MonetDB and mount the existing database: we use the prepared database on the shared disk. +We then run two power tests, one after the other (`-ne 1,1`), and shut down the DBMS. +This is repeated 5 times (`-nc`). + + +```bash +mkdir -p ./logs/ + +BEXHOMA_NODE_SUT="cl-worker11" +BEXHOMA_NODE_LOAD="cl-worker19" +BEXHOMA_NODE_BENCHMARK="cl-worker19" + +nohup python tpch.py -ms 1 \ + -m -mc \ + -sf 100 \ + -ii -ic -is \ + -nlp 8 -nlt 8 \ + -nc 5 -ne 1,1 \ + -rnn $BEXHOMA_NODE_SUT -rnl $BEXHOMA_NODE_LOAD -rnb $BEXHOMA_NODE_BENCHMARK \ + -dbms MonetDB \ + -t 1200 -dt \ + -rst shared -rss 300Gi \ + run &>logs/test_tpch_monetdb_2.log & +``` + +## Perform Benchmark - Throughput Test + +We now start a new instance of MonetDB and mount the existing database: we use the prepared database on the shared disk. +We then run two power tests, one after the other (`-ne 1,1`), and shut down the DBMS. +This is repeated 5 times (`-nc`). + + +```bash +mkdir -p ./logs/ + +BEXHOMA_NODE_SUT="cl-worker11" +BEXHOMA_NODE_LOAD="cl-worker19" +BEXHOMA_NODE_BENCHMARK="cl-worker19" + +nohup python tpch.py -ms 1 \ + -m -mc \ + -sf 100 \ + -ii -ic -is \ + -nlp 8 -nlt 8 \ + -nc 5 -ne 1,1,5 \ + -rnn $BEXHOMA_NODE_SUT -rnl $BEXHOMA_NODE_LOAD -rnb $BEXHOMA_NODE_BENCHMARK \ + -dbms MonetDB \ + -t 1200 -dt \ + -rst shared -rss 300Gi \ + run &>logs/test_tpch_monetdb_2.log & +``` + From fe851500d2d8f0111aa57b4d3acd12e3bddb6f08 Mon Sep 17 00:00:00 2001 From: perdelt Date: Fri, 3 May 2024 12:21:22 +0200 Subject: [PATCH 094/121] Experiment: Prepare TPCx-AI --- bexhoma/experiments.py | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index 19287d60a..ae50c443c 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -2041,3 +2041,48 @@ def __init__(self, ) self.storage_label = 'example' + +""" +############################################################################ +TPCx-AI +############################################################################ +""" + +class tpcxai(default): + """ + Class for defining an TPCx-AI experiment. + This sets + + * the folder to the experiment - including query file and schema informations per dbms + * name and information about the experiment + * additional parameters - here SF (the scaling factor) + """ + def __init__(self, + cluster, + code=None, + queryfile = 'queries-tpcxai.config', + SF = '100', + num_experiment_to_apply = 1, + timeout = 7200, + script=None + #detached=False + ): + default.__init__(self, cluster, code, num_experiment_to_apply, timeout)#, detached) + if script is None: + script = 'SF'+str(SF)+'-index' + self.set_experiment(volume='tpcxai') + self.set_experiment(script=script) + self.cluster.set_experiments_configfolder('experiments/tpcxai') + parameter.defaultParameters = {'SF': str(SF)} + self.set_additional_labels(SF=SF) + self.set_queryfile(queryfile) + self.set_workload( + name = 'TPCx-AI Queries SF='+str(SF), + info = 'This experiment performs some TPCx-AI inspired queries.' + ) + self.storage_label = 'tpcxai-'+str(SF) + def set_queries_full(self): + self.set_queryfile('queries-tpcxai.config') + def set_queries_profiling(self): + self.set_queryfile('queries-tpcxai-profiling.config') + From ca2d2462ac88e30e01030bc9ceaae5246837b53f Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 14 Jun 2024 09:33:25 +0200 Subject: [PATCH 095/121] fix: requirements.txt to reduce vulnerabilities (#284) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-WERKZEUG-6808933 Co-authored-by: snyk-bot --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d10c18828..cd885549b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,8 +13,8 @@ HiYaPyCo==0.5.1 mistune>=2.0.3 # not directly required, pinned by Snyk to avoid a vulnerability numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability +Werkzeug>=3.0.3 pillow>=10.3.0 # not directly required, pinned by Snyk to avoid a vulnerability -Werkzeug>=3.0.1 fonttools>=4.43.0 # not directly required, pinned by Snyk to avoid a vulnerability dash>=2.15.0 # not directly required, pinned by Snyk to avoid a vulnerability pyarrow>=14.0.2 From 9925b002547906c6e40cad28c8403a735aff79b2 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 14 Jun 2024 09:35:20 +0200 Subject: [PATCH 096/121] fix: images/benchmarker_dbmsbenchmarker/requirements.txt to reduce vulnerabilities (#288) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-REQUESTS-6928867 Co-authored-by: snyk-bot --- images/benchmarker_dbmsbenchmarker/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/benchmarker_dbmsbenchmarker/requirements.txt b/images/benchmarker_dbmsbenchmarker/requirements.txt index 1b6d198c2..cb1c80c8b 100644 --- a/images/benchmarker_dbmsbenchmarker/requirements.txt +++ b/images/benchmarker_dbmsbenchmarker/requirements.txt @@ -1,7 +1,7 @@ paramiko>=2.4.2 urllib3>=1.24.1 boto3>=1.9.104 -requests>=2.21.0 +requests>=2.32.0 scp>=0.13.2 kubernetes>=9.0.0 psutil>=5.6.1 From b895d606b4b01aec38c4c5d6a40b5cc117d24312 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 14 Jun 2024 09:36:24 +0200 Subject: [PATCH 097/121] fix: requirements.txt to reduce vulnerabilities (#287) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-REQUESTS-6928867 Co-authored-by: snyk-bot --- requirements.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index cd885549b..f44f50518 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ #paramiko>=2.4.2 urllib3>=1.24.1 #boto3>=1.9.104 -#requests>=2.21.0 #scp>=0.13.2 kubernetes==22.6.0 psutil>=5.6.1 @@ -18,5 +17,5 @@ pillow>=10.3.0 # not directly required, pinned by Snyk to avoid a vulnerability fonttools>=4.43.0 # not directly required, pinned by Snyk to avoid a vulnerability dash>=2.15.0 # not directly required, pinned by Snyk to avoid a vulnerability pyarrow>=14.0.2 +requests>=2.32.0 # not directly required, pinned by Snyk to avoid a vulnerability prettytable - From 87f2aba239d4064db73bf448e894ae8a9436800b Mon Sep 17 00:00:00 2001 From: perdelt Date: Fri, 14 Jun 2024 10:49:24 +0200 Subject: [PATCH 098/121] Action: Publish only on release --- .github/workflows/publish-to-test-pypi.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml index 4398b484d..f7f89a1f9 100644 --- a/.github/workflows/publish-to-test-pypi.yml +++ b/.github/workflows/publish-to-test-pypi.yml @@ -4,8 +4,9 @@ name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI # Controls when the workflow will run on: - # Triggers the workflow on push or pull request events but only for the master branch - push: + # Triggers the workflow on release events but only for the master branch + release: + types: [published] branches: [ master ] tags: - "v*" @@ -15,8 +16,8 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: + # This workflow contains a single job called "release" + release: # The type of runner that the job will run on runs-on: ubuntu-latest From f4c1996f210b9decd02ecf2bf8a58b63b09d2b75 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Wed, 19 Jun 2024 15:10:09 +0200 Subject: [PATCH 099/121] Benchmarker: Catch error if volume is missing --- .gitignore | 1 + bexhoma/configurations.py | 15 +++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4ece6538e..b4dd98d6a 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ dist/* .spyproject/* docs/html/* api/* +bexhoma/__pycache__/* diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index 28a0ba41e..d8a4a215f 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -1498,11 +1498,14 @@ def get_host_volume(self): stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) parts = stdout.split(" ") parts = [x for x in parts if x != ''] - size = parts[1] - #command = "df -h | grep volumes | awk -F ' ' '{print $3}'" - #stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) - used = parts[2] - return size, used + if len(parts) > 2: + size = parts[1] + #command = "df -h | grep volumes | awk -F ' ' '{print $3}'" + #stdin, stdout, stderr = self.execute_command_in_pod_sut(command=command) + used = parts[2] + return size, used + else: + return 0,0 except Exception as e: logging.error(e) return "", "" @@ -3338,7 +3341,7 @@ def get_worker_endpoints(self): #@fire_and_forget -def load_data_asynch(app, component, experiment, configuration, pod_sut, scriptfolder, commands, loadData, path, volume, context, service_name, time_offset=0, time_start_int=0, script_type='loaded', namespace): +def load_data_asynch(app, component, experiment, configuration, pod_sut, scriptfolder, commands, loadData, path, volume, context, service_name, time_offset=0, time_start_int=0, script_type='loaded', namespace=''): logger = logging.getLogger('load_data_asynch') #with open('asynch.test.log','w') as file: # file.write('started') From fa98529af81e04e0b7b0292f3f785b88302a372a Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Wed, 19 Jun 2024 15:11:01 +0200 Subject: [PATCH 100/121] README: Link corrected --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3ac5be9a..40d74b45d 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ The basic workflow is [1,2]: start a containerized version of the DBMS, install A more advanced workflow is: Plan a sequence of such experiments, run plan as a batch and join results for comparison. It is also possible to scale-out drivers for generating and loading data and for benchmarking to simulate cloud-native environments as in [4]. -See [example](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/TPCTC23/README.md) results as presented in [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) and how they are generated. +See [example](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager/tree/master/TPCTC23) results as presented in [A Cloud-Native Adoption of Classical DBMS Performance Benchmarks and Tools](http://dx.doi.org/10.13140/RG.2.2.29866.18880) and how they are generated. See the [homepage](https://github.com/Beuth-Erdelt/Benchmark-Experiment-Host-Manager) and the [documentation](https://bexhoma.readthedocs.io/en/latest/). From 9b6072cbc73ede010fd0418a1b3710317b8ce714 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Wed, 19 Jun 2024 15:12:25 +0200 Subject: [PATCH 101/121] fix: requirements.txt to reduce vulnerabilities (#293) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-URLLIB3-7267250 Co-authored-by: snyk-bot --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f44f50518..0b3c46934 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ #paramiko>=2.4.2 -urllib3>=1.24.1 +urllib3>=2.2.2 #boto3>=1.9.104 #scp>=0.13.2 kubernetes==22.6.0 From 0ee1910f2e51c70979dd593302bce3e816870944 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Wed, 19 Jun 2024 15:14:27 +0200 Subject: [PATCH 102/121] fix: images/benchmarker_dbmsbenchmarker/requirements.txt to reduce vulnerabilities (#292) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-CERTIFI-3164749 - https://snyk.io/vuln/SNYK-PYTHON-CERTIFI-5805047 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3172287 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3314966 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315324 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315328 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315331 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315452 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315972 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3315975 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3316038 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-3316211 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-5663682 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-5777683 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-5813745 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-5813746 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-5813750 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-5914629 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-6036192 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-6050294 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-6092044 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-6126975 - https://snyk.io/vuln/SNYK-PYTHON-CRYPTOGRAPHY-6210214 - https://snyk.io/vuln/SNYK-PYTHON-IDNA-6597975 - https://snyk.io/vuln/SNYK-PYTHON-PARAMIKO-6130887 - https://snyk.io/vuln/SNYK-PYTHON-REQUESTS-5595532 - https://snyk.io/vuln/SNYK-PYTHON-RSA-1038401 - https://snyk.io/vuln/SNYK-PYTHON-SETUPTOOLS-3180412 Co-authored-by: snyk-bot --- images/benchmarker_dbmsbenchmarker/requirements.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/images/benchmarker_dbmsbenchmarker/requirements.txt b/images/benchmarker_dbmsbenchmarker/requirements.txt index cb1c80c8b..900df5161 100644 --- a/images/benchmarker_dbmsbenchmarker/requirements.txt +++ b/images/benchmarker_dbmsbenchmarker/requirements.txt @@ -1,4 +1,4 @@ -paramiko>=2.4.2 +paramiko>=3.4.0 urllib3>=1.24.1 boto3>=1.9.104 requests>=2.32.0 @@ -6,3 +6,8 @@ scp>=0.13.2 kubernetes>=9.0.0 psutil>=5.6.1 #dbmsbenchmarker>=0.10.3 +certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability +cryptography>=42.0.2 # not directly required, pinned by Snyk to avoid a vulnerability +idna>=3.7 # not directly required, pinned by Snyk to avoid a vulnerability +rsa>=4.7 # not directly required, pinned by Snyk to avoid a vulnerability +setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability From 9ebe7533e2d38639c8627bd5b4002f247e8e923b Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 20 Jun 2024 07:17:09 +0200 Subject: [PATCH 103/121] Docs: Typos and remove old texts --- README.md | 8 ++++---- docs/Example-TPC-H.md | 2 +- docs/Example-YCSB.md | 2 +- docs/index.rst | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 40d74b45d..fb7accf49 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ If you encounter any issues, please report them to our [Github issue tracker](ht 1. Run `python ycsb.py -ms 1 -dbms PostgreSQL -workload a run`. This installs PostgreSQL and runs YCSB workload A with varying target. The driver is monolithic with 64 threads. The experiments runs a second time with the driver scaled out to 8 instances each having 8 threads. -1. You can watch status using `bexperiments status` while running. This is equivalent to `python cluster.py status`. +1. You can watch status using `bexperiments status` while running. 1. After benchmarking has finished, you will see a summary. - For further inspections, run `bexperiments dashboard` to connect to a dashboard. You can open dashboard in browser at `http://localhost:8050`. This is equivalent to `python cluster.py dashboard`. Alternatively you can open a Jupyter notebook at `http://localhost:8888`. + For further inspections, run `bexperiments dashboard` to connect to a dashboard. You can open dashboard in browser at `http://localhost:8050`. Alternatively you can open a Jupyter notebook at `http://localhost:8888`. See more details at https://bexhoma.readthedocs.io/en/latest/Example-YCSB.html @@ -68,9 +68,9 @@ See more details at https://bexhoma.readthedocs.io/en/latest/Example-YCSB.html 1. Run `python tpch.py -ms 1 -dbms PostgreSQL run`. This installs PostgreSQL and runs TPC-H at scale factor 1. The driver is monolithic. -1. You can watch status using `bexperiments status` while running. This is equivalent to `python cluster.py status`. +1. You can watch status using `bexperiments status` while running. 1. After benchmarking has finished, you will see a summary. - For further inspections, run `bexperiments dashboard` to connect to a dashboard. This is equivalent to `python cluster.py dashboard`. You can open a Jupyter notebook at `http://localhost:8888`. + For further inspections, run `bexperiments dashboard` to connect to a dashboard. You can open a Jupyter notebook at `http://localhost:8888`. See more details at https://bexhoma.readthedocs.io/en/latest/Example-TPC-H.html diff --git a/docs/Example-TPC-H.md b/docs/Example-TPC-H.md index f08849cad..c889314e3 100644 --- a/docs/Example-TPC-H.md +++ b/docs/Example-TPC-H.md @@ -364,7 +364,7 @@ MySQL-BHT-8-8-1 132.57 PostgreSQL-BHT-8-1 116.69 3.84 ``` -This gives a survey about CPU (in CPU seconds) and RAM usage (in Mb) during loading and execution of the benchmark. +This gives a survey about CPU (in CPU seconds) and RAM usage (in Gb) during loading and execution of the benchmark. ## Perform Benchmark - Throughput Test diff --git a/docs/Example-YCSB.md b/docs/Example-YCSB.md index 5c26bcb3c..726536cbf 100644 --- a/docs/Example-YCSB.md +++ b/docs/Example-YCSB.md @@ -262,7 +262,7 @@ PostgreSQL-64-8-114688-1 190.45 PostgreSQL-64-8-131072-1 146.15 4.02 ``` -This gives a survey about CPU (in CPU seconds) and RAM usage (in Mb) during loading and execution of the benchmark. +This gives a survey about CPU (in CPU seconds) and RAM usage (in Gb) during loading and execution of the benchmark. In this example, metrics are very instable. Metrics are fetched every 30 seconds. This is too coarse for such a quick example. diff --git a/docs/index.rst b/docs/index.rst index 059fa59d5..98a446529 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -18,7 +18,6 @@ ./Concept.md ./Config.md ./DBMS.md - ./Monitoring.md ./CONTRIBUTING.md ./bexhoma From a200415ae2c1bf32c10bd673cfd668172b97acc1 Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 20 Jun 2024 07:27:45 +0200 Subject: [PATCH 104/121] Test: No urllib3 --- TPCTC23/experiment-1-ycsb.py | 4 ++-- TPCTC23/experiment-2-hammerdb.py | 4 ++-- TPCTC23/experiment-3-benchbase.py | 4 ++-- TPCTC23/experiment-4-1-tpch-generating-filesystem.py | 6 +++--- TPCTC23/experiment-4-2-tpch-loading-filesystem.py | 6 +++--- TPCTC23/experiment-4-3-tpch-benchmarking.py | 4 ++-- bexhoma/experiments.py | 4 ++-- bexhoma/scripts/experimentsmanager.py | 4 ++-- bexhoma/scripts/tpcds.py | 4 ++-- bexhoma/scripts/tpch.py | 4 ++-- cluster.py | 4 ++-- example.py | 4 ++-- images/benchmarker_dbmsbenchmarker/requirements.txt | 8 ++++---- requirements.txt | 7 +------ simple_tpch.py | 4 ++-- tpch.py | 4 ++-- ycsb.py | 4 ++-- 17 files changed, 37 insertions(+), 42 deletions(-) diff --git a/TPCTC23/experiment-1-ycsb.py b/TPCTC23/experiment-1-ycsb.py index c7407654b..0feb99c62 100644 --- a/TPCTC23/experiment-1-ycsb.py +++ b/TPCTC23/experiment-1-ycsb.py @@ -7,7 +7,7 @@ from dbmsbenchmarker import * #import experiments import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -15,7 +15,7 @@ import datetime -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-2-hammerdb.py b/TPCTC23/experiment-2-hammerdb.py index fcbe7d20d..cfe55a140 100644 --- a/TPCTC23/experiment-2-hammerdb.py +++ b/TPCTC23/experiment-2-hammerdb.py @@ -11,7 +11,7 @@ from dbmsbenchmarker import * #import experiments import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -19,7 +19,7 @@ import datetime -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-3-benchbase.py b/TPCTC23/experiment-3-benchbase.py index 3e3fbcc7f..21f728aaf 100644 --- a/TPCTC23/experiment-3-benchbase.py +++ b/TPCTC23/experiment-3-benchbase.py @@ -11,7 +11,7 @@ from dbmsbenchmarker import * #import experiments import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -19,7 +19,7 @@ import datetime -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-4-1-tpch-generating-filesystem.py b/TPCTC23/experiment-4-1-tpch-generating-filesystem.py index 2c4e8af7c..0703bae74 100644 --- a/TPCTC23/experiment-4-1-tpch-generating-filesystem.py +++ b/TPCTC23/experiment-4-1-tpch-generating-filesystem.py @@ -28,18 +28,18 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time from timeit import default_timer import datetime # queue -import redis +#import redis import subprocess import psutil -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-4-2-tpch-loading-filesystem.py b/TPCTC23/experiment-4-2-tpch-loading-filesystem.py index 184a50e5a..dc6185a8c 100644 --- a/TPCTC23/experiment-4-2-tpch-loading-filesystem.py +++ b/TPCTC23/experiment-4-2-tpch-loading-filesystem.py @@ -34,18 +34,18 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time from timeit import default_timer import datetime # queue -import redis +#import redis import subprocess import psutil -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-4-3-tpch-benchmarking.py b/TPCTC23/experiment-4-3-tpch-benchmarking.py index 870ec7e2b..043d3a65a 100644 --- a/TPCTC23/experiment-4-3-tpch-benchmarking.py +++ b/TPCTC23/experiment-4-3-tpch-benchmarking.py @@ -34,7 +34,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -45,7 +45,7 @@ import subprocess import psutil -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index ae50c443c..fcf665485 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -30,7 +30,7 @@ """ from dbmsbenchmarker import parameter, tools, inspector import logging -import urllib3 +#import urllib3 import gc import shutil # for zipping from os import makedirs, path @@ -46,7 +46,7 @@ from bexhoma import evaluators -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) diff --git a/bexhoma/scripts/experimentsmanager.py b/bexhoma/scripts/experimentsmanager.py index ee12fcb31..86fd7c3a2 100644 --- a/bexhoma/scripts/experimentsmanager.py +++ b/bexhoma/scripts/experimentsmanager.py @@ -19,7 +19,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -28,7 +28,7 @@ from datetime import datetime from prettytable import PrettyTable, ALL -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) diff --git a/bexhoma/scripts/tpcds.py b/bexhoma/scripts/tpcds.py index 8c925479a..39870281b 100644 --- a/bexhoma/scripts/tpcds.py +++ b/bexhoma/scripts/tpcds.py @@ -13,7 +13,7 @@ from dbmsbenchmarker import * #import experiments import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -21,7 +21,7 @@ import datetime -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) def do_benchmark(): diff --git a/bexhoma/scripts/tpch.py b/bexhoma/scripts/tpch.py index 44eb213f5..4ae14b69f 100644 --- a/bexhoma/scripts/tpch.py +++ b/bexhoma/scripts/tpch.py @@ -12,7 +12,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -20,7 +20,7 @@ import datetime -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) def do_benchmark(): diff --git a/cluster.py b/cluster.py index 69a23b93a..9bda4d759 100644 --- a/cluster.py +++ b/cluster.py @@ -19,7 +19,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -29,7 +29,7 @@ import multiprocessing as mp from prettytable import PrettyTable, ALL -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) diff --git a/example.py b/example.py index 8c3e767bf..7125828dc 100644 --- a/example.py +++ b/example.py @@ -8,7 +8,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -19,7 +19,7 @@ import subprocess import psutil -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/images/benchmarker_dbmsbenchmarker/requirements.txt b/images/benchmarker_dbmsbenchmarker/requirements.txt index 900df5161..7d07e5c18 100644 --- a/images/benchmarker_dbmsbenchmarker/requirements.txt +++ b/images/benchmarker_dbmsbenchmarker/requirements.txt @@ -1,8 +1,8 @@ -paramiko>=3.4.0 -urllib3>=1.24.1 -boto3>=1.9.104 +#paramiko>=3.4.0 +#urllib3>=1.24.1 +#boto3>=1.9.104 requests>=2.32.0 -scp>=0.13.2 +#scp>=0.13.2 kubernetes>=9.0.0 psutil>=5.6.1 #dbmsbenchmarker>=0.10.3 diff --git a/requirements.txt b/requirements.txt index 0b3c46934..f822ee5fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,9 @@ -#paramiko>=2.4.2 -urllib3>=2.2.2 -#boto3>=1.9.104 -#scp>=0.13.2 +#urllib3>=2.2.2 kubernetes==22.6.0 psutil>=5.6.1 dbmsbenchmarker>=0.13.6 -#nbconvert==7.8.0 myst_parser HiYaPyCo==0.5.1 -#redis mistune>=2.0.3 # not directly required, pinned by Snyk to avoid a vulnerability numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/simple_tpch.py b/simple_tpch.py index 7a38c7885..5c13fae40 100644 --- a/simple_tpch.py +++ b/simple_tpch.py @@ -12,7 +12,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -20,7 +20,7 @@ import datetime -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/tpch.py b/tpch.py index 113d357cb..577d472f9 100644 --- a/tpch.py +++ b/tpch.py @@ -17,7 +17,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -28,7 +28,7 @@ import subprocess import psutil -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/ycsb.py b/ycsb.py index 4b8c3b6aa..9b3e4c293 100644 --- a/ycsb.py +++ b/ycsb.py @@ -7,7 +7,7 @@ from dbmsbenchmarker import * #import experiments import logging -import urllib3 +#import urllib3 import logging import argparse import time @@ -15,7 +15,7 @@ import datetime import pandas as pd -urllib3.disable_warnings() +#urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': From aa9b81ab11aa8554a4e75500e355bc31f2dcdeac Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 20 Jun 2024 07:35:18 +0200 Subject: [PATCH 105/121] Images: we only need packages required by dbmsbenchmarker for benchmarker container --- .../benchmarker_dbmsbenchmarker/Dockerfile_template | 5 +++-- images/benchmarker_dbmsbenchmarker/requirements.txt | 13 ------------- 2 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 images/benchmarker_dbmsbenchmarker/requirements.txt diff --git a/images/benchmarker_dbmsbenchmarker/Dockerfile_template b/images/benchmarker_dbmsbenchmarker/Dockerfile_template index a4159045c..db9621a30 100644 --- a/images/benchmarker_dbmsbenchmarker/Dockerfile_template +++ b/images/benchmarker_dbmsbenchmarker/Dockerfile_template @@ -23,8 +23,9 @@ RUN apt install default-jre -y RUN pip uninstall dbmsbenchmarker -y RUN JAVA_HOME=/usr/lib/jvm/java-1.8.0/ pip install --no-cache-dir --upgrade --force-reinstall git+https://github.com/Beuth-Erdelt/DBMS-Benchmarker@{version} -COPY requirements.txt ./ -RUN pip install --no-cache-dir -r requirements.txt +# we only need packages required by dbmsbenchmarker +#COPY requirements.txt ./ +#RUN pip install --no-cache-dir -r requirements.txt RUN git clone https://github.com/Beuth-Erdelt/DBMS-Benchmarker --branch {version} diff --git a/images/benchmarker_dbmsbenchmarker/requirements.txt b/images/benchmarker_dbmsbenchmarker/requirements.txt deleted file mode 100644 index 7d07e5c18..000000000 --- a/images/benchmarker_dbmsbenchmarker/requirements.txt +++ /dev/null @@ -1,13 +0,0 @@ -#paramiko>=3.4.0 -#urllib3>=1.24.1 -#boto3>=1.9.104 -requests>=2.32.0 -#scp>=0.13.2 -kubernetes>=9.0.0 -psutil>=5.6.1 -#dbmsbenchmarker>=0.10.3 -certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability -cryptography>=42.0.2 # not directly required, pinned by Snyk to avoid a vulnerability -idna>=3.7 # not directly required, pinned by Snyk to avoid a vulnerability -rsa>=4.7 # not directly required, pinned by Snyk to avoid a vulnerability -setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability From eddfbf3415cd884b681b92d039258f25f1b0ce16 Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 20 Jun 2024 09:37:46 +0200 Subject: [PATCH 106/121] Docs: Include monitoring --- docs/Monitoring.md | 10 ++++------ docs/index.rst | 1 + 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/Monitoring.md b/docs/Monitoring.md index 166fbf472..349234223 100644 --- a/docs/Monitoring.md +++ b/docs/Monitoring.md @@ -131,11 +131,9 @@ Note that the metrics make a summation over all matching components (containers, ### Installation Templates -cAdvisor -* container `cadvisor` and a service with `port-monitoring` 9300 -* example per SUT: `k8s/deploymenttemplate-PostgreSQL.yml` -* example per node: `k8s/daemonsettemplate-monitoring.yml` +cAdvisor runs as a container `cadvisor` and a service with `port-monitoring` 9300 +* example per SUT (sidecar container): `k8s/deploymenttemplate-PostgreSQL.yml` +* example per node (daemonset): `k8s/daemonsettemplate-monitoring.yml` -Prometheus -* container with a service with `port-prometheus` 9090 +Prometheus runs as a container with a service with `port-prometheus` 9090 * `k8s/deploymenttemplate-bexhoma-prometheus.yml` diff --git a/docs/index.rst b/docs/index.rst index 98a446529..0fb14848b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,6 +17,7 @@ ./Example-custom.md ./Concept.md ./Config.md + ./Monitoring.md ./DBMS.md ./CONTRIBUTING.md ./bexhoma From 7748600db83a82dd017dbb5a4191b47f9fa2bc5c Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 20 Jun 2024 10:01:40 +0200 Subject: [PATCH 107/121] TPC-H: More helpful infos per workload in results --- tpch.py | 20 +++++++++++++------- ycsb.py | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tpch.py b/tpch.py index 577d472f9..4e0b8dc84 100644 --- a/tpch.py +++ b/tpch.py @@ -176,15 +176,18 @@ ) # patch: use short profiling (only keys) experiment.set_queryfile('queries-tpch-profiling-keys.config') - if monitoring: + if monitoring_cluster: + # monitor all nodes of cluster (for not missing any component) + experiment.set_querymanagement_monitoring(numRun=numRun, delay=10, datatransfer=datatransfer) + cluster.start_monitoring_cluster() + experiment.workload['info'] = experiment.workload['info']+" System metrics are monitored by a cluster-wide installation." + elif monitoring: # we want to monitor resource consumption experiment.set_querymanagement_monitoring(numRun=numRun, delay=10, datatransfer=datatransfer) + experiment.workload['info'] = experiment.workload['info']+" System metrics are monitored by sidecar containers." else: # we want to just run the queries experiment.set_querymanagement_quicktest(numRun=numRun, datatransfer=datatransfer) - if monitoring_cluster: - # monitor all nodes of cluster (for not missing any component) - cluster.start_monitoring_cluster() # set resources for dbms experiment.set_resources( requests = { @@ -232,10 +235,13 @@ # optionally set some indexes and constraints after import if init_indexes or init_constraints or init_statistics: experiment.set_experiment(indexing='Index') + experiment.workload['info'] = experiment.workload['info']+" Import sets indexes after loading." if init_constraints: experiment.set_experiment(indexing='Index_and_Constraints') + experiment.workload['info'] = experiment.workload['info']+" Import sets indexes and constraints after loading." if init_statistics: experiment.set_experiment(indexing='Index_and_Constraints_and_Statistics') + experiment.workload['info'] = experiment.workload['info']+" Import sets indexes and constraints after loading and recomputes statistics." #experiment.set_experiment(script='Schema', indexing='Index') # note more infos about experiment in workload description experiment.workload['info'] = experiment.workload['info']+" TPC-H data is loaded from a filesystem using several processes." @@ -244,10 +250,10 @@ experiment.workload['info'] = experiment.workload['info']+" Import is limited to table {}.".format(limit_import_table) if len(args.dbms): # import is limited to single DBMS - experiment.workload['info'] = experiment.workload['info']+" Import is limited to DBMS {}.".format(args.dbms) - if len(list_loading_split): + experiment.workload['info'] = experiment.workload['info']+" Benchmark is limited to DBMS {}.".format(", ".join(args.dbms)) + if len(list_loading_pods): # import uses several processes in pods - experiment.workload['info'] = experiment.workload['info']+" Import is handled by {} processes.".format(num_loading_split) + experiment.workload['info'] = experiment.workload['info']+" Import is handled by {} processes (pods).".format(list_loading_pods) # fix loading if not request_node_loading is None: experiment.patch_loading(patch=""" diff --git a/ycsb.py b/ycsb.py index 9b3e4c293..1f4840407 100644 --- a/ycsb.py +++ b/ycsb.py @@ -227,7 +227,7 @@ experiment.workload['info'] = experiment.workload['info']+" YCSB data is loaded using several processes." if len(args.dbms): # import is limited to single DBMS - experiment.workload['info'] = experiment.workload['info']+" Benchmark is limited to DBMS {}.".format(args.dbms) + experiment.workload['info'] = experiment.workload['info']+" Benchmark is limited to DBMS {}.".format(", ".join(args.dbms)) # fix loading if not request_node_loading is None: experiment.patch_loading(patch=""" From 5403dafdf8cd3aa451370cb73e2b69edfc32861a Mon Sep 17 00:00:00 2001 From: perdelt Date: Thu, 20 Jun 2024 10:21:50 +0200 Subject: [PATCH 108/121] TPC-H: More helpful infos per workload in results --- tpch.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tpch.py b/tpch.py index 4e0b8dc84..5c8f9086d 100644 --- a/tpch.py +++ b/tpch.py @@ -232,6 +232,18 @@ experiment.loading_active = True experiment.use_distributed_datasource = True experiment.set_experiment(script='Schema') + # note more infos about experiment in workload description + experiment.workload['info'] = experiment.workload['info']+" TPC-H (SF={}) data is loaded and benchmark is executed.".format(SF) + if request_storage_type is not None: + experiment.workload['info'] = experiment.workload['info']+" Database is persistent on a volume of type {}.".format(request_storage_type) + if shuffle_queries: + experiment.workload['info'] = experiment.workload['info']+" Query ordering is as required by the TPC." + else: + experiment.workload['info'] = experiment.workload['info']+" Query ordering is Q1 - Q22." + if recreate_parameter: + experiment.workload['info'] = experiment.workload['info']+" All instances use different query parameters." + else: + experiment.workload['info'] = experiment.workload['info']+" All instances use the same query parameters." # optionally set some indexes and constraints after import if init_indexes or init_constraints or init_statistics: experiment.set_experiment(indexing='Index') @@ -243,8 +255,6 @@ experiment.set_experiment(indexing='Index_and_Constraints_and_Statistics') experiment.workload['info'] = experiment.workload['info']+" Import sets indexes and constraints after loading and recomputes statistics." #experiment.set_experiment(script='Schema', indexing='Index') - # note more infos about experiment in workload description - experiment.workload['info'] = experiment.workload['info']+" TPC-H data is loaded from a filesystem using several processes." if len(limit_import_table): # import is limited to single table experiment.workload['info'] = experiment.workload['info']+" Import is limited to table {}.".format(limit_import_table) From b65c38b14b2bccb08aeadf5ba5f2c1d867a42f29 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 20 Jun 2024 11:59:01 +0200 Subject: [PATCH 109/121] Test: We need urllib3, because of security warnings --- TPCTC23/experiment-1-ycsb.py | 5 ++--- TPCTC23/experiment-2-hammerdb.py | 5 ++--- TPCTC23/experiment-3-benchbase.py | 5 ++--- TPCTC23/experiment-4-1-tpch-generating-filesystem.py | 4 +--- TPCTC23/experiment-4-2-tpch-loading-filesystem.py | 6 ++---- TPCTC23/experiment-4-3-tpch-benchmarking.py | 6 ++---- bexhoma/experiments.py | 4 ++-- bexhoma/scripts/experimentsmanager.py | 4 ++-- bexhoma/scripts/tpcds.py | 4 ++-- bexhoma/scripts/tpch.py | 4 ++-- cluster.py | 4 ++-- example.py | 6 ++---- requirements.txt | 2 +- simple_tpch.py | 4 ++-- tpch.py | 6 ++---- ycsb.py | 5 ++--- 16 files changed, 30 insertions(+), 44 deletions(-) diff --git a/TPCTC23/experiment-1-ycsb.py b/TPCTC23/experiment-1-ycsb.py index 0feb99c62..8ad6240bc 100644 --- a/TPCTC23/experiment-1-ycsb.py +++ b/TPCTC23/experiment-1-ycsb.py @@ -5,9 +5,8 @@ """ from bexhoma import * from dbmsbenchmarker import * -#import experiments import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -15,7 +14,7 @@ import datetime -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-2-hammerdb.py b/TPCTC23/experiment-2-hammerdb.py index cfe55a140..4190f91cf 100644 --- a/TPCTC23/experiment-2-hammerdb.py +++ b/TPCTC23/experiment-2-hammerdb.py @@ -9,9 +9,8 @@ """ from bexhoma import * from dbmsbenchmarker import * -#import experiments import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -19,7 +18,7 @@ import datetime -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-3-benchbase.py b/TPCTC23/experiment-3-benchbase.py index 21f728aaf..c09b37daa 100644 --- a/TPCTC23/experiment-3-benchbase.py +++ b/TPCTC23/experiment-3-benchbase.py @@ -9,9 +9,8 @@ """ from bexhoma import * from dbmsbenchmarker import * -#import experiments import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -19,7 +18,7 @@ import datetime -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-4-1-tpch-generating-filesystem.py b/TPCTC23/experiment-4-1-tpch-generating-filesystem.py index 0703bae74..4ae91de48 100644 --- a/TPCTC23/experiment-4-1-tpch-generating-filesystem.py +++ b/TPCTC23/experiment-4-1-tpch-generating-filesystem.py @@ -28,14 +28,12 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time from timeit import default_timer import datetime -# queue -#import redis import subprocess import psutil diff --git a/TPCTC23/experiment-4-2-tpch-loading-filesystem.py b/TPCTC23/experiment-4-2-tpch-loading-filesystem.py index dc6185a8c..27febf626 100644 --- a/TPCTC23/experiment-4-2-tpch-loading-filesystem.py +++ b/TPCTC23/experiment-4-2-tpch-loading-filesystem.py @@ -34,18 +34,16 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time from timeit import default_timer import datetime -# queue -#import redis import subprocess import psutil -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/TPCTC23/experiment-4-3-tpch-benchmarking.py b/TPCTC23/experiment-4-3-tpch-benchmarking.py index 043d3a65a..b862c338e 100644 --- a/TPCTC23/experiment-4-3-tpch-benchmarking.py +++ b/TPCTC23/experiment-4-3-tpch-benchmarking.py @@ -34,18 +34,16 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time from timeit import default_timer import datetime -# queue -import redis import subprocess import psutil -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index fcf665485..ae50c443c 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -30,7 +30,7 @@ """ from dbmsbenchmarker import parameter, tools, inspector import logging -#import urllib3 +import urllib3 import gc import shutil # for zipping from os import makedirs, path @@ -46,7 +46,7 @@ from bexhoma import evaluators -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) diff --git a/bexhoma/scripts/experimentsmanager.py b/bexhoma/scripts/experimentsmanager.py index 86fd7c3a2..ee12fcb31 100644 --- a/bexhoma/scripts/experimentsmanager.py +++ b/bexhoma/scripts/experimentsmanager.py @@ -19,7 +19,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -28,7 +28,7 @@ from datetime import datetime from prettytable import PrettyTable, ALL -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) diff --git a/bexhoma/scripts/tpcds.py b/bexhoma/scripts/tpcds.py index 39870281b..8c925479a 100644 --- a/bexhoma/scripts/tpcds.py +++ b/bexhoma/scripts/tpcds.py @@ -13,7 +13,7 @@ from dbmsbenchmarker import * #import experiments import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -21,7 +21,7 @@ import datetime -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) def do_benchmark(): diff --git a/bexhoma/scripts/tpch.py b/bexhoma/scripts/tpch.py index 4ae14b69f..44eb213f5 100644 --- a/bexhoma/scripts/tpch.py +++ b/bexhoma/scripts/tpch.py @@ -12,7 +12,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -20,7 +20,7 @@ import datetime -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) def do_benchmark(): diff --git a/cluster.py b/cluster.py index 9bda4d759..69a23b93a 100644 --- a/cluster.py +++ b/cluster.py @@ -19,7 +19,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -29,7 +29,7 @@ import multiprocessing as mp from prettytable import PrettyTable, ALL -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) diff --git a/example.py b/example.py index 7125828dc..c7c71989d 100644 --- a/example.py +++ b/example.py @@ -8,18 +8,16 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time from timeit import default_timer import datetime -# queue -import redis import subprocess import psutil -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/requirements.txt b/requirements.txt index f822ee5fe..6a5e71984 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -#urllib3>=2.2.2 +urllib3>=2.2.2 kubernetes==22.6.0 psutil>=5.6.1 dbmsbenchmarker>=0.13.6 diff --git a/simple_tpch.py b/simple_tpch.py index 5c13fae40..7a38c7885 100644 --- a/simple_tpch.py +++ b/simple_tpch.py @@ -12,7 +12,7 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -20,7 +20,7 @@ import datetime -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/tpch.py b/tpch.py index 5c8f9086d..9bb6600c5 100644 --- a/tpch.py +++ b/tpch.py @@ -17,18 +17,16 @@ from bexhoma import * from dbmsbenchmarker import * import logging -#import urllib3 +import urllib3 import logging import argparse import time from timeit import default_timer import datetime -# queue -#import redis import subprocess import psutil -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': diff --git a/ycsb.py b/ycsb.py index 1f4840407..f73923a59 100644 --- a/ycsb.py +++ b/ycsb.py @@ -5,9 +5,8 @@ """ from bexhoma import * from dbmsbenchmarker import * -#import experiments import logging -#import urllib3 +import urllib3 import logging import argparse import time @@ -15,7 +14,7 @@ import datetime import pandas as pd -#urllib3.disable_warnings() +urllib3.disable_warnings() logging.basicConfig(level=logging.ERROR) if __name__ == '__main__': From ccbb9d59ced4c719b40e0cd1608c540cb8e90e2a Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 20 Jun 2024 14:01:47 +0200 Subject: [PATCH 110/121] Docs: Improved output --- tpch.py | 3 ++- ycsb.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tpch.py b/tpch.py index 9bb6600c5..86a925bce 100644 --- a/tpch.py +++ b/tpch.py @@ -35,7 +35,7 @@ parser = argparse.ArgumentParser(description=description) parser.add_argument('mode', help='profile the import or run the TPC-H queries', choices=['profiling', 'run', 'start', 'load', 'empty', 'summary']) parser.add_argument('-aws', '--aws', help='fix components to node groups at AWS', action='store_true', default=False) - parser.add_argument('-dbms','--dbms', help='DBMS', choices=['PostgreSQL', 'MonetDB', 'MySQL'], default=[], action='append') + parser.add_argument('-dbms','--dbms', help='DBMS', choices=['PostgreSQL', 'MonetDB', 'MySQL', 'MariaDB'], default=[], action='append') parser.add_argument('-lit', '--limit-import-table', help='limit import to one table, name of this table', default='') parser.add_argument('-db', '--debug', help='dump debug informations', action='store_true') parser.add_argument('-cx', '--context', help='context of Kubernetes (for a multi cluster environment), default is current context', default=None) @@ -437,6 +437,7 @@ # total time of experiment start = default_timer() start_datetime = str(datetime.datetime.now()) + print("{:30s}: has code {}".format("Experiment",experiment.code)) print("{:30s}: starts at {} ({})".format("Experiment",start_datetime, start)) # run workflow experiment.work_benchmark_list() diff --git a/ycsb.py b/ycsb.py index f73923a59..29583ee8d 100644 --- a/ycsb.py +++ b/ycsb.py @@ -432,6 +432,7 @@ start = default_timer() start_datetime = str(datetime.datetime.now()) #print("Experiment starts at {} ({})".format(start_datetime, start)) + print("{:30s}: has code {}".format("Experiment",experiment.code)) print("{:30s}: starts at {} ({})".format("Experiment",start_datetime, start)) # run workflow experiment.work_benchmark_list() From 8480a1448ccfd6f7e58545fc5038aa828121f750 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 20 Jun 2024 14:28:36 +0200 Subject: [PATCH 111/121] Bexhoma: Bugfix cluster monitoring exists --- bexhoma/configurations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index d8a4a215f..b31322211 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -2151,7 +2151,7 @@ def run_benchmarker_pod(self, # get metrics of loader components # only if general monitoring is on endpoints_cluster = self.experiment.cluster.get_service_endpoints(service_name="bexhoma-service-monitoring-default") - if len(endpoints_cluster)>0 or self.cluster.monitor_cluster_exists: + if len(endpoints_cluster)>0 or self.experiment.cluster.monitor_cluster_exists: # data generator container print("{:30s}: collecting metrics of data generator".format(connection)) cmd['fetch_loader_metrics'] = 'python metrics.py -r /results/ -db -ct datagenerator -cn datagenerator -c {} -cf {} -f {} -e {} -ts {} -te {}'.format( From f79c4c182caaf525ef2872c7ccefc30193903fb0 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 21 Jun 2024 12:23:49 +0200 Subject: [PATCH 112/121] Bexhoma: Bugfix cluster monitoring --- .gitignore | 1 + bexhoma/clusters.py | 2 +- bexhoma/configurations.py | 2 +- docs/Example-TPC-H.md | 27 ++++++++++++++++++++++----- tpch.py | 10 ++++++---- 5 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index b4dd98d6a..d8ed0a3d5 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ dist/* docs/html/* api/* bexhoma/__pycache__/* +/cluster-monitoring-default.config diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index f5a4ffd29..ef2d0feaa 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -1321,7 +1321,7 @@ def test_if_monitoring_healthy(self): self.logger.debug('testbed.test_if_monitoring_healthy()') config_K8s = self.config['credentials']['k8s'] if 'service_monitoring' in config_K8s['monitor']: - url = config_K8s['monitor']['service_monitoring'].format(namespace=self.contextdata['namespace']) + url = config_K8s['monitor']['service_monitoring'].format(namespace=self.contextdata['namespace'], service="monitoring") query = "node_memory_MemTotal_bytes" safe_query = urllib.parse.quote_plus(query) try: diff --git a/bexhoma/configurations.py b/bexhoma/configurations.py index b31322211..f0b57a445 100644 --- a/bexhoma/configurations.py +++ b/bexhoma/configurations.py @@ -729,7 +729,7 @@ def start_monitoring(self, app='', component='monitoring', experiment='', config :param experiment: Unique identifier of the experiment :param configuration: Name of the dbms configuration """ - if not self.experiment.monitoring_active or self.experiment.cluster.monitor_cluster_exists: + if not self.experiment.monitoring_active or (self.experiment.cluster.monitor_cluster_active and self.experiment.cluster.monitor_cluster_exists): return if len(app) == 0: app = self.appname diff --git a/docs/Example-TPC-H.md b/docs/Example-TPC-H.md index c889314e3..3dae08e5f 100644 --- a/docs/Example-TPC-H.md +++ b/docs/Example-TPC-H.md @@ -415,11 +415,28 @@ The first instance of PostgreSQL mounts the volume and generates the data. All other instances just use the database without generating and loading data. ``` -+-----------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+ -| Volumes | configuration | experiment | loaded [s] | timeLoading [s] | dbms | storage_class_name | storage | status | -+===================================+=================+==============+==============+===================+============+======================+===========+==========+ -| bexhoma-storage-postgresql-tpch-1 | postgresql | tpch-1 | True | 185.41 | PostgreSQL | local-hdd | 50Gi | Bound | -+-----------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+ ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| Volumes | configuration | experiment | loaded [s] | timeLoading [s] | dbms | storage_class_name | storage | status | size | used | ++====================================+=================+==============+==============+===================+============+======================+===========+==========+========+========+ +| bexhoma-storage-monetdb-tpch-10 | monetdb | tpch-10 | True | 576 | MonetDB | shared | 100Gi | Bound | 100G | 21G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| bexhoma-storage-monetdb-tpch-100 | monetdb | tpch-100 | True | 7061 | MonetDB | shared | 300Gi | Bound | 300G | 210G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| bexhoma-storage-monetdb-tpch-3 | monetdb | tpch-3 | True | 215 | MonetDB | shared | 100Gi | Bound | 100G | 6.2G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| bexhoma-storage-monetdb-tpch-30 | monetdb | tpch-30 | True | 1734 | MonetDB | shared | 150Gi | Bound | 150G | 63G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| bexhoma-storage-mysql-tpch-1 | mysql | tpch-1 | True | 2178 | MySQL | shared | 30Gi | Bound | 30G | 11G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| bexhoma-storage-mysql-tpch-10 | mysql | tpch-10 | True | 33932 | MySQL | shared | 150Gi | Bound | 150G | 36G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| bexhoma-storage-postgresql-tpch-1 | postgresql | tpch-1 | True | 148 | PostgreSQL | shared | 100Gi | Bound | 100G | 2.7G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| bexhoma-storage-postgresql-tpch-10 | postgresql | tpch-10 | True | 2581 | PostgreSQL | shared | 100Gi | Bound | 100G | 26G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| bexhoma-storage-postgresql-tpch-30 | postgresql | tpch-30 | True | 10073 | PostgreSQL | shared | 150Gi | Bound | 150G | 76G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ + +------------------+--------------+--------------+---------------+ | 1707740320 | sut | loaded [s] | benchmarker | +==================+==============+==============+===============+ diff --git a/tpch.py b/tpch.py index 86a925bce..0fe7d893a 100644 --- a/tpch.py +++ b/tpch.py @@ -245,13 +245,14 @@ # optionally set some indexes and constraints after import if init_indexes or init_constraints or init_statistics: experiment.set_experiment(indexing='Index') - experiment.workload['info'] = experiment.workload['info']+" Import sets indexes after loading." + init_scripts = " Import sets indexes after loading." if init_constraints: experiment.set_experiment(indexing='Index_and_Constraints') - experiment.workload['info'] = experiment.workload['info']+" Import sets indexes and constraints after loading." + init_scripts = " Import sets indexes and constraints after loading." if init_statistics: experiment.set_experiment(indexing='Index_and_Constraints_and_Statistics') - experiment.workload['info'] = experiment.workload['info']+" Import sets indexes and constraints after loading and recomputes statistics." + init_scripts = " Import sets indexes and constraints after loading and recomputes statistics." + experiment.workload['info'] = experiment.workload['info']+init_scripts #experiment.set_experiment(script='Schema', indexing='Index') if len(limit_import_table): # import is limited to single table @@ -261,7 +262,7 @@ experiment.workload['info'] = experiment.workload['info']+" Benchmark is limited to DBMS {}.".format(", ".join(args.dbms)) if len(list_loading_pods): # import uses several processes in pods - experiment.workload['info'] = experiment.workload['info']+" Import is handled by {} processes (pods).".format(list_loading_pods) + experiment.workload['info'] = experiment.workload['info']+" Import is handled by {} processes (pods).".format(" and ".join(map(str, list_loading_pods))) # fix loading if not request_node_loading is None: experiment.patch_loading(patch=""" @@ -439,6 +440,7 @@ start_datetime = str(datetime.datetime.now()) print("{:30s}: has code {}".format("Experiment",experiment.code)) print("{:30s}: starts at {} ({})".format("Experiment",start_datetime, start)) + print("{:30s}: {}".format("Experiment",experiment.workload['info'])) # run workflow experiment.work_benchmark_list() # total time of experiment From ad2efbbb49eae1c8a03ec7b7f43870b0cb56a9f2 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Fri, 21 Jun 2024 17:18:20 +0200 Subject: [PATCH 113/121] Bexhoma: Bugfix missing dashboard --- bexhoma/clusters.py | 4 +++- bexhoma/scripts/experimentsmanager.py | 15 +++++++++------ cluster.py | 23 +++++++++++++---------- docs/DBMS.md | 4 ++-- docs/Example-YCSB.md | 14 +++++++------- 5 files changed, 34 insertions(+), 26 deletions(-) diff --git a/bexhoma/clusters.py b/bexhoma/clusters.py index ef2d0feaa..c7eb7cde0 100644 --- a/bexhoma/clusters.py +++ b/bexhoma/clusters.py @@ -849,7 +849,9 @@ def execute_command_in_pod(self, command, pod='', container='', params=''): :return: stdout of the shell command """ if len(pod) == 0: - pod = self.activepod + self.logger.debug('testbed.execute_command_in_pod({}): empty pod name given for command'.format(command)) + return "", "", "" + #pod = self.activepod command_clean = command.replace('"','\\"') if len(container) > 0: fullcommand = 'kubectl --context {context} exec {pod} --container={container} -- bash -c "{command}"'.format(context=self.context, pod=pod, container=container, command=command_clean) diff --git a/bexhoma/scripts/experimentsmanager.py b/bexhoma/scripts/experimentsmanager.py index ee12fcb31..13d42b4bb 100644 --- a/bexhoma/scripts/experimentsmanager.py +++ b/bexhoma/scripts/experimentsmanager.py @@ -128,6 +128,15 @@ def manage(): if len(dashboard_name) > 0: status = cluster.get_pod_status(dashboard_name) print("Dashboard: {}".format(status)) + # get cluster monitoring Prometheus + monitoring_running = cluster.test_if_monitoring_healthy() + if monitoring_running: + print("Cluster Prometheus: {}".format("Running")) + else: + print("Cluster Prometheus: {}".format("Not running")) + else: + print("Dashboard: {}".format("Not running")) + print("Cluster Prometheus: {}".format("Unknown")) # check message queue messagequeue_name = cluster.get_pods(component='messagequeue') if len(messagequeue_name) > 0: @@ -145,12 +154,6 @@ def manage(): print("Result directory: {}".format("Running")) else: print("Result directory: {}".format("Missing")) - # get cluster monitoring Prometheus - monitoring_running = cluster.test_if_monitoring_healthy() - if monitoring_running: - print("Cluster Prometheus: {}".format("Running")) - else: - print("Cluster Prometheus: {}".format("Not running")) # get all storage volumes pvcs = cluster.get_pvc(app=app, component='storage', experiment='', configuration='') #print("PVCs", pvcs) diff --git a/cluster.py b/cluster.py index 69a23b93a..0cf1f11f2 100644 --- a/cluster.py +++ b/cluster.py @@ -128,6 +128,15 @@ if len(dashboard_name) > 0: status = cluster.get_pod_status(dashboard_name) print("Dashboard: {}".format(status)) + # get cluster monitoring Prometheus + monitoring_running = cluster.test_if_monitoring_healthy() + if monitoring_running: + print("Cluster Prometheus: {}".format("Running")) + else: + print("Cluster Prometheus: {}".format("Not running")) + else: + print("Dashboard: {}".format("Not running")) + print("Cluster Prometheus: {}".format("Unknown")) # check message queue messagequeue_name = cluster.get_pods(component='messagequeue') if len(messagequeue_name) > 0: @@ -136,21 +145,15 @@ # get data directory pvcs = cluster.get_pvc(app=app, component='data-source', experiment='', configuration='') if len(pvcs) > 0: - print("Data Directory: {}".format("Running")) + print("Data directory: {}".format("Running")) else: - print("Data Directory: {}".format("Missing")) + print("Data directory: {}".format("Missing")) # get result directory pvcs = cluster.get_pvc(app=app, component='results', experiment='', configuration='') if len(pvcs) > 0: - print("Result Directory: {}".format("Running")) - else: - print("Result Directory: {}".format("Missing")) - # get cluster monitoring Prometheus - monitoring_running = cluster.test_if_monitoring_healthy() - if monitoring_running: - print("Cluster Prometheus: {}".format("Running")) + print("Result directory: {}".format("Running")) else: - print("Cluster Prometheus: {}".format("Not running")) + print("Result directory: {}".format("Missing")) # get all storage volumes pvcs = cluster.get_pvc(app=app, component='storage', experiment='', configuration='') #print("PVCs", pvcs) diff --git a/docs/DBMS.md b/docs/DBMS.md index 2c0de0401..40f0e1afd 100644 --- a/docs/DBMS.md +++ b/docs/DBMS.md @@ -120,7 +120,7 @@ as default settings. ``` 'MariaDB': { - 'loadData': 'mysql < {scriptname}', + 'loadData': 'mariadb < {scriptname}', 'template': { 'version': 'v10.4.6', 'alias': 'GP A', @@ -130,7 +130,7 @@ as default settings. 'driver': "org.mariadb.jdbc.Driver", 'auth': ["root", ""], 'url': 'jdbc:mysql://{serverip}:9091/{dbname}', - 'jar': './mariadb-java-client-2.3.0.jar' + 'jar': './mariadb-java-client-3.1.0.jar' } }, 'logfile': '', diff --git a/docs/Example-YCSB.md b/docs/Example-YCSB.md index 726536cbf..2ee1bb59b 100644 --- a/docs/Example-YCSB.md +++ b/docs/Example-YCSB.md @@ -311,13 +311,13 @@ The first instance of MySQL mounts the volume and generates the data. All other instances just use the database without generating and loading data. ``` -+-----------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+ -| Volumes | configuration | experiment | loaded [s] | timeLoading [s] | dbms | storage_class_name | storage | status | -+===================================+=================+==============+==============+===================+============+======================+===========+==========+ -| bexhoma-storage-mysql-ycsb-1 | mysql | ycsb-1 | True | 2398.11 | MySQL | local-hdd | 50Gi | Bound | -+-----------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+ -| bexhoma-storage-postgresql-ycsb-1 | postgresql | ycsb-1 | True | 61.82 | PostgreSQL | local-hdd | 50Gi | Bound | -+-----------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+ ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ +| Volumes | configuration | experiment | loaded [s] | timeLoading [s] | dbms | storage_class_name | storage | status | size | used | ++====================================+=================+==============+==============+===================+============+======================+===========+==========+========+========+ +| bexhoma-storage-postgresql-ycsb-1 | postgresql | ycsb-1 | True | 64 | PostgreSQL | shared | 50Gi | Bound | 50G | 2.1G | ++------------------------------------+-----------------+--------------+--------------+-------------------+------------+----------------------+-----------+----------+--------+--------+ ++------------------+--------------+--------------+--------------------------+ + +------------------+--------------+--------------+--------------+---------------+ | 1706957093 | sut | loaded [s] | monitoring | benchmarker | +==================+==============+==============+==============+===============+ From 1b65a61e38d65a392ee3d2e0f0f152a98da9c896 Mon Sep 17 00:00:00 2001 From: perdelt Date: Sun, 23 Jun 2024 18:15:14 +0200 Subject: [PATCH 114/121] MySQL: Default to mysql:8.4.0 --- docs/DBMS.md | 2 +- k8s/deploymenttemplate-MySQL.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/DBMS.md b/docs/DBMS.md index 2c0de0401..ac79314cd 100644 --- a/docs/DBMS.md +++ b/docs/DBMS.md @@ -296,7 +296,7 @@ As of bexhoma version `v0.7.0` this contains "--innodb-change-buffer-max-size=50", # You might increase this value for a MySQL server with heavy insert, update, and delete activity ] ``` -as default settings. +as default settings. It also runs MySQL 8.4.0 as default. Please visit the official website for explanations about settings, https://dev.mysql.com/doc/refman/8.4/en/mysql-nutshell.html ### Configuration diff --git a/k8s/deploymenttemplate-MySQL.yml b/k8s/deploymenttemplate-MySQL.yml index c50d37651..a6cf4d94e 100644 --- a/k8s/deploymenttemplate-MySQL.yml +++ b/k8s/deploymenttemplate-MySQL.yml @@ -44,7 +44,8 @@ spec: # effect: "NoSchedule" containers: - name: dbms - image: mysql:8.0.36 # latest bug fixes + image: mysql:8.4.0 # latest image, default InnoDB settigns have changed + #image: mysql:8.0.36 # latest bug fixes #image: mysql:8.1.0 # no docs #image: mysql:8.2.0 # no docs #image: mysql:8.3.0 # current, but slow import (?) From df1c30d936326c7d304007828529355cf3df5501 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Mon, 24 Jun 2024 10:49:26 +0200 Subject: [PATCH 115/121] MariaDB: Current version --- k8s/deploymenttemplate-MariaDB.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/deploymenttemplate-MariaDB.yml b/k8s/deploymenttemplate-MariaDB.yml index d52256193..2e7aa091e 100644 --- a/k8s/deploymenttemplate-MariaDB.yml +++ b/k8s/deploymenttemplate-MariaDB.yml @@ -44,7 +44,7 @@ spec: # effect: "NoSchedule" containers: - name: dbms - image: mariadb:11.2.3 + image: mariadb:11.4.2 #image: mariadb:10.5.8 #args: ["--innodb_log_buffer_size", "17179869184", "--innodb-write-io-threads", "16", "--innodb-log-file-size", "4294967296", "--LimitMEMLOCK", "16M"] args: ["--innodb_log_buffer_size", "17179869184", "--innodb-write-io-threads", "16", "--innodb-log-file-size", "4294967296"] From 9fe8f47eaa0fefa22c668ccf44fef3c124a44997 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Tue, 25 Jun 2024 09:32:28 +0200 Subject: [PATCH 116/121] MariaDB: Removed some MySQL settings --- k8s/deploymenttemplate-MariaDB.yml | 38 +++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/k8s/deploymenttemplate-MariaDB.yml b/k8s/deploymenttemplate-MariaDB.yml index 2e7aa091e..7fd6a91ea 100644 --- a/k8s/deploymenttemplate-MariaDB.yml +++ b/k8s/deploymenttemplate-MariaDB.yml @@ -47,7 +47,43 @@ spec: image: mariadb:11.4.2 #image: mariadb:10.5.8 #args: ["--innodb_log_buffer_size", "17179869184", "--innodb-write-io-threads", "16", "--innodb-log-file-size", "4294967296", "--LimitMEMLOCK", "16M"] - args: ["--innodb_log_buffer_size", "17179869184", "--innodb-write-io-threads", "16", "--innodb-log-file-size", "4294967296"] + #args: ["--innodb_log_buffer_size", "17179869184", "--innodb-write-io-threads", "16", "--innodb-log-file-size", "4294967296"] + args: [ + # Some of these need restart + # The comments come from MySQL 8.3 docs + # https://dev.mysql.com/doc/refman/8.3/en/optimizing-innodb-logging.html + # https://dev.mysql.com/doc/refman/8.3/en/innodb-performance-multiple_io_threads.html + "--innodb-write-io-threads=64", # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_write_io_threads + "--innodb-read-io-threads=64", # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_read_io_threads + # https://dev.mysql.com/doc/refman/8.3/en/innodb-linux-native-aio.html + "--innodb-use-native-aio=0", # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_use_native_aio + # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_page_size + # "--innodb-page-size=4K", # Small for OLTP or similar to filesystem page size + # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_buffer_pool_chunk_size + # To avoid potential performance issues, the number of chunks (innodb_buffer_pool_size / innodb_buffer_pool_chunk_size) should not exceed 1000. + "--innodb-buffer-pool-chunk-size=500M", # Small when size of pool changes often + # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_buffer_pool_instances + # https://releem.com/docs/mysql-performance-tuning/innodb_buffer_pool_size + ##"--innodb-buffer-pool-instances=64", # Parallelizes reads, but may lock writes + "--innodb-buffer-pool-size=32G", # Buffer pool size must always be equal to or a multiple of innodb_buffer_pool_chunk_size * innodb_buffer_pool_instances. + # https://dev.mysql.com/doc/refman/8.3/en/innodb-configuring-io-capacity.html + "--innodb-io-capacity=1000", # Faster SSD assumed + # https://dev.mysql.com/doc/refman/8.0/en/innodb-redo-log-buffer.html + "--innodb-log-buffer-size=32G", # The size in bytes of the buffer that InnoDB uses to write to the log files on disk + ##"--innodb-redo-log-capacity=8G", # Defines the amount of disk space occupied by redo log files + "--innodb-flush-log-at-trx-commit=0", # The default setting of 1 is required for full ACID compliance. With a setting of 0, logs are written and flushed to disk once per second. + # https://dev.mysql.com/doc/refman/8.3/en/online-ddl-parallel-thread-configuration.html + ##"--innodb-parallel-read-threads=64", # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_parallel_read_threads + ##"--innodb-ddl-threads=64", # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_ddl_threads + ##"--innodb-ddl-buffer-size=128M", # https://dev.mysql.com/doc/refman/8.3/en/innodb-parameters.html#sysvar_innodb_ddl_buffer_size + # https://dev.mysql.com/doc/refman/8.3/en/server-system-variables.html#sysvar_tmp_table_size + "--tmp-table-size=1GB", # Defines the maximum size of internal in-memory temporary tables + "--max-heap-table-size=1GB", # Maximum size to which user-created MEMORY tables are permitted to grow + # https://dev.mysql.com/doc/refman/8.3/en/innodb-doublewrite-buffer.html + "--innodb-doublewrite=0", + ##"--innodb-change-buffer-max-size=50", # You might increase this value for a MySQL server with heavy insert, update, and delete activity + "--innodb_log_buffer_size=4294967295", # MariaDB max value https://mariadb.com/kb/en/innodb-system-variables/#innodb_log_buffer_size + ] env: - {name: MYSQL_ALLOW_EMPTY_PASSWORD, value: 'yes'} ports: From 355c1a19bde6adc546167c13ec7864fce0ebf3b8 Mon Sep 17 00:00:00 2001 From: perdelt Date: Wed, 26 Jun 2024 08:23:50 +0200 Subject: [PATCH 117/121] Docs: Improved output --- bexhoma/experiments.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bexhoma/experiments.py b/bexhoma/experiments.py index fcf665485..9feffc1f5 100644 --- a/bexhoma/experiments.py +++ b/bexhoma/experiments.py @@ -1240,10 +1240,10 @@ def show_summary(self): evaluate = inspector.inspector(resultfolder) evaluate.load_experiment(code=code, silent=True) ##################### - print("\n### Errors") + print("\n### Errors (failed queries)") print(evaluate.get_total_errors().T) ##################### - print("\n### Warnings") + print("\n### Warnings (result mismatch)") print(evaluate.get_total_warnings().T) ##################### print("\n### Latency of Timer Execution [ms]") From 9dea4f557260028caab5215cb98a056c5bf6f2f6 Mon Sep 17 00:00:00 2001 From: perdelt Date: Mon, 1 Jul 2024 20:16:24 +0200 Subject: [PATCH 118/121] DBMSBenchmarker: Dev channel --- build.sh | 2 ++ images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py | 2 +- images/evaluator_dbmsbenchmarker/create_Dockerfiles.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index bff8eefa1..09a2c24b3 100644 --- a/build.sh +++ b/build.sh @@ -8,6 +8,7 @@ cd evaluator_dbmsbenchmarker python create_Dockerfiles.py #docker build -f Dockerfile_v0.13.6 -t bexhoma/evaluator_dbmsbenchmarker:v0.13.6 --no-cache . #docker build -f Dockerfile_v0.13.6 -t bexhoma/evaluator_dbmsbenchmarker:v0.13.6 . +docker push bexhoma/evaluator_dbmsbenchmarker:dev & docker push bexhoma/evaluator_dbmsbenchmarker:v0.13.7 & cd .. @@ -15,6 +16,7 @@ cd benchmarker_dbmsbenchmarker python create_Dockerfiles.py #docker build -f Dockerfile_v0.13.6 -t bexhoma/benchmarker_dbmsbenchmarker:v0.13.6 --no-cache . #docker build -f Dockerfile_v0.13.6 -t bexhoma/benchmarker_dbmsbenchmarker:v0.13.6 . +docker push bexhoma/benchmarker_dbmsbenchmarker:dev & docker push bexhoma/benchmarker_dbmsbenchmarker:v0.13.7 & cd .. diff --git a/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py b/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py index bdca4be93..40a24a94d 100644 --- a/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py +++ b/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py @@ -1,7 +1,7 @@ import subprocess #versions = ['v0.12.1','v0.12.2','v0.12.3','v0.12.4','v0.12.5'] -versions = ['v0.13.7'] +versions = ['v0.13.7','dev'] with open('Dockerfile_template', 'r') as file: dockerfile = file.read() diff --git a/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py b/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py index aec78e48a..4d19754bc 100644 --- a/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py +++ b/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py @@ -1,7 +1,7 @@ import subprocess #versions = ['v0.12.1','v0.12.2','v0.12.3','v0.12.4','v0.12.5'] -versions = ['v0.13.7'] +versions = ['v0.13.7','dev'] with open('Dockerfile_template', 'r') as file: dockerfile = file.read() From be8393f7dfbf4ac87ea55606fbb19a887a433ab0 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Tue, 2 Jul 2024 15:40:26 +0200 Subject: [PATCH 119/121] DBMSBenchmarker: Dockerfiles v0.13.7 and dev --- .../Dockerfile_dev | 112 ++++++++++++++++++ .../Dockerfile_v0.13.7 | 112 ++++++++++++++++++ .../evaluator_dbmsbenchmarker/Dockerfile_dev | 44 +++++++ .../Dockerfile_v0.13.7 | 44 +++++++ 4 files changed, 312 insertions(+) create mode 100644 images/benchmarker_dbmsbenchmarker/Dockerfile_dev create mode 100644 images/benchmarker_dbmsbenchmarker/Dockerfile_v0.13.7 create mode 100644 images/evaluator_dbmsbenchmarker/Dockerfile_dev create mode 100644 images/evaluator_dbmsbenchmarker/Dockerfile_v0.13.7 diff --git a/images/benchmarker_dbmsbenchmarker/Dockerfile_dev b/images/benchmarker_dbmsbenchmarker/Dockerfile_dev new file mode 100644 index 000000000..490b6cdb0 --- /dev/null +++ b/images/benchmarker_dbmsbenchmarker/Dockerfile_dev @@ -0,0 +1,112 @@ +FROM python:3.11.7 + +# does not compile numpy correctly +# FROM python:3.13-rc-slim + +WORKDIR /usr/src/app + +ENV DBMSBENCHMARKER_SLEEP 30 +ENV DBMSBENCHMARKER_RECREATE_PARAMETER 0 +ENV DBMSBENCHMARKER_VERBOSE 0 +ENV DBMSBENCHMARKER_DEV 0 +ENV DBMSBENCHMARKER_NOW 0 +ENV DBMSBENCHMARKER_START 0 +ENV DBMSBENCHMARKER_SHUFFLE_QUERIES False + +RUN apt update +RUN apt install default-jre -y + +# only needed in slim releases +# RUN apt install git -y +# RUN apt install build-essential -y + +RUN pip uninstall dbmsbenchmarker -y +RUN JAVA_HOME=/usr/lib/jvm/java-1.8.0/ pip install --no-cache-dir --upgrade --force-reinstall git+https://github.com/Beuth-Erdelt/DBMS-Benchmarker@dev + +# we only need packages required by dbmsbenchmarker +#COPY requirements.txt ./ +#RUN pip install --no-cache-dir -r requirements.txt + +RUN git clone https://github.com/Beuth-Erdelt/DBMS-Benchmarker --branch dev + +WORKDIR /usr/src/app/DBMS-Benchmarker + +# RUN git pull + +#COPY . . + +RUN apt install nano -y + +RUN mkdir -p /results +RUN mkdir -p /results/$DBMSBENCHMARKER_CODE + + +RUN mkdir -p jars/ + +######### Specific version of PostgreSQL JDBC ######### +RUN wget https://jdbc.postgresql.org/download/postgresql-42.5.0.jar --no-check-certificate +RUN cp postgresql-42.5.0.jar jars/postgresql-42.5.0.jar + +######### Specific version of MySQL JDBC ######### +RUN wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-j-8.0.31.tar.gz +RUN tar -zxvf mysql-connector-j-8.0.31.tar.gz +RUN cp mysql-connector-j-8.0.31/mysql-connector-j-8.0.31.jar jars/mysql-connector-j-8.0.31.jar + +######### Specific version of MariaDB JDBC ######### +RUN wget https://dlm.mariadb.com/2678616/Connectors/java/connector-java-3.1.0/mariadb-java-client-3.1.0.jar +RUN cp mariadb-java-client-3.1.0.jar jars/mariadb-java-client-3.1.0.jar + +######### Specific version of MonetDB JDBC ######### +RUN wget https://www.monetdb.org/downloads/Java/archive/monetdb-jdbc-3.2.jre8.jar --no-check-certificate +RUN cp monetdb-jdbc-3.2.jre8.jar jars/monetdb-jdbc-3.2.jre8.jar + +######### Specific version of MonetDB JDBC ######### +RUN wget https://www.monetdb.org/downloads/Java/monetdb-jdbc-3.3.jre8.jar --no-check-certificate +RUN cp monetdb-jdbc-3.3.jre8.jar jars/monetdb-jdbc-3.3.jre8.jar + +######### Specific version of SingleStore JDBC ######### +RUN wget https://github.com/memsql/S2-JDBC-Connector/releases/download/v1.1.4/singlestore-jdbc-client-1.1.4.jar +RUN cp singlestore-jdbc-client-1.1.4.jar jars/singlestore-jdbc-client-1.1.4.jar + +######### Specific version of Kinetica JDBC ######### +RUN wget https://github.com/kineticadb/kinetica-client-jdbc/archive/refs/tags/v7.1.8.7.tar.gz +RUN tar -zxvf v7.1.8.7.tar.gz +RUN cp kinetica-client-jdbc-7.1.8.7/kinetica-jdbc-7.1.8.7-jar-with-dependencies.jar jars/kinetica-jdbc-7.1.8.7-jar-with-dependencies.jar + +######### Specific version of YugabyteDB JDBC ######### +RUN wget https://github.com/yugabyte/pgjdbc/releases/download/v42.3.5-yb-2/jdbc-yugabytedb-42.3.5-yb-2.jar +RUN cp jdbc-yugabytedb-42.3.5-yb-2.jar jars/jdbc-yugabytedb-42.3.5-yb-2.jar + + + +######### Redis Client - Download and compile ######### +RUN cd /tmp; wget http://download.redis.io/redis-stable.tar.gz; tar xvzf redis-stable.tar.gz; cd redis-stable; make; cp src/redis-cli /usr/local/bin/; chmod 755 /usr/local/bin/redis-cli + + +COPY ./benchmarker.sh ./benchmarker.sh +RUN ["chmod", "+x", "./benchmarker.sh"] + +CMD ["/bin/bash", "-c", "./benchmarker.sh"] + +#CMD git pull; python ./benchmark.py run -b -d -w connection \ +# -f /results/$DBMSBENCHMARKER_CODE \ +# -r /results/$DBMSBENCHMARKER_CODE \ +# -mps \ +# -cs -sf $DBMSBENCHMARKER_CONNECTION \ +# -ms $DBMSBENCHMARKER_CLIENT \ +# -sl $DBMSBENCHMARKER_SLEEP \ +# -st "$DBMSBENCHMARKER_START" \ +# -c "$DBMSBENCHMARKER_CONNECTION" \ +# -ca "$DBMSBENCHMARKER_ALIAS" \ +# -cf ${DBMSBENCHMARKER_CONNECTION}.config \ + +# -f config folder +# -r result folder +# -mps monitor per stream (not per query) +# -cs -sf subfolder per dbms (connection) +# -ms max number of subfolders +# -sl sleep seconds before start benchmarking +# -st start time for operating +# -c name of dbms (connection) to benchmark +# -ca alias for dbms (connection) to benchmark +# -cf config of dbms (connection) diff --git a/images/benchmarker_dbmsbenchmarker/Dockerfile_v0.13.7 b/images/benchmarker_dbmsbenchmarker/Dockerfile_v0.13.7 new file mode 100644 index 000000000..4e7223301 --- /dev/null +++ b/images/benchmarker_dbmsbenchmarker/Dockerfile_v0.13.7 @@ -0,0 +1,112 @@ +FROM python:3.11.7 + +# does not compile numpy correctly +# FROM python:3.13-rc-slim + +WORKDIR /usr/src/app + +ENV DBMSBENCHMARKER_SLEEP 30 +ENV DBMSBENCHMARKER_RECREATE_PARAMETER 0 +ENV DBMSBENCHMARKER_VERBOSE 0 +ENV DBMSBENCHMARKER_DEV 0 +ENV DBMSBENCHMARKER_NOW 0 +ENV DBMSBENCHMARKER_START 0 +ENV DBMSBENCHMARKER_SHUFFLE_QUERIES False + +RUN apt update +RUN apt install default-jre -y + +# only needed in slim releases +# RUN apt install git -y +# RUN apt install build-essential -y + +RUN pip uninstall dbmsbenchmarker -y +RUN JAVA_HOME=/usr/lib/jvm/java-1.8.0/ pip install --no-cache-dir --upgrade --force-reinstall git+https://github.com/Beuth-Erdelt/DBMS-Benchmarker@v0.13.7 + +# we only need packages required by dbmsbenchmarker +#COPY requirements.txt ./ +#RUN pip install --no-cache-dir -r requirements.txt + +RUN git clone https://github.com/Beuth-Erdelt/DBMS-Benchmarker --branch v0.13.7 + +WORKDIR /usr/src/app/DBMS-Benchmarker + +# RUN git pull + +#COPY . . + +RUN apt install nano -y + +RUN mkdir -p /results +RUN mkdir -p /results/$DBMSBENCHMARKER_CODE + + +RUN mkdir -p jars/ + +######### Specific version of PostgreSQL JDBC ######### +RUN wget https://jdbc.postgresql.org/download/postgresql-42.5.0.jar --no-check-certificate +RUN cp postgresql-42.5.0.jar jars/postgresql-42.5.0.jar + +######### Specific version of MySQL JDBC ######### +RUN wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-j-8.0.31.tar.gz +RUN tar -zxvf mysql-connector-j-8.0.31.tar.gz +RUN cp mysql-connector-j-8.0.31/mysql-connector-j-8.0.31.jar jars/mysql-connector-j-8.0.31.jar + +######### Specific version of MariaDB JDBC ######### +RUN wget https://dlm.mariadb.com/2678616/Connectors/java/connector-java-3.1.0/mariadb-java-client-3.1.0.jar +RUN cp mariadb-java-client-3.1.0.jar jars/mariadb-java-client-3.1.0.jar + +######### Specific version of MonetDB JDBC ######### +RUN wget https://www.monetdb.org/downloads/Java/archive/monetdb-jdbc-3.2.jre8.jar --no-check-certificate +RUN cp monetdb-jdbc-3.2.jre8.jar jars/monetdb-jdbc-3.2.jre8.jar + +######### Specific version of MonetDB JDBC ######### +RUN wget https://www.monetdb.org/downloads/Java/monetdb-jdbc-3.3.jre8.jar --no-check-certificate +RUN cp monetdb-jdbc-3.3.jre8.jar jars/monetdb-jdbc-3.3.jre8.jar + +######### Specific version of SingleStore JDBC ######### +RUN wget https://github.com/memsql/S2-JDBC-Connector/releases/download/v1.1.4/singlestore-jdbc-client-1.1.4.jar +RUN cp singlestore-jdbc-client-1.1.4.jar jars/singlestore-jdbc-client-1.1.4.jar + +######### Specific version of Kinetica JDBC ######### +RUN wget https://github.com/kineticadb/kinetica-client-jdbc/archive/refs/tags/v7.1.8.7.tar.gz +RUN tar -zxvf v7.1.8.7.tar.gz +RUN cp kinetica-client-jdbc-7.1.8.7/kinetica-jdbc-7.1.8.7-jar-with-dependencies.jar jars/kinetica-jdbc-7.1.8.7-jar-with-dependencies.jar + +######### Specific version of YugabyteDB JDBC ######### +RUN wget https://github.com/yugabyte/pgjdbc/releases/download/v42.3.5-yb-2/jdbc-yugabytedb-42.3.5-yb-2.jar +RUN cp jdbc-yugabytedb-42.3.5-yb-2.jar jars/jdbc-yugabytedb-42.3.5-yb-2.jar + + + +######### Redis Client - Download and compile ######### +RUN cd /tmp; wget http://download.redis.io/redis-stable.tar.gz; tar xvzf redis-stable.tar.gz; cd redis-stable; make; cp src/redis-cli /usr/local/bin/; chmod 755 /usr/local/bin/redis-cli + + +COPY ./benchmarker.sh ./benchmarker.sh +RUN ["chmod", "+x", "./benchmarker.sh"] + +CMD ["/bin/bash", "-c", "./benchmarker.sh"] + +#CMD git pull; python ./benchmark.py run -b -d -w connection \ +# -f /results/$DBMSBENCHMARKER_CODE \ +# -r /results/$DBMSBENCHMARKER_CODE \ +# -mps \ +# -cs -sf $DBMSBENCHMARKER_CONNECTION \ +# -ms $DBMSBENCHMARKER_CLIENT \ +# -sl $DBMSBENCHMARKER_SLEEP \ +# -st "$DBMSBENCHMARKER_START" \ +# -c "$DBMSBENCHMARKER_CONNECTION" \ +# -ca "$DBMSBENCHMARKER_ALIAS" \ +# -cf ${DBMSBENCHMARKER_CONNECTION}.config \ + +# -f config folder +# -r result folder +# -mps monitor per stream (not per query) +# -cs -sf subfolder per dbms (connection) +# -ms max number of subfolders +# -sl sleep seconds before start benchmarking +# -st start time for operating +# -c name of dbms (connection) to benchmark +# -ca alias for dbms (connection) to benchmark +# -cf config of dbms (connection) diff --git a/images/evaluator_dbmsbenchmarker/Dockerfile_dev b/images/evaluator_dbmsbenchmarker/Dockerfile_dev new file mode 100644 index 000000000..b115b4933 --- /dev/null +++ b/images/evaluator_dbmsbenchmarker/Dockerfile_dev @@ -0,0 +1,44 @@ +FROM python:3.11.7 + +# does not compile numpy correctly +# FROM python:3.13-rc-slim + +WORKDIR /usr/src/app + +RUN apt update +RUN apt install default-jre -y +RUN apt install zip -y +RUN apt install nano -y + +# only needed in slim releases +# RUN apt install git -y +# RUN apt install build-essential -y + +RUN mkdir /results + +SHELL ["/bin/bash", "-c"] + +ENV VIRTUAL_ENV=/opt/venv +RUN python3 -m pip install --user virtualenv +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + +RUN JAVA_HOME=/usr/lib/jvm/java-1.8.0/ pip install --no-cache-dir --upgrade --force-reinstall git+https://github.com/Beuth-Erdelt/DBMS-Benchmarker@dev + +RUN pip install jupyter +RUN pip install jupyter_contrib_nbextensions +#RUN jupyter contrib nbextension install --user +#RUN jupyter nbextensions_configurator enable --user +#RUN jupyter nbextension enable toc2/main + +RUN git clone https://github.com/Beuth-Erdelt/DBMS-Benchmarker --branch dev + +WORKDIR /usr/src/app/DBMS-Benchmarker + +RUN mkdir /usr/src/app/DBMS-Benchmarker/notebooks + +COPY ./notebooks /usr/src/app/DBMS-Benchmarker/notebooks + +# RUN git pull + +CMD git pull; python ./dashboard.py -r /results diff --git a/images/evaluator_dbmsbenchmarker/Dockerfile_v0.13.7 b/images/evaluator_dbmsbenchmarker/Dockerfile_v0.13.7 new file mode 100644 index 000000000..623d55e59 --- /dev/null +++ b/images/evaluator_dbmsbenchmarker/Dockerfile_v0.13.7 @@ -0,0 +1,44 @@ +FROM python:3.11.7 + +# does not compile numpy correctly +# FROM python:3.13-rc-slim + +WORKDIR /usr/src/app + +RUN apt update +RUN apt install default-jre -y +RUN apt install zip -y +RUN apt install nano -y + +# only needed in slim releases +# RUN apt install git -y +# RUN apt install build-essential -y + +RUN mkdir /results + +SHELL ["/bin/bash", "-c"] + +ENV VIRTUAL_ENV=/opt/venv +RUN python3 -m pip install --user virtualenv +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + +RUN JAVA_HOME=/usr/lib/jvm/java-1.8.0/ pip install --no-cache-dir --upgrade --force-reinstall git+https://github.com/Beuth-Erdelt/DBMS-Benchmarker@v0.13.7 + +RUN pip install jupyter +RUN pip install jupyter_contrib_nbextensions +#RUN jupyter contrib nbextension install --user +#RUN jupyter nbextensions_configurator enable --user +#RUN jupyter nbextension enable toc2/main + +RUN git clone https://github.com/Beuth-Erdelt/DBMS-Benchmarker --branch v0.13.7 + +WORKDIR /usr/src/app/DBMS-Benchmarker + +RUN mkdir /usr/src/app/DBMS-Benchmarker/notebooks + +COPY ./notebooks /usr/src/app/DBMS-Benchmarker/notebooks + +# RUN git pull + +CMD git pull; python ./dashboard.py -r /results From 0e4ca5523514e7b363b8acb136073fd84c672561 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Wed, 3 Jul 2024 16:04:21 +0200 Subject: [PATCH 120/121] DBMSBenchmarker: dev option in YAML --- images/benchmarker_dbmsbenchmarker/benchmarker.sh | 2 ++ k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/images/benchmarker_dbmsbenchmarker/benchmarker.sh b/images/benchmarker_dbmsbenchmarker/benchmarker.sh index 54e79b375..4df2df85b 100644 --- a/images/benchmarker_dbmsbenchmarker/benchmarker.sh +++ b/images/benchmarker_dbmsbenchmarker/benchmarker.sh @@ -94,7 +94,9 @@ echo "Start at $bexhoma_start_epoch epoch seconds" if test $DBMSBENCHMARKER_DEV -gt 0 then # dev environment + git checkout dev git pull + git status fi ######################## Convert parameters ################### diff --git a/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml b/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml index b26a50ca7..9456bff34 100644 --- a/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml +++ b/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml @@ -21,6 +21,7 @@ spec: containers: - name: dbmsbenchmarker image: bexhoma/benchmarker_dbmsbenchmarker:v0.13.7 + #image: bexhoma/benchmarker_dbmsbenchmarker:dev imagePullPolicy: Always #imagePullPolicy: IfNotPresent env: From 481f0848dc4e1862348ef13e1de898d0866dd9a8 Mon Sep 17 00:00:00 2001 From: Patrick Erdelt Date: Thu, 4 Jul 2024 15:00:00 +0200 Subject: [PATCH 121/121] DBMSBenchmarker: :v0.14.0 --- build.sh | 6 +- .../Dockerfile_v0.14.0 | 112 ++++++++++++++++++ .../create_Dockerfiles.py | 2 +- .../Dockerfile_v0.14.0 | 44 +++++++ .../create_Dockerfiles.py | 2 +- ...btemplate-benchmarking-dbmsbenchmarker.yml | 3 +- requirements.txt | 2 +- 7 files changed, 165 insertions(+), 6 deletions(-) create mode 100644 images/benchmarker_dbmsbenchmarker/Dockerfile_v0.14.0 create mode 100644 images/evaluator_dbmsbenchmarker/Dockerfile_v0.14.0 diff --git a/build.sh b/build.sh index 09a2c24b3..cc382b97f 100644 --- a/build.sh +++ b/build.sh @@ -9,7 +9,8 @@ python create_Dockerfiles.py #docker build -f Dockerfile_v0.13.6 -t bexhoma/evaluator_dbmsbenchmarker:v0.13.6 --no-cache . #docker build -f Dockerfile_v0.13.6 -t bexhoma/evaluator_dbmsbenchmarker:v0.13.6 . docker push bexhoma/evaluator_dbmsbenchmarker:dev & -docker push bexhoma/evaluator_dbmsbenchmarker:v0.13.7 & +#docker push bexhoma/evaluator_dbmsbenchmarker:v0.13.7 & +#docker push bexhoma/evaluator_dbmsbenchmarker:v0.14.0 & cd .. cd benchmarker_dbmsbenchmarker @@ -17,7 +18,8 @@ python create_Dockerfiles.py #docker build -f Dockerfile_v0.13.6 -t bexhoma/benchmarker_dbmsbenchmarker:v0.13.6 --no-cache . #docker build -f Dockerfile_v0.13.6 -t bexhoma/benchmarker_dbmsbenchmarker:v0.13.6 . docker push bexhoma/benchmarker_dbmsbenchmarker:dev & -docker push bexhoma/benchmarker_dbmsbenchmarker:v0.13.7 & +#docker push bexhoma/benchmarker_dbmsbenchmarker:v0.13.7 & +#docker push bexhoma/benchmarker_dbmsbenchmarker:v0.14.0 & cd .. ########### diff --git a/images/benchmarker_dbmsbenchmarker/Dockerfile_v0.14.0 b/images/benchmarker_dbmsbenchmarker/Dockerfile_v0.14.0 new file mode 100644 index 000000000..ef485b787 --- /dev/null +++ b/images/benchmarker_dbmsbenchmarker/Dockerfile_v0.14.0 @@ -0,0 +1,112 @@ +FROM python:3.11.7 + +# does not compile numpy correctly +# FROM python:3.13-rc-slim + +WORKDIR /usr/src/app + +ENV DBMSBENCHMARKER_SLEEP 30 +ENV DBMSBENCHMARKER_RECREATE_PARAMETER 0 +ENV DBMSBENCHMARKER_VERBOSE 0 +ENV DBMSBENCHMARKER_DEV 0 +ENV DBMSBENCHMARKER_NOW 0 +ENV DBMSBENCHMARKER_START 0 +ENV DBMSBENCHMARKER_SHUFFLE_QUERIES False + +RUN apt update +RUN apt install default-jre -y + +# only needed in slim releases +# RUN apt install git -y +# RUN apt install build-essential -y + +RUN pip uninstall dbmsbenchmarker -y +RUN JAVA_HOME=/usr/lib/jvm/java-1.8.0/ pip install --no-cache-dir --upgrade --force-reinstall git+https://github.com/Beuth-Erdelt/DBMS-Benchmarker@v0.14.0 + +# we only need packages required by dbmsbenchmarker +#COPY requirements.txt ./ +#RUN pip install --no-cache-dir -r requirements.txt + +RUN git clone https://github.com/Beuth-Erdelt/DBMS-Benchmarker --branch v0.14.0 + +WORKDIR /usr/src/app/DBMS-Benchmarker + +# RUN git pull + +#COPY . . + +RUN apt install nano -y + +RUN mkdir -p /results +RUN mkdir -p /results/$DBMSBENCHMARKER_CODE + + +RUN mkdir -p jars/ + +######### Specific version of PostgreSQL JDBC ######### +RUN wget https://jdbc.postgresql.org/download/postgresql-42.5.0.jar --no-check-certificate +RUN cp postgresql-42.5.0.jar jars/postgresql-42.5.0.jar + +######### Specific version of MySQL JDBC ######### +RUN wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-j-8.0.31.tar.gz +RUN tar -zxvf mysql-connector-j-8.0.31.tar.gz +RUN cp mysql-connector-j-8.0.31/mysql-connector-j-8.0.31.jar jars/mysql-connector-j-8.0.31.jar + +######### Specific version of MariaDB JDBC ######### +RUN wget https://dlm.mariadb.com/2678616/Connectors/java/connector-java-3.1.0/mariadb-java-client-3.1.0.jar +RUN cp mariadb-java-client-3.1.0.jar jars/mariadb-java-client-3.1.0.jar + +######### Specific version of MonetDB JDBC ######### +RUN wget https://www.monetdb.org/downloads/Java/archive/monetdb-jdbc-3.2.jre8.jar --no-check-certificate +RUN cp monetdb-jdbc-3.2.jre8.jar jars/monetdb-jdbc-3.2.jre8.jar + +######### Specific version of MonetDB JDBC ######### +RUN wget https://www.monetdb.org/downloads/Java/monetdb-jdbc-3.3.jre8.jar --no-check-certificate +RUN cp monetdb-jdbc-3.3.jre8.jar jars/monetdb-jdbc-3.3.jre8.jar + +######### Specific version of SingleStore JDBC ######### +RUN wget https://github.com/memsql/S2-JDBC-Connector/releases/download/v1.1.4/singlestore-jdbc-client-1.1.4.jar +RUN cp singlestore-jdbc-client-1.1.4.jar jars/singlestore-jdbc-client-1.1.4.jar + +######### Specific version of Kinetica JDBC ######### +RUN wget https://github.com/kineticadb/kinetica-client-jdbc/archive/refs/tags/v7.1.8.7.tar.gz +RUN tar -zxvf v7.1.8.7.tar.gz +RUN cp kinetica-client-jdbc-7.1.8.7/kinetica-jdbc-7.1.8.7-jar-with-dependencies.jar jars/kinetica-jdbc-7.1.8.7-jar-with-dependencies.jar + +######### Specific version of YugabyteDB JDBC ######### +RUN wget https://github.com/yugabyte/pgjdbc/releases/download/v42.3.5-yb-2/jdbc-yugabytedb-42.3.5-yb-2.jar +RUN cp jdbc-yugabytedb-42.3.5-yb-2.jar jars/jdbc-yugabytedb-42.3.5-yb-2.jar + + + +######### Redis Client - Download and compile ######### +RUN cd /tmp; wget http://download.redis.io/redis-stable.tar.gz; tar xvzf redis-stable.tar.gz; cd redis-stable; make; cp src/redis-cli /usr/local/bin/; chmod 755 /usr/local/bin/redis-cli + + +COPY ./benchmarker.sh ./benchmarker.sh +RUN ["chmod", "+x", "./benchmarker.sh"] + +CMD ["/bin/bash", "-c", "./benchmarker.sh"] + +#CMD git pull; python ./benchmark.py run -b -d -w connection \ +# -f /results/$DBMSBENCHMARKER_CODE \ +# -r /results/$DBMSBENCHMARKER_CODE \ +# -mps \ +# -cs -sf $DBMSBENCHMARKER_CONNECTION \ +# -ms $DBMSBENCHMARKER_CLIENT \ +# -sl $DBMSBENCHMARKER_SLEEP \ +# -st "$DBMSBENCHMARKER_START" \ +# -c "$DBMSBENCHMARKER_CONNECTION" \ +# -ca "$DBMSBENCHMARKER_ALIAS" \ +# -cf ${DBMSBENCHMARKER_CONNECTION}.config \ + +# -f config folder +# -r result folder +# -mps monitor per stream (not per query) +# -cs -sf subfolder per dbms (connection) +# -ms max number of subfolders +# -sl sleep seconds before start benchmarking +# -st start time for operating +# -c name of dbms (connection) to benchmark +# -ca alias for dbms (connection) to benchmark +# -cf config of dbms (connection) diff --git a/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py b/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py index 40a24a94d..9f86469ac 100644 --- a/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py +++ b/images/benchmarker_dbmsbenchmarker/create_Dockerfiles.py @@ -1,7 +1,7 @@ import subprocess #versions = ['v0.12.1','v0.12.2','v0.12.3','v0.12.4','v0.12.5'] -versions = ['v0.13.7','dev'] +versions = ['v0.14.0','v0.13.7','dev'] with open('Dockerfile_template', 'r') as file: dockerfile = file.read() diff --git a/images/evaluator_dbmsbenchmarker/Dockerfile_v0.14.0 b/images/evaluator_dbmsbenchmarker/Dockerfile_v0.14.0 new file mode 100644 index 000000000..8f629f9c1 --- /dev/null +++ b/images/evaluator_dbmsbenchmarker/Dockerfile_v0.14.0 @@ -0,0 +1,44 @@ +FROM python:3.11.7 + +# does not compile numpy correctly +# FROM python:3.13-rc-slim + +WORKDIR /usr/src/app + +RUN apt update +RUN apt install default-jre -y +RUN apt install zip -y +RUN apt install nano -y + +# only needed in slim releases +# RUN apt install git -y +# RUN apt install build-essential -y + +RUN mkdir /results + +SHELL ["/bin/bash", "-c"] + +ENV VIRTUAL_ENV=/opt/venv +RUN python3 -m pip install --user virtualenv +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + +RUN JAVA_HOME=/usr/lib/jvm/java-1.8.0/ pip install --no-cache-dir --upgrade --force-reinstall git+https://github.com/Beuth-Erdelt/DBMS-Benchmarker@v0.14.0 + +RUN pip install jupyter +RUN pip install jupyter_contrib_nbextensions +#RUN jupyter contrib nbextension install --user +#RUN jupyter nbextensions_configurator enable --user +#RUN jupyter nbextension enable toc2/main + +RUN git clone https://github.com/Beuth-Erdelt/DBMS-Benchmarker --branch v0.14.0 + +WORKDIR /usr/src/app/DBMS-Benchmarker + +RUN mkdir /usr/src/app/DBMS-Benchmarker/notebooks + +COPY ./notebooks /usr/src/app/DBMS-Benchmarker/notebooks + +# RUN git pull + +CMD git pull; python ./dashboard.py -r /results diff --git a/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py b/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py index 4d19754bc..46b0db146 100644 --- a/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py +++ b/images/evaluator_dbmsbenchmarker/create_Dockerfiles.py @@ -1,7 +1,7 @@ import subprocess #versions = ['v0.12.1','v0.12.2','v0.12.3','v0.12.4','v0.12.5'] -versions = ['v0.13.7','dev'] +versions = ['v0.14.0','v0.13.7','dev'] with open('Dockerfile_template', 'r') as file: dockerfile = file.read() diff --git a/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml b/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml index 9456bff34..2775e5976 100644 --- a/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml +++ b/k8s/jobtemplate-benchmarking-dbmsbenchmarker.yml @@ -20,7 +20,8 @@ spec: effect: "NoSchedule" containers: - name: dbmsbenchmarker - image: bexhoma/benchmarker_dbmsbenchmarker:v0.13.7 + image: bexhoma/benchmarker_dbmsbenchmarker:v0.14.0 + #image: bexhoma/benchmarker_dbmsbenchmarker:v0.13.7 #image: bexhoma/benchmarker_dbmsbenchmarker:dev imagePullPolicy: Always #imagePullPolicy: IfNotPresent diff --git a/requirements.txt b/requirements.txt index 6a5e71984..634af0c54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ urllib3>=2.2.2 kubernetes==22.6.0 psutil>=5.6.1 -dbmsbenchmarker>=0.13.6 +dbmsbenchmarker>=0.14.0 myst_parser HiYaPyCo==0.5.1 mistune>=2.0.3 # not directly required, pinned by Snyk to avoid a vulnerability