Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3880dc3

Browse filesBrowse files
committed
Configure & launch dblab server (WIP)
1 parent 72e476e commit 3880dc3
Copy full SHA for 3880dc3

File tree

2 files changed

+28
-0
lines changed
Filter options

2 files changed

+28
-0
lines changed

‎test/1.synthetic.sh

Copy file name to clipboardExpand all lines: test/1.synthetic.sh
+27Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
set -euxo pipefail
33

44
DIR=${0%/*}
5+
IMAGE2TEST="registry.gitlab.com/postgres-ai/database-lab/dblab-server:master"
6+
7+
### Step 1: Prepare a machine with two disks, Docker and ZFS
8+
59
source "${DIR}/_prerequisites.ubuntu.sh"
610
source "${DIR}/_zfs.file.sh"
711

12+
### Step 2. Prepare database data directory
13+
814
sudo docker run \
915
--name dblab_pg_initdb \
1016
--label dblab_sync \
@@ -26,3 +32,24 @@ sudo docker exec -it dblab_pg_initdb pgbench -U postgres -i -s 10 test
2632

2733
sudo docker stop dblab_pg_initdb
2834
sudo docker rm dblab_pg_initdb
35+
36+
### Step ?. Configure and launch the Database Lab server
37+
mkdir -p ~/.dblab
38+
cp ./configs/config.example.physical_generic.yml ~/.dblab/server_test.yml
39+
sed -ri 's/^(\s*)(port:.*$)/\1port: 12345/' ~/.dblab/server_test.yml
40+
sed -ri 's/^(\s*)(debug:.*$)/\1debug: true/' ~/.dblab/server_test.yml
41+
sed -ri 's/^(\s*)(pool:.*$)/\1pool: "test_pool"/' ~/.dblab/server_test.yml
42+
sed -ri 's/^(\s*)(pool:.*$)/\1pool: "test_pool"/' ~/.dblab/server_test.yml
43+
44+
sudo docker run \
45+
--detach \
46+
--name dblab_test \
47+
--label dblab_control \
48+
--privileged \
49+
--publish 12345:12345 \
50+
--volume /var/run/docker.sock:/var/run/docker.sock \
51+
--volume /var/lib/dblab/data:/var/lib/dblab/data:rshared \
52+
--volume ~/.dblab/server_test.yml:/home/dblab/configs/config.yml \
53+
"${IMAGE2TEST}"
54+
55+
### Step ?. Setup Database Lab client CLI

‎test/_cleanup.sh

Copy file name to clipboardExpand all lines: test/_cleanup.sh
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ sudo docker rm -f dblab_pg_initdb || true
77
sudo zpool destroy test_pool || true
88
sudo umount /var/lib/dblab/data || true
99
sudo rm -f "${ZFS_FILE}"
10+
rm -f ~/.dblab/server_test.yml

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.