Skip to content

Ovh #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 31 commits into
base: development
Choose a base branch
from
Draft

Ovh #168

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d4a4f0c
OVH pipeline (WIP)
dmitrii-ubskii May 2, 2025
e6cb68c
ensure ipv4
dmitrii-ubskii May 9, 2025
d465b77
toool => tool
dmitrii-ubskii May 9, 2025
6e4549e
fix test, remove DISK_SIZE
dmitrii-ubskii May 9, 2025
f358a82
profile check
dmitrii-ubskii May 9, 2025
f9b5557
quote things
dmitrii-ubskii May 9, 2025
de6530f
ipv4 redux
dmitrii-ubskii May 9, 2025
aeb2cc0
wait for machine creation
dmitrii-ubskii May 9, 2025
41ebe43
ask for openrc.sh
dmitrii-ubskii May 9, 2025
9e144e4
don't ask to add to known hosts
dmitrii-ubskii May 9, 2025
b4e191b
double quote
dmitrii-ubskii May 9, 2025
a223695
replace scp with ssh
dmitrii-ubskii May 12, 2025
92d157b
force venv
dmitrii-ubskii May 12, 2025
de0f8b9
run_batched.sh
dmitrii-ubskii May 12, 2025
b9e0e85
MAX_JOBS=8
dmitrii-ubskii May 12, 2025
e3d91c7
delete on exit trap
dmitrii-ubskii May 12, 2025
c2f74bc
typedb 3.2.0
dmitrii-ubskii May 12, 2025
b4293d1
don't update java alternatives eagerly?
dmitrii-ubskii May 14, 2025
f2bf8e6
disable http endpoint
dmitrii-ubskii May 14, 2025
5fd4ff7
disable diagnostics reporting
dmitrii-ubskii May 19, 2025
1bf2cd6
verify
dmitrii-ubskii May 19, 2025
8e1af32
sleep 0.5 is not always supported
dmitrii-ubskii May 28, 2025
97c8fa3
silence misleading tar error
dmitrii-ubskii May 28, 2025
bf8094a
give typedb3 more time to boot
dmitrii-ubskii May 28, 2025
c05b1aa
fix neo payment
dmitrii-ubskii May 30, 2025
2a9e5de
fix typedb3 log
dmitrii-ubskii May 30, 2025
1f46ff7
ulimit for tdb3
dmitrii-ubskii May 30, 2025
a928237
tdb3 latest server snapshot
dmitrii-ubskii May 30, 2025
9ce0ed5
temporarily revert typedb to 3.2.0
dmitrii-ubskii Jun 2, 2025
cb098b4
enable txns in mongo
dmitrii-ubskii Jun 6, 2025
e7d00f1
latest tdb3 snapshot
dmitrii-ubskii Jul 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,6 @@ bazel-*
tpcc/profiling/
ldbc/profiling/
*.json

# OpenStack credentials
openrc.sh
8 changes: 5 additions & 3 deletions tool/mongodb/install-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ set -eu

echo 'installing driver...'
sudo apt update -y
sudo apt install -y python3-pip
python3 -m pip install pymongo
echo 'installing driver done'
sudo apt install -y python3-pip python3-venv
if [ ! -x venv ]; then python3 -m venv venv; fi
. venv/bin/activate
pip install pymongo
echo 'installing driver done'
5 changes: 4 additions & 1 deletion tool/neo4j/install-driver.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
set -eu

sudo apt install -y python3-pip
sudo apt update -y
sudo apt install -y python3-pip python3-venv
if [ ! -x venv ]; then python3 -m venv venv; fi
. venv/bin/activate
pip install neo4j
2 changes: 1 addition & 1 deletion tool/neo4j/install-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ echo 'deb [signed-by=/etc/apt/keyrings/neotechnology.gpg] https://debian.neo4j.c
sudo apt update -y
sudo apt install -y neo4j=1:$SERVER_VERSION

sudo update-java-alternatives --jre --set java-1.21.0-openjdk-amd64
# sudo update-java-alternatives --jre --set java-1.21.0-openjdk-amd64
sudo sed -i 's/#dbms.security.auth_enabled=.*/dbms.security.auth_enabled=false/' /etc/neo4j/neo4j.conf
2 changes: 1 addition & 1 deletion tool/neo4j/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo nohup neo4j start >&/dev/null &

# wait until ready
set +e
POLL_INTERVAL_SECS=0.5
POLL_INTERVAL_SECS=1
RETRY_NUM=20
while [[ $RETRY_NUM -gt 0 ]]; do
lsof -i :7687 > /dev/null
Expand Down
7 changes: 7 additions & 0 deletions tool/ovh/clone-repo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -eu

tool/ovh/ssh-exec.sh "'git clone https://github.com/typedb/typedb-benchmark.git'"
if [ $# -eq 1 ]; then
REF=$1
tool/ovh/ssh-exec.sh "'cd typedb-benchmark && git fetch origin $REF && git checkout $REF'"
fi
12 changes: 12 additions & 0 deletions tool/ovh/create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set -eu

openstack server create "$MACHINE_NAME" \
--key-name "$OS_KEY_ID" \
--flavor "$MACHINE_TYPE" \
--image "$IMAGE" \
--network Ext-Net

for _ in `seq 60`; do
STATUS=$(openstack server show "$MACHINE_NAME" |& grep '\bstatus' | awk '{print $4}')
if [[ $STATUS == "ACTIVE" ]]; then break; fi
done
6 changes: 6 additions & 0 deletions tool/ovh/download-result.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
openstack server ssh $MACHINE_NAME -4 --address-type Ext-Net -- -i $OS_PRIVATE_KEY -l ubuntu -o StrictHostKeychecking=no "cat ~/typedb-benchmark/results.log" > result-$MACHINE_NAME.log
# resolve typedb folder using glob '*', as there's exactly one typedb folder
if [[ $DB =~ typedb ]]; then
openstack server ssh $MACHINE_NAME -4 --address-type Ext-Net -- -i $OS_PRIVATE_KEY -l ubuntu -o StrictHostKeychecking=no "cat ~/typedb-benchmark/typedb-all-linux-x86_64-*/log" > result-$MACHINE_NAME-server.log
fi

45 changes: 45 additions & 0 deletions tool/ovh/profile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
set -eu

# TPCC config
DB=${DB:-typedb3}
source tool/$DB/config.sh # export the DB server and driver version
SCALE_FACTOR=${SCALE_FACTOR:-1} # 0.5, 1
WAREHOUSES=${WAREHOUSES:-1} # 1, 5, 10, --- 100, 300, 500, 1000
CLIENTS=${CLIENTS:-1} # 4, 8, 16, 32, 48, 64
DURATION=${DURATION:-600}

# machine config
MACHINE_TYPE=b2-15

# cloud provider config
if [ ! -v OS_TENANT_ID -o ! -v OS_TENANT_NAME ]; then
echo "OS_TENANT_ID and OS_TENANT_NAME must be set; download and source openrc.sh"
exit 1
fi

if [ ! -v OS_USERNAME -o ! -v OS_PASSWORD ]; then
echo "OS_USERNAME and OS_PASSWORD must be set; download and source openrc.sh"
exit 1
fi

if [ ! -v OS_KEY_ID -o ! -v OS_PRIVATE_KEY ]; then
echo "OS_KEY_ID and OS_PRIVATE_KEY must be set"
exit 1
fi

PROJECT=vaticle-engineers
ZONE=europe-west2-c
IMAGE="Ubuntu 24.10"
IMAGE_PROJECT=vaticle-factory-prod

# four digit random number with zero padding
ID=0000$RANDOM
ID=${ID:(-4)}

# extrapolation
DB_SHORT="${DB:0:1}${DB: -1}"
SERVER_VERSION_SHORT=${SERVER_VERSION:0:4}
SERVER_VERSION_SHORT=${SERVER_VERSION_SHORT//\./-} # replace '.'s in version with hyphens
DRIVER_VERSION_SHORT="eac3" # TODO: update according to DRIVER_VERSION
BENCH_ID=$USER-$DB_SHORT-$SERVER_VERSION_SHORT-$DRIVER_VERSION_SHORT-$MACHINE_TYPE-sf$SCALE_FACTOR-w$WAREHOUSES-c$CLIENTS-dur$DURATION-$ID
MACHINE_NAME=$BENCH_ID
3 changes: 3 additions & 0 deletions tool/ovh/ssh-exec.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -eu

openstack server ssh $MACHINE_NAME -4 --address-type Ext-Net -- -i $OS_PRIVATE_KEY -l ubuntu -o StrictHostKeychecking=no "$@"
3 changes: 3 additions & 0 deletions tool/ovh/ssh.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -eu

openstack server ssh $MACHINE_NAME -4 --address-type Ext-Net -- -i $OS_PRIVATE_KEY -l ubuntu
57 changes: 57 additions & 0 deletions tool/ovh/tpcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
set -euo allexport

usage() {
echo "Usage: $0 [-d <neo4j|mongodb|postgres|typedb2|typedb3>] [-s SCALE_FACTOR] [-w WAREHOUSES] [-c CLIENTS] [-t DURATION] [-k]" 1>&2
echo "Default: $0 -d typedb3 -s 1 -w 1 -c 1 -t 600" 1>&2
echo "-d DATABASE target database"
echo "-s SCALE_FACTOR benchmark scale factor"
echo "-w WAREHOUSES number of warehouses"
echo "-c CLIENTS number of clients"
echo "-t DURATION how long to run the execution portion of the benchmark (seconds)"
echo "-k keep the server instance (default: deletes)"
exit 1
}

KEEP_SERVER=
while getopts ":d:w:c:s:t:k" opt; do
case $opt in
d) DB="$OPTARG" ;;
s) SCALE_FACTOR="$OPTARG" ;;
w) WAREHOUSES="$OPTARG" ;;
c) CLIENTS="$OPTARG" ;;
t) DURATION="$OPTARG" ;;
k) KEEP_SERVER=1 ;;
*) usage ;;
esac
done

source tool/ovh/profile.sh

echo Machine name: $MACHINE_NAME

function cleanup {
tool/ovh/download-result.sh

if [[ -z $KEEP_SERVER ]]; then
openstack server delete $MACHINE_NAME
fi
}
trap cleanup ERR
trap cleanup EXIT

tool/ovh/create.sh
sleep 40
tool/ovh/clone-repo.sh $(git rev-parse HEAD)

tool/ovh/ssh-exec.sh "'cd typedb-benchmark && tool/$DB/setup.sh'"
tool/ovh/ssh-exec.sh "'cd typedb-benchmark && tool/postgres/setup.sh'"

tool/ovh/ssh-exec.sh "'
cd typedb-benchmark && . venv/bin/activate &&
nohup tool/execute-tpcc.sh --no-execute --reset --scalefactor=$SCALE_FACTOR --warehouses=$WAREHOUSES --clients=$CLIENTS --duration=$DURATION --verify $DB & wait \$!
'"

tool/ovh/ssh-exec.sh "'
cd typedb-benchmark && . venv/bin/activate &&
nohup tool/execute-tpcc.sh --no-load --scalefactor=$SCALE_FACTOR --warehouses=$WAREHOUSES --clients=$CLIENTS --duration=$DURATION --verify $DB & wait \$!
'"
3 changes: 3 additions & 0 deletions tool/ovh/watch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -eu

tool/ovh/ssh-exec.sh "tail -n +1 -F typedb-benchmark/results.log"
4 changes: 3 additions & 1 deletion tool/postgres/install-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ set -eu

echo 'installing driver...'
sudo apt update -y
sudo apt install -y python3-pip
sudo apt install -y python3-pip python3-venv
if [ ! -x venv ]; then python3 -m venv venv; fi
. venv/bin/activate
pip install psycopg2-binary
echo 'installing driver done'
20 changes: 20 additions & 0 deletions tool/run_batched.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# usage: for ...; do echo cmd; done | run_batched.sh

MAX_JOBS=8

while true; do
CUR_JOBS=$(jobs | wc -l)
if ((CUR_JOBS < MAX_JOBS)); then
read cmd || break
echo "$cmd"
bash -c "$cmd" &
else
sleep 60
fi
done

echo "scheduled all jobs"

wait $(jobs -p)
6 changes: 4 additions & 2 deletions tool/typedb2/install-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ set -eu
source tool/typedb2/config.sh

sudo apt update -y
sudo apt install -y python3-pip
pip install typedb-driver=="$DRIVER_VERSION"
sudo apt install -y python3-pip python3-venv
if [ ! -x venv ]; then python3 -m venv venv; fi
. venv/bin/activate
pip install typedb-driver=="$DRIVER_VERSION"
2 changes: 1 addition & 1 deletion tool/typedb2/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tmux new-session -d -s "typedb" "./$DISTRIBUTION_DIR/typedb server > ./$DISTRIBU

# wait until ready
set +e
POLL_INTERVAL_SECS=0.5
POLL_INTERVAL_SECS=1
RETRY_NUM=20
while [[ $RETRY_NUM -gt 0 ]]; do
lsof -i :1729 > /dev/null
Expand Down
4 changes: 2 additions & 2 deletions tool/typedb3/config.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -eu

SERVER_VERSION=3.1.0
DRIVER_VERSION=3.1.0
SERVER_VERSION=cf3da89684083876900877bd2f95731e5ea4dceb
DRIVER_VERSION=3.4.0
4 changes: 3 additions & 1 deletion tool/typedb3/install-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ set -eu
source tool/typedb3/config.sh

sudo apt update -y
sudo apt install -y python3-pip
sudo apt install -y python3-pip python3-venv
if [ ! -x venv ]; then python3 -m venv venv; fi
. venv/bin/activate
pip install typedb-driver=="$DRIVER_VERSION" --extra-index-url https://repo.typedb.com/public/public-snapshot/python/simple/
2 changes: 1 addition & 1 deletion tool/typedb3/install-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ DISTRIBUTION_TARGZ="$DISTRIBUTION_DIR.tar.gz"
DISTRIBUTION_URL_SNAPSHOT="https://repo.typedb.com/public/public-snapshot/raw/names/$DISTRIBUTION/versions/$SERVER_VERSION/$DISTRIBUTION_TARGZ"
DISTRIBUTION_URL_RELEASE="https://repo.typedb.com/public/public-release/raw/names/$DISTRIBUTION/versions/$SERVER_VERSION/$DISTRIBUTION_TARGZ"

(curl -o "$DISTRIBUTION_TARGZ" "$DISTRIBUTION_URL_SNAPSHOT" && tar -xf "$DISTRIBUTION_TARGZ") ||
(curl -o "$DISTRIBUTION_TARGZ" "$DISTRIBUTION_URL_SNAPSHOT" && tar -xf "$DISTRIBUTION_TARGZ" 2> /dev/null) ||
(curl -o "$DISTRIBUTION_TARGZ" "$DISTRIBUTION_URL_RELEASE" && tar -xf "$DISTRIBUTION_TARGZ")
7 changes: 4 additions & 3 deletions tool/typedb3/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ source tool/typedb3/config.sh
# start server
DISTRIBUTION="typedb-all-linux-x86_64"
DISTRIBUTION_DIR="$DISTRIBUTION-$SERVER_VERSION"
tmux new-session -d -s "typedb" "./$DISTRIBUTION_DIR/typedb server > ./$DISTRIBUTION_DIR/log"
ulimit -n 10240
tmux new-session -d -s "typedb" "./$DISTRIBUTION_DIR/typedb server --diagnostics.reporting.metrics false >& ./$DISTRIBUTION_DIR/log"

# wait until ready
set +e
POLL_INTERVAL_SECS=0.5
RETRY_NUM=20
POLL_INTERVAL_SECS=1
RETRY_NUM=120
while [[ $RETRY_NUM -gt 0 ]]; do
lsof -i :1729 > /dev/null
if [ $? -eq 0 ]; then exit 0; fi
Expand Down
2 changes: 1 addition & 1 deletion tpcc/pytpcc/drivers/mongodbdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ class MongodbDriver(AbstractDriver):
"uri": ("The mongodb connection string or URI", "mongodb://localhost:27017"),
"name": ("Database name", "tpcc"),
"denormalize": ("If true, data will be denormalized using MongoDB schema design best practices", False),
"notransactions": ("If true, transactions will not be used (benchmarking only)", True),
"notransactions": ("If true, transactions will not be used (benchmarking only)", False),
"findandmodify": ("If true, all things to update will be fetched via findAndModify", True),
"secondary_reads": ("If true, we will allow secondary reads", True),
"retry_writes": ("If true, we will enable retryable writes", True),
Expand Down
3 changes: 1 addition & 2 deletions tpcc/pytpcc/drivers/neo4jdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,6 @@ def doPayment(self, params):
MATCH (c:CUSTOMER {C_ID: $c_id})
-[:BELONGS_TO]-> (:DISTRICT {D_ID: $c_d_id})
-[:BELONGS_TO]-> (:WAREHOUSE {W_ID: $c_w_id})
-[:BELONGS_TO]-> (:DISTRICT {D_ID: $c_d_id})
MATCH (d:DISTRICT {D_ID: $d_id}) -[:BELONGS_TO]-> (w:WAREHOUSE {W_ID: $w_id})
CREATE (h:HISTORY {H_C_ID: $c_id, H_C_D_ID: $c_d_id, H_C_W_ID: $c_w_id,
H_D_ID: $d_id, H_W_ID: $w_id, H_DATE: $h_date,
Expand Down Expand Up @@ -784,4 +783,4 @@ def get_counts(self):
verification += "}"
return verification

## CLASS
## CLASS