Skip to content
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

[ADH-5210]: Create docke-compose for running trino cluster in containers #2

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
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
83d729d
ADH-4982
VitekArkhipov Sep 28, 2024
8b22b62
ADH-4982
VitekArkhipov Sep 30, 2024
44a9648
ADH-5210
VitekArkhipov Oct 23, 2024
3959401
ADH-5240
VitekArkhipov Nov 18, 2024
41932c6
ADH-5241
VitekArkhipov Nov 26, 2024
7bb5957
ADH-5332
VitekArkhipov Nov 27, 2024
1fd93f9
ADH-5241
VitekArkhipov Nov 28, 2024
61de6ec
ADH-5241
VitekArkhipov Nov 28, 2024
9cabe0a
ADH-5241
VitekArkhipov Nov 28, 2024
f5b0722
ADH-5241
VitekArkhipov Nov 28, 2024
bd1ddec
Merge pull request #4 from arenadata/feature/ADH-5241
VitekArkhipov Nov 28, 2024
d591a02
ADH-5240
VitekArkhipov Nov 28, 2024
4281e92
ADH-5240
VitekArkhipov Nov 29, 2024
df75758
ADH-5240
VitekArkhipov Nov 29, 2024
e81f023
Merge remote-tracking branch 'origin/feature/ADH-5240' into feature/A…
VitekArkhipov Nov 29, 2024
75f6f18
ADH-5231
VitekArkhipov Nov 29, 2024
14a319d
ADH-5231
VitekArkhipov Nov 29, 2024
ce438d4
ADH-5240
VitekArkhipov Dec 4, 2024
8408fa2
Merge branch 'feature/ADH-5240' into feature/ADH-5332
VitekArkhipov Dec 4, 2024
a74e292
ADH-5240
VitekArkhipov Dec 4, 2024
dbdf0bd
Merge branch 'feature/ADH-5240' into feature/ADH-5332
VitekArkhipov Dec 4, 2024
c14c03f
ADH-5332
VitekArkhipov Dec 5, 2024
ba328e5
Merge branch 'feature/ADH-5332' into feature/ADH-5331
VitekArkhipov Dec 5, 2024
8032a30
ADH-5331
VitekArkhipov Dec 5, 2024
03cc221
Merge pull request #3 from arenadata/feature/ADH-5240
iamlapa Dec 6, 2024
0c25a25
Merge pull request #5 from arenadata/feature/ADH-5332
iamlapa Dec 6, 2024
bef1dc9
[ADH-5242]: Prepare environment for integration tests for the trino-…
VitekArkhipov Jan 9, 2025
2b3b4a3
Merge branch 'feature/ADH-5331' into feature/ADH-5240
VitekArkhipov Jan 9, 2025
ad6616d
ADH-5240
VitekArkhipov Jan 9, 2025
e5cb83a
ADH-5240
VitekArkhipov Jan 9, 2025
d3cd813
Merge pull request #12 from arenadata/feature/ADH-5240
VitekArkhipov Jan 10, 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
4 changes: 4 additions & 0 deletions core/docker/arenadata/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TRINO_VERSION=455-SNAPSHOT-amd64
POSTGRES_DB=trino
POSTGRES_USER=trino
POSTGRES_PASSWORD=trino
35 changes: 35 additions & 0 deletions core/docker/arenadata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Trino server in multi node configuration in docker containers

## Build the project

```bash
cd ../../../
mvn clean install -DskipTests=true
```

## Build the docker image with a specific architecture

```bash
../build.sh -a amd64
```

## Start docker containers

```bash
docker compose --env-file .env up -d
```

## Stop docker containers

```bash
docker compose down -v
```

## Connect to server via trino-cli

* go to directory `../../../client/trino-cli/target`
* to start the cli in interactive mode, execute command:

```bash
./trino-cli-${TRINO_VERSION}-executable.jar http://localhost:8080
```
4 changes: 4 additions & 0 deletions core/docker/arenadata/coordinator/etc/catalog/adb.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
connector.name=adb
connection-url=jdbc:postgresql://adb:6000/postgres
connection-user=gpadmin
connection-password=gpadmin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connector.name=jmx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connector.name=memory
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
connector.name=postgresql
connection-url=jdbc:postgresql://postgres-db:5432/postgres
connection-user=trino
connection-password=trino
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connector.name=tpcds
tpcds.splits-per-node=4
2 changes: 2 additions & 0 deletions core/docker/arenadata/coordinator/etc/catalog/tpch.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connector.name=tpch
tpch.splits-per-node=4
9 changes: 9 additions & 0 deletions core/docker/arenadata/coordinator/etc/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coordinator=true
node-scheduler.include-coordinator=true
http-server.http.port=8080
discovery.uri=http://coordinator:8080
catalog.management=ARENADATA

arenadata.catalog.store.jdbc.url=jdbc:postgresql://postgres-db:5432/trino
arenadata.catalog.store.jdbc.username=trino
arenadata.catalog.store.jdbc.password=trino
16 changes: 16 additions & 0 deletions core/docker/arenadata/coordinator/etc/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-server
-agentpath:/usr/lib/trino/bin/libjvmkill.so
-XX:InitialRAMPercentage=80
-XX:MaxRAMPercentage=80
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:ReservedCodeCacheSize=256M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
# Allow loading dynamic agent used by JOL
-XX:+EnableDynamicAgentLoading
2 changes: 2 additions & 0 deletions core/docker/arenadata/coordinator/etc/log.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Enable verbose logging from Trino
io.trino=DEBUG
2 changes: 2 additions & 0 deletions core/docker/arenadata/coordinator/etc/node.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node.environment=docker
node.data-dir=/data/trino
184 changes: 184 additions & 0 deletions core/docker/arenadata/docker-compose-with-adb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
version: "3.8"
services:
postgres:
image: "docker.io/library/postgres:12.0"
restart: unless-stopped
container_name: postgres-db
hostname: postgres-db
environment:
POSTGRES_DB: '${POSTGRES_DB}'
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
ports:
- '5432:5432'
healthcheck:
test: psql -d ${POSTGRES_DB} -U ${POSTGRES_USER} -Atc 'SELECT 1;'
interval: 30s
timeout: 15s
retries: 3
networks:
- trino-with-adb

coordinator:
image: "trino:${TRINO_VERSION}"
ports:
- "8080:8080"
- "8990:8990"
container_name: "coordinator"
volumes:
- ./coordinator/etc:/etc/trino:rw
depends_on:
- postgres
networks:
- trino-with-adb

worker0:
image: "trino:${TRINO_VERSION}"
container_name: "worker0"
ports:
- "8081:8080"
- "8991:8990"
volumes:
- ./worker/etc:/etc/trino:rw
depends_on:
- postgres
networks:
- "trino-with-adb"

worker1:
image: "trino:${TRINO_VERSION}"
container_name: "worker1"
ports:
- "8082:8080"
- "8992:8990"
volumes:
- ./worker/etc:/etc/trino:rw
depends_on:
- postgres
networks:
- trino-with-adb

adb:
image: "hub.adsw.io/adbcc/gpdb6-adbm-distributed:it"
working_dir: /home/gpadmin
hostname: mdw
ports:
- "6000:6000"
- "38005:35285"
environment:
- ADB_CLUSTER_NAME=adb
- ADBM_EUREKA_CLIENT_HOSTNAME=mdw
- ADBM_EUREKA_CLIENT_IP_ADDRESS=mdw
- ADBM_EUREKA_CLIENT_PREFER_IP_ADDRESS=true
- ADBM_EUREKA_CLIENT_SERV_URL_DEF_ZONE=http://registry:8761/eureka
- AGENT_JAVA_OPTS=-XX:+HeapDumpOnOutOfMemoryError -XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+UseLWPSynchronization -XX:HeapDumpPath=/opt/adbm-agent/tmp/java_pid.hprof -Xlog:gc*,safepoint:gc.log:time,uptime:filecount=100,filesize=50M -Djava.library.path=/opt/adbm-agent/tmp -Djava.io.tmpdir=/opt/adbm-agent/tmp -Dlogging.config=/opt/adbm-agent/adbm-agent-logback.xml -Xmx2g -Xms256m -Dspring.config.location=file:///opt/adbm-agent/adbm-agent-application.yml
- DOCKER_GP_CLUSTER_HOSTS=mdw,smdw,sdw1,sdw2
- DOCKER_GP_MASTER_SERVER=mdw
- DOCKER_GP_STANDBY_SERVER=smdw
- DOCKER_GP_SEGMENT_SERVERS=sdw1,sdw2
- DOCKER_GP_PRIMARY_SEGMENTS_PER_HOST=2
- DOCKER_GP_WITH_MIRROR=true
depends_on:
- sdw1
- sdw2
- smdw
volumes:
- backup-data:/tmp/pgbackrest/:rw
privileged: true
extra_hosts:
- "host.docker.internal:host-gateway"
sysctls:
kernel.sem: 500 1024000 200 4096
networks:
- trino-with-adb

sdw1:
image: "hub.adsw.io/adbcc/gpdb6-adbm-distributed:it"
privileged: true
hostname: sdw1
ports:
- "38006:35285"
environment:
- ADB_CLUSTER_NAME=adb
- ADBM_EUREKA_CLIENT_HOSTNAME=sdw1
- ADBM_EUREKA_CLIENT_IP_ADDRESS=sdw1
- ADBM_EUREKA_CLIENT_PREFER_IP_ADDRESS=true
- ADBM_EUREKA_CLIENT_SERV_URL_DEF_ZONE=http://registry:8761/eureka
- AGENT_JAVA_OPTS=-XX:+HeapDumpOnOutOfMemoryError -XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+UseLWPSynchronization -XX:HeapDumpPath=/opt/adbm-agent/tmp/java_pid.hprof -Xlog:gc*,safepoint:gc.log:time,uptime:filecount=100,filesize=50M -Djava.library.path=/opt/adbm-agent/tmp -Djava.io.tmpdir=/opt/adbm-agent/tmp -Dlogging.config=/opt/adbm-agent/adbm-agent-logback.xml -Xmx2g -Xms256m -Dspring.config.location=file:///opt/adbm-agent/adbm-agent-application.yml
- DOCKER_GP_CLUSTER_HOSTS=mdw,smdw,sdw1,sdw2
- DOCKER_GP_MASTER_SERVER=mdw
- DOCKER_GP_STANDBY_SERVER=smdw
- DOCKER_GP_SEGMENT_SERVERS=sdw1,sdw2
- DOCKER_GP_PRIMARY_SEGMENTS_PER_HOST=2
- DOCKER_GP_WITH_MIRROR=true
volumes:
- backup-data:/tmp/pgbackrest/:rw
extra_hosts:
- "host.docker.internal:host-gateway"
sysctls:
kernel.sem: 500 1024000 200 4096
networks:
- trino-with-adb

sdw2:
image: "hub.adsw.io/adbcc/gpdb6-adbm-distributed:it"
privileged: true
hostname: sdw2
ports:
- "38007:35285"
environment:
- ADB_CLUSTER_NAME=adb
- ADBM_EUREKA_CLIENT_HOSTNAME=sdw2
- ADBM_EUREKA_CLIENT_IP_ADDRESS=sdw2
- ADBM_EUREKA_CLIENT_PREFER_IP_ADDRESS=true
- ADBM_EUREKA_CLIENT_SERV_URL_DEF_ZONE=http://registry:8761/eureka
- AGENT_JAVA_OPTS=-XX:+HeapDumpOnOutOfMemoryError -XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+UseLWPSynchronization -XX:HeapDumpPath=/opt/adbm-agent/tmp/java_pid.hprof -Xlog:gc*,safepoint:gc.log:time,uptime:filecount=100,filesize=50M -Djava.library.path=/opt/adbm-agent/tmp -Djava.io.tmpdir=/opt/adbm-agent/tmp -Dlogging.config=/opt/adbm-agent/adbm-agent-logback.xml -Xmx2g -Xms256m -Dspring.config.location=file:///opt/adbm-agent/adbm-agent-application.yml
- DOCKER_GP_CLUSTER_HOSTS=mdw,smdw,sdw1,sdw2
- DOCKER_GP_MASTER_SERVER=mdw
- DOCKER_GP_STANDBY_SERVER=smdw
- DOCKER_GP_SEGMENT_SERVERS=sdw1,sdw2
- DOCKER_GP_PRIMARY_SEGMENTS_PER_HOST=2
- DOCKER_GP_WITH_MIRROR=true
volumes:
- backup-data:/tmp/pgbackrest/:rw
extra_hosts:
- "host.docker.internal:host-gateway"
sysctls:
kernel.sem: 500 1024000 200 4096
networks:
- trino-with-adb

smdw:
image: "hub.adsw.io/adbcc/gpdb6-adbm-distributed:it"
privileged: true
hostname: smdw
ports:
- "5433:6000"
- "38008:35285"
environment:
- ADB_CLUSTER_NAME=adb
- ADBM_EUREKA_CLIENT_HOSTNAME=smdw
- ADBM_EUREKA_CLIENT_IP_ADDRESS=smdw
- ADBM_EUREKA_CLIENT_PREFER_IP_ADDRESS=true
- ADBM_EUREKA_CLIENT_SERV_URL_DEF_ZONE=http://registry:8761/eureka
- AGENT_JAVA_OPTS=-XX:+HeapDumpOnOutOfMemoryError -XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+UseLWPSynchronization -XX:HeapDumpPath=/opt/adbm-agent/tmp/java_pid.hprof -Xlog:gc*,safepoint:gc.log:time,uptime:filecount=100,filesize=50M -Djava.library.path=/opt/adbm-agent/tmp -Djava.io.tmpdir=/opt/adbm-agent/tmp -Dlogging.config=/opt/adbm-agent/adbm-agent-logback.xml -Xmx2g -Xms256m -Dspring.config.location=file:///opt/adbm-agent/adbm-agent-application.yml
- DOCKER_GP_CLUSTER_HOSTS=mdw,smdw,sdw1,sdw2
- DOCKER_GP_MASTER_SERVER=mdw
- DOCKER_GP_STANDBY_SERVER=smdw
- DOCKER_GP_SEGMENT_SERVERS=sdw1,sdw2
- DOCKER_GP_PRIMARY_SEGMENTS_PER_HOST=2
- DOCKER_GP_WITH_MIRROR=true
volumes:
- backup-data:/tmp/pgbackrest/:rw
extra_hosts:
- "host.docker.internal:host-gateway"
sysctls:
kernel.sem: 500 1024000 200 4096
networks:
- trino-with-adb

networks:
trino-with-adb:
volumes:
backup-data:
driver: local
49 changes: 49 additions & 0 deletions core/docker/arenadata/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
version: "3.8"
services:
postgres:
image: "docker.io/library/postgres:12.0"
restart: unless-stopped
container_name: postgres-db
hostname: postgres-db
environment:
POSTGRES_DB: '${POSTGRES_DB}'
POSTGRES_USER: '${POSTGRES_USER}'
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
ports:
- '5432:5432'
healthcheck:
test: psql -d ${POSTGRES_DB} -U ${POSTGRES_USER} -Atc 'SELECT 1;'
interval: 30s
timeout: 15s
retries: 3

coordinator:
image: "trino:${TRINO_VERSION}"
ports:
- "8080:8080"
container_name: "coordinator"
volumes:
- ./coordinator/etc:/etc/trino:rw
depends_on:
- postgres

worker0:
image: "trino:${TRINO_VERSION}"
container_name: "worker0"
ports:
- "8081:8080"
volumes:
- ./worker/etc:/etc/trino:rw
depends_on:
- postgres

worker1:
image: "trino:${TRINO_VERSION}"
container_name: "worker1"
ports:
- "8082:8080"
volumes:
- ./worker/etc:/etc/trino:rw
depends_on:
- postgres

4 changes: 4 additions & 0 deletions core/docker/arenadata/worker/etc/catalog/adb.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
connector.name=adb
connection-url=jdbc:postgresql://adb:6000/postgres
connection-user=gpadmin
connection-password=gpadmin
1 change: 1 addition & 0 deletions core/docker/arenadata/worker/etc/catalog/jmx.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connector.name=jmx
1 change: 1 addition & 0 deletions core/docker/arenadata/worker/etc/catalog/memory.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
connector.name=memory
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
connector.name=postgresql
connection-url=jdbc:postgresql://postgres-db:5432/postgres
connection-user=trino
connection-password=trino
2 changes: 2 additions & 0 deletions core/docker/arenadata/worker/etc/catalog/tpcds.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connector.name=tpcds
tpcds.splits-per-node=4
2 changes: 2 additions & 0 deletions core/docker/arenadata/worker/etc/catalog/tpch.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connector.name=tpch
tpch.splits-per-node=4
9 changes: 9 additions & 0 deletions core/docker/arenadata/worker/etc/config.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#single node install config
coordinator=false
http-server.http.port=8080
discovery.uri=http://coordinator:8080
catalog.management=ARENADATA

arenadata.catalog.store.jdbc.url=jdbc:postgresql://postgres-db:5432/trino
arenadata.catalog.store.jdbc.username=trino
arenadata.catalog.store.jdbc.password=trino
16 changes: 16 additions & 0 deletions core/docker/arenadata/worker/etc/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-server
-agentpath:/usr/lib/trino/bin/libjvmkill.so
-XX:InitialRAMPercentage=80
-XX:MaxRAMPercentage=80
-XX:G1HeapRegionSize=32M
-XX:+ExplicitGCInvokesConcurrent
-XX:+HeapDumpOnOutOfMemoryError
-XX:+ExitOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-XX:ReservedCodeCacheSize=256M
-XX:PerMethodRecompilationCutoff=10000
-XX:PerBytecodeRecompilationCutoff=10000
-Djdk.attach.allowAttachSelf=true
-Djdk.nio.maxCachedBufferSize=2000000
# Allow loading dynamic agent used by JOL
-XX:+EnableDynamicAgentLoading
2 changes: 2 additions & 0 deletions core/docker/arenadata/worker/etc/log.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Enable verbose logging from Trino
io.trino=DEBUG
2 changes: 2 additions & 0 deletions core/docker/arenadata/worker/etc/node.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node.environment=docker
node.data-dir=/data/trino
1 change: 0 additions & 1 deletion core/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ for arch in "${ARCHITECTURES[@]}"; do
echo "🫙 Building the image for $arch with JDK ${JDK_RELEASE}"
docker build \
"${WORK_DIR}" \
--progress=plain \
--pull \
--build-arg JDK_VERSION="${JDK_RELEASE}" \
--build-arg JDK_DOWNLOAD_LINK="$(jdk_download_link "${JDKS_PATH}/${JDK_RELEASE}" "${arch}")" \
Expand Down
Loading
Loading