Postgress support (#10331)

* Pure PostgreSQL

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>

* Fix formatting

* Optimize a tests

+ Optimize a stream docker build

* Fix migrations

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* Fix datalake image

Signed-off-by: Artem Savchenko <armisav@gmail.com>

* Fix formatting

Signed-off-by: Artem Savchenko <armisav@gmail.com>

---------

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
Signed-off-by: Artem Savchenko <armisav@gmail.com>
Co-authored-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Artyom Savchenko
2025-12-26 12:11:38 +07:00
committed by GitHub
co-authored by Andrey Sobolev
parent d69af65ea1
commit c8aec52f13
19 changed files with 950 additions and 276 deletions
+1
View File
@@ -6,4 +6,5 @@ BACKUP_BUCKET_NAME=dev-backups
DB_URL=mongodb://mongodb:27018
MONGO_URL=mongodb://mongodb:27018
DB_PG_URL=postgresql://root@cockroach:26257/defaultdb?sslmode=disable
DB_PURE_PG_URL=postgresql://postgres:postgres@postgres:5433/postgres
QUEUE_CONFIG='redpanda:9093;-staging'
+52
View File
@@ -0,0 +1,52 @@
services:
account:
environment:
- DB_URL=${DB_PURE_PG_URL}
- STORAGE_CONFIG=${DATALAKE_STORAGE_CONFIG}
- PROCEED_V7_MONGO=false
transactor:
environment:
- DB_URL=${DB_PURE_PG_URL}
- STORAGE_CONFIG=${DATALAKE_STORAGE_CONFIG}
workspace:
environment:
- DB_URL=${DB_PURE_PG_URL}
- STORAGE_CONFIG=${DATALAKE_STORAGE_CONFIG}
- ACCOUNTS_DB_URL=${DB_PURE_PG_URL}
fulltext:
environment:
- DB_URL=${DB_PURE_PG_URL}
- STORAGE_CONFIG=${DATALAKE_STORAGE_CONFIG}
front:
environment:
- STORAGE_CONFIG=${DATALAKE_STORAGE_CONFIG}
- FILES_URL=http://localhost:4031/blob/:workspace/:blobId/:filename
- UPLOAD_URL=http://localhost:4031/upload/form-data/:workspace
- DATALAKE_URL=http://localhost:4031
- PREVIEW_URL=http://localhost:4031
collaborator:
environment:
- STORAGE_CONFIG=${DATALAKE_STORAGE_CONFIG}
datalake:
image: hardcoreeng/datalake
depends_on:
minio:
condition: service_healthy
cockroach:
condition: service_started
stats:
condition: service_started
account:
condition: service_started
ports:
- 4031:4031
environment:
- PORT=4031
- SECRET=secret
- ACCOUNTS_URL=http://account:3003
- STATS_URL=http://stats:4901
- STREAM_URL=http://localhost:1081/recording
- DB_URL=${DB_PURE_PG_URL}
- BUCKETS=blobs,eu|http://minio:9000?accessKey=minioadmin&secretKey=minioadmin
- QUEUE_CONFIG=${QUEUE_CONFIG}
restart: unless-stopped
+21
View File
@@ -34,6 +34,21 @@ services:
- '18089:8080'
command: start-single-node --insecure
restart: unless-stopped
postgres:
image: postgres:18.1
command: ["postgres", "-p", "5433"]
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -p 5433"]
interval: 5s
timeout: 5s
retries: 10
ports:
- 5433:5433
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
restart: unless-stopped
redpanda:
image: docker.redpanda.com/redpandadata/redpanda:v24.3.6
command:
@@ -110,10 +125,14 @@ services:
account:
image: hardcoreeng/account
pull_policy: never
depends_on:
postgres:
condition: service_healthy
links:
- mongodb
- minio
- cockroach
- postgres
ports:
- 3003:3003
volumes:
@@ -136,6 +155,7 @@ services:
links:
- mongodb
- cockroach
- postgres
- minio
- redpanda
depends_on:
@@ -198,6 +218,7 @@ services:
- minio
- rekoni
- cockroach
- postgres
- account
- stats
- redpanda
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
docker compose -p sanity kill
docker compose -p sanity down --volumes
docker compose -p sanity up -d --force-recreate --renew-anon-volumes
docker_exit=$?
if [ ${docker_exit} -eq 0 ]; then
echo "Container started successfully"
else
echo "Container started with errors"
exit ${docker_exit}
fi
if [ "x$DO_CLEAN" == 'xtrue' ]; then
echo 'Do docker Clean'
docker system prune -a -f
fi
./wait-elastic.sh 9201
# Create user record in accounts
./tool-cockroach.sh create-account user1 -f John -l Appleseed -p 1234
./tool-cockroach.sh create-account user2 -f Kainin -l Dirak -p 1234
./tool-cockroach.sh create-account admin -f Super -l User -p 1234
# Create workspace record in accounts
./tool-cockroach.sh create-workspace sanity-ws email:user1
./restore-cockroach.sh
rm -rf ./sanity/.auth
+1 -1
View File
@@ -2,7 +2,7 @@
docker compose -p sanity kill
docker compose -p sanity down --volumes
docker compose -p sanity up -d --force-recreate --renew-anon-volumes
docker compose -f docker-compose.yaml -f docker-compose.purepg.yaml -p sanity up -d --force-recreate --renew-anon-volumes
docker_exit=$?
if [ ${docker_exit} -eq 0 ]; then
echo "Container started successfully"
+2 -2
View File
@@ -2,7 +2,7 @@
docker compose -p sanity kill
docker compose -p sanity down --volumes
docker compose -f docker-compose.yaml -p sanity up elastic mongodb cockroach redpanda redpanda_console -d --force-recreate --renew-anon-volumes
docker compose -f docker-compose.yaml -p sanity up elastic mongodb cockroach postgres redpanda -d --force-recreate --renew-anon-volumes
docker_exit=$?
if [ ${docker_exit} -eq 0 ]; then
echo "Container started successfully"
@@ -11,4 +11,4 @@ else
exit ${docker_exit}
fi
./wait-elastic.sh 9201
./wait-elastic.sh 9201
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
# Restore workspace contents in mongo/elastic
./tool-cockroach.sh backup-restore ./sanity-ws sanity-ws --upgrade
# ./tool-cockroach.sh upgrade-workspace sanity-ws
# Re-assign user to workspace.
./tool-cockroach.sh assign-workspace user1 sanity-ws
./tool-cockroach.sh assign-workspace user2 sanity-ws
./tool-cockroach.sh set-user-role user1 sanity-ws OWNER
./tool-cockroach.sh set-user-role user2 sanity-ws OWNER
./tool-cockroach.sh configure sanity-ws --enable=*
./tool-cockroach.sh configure sanity-ws --list
# setup issue createdOn for yesterday
./tool-cockroach.sh change-field sanity-ws --objectId 65e47f1f1b875b51e3b4b983 --objectClass tracker:class:Issue --attribute createdOn --value $(($(date +%s)*1000 - 86400000)) --type number
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
export MODEL_VERSION=$(node ../common/scripts/show_version.js)
export STORAGE_CONFIG="datalake|http://localhost:4031"
export ACCOUNTS_URL=http://localhost:3003
export TRANSACTOR_URL=ws://localhost:3334
export ACCOUNT_DB_URL=postgresql://root@localhost:26258/defaultdb?sslmode=disable
export MONGO_URL=mongodb://localhost:27018
export ELASTIC_URL=http://localhost:9201
export SERVER_SECRET=secret
export DB_URL=postgresql://root@localhost:26258/defaultdb?sslmode=disable
export QUEUE_CONFIG='localhost:19093;-staging'
node ${TOOL_OPTIONS} ../dev/tool/bundle/bundle.js $@
+3 -3
View File
@@ -4,11 +4,11 @@ export MODEL_VERSION=$(node ../common/scripts/show_version.js)
export STORAGE_CONFIG="datalake|http://localhost:4031"
export ACCOUNTS_URL=http://localhost:3003
export TRANSACTOR_URL=ws://localhost:3334
export ACCOUNT_DB_URL=postgresql://root@localhost:26258/defaultdb?sslmode=disable
export ACCOUNT_DB_URL=postgresql://postgres:postgres@localhost:5433/postgres
export MONGO_URL=mongodb://localhost:27018
export ELASTIC_URL=http://localhost:9201
export SERVER_SECRET=secret
export DB_URL=postgresql://root@localhost:26258/defaultdb?sslmode=disable
export DB_URL=postgresql://postgres:postgres@localhost:5433/postgres
export QUEUE_CONFIG='localhost:19093;-staging'
node ${TOOL_OPTIONS} ../dev/tool/bundle/bundle.js $@
node ${TOOL_OPTIONS} ../dev/tool/bundle/bundle.js $@