Skip to content

Commit

Permalink
ADH-5210
Browse files Browse the repository at this point in the history
- added files for starting trino server in multi node mode in docker containers
  • Loading branch information
VitekArkhipov committed Oct 23, 2024
1 parent 8b22b62 commit 44a9648
Show file tree
Hide file tree
Showing 24 changed files with 215 additions and 1 deletion.
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
```
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
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

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
37 changes: 37 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,11 @@
<requirePropertyDiverges>
<property>project.description</property>
</requirePropertyDiverges>
<requireUpperBoundDeps>
<excludes>
<exclude>org.postgresql:postgresql</exclude>
</excludes>
</requireUpperBoundDeps>
</rules>
</configuration>
</plugin>
Expand Down Expand Up @@ -2699,6 +2704,38 @@
</dependency>
</conflictingDependencies>
</exception>
<exception>
<conflictingDependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<dependency>
<groupId>com.opencsv</groupId>
<artifactId>opencsv</artifactId>
</dependency>
<dependency>
<groupId>io.arenadata</groupId>
<artifactId>trino-catalog-manager</artifactId>
</dependency>
</conflictingDependencies>
</exception>
</exceptions>
</configuration>
</plugin>
Expand Down
12 changes: 12 additions & 0 deletions testing/trino-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,25 @@
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>io.arenadata</groupId>
<artifactId>trino-catalog-manager</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.trino</groupId>
<artifactId>trino-main</artifactId>
<type>test-jar</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>io.arenadata</groupId>
<artifactId>trino-catalog-manager</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down

0 comments on commit 44a9648

Please sign in to comment.