Skip to content

Commit 8a7d05d

Browse files
committed
replace cedardb docker image with native cedardb and update measurements
1 parent 1add9c1 commit 8a7d05d

25 files changed

Lines changed: 462 additions & 127 deletions

cedardb-parquet/benchmark.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22
# Thin shim — actual flow is in lib/benchmark-common.sh.
33
export BENCH_DOWNLOAD_SCRIPT="download-hits-parquet-single"
44
export BENCH_DURABLE=yes
5+
export PGHOST="/tmp"
6+
export PGUSER=postgres
7+
export PGDATABASE=postgres
8+
59
exec ../lib/benchmark-common.sh

cedardb-parquet/check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
set -e
33

4-
PGPASSWORD=test psql -h localhost -U postgres -c 'SELECT 1' >/dev/null
4+
psql -c 'SELECT 1' >/dev/null

cedardb-parquet/create.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ SELECT
105105
"RefererHash" AS RefererHash,
106106
"URLHash" AS URLHash,
107107
"CLID" AS CLID
108-
FROM '/data/hits.parquet';
108+
FROM 'hits.parquet';

cedardb-parquet/data-size

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
set -eu
33

44
# No ingestion — reported size is the parquet file itself.
5-
stat -c%s data/hits.parquet
5+
stat -c%s hits.parquet

cedardb-parquet/install

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22
set -eu
33

44
sudo apt-get update -y
5-
sudo apt-get install -y docker.io postgresql-client
5+
sudo apt-get install -y postgresql-client
66

7-
sudo docker pull cedardb/cedardb:latest
7+
# Stop any running instance before reinstalling
8+
./stop || true
89

9-
mkdir -p data db
10-
chmod -R 777 data db
10+
# Delete potential previously created database
11+
rm -rf ./db
12+
13+
mkdir -p "${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"
14+
15+
curl https://get.cedardb.com | bash -s -- -y \
16+
--install-dir "$PWD" \
17+
--db-dir "$PWD/db" \
18+
--with-systemd=user

cedardb-parquet/load

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
#!/bin/bash
22
set -eu
33

4-
# Stage parquet file under ./data so the docker container sees /data/hits.parquet.
5-
mkdir -p data
6-
mv hits.parquet data/
7-
chmod -R 777 data
8-
9-
# create.sql defines a view over the parquet file — no ingestion needed.
10-
PGPASSWORD=test psql -h localhost -U postgres -t < create.sql
4+
# Substitute the absolute path so CedarDB can find the file regardless of
5+
# its working directory.
6+
sed "s|'hits\.parquet'|'$PWD/hits.parquet'|" create.sql | psql
117

128
sync

cedardb-parquet/query

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -e
88

99
query=$(cat)
1010

11-
raw=$(PGPASSWORD=test psql -h localhost -U postgres -t -c '\timing' -c "$query" 2>&1) && exit_code=0 || exit_code=$?
11+
raw=$(psql -t -c '\timing' -c "$query" 2>&1) && exit_code=0 || exit_code=$?
1212

1313
if [ "$exit_code" -ne 0 ] || printf '%s\n' "$raw" | grep -qE '^ERROR|psql: error'; then
1414
printf '%s\n' "$raw" >&2

cedardb-parquet/start

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,4 @@
11
#!/bin/bash
22
set -eu
33

4-
if PGPASSWORD=test psql -h localhost -U postgres -c 'SELECT 1' >/dev/null 2>&1; then
5-
exit 0
6-
fi
7-
8-
sudo docker stop cedardb >/dev/null 2>&1 || true
9-
sudo docker rm cedardb >/dev/null 2>&1 || true
10-
11-
sudo docker run -d --rm -p 5432:5432 \
12-
-v "$(pwd)/data:/data" \
13-
-v "$(pwd)/db:/var/lib/cedardb/data" \
14-
-e CEDAR_PASSWORD=test \
15-
--name cedardb cedardb/cedardb:latest >/dev/null
16-
17-
until pg_isready -h localhost --dbname postgres -U postgres >/dev/null 2>&1; do
18-
sleep 1
19-
done
4+
systemctl --user start cedardb.service

cedardb-parquet/stop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
sudo docker stop cedardb >/dev/null 2>&1 || true
3+
systemctl --user stop cedardb.service || true

cedardb/benchmark.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#!/bin/bash
22
# Thin shim — actual flow is in lib/benchmark-common.sh.
3-
export BENCH_DOWNLOAD_SCRIPT="download-hits-tsv"
3+
export BENCH_DOWNLOAD_SCRIPT="download-hits-parquet-single"
44
export BENCH_DURABLE=yes
5+
export PGHOST="/tmp"
6+
export PGUSER=postgres
7+
export PGDATABASE=postgres
8+
59
exec ../lib/benchmark-common.sh

0 commit comments

Comments
 (0)