Skip to content

Commit 0fa5877

Browse files
committed
changes so installing/updating goes smooth
1 parent 2bb9f33 commit 0fa5877

File tree

7 files changed

+65
-27
lines changed

7 files changed

+65
-27
lines changed

.github/workflows/RunBenchmark.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
CC: gcc-10
4141
CXX: g++-10
4242
GEN: ninja
43+
MACHINE_TYPE="c6id.4xlarge"
4344
runs-on: self-hosted
4445
steps:
4546
- uses: actions/checkout@v3
@@ -53,11 +54,13 @@ jobs:
5354
run: |
5455
./_setup_utils/mount.sh
5556
56-
- name: Upgrade all solutions
57+
- name: Install or Upgrade all solutions
5758
shell: bash
5859
working-directory: /var/lib/mount/db-benchmark-metal
5960
run: |
60-
python3 _setup_utils/install_all_solutions.py all
61+
python3 _setup_utils/install_all_solutions.py all --exclude clickhouse
62+
# clickhouse needs sudo priviledges
63+
sudo python3 _setup_utils/install_all_solutions clickhouse
6164
6265
- name: Run the benchmark
6366
shell: bash
Lines changed: 55 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,83 @@
11
import os
22
import csv
33
import sys
4+
import subprocess
45

56
SOLUTIONS_FILENAME = "_control/solutions.csv"
67

78

9+
INCLUDE = set()
10+
811
def install_solution(solution_name):
912
min_setup_file_name = f"./{solution_name}/min-setup-{solution_name}.sh"
1013
setup_file_name = f"./{solution_name}/setup-{solution_name}.sh"
14+
upgrade_file_name = f"./{solution_name}/upg-{solution_name}.sh"
15+
get_version_filename = f"./{solution_name}/ver-{solution_name}.sh"
1116
print(f"Installing {solution_name}")
12-
if os.path.exists(min_setup_file_name):
13-
os.system(min_setup_file_name)
14-
elif os.path.exists(setup_file_name):
15-
os.system(setup_file_name)
17+
do_install = False
18+
try:
19+
subprocess.call([get_version_filename], stdout="/dev/null")
20+
except Exception as e:
21+
do_install = True
22+
23+
if do_install:
24+
if os.path.exists(min_setup_file_name):
25+
subprocess.call([min_setup_file_name])
26+
elif os.path.exists(setup_file_name):
27+
subprocess.call([setup_file_name])
28+
else:
29+
# print(f"no script for {setup_file_name} or {min_setup_file_name}")
30+
raise Exception(f"No script to install {solution_name}")
1631
else:
17-
# print(f"no script for {setup_file_name} or {min_setup_file_name}")
18-
raise Exception(f"No script to install {solution_name}")
32+
subprocess.call([upgrade_file_name])
1933

2034
# based on the name of the solution, run the {{solution}}/min-setup-{{solution}}.sh file.
2135
# if there is no min-setup-{{solution}}.sh, then run setup-{{solution}}.sh.
2236
# if error, exit with an error
2337
# else don't
24-
def install_all_solutions():
25-
install_solutions = set()
38+
def include_all_solutions():
39+
global INCLUDE
2640
with open(SOLUTIONS_FILENAME, newline="") as solutions_file:
2741
solutions = csv.DictReader(solutions_file, delimiter=',')
2842
for row in solutions:
2943
if row['solution'] == "data.table":
30-
install_solutions.add("datatable")
44+
INCLUDE.add("datatable")
3145
else:
32-
install_solutions.add(row['solution'])
33-
for solution in install_solutions:
34-
install_solution(solution)
46+
INCLUDE.add(row['solution'])
3547

3648
if len(sys.argv) == 0:
37-
print("Usage: python3 install_all_solutions.py solution_name solution_name ...")
49+
print("""
50+
Usage: python3 install_all_solutions.py solution_name solution_name ...
51+
python3 install_all_solutions.py all --exclude clickhouse polars
52+
""")
3853
exit(1)
3954

4055
# first argument is file name
41-
for solution in sys.argv[1:]:
42-
if solution.strip() == "all":
43-
install_all_solutions()
44-
else:
45-
if solution == "data.table":
46-
install_solution("datatable")
47-
elif solution == "clickhouse":
48-
install_solution("clickhouse")
49-
install_solution("polars")
56+
57+
def main():
58+
global INCLUDE
59+
including = True
60+
for solution in sys.argv[1:]:
61+
if solution.strip() == "all":
62+
include_all_solutions()
63+
elif solution.strip() == "--exclude":
64+
including = False
5065
else:
51-
install_solution(solution)
52-
66+
if including:
67+
if solution == "data.table":
68+
INCLUDE.add("datatable")
69+
elif solution == "clickhouse":
70+
INCLUDE.add("clickhouse")
71+
else:
72+
INCLUDE.add(solution)
73+
else:
74+
sol = solution.strip()
75+
INCLUDE.remove(sol)
76+
77+
for solution in INCLUDE:
78+
install_solution(solution)
79+
80+
81+
if __name__ == "__main__":
82+
main()
83+

clickhouse/setup-clickhouse.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# install
23
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg
34
curl -fsSL 'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key' | sudo gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg

clickhouse/upg-clickhouse.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ set -e
33

44
# upgrade to latest released
55
echo 'upgrading clickhouse-server clickhouse-client...'
6-
apt-get install --only-upgrade clickhouse-server clickhouse-client
6+
sudo apt-get install --only-upgrade clickhouse-server clickhouse-client

datatable/setup-datatable.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# install devel data.table
23
mkdir -p ./datatable/r-datatable
34
Rscript -e 'install.packages("data.table", repos="https://Rdatatable.gitlab.io/data.table", method="curl", lib="./datatable/r-datatable")'

juliadf/setup-juliadf.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# install julia
23

34
wget https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.5-linux-x86_64.tar.gz

juliads/setup-juliads.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
# install julia
23

34
wget https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.5-linux-x86_64.tar.gz

0 commit comments

Comments
 (0)