Skip to content

Commit 4e255d4

Browse files
committed
Adds Docker Compose setup for Trino
Adds a Docker Compose configuration for setting up Trino with Iceberg, including support for Hive Metastore and REST catalog types. This allows for easier testing and development with Trino and Iceberg. closes #2219
1 parent 63a37b1 commit 4e255d4

File tree

4 files changed

+122
-0
lines changed

4 files changed

+122
-0
lines changed

dev/docker-compose-integration.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ services:
5454
- CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO
5555
- CATALOG_S3_ENDPOINT=http://minio:9000
5656
- CATALOG_JDBC_STRICT__MODE=true
57+
58+
trino:
59+
image: trinodb/trino:476
60+
container_name: pyiceberg-trino
61+
networks:
62+
iceberg_net:
63+
ports:
64+
- 8082:8080
65+
environment:
66+
- CATALOG_MANAGEMENT=dynamic
67+
depends_on:
68+
- rest
69+
- hive
70+
volumes:
71+
- ./trino/catalog:/etc/trino/catalog
5772
minio:
5873
image: minio/minio
5974
container_name: pyiceberg-minio

dev/docker-compose-trino.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
services:
2+
rest:
3+
image: apache/iceberg-rest-fixture
4+
container_name: pyiceberg-rest
5+
networks:
6+
iceberg_net:
7+
ports:
8+
- 8181:8181
9+
environment:
10+
- AWS_ACCESS_KEY_ID=admin
11+
- AWS_SECRET_ACCESS_KEY=password
12+
- AWS_REGION=us-east-1
13+
- CATALOG_WAREHOUSE=s3://warehouse/
14+
- CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO
15+
- CATALOG_S3_ENDPOINT=http://minio:9000
16+
17+
trino:
18+
image: trinodb/trino:476
19+
container_name: pyiceberg-trino
20+
networks:
21+
iceberg_net:
22+
ports:
23+
- 8082:8080
24+
environment:
25+
- CATALOG_MANAGEMENT=dynamic
26+
depends_on:
27+
- rest
28+
- hive
29+
volumes:
30+
- ./trino/catalog:/etc/trino/catalog
31+
32+
minio:
33+
image: minio/minio
34+
container_name: pyiceberg-minio
35+
environment:
36+
- MINIO_ROOT_USER=admin
37+
- MINIO_ROOT_PASSWORD=password
38+
- MINIO_DOMAIN=minio
39+
networks:
40+
iceberg_net:
41+
aliases:
42+
- warehouse.minio
43+
ports:
44+
- 9001:9001
45+
- 9000:9000
46+
command: ["server", "/data", "--console-address", ":9001"]
47+
mc:
48+
depends_on:
49+
- minio
50+
image: minio/mc
51+
container_name: pyiceberg-mc
52+
networks:
53+
iceberg_net:
54+
environment:
55+
- AWS_ACCESS_KEY_ID=admin
56+
- AWS_SECRET_ACCESS_KEY=password
57+
- AWS_REGION=us-east-1
58+
entrypoint: >
59+
/bin/sh -c "
60+
until (/usr/bin/mc alias set minio http://minio:9000 admin password) do echo '...waiting...' && sleep 1; done;
61+
/usr/bin/mc mb minio/warehouse;
62+
/usr/bin/mc policy set public minio/warehouse;
63+
tail -f /dev/null
64+
"
65+
66+
hive:
67+
build: hive/
68+
container_name: hive
69+
hostname: hive
70+
networks:
71+
iceberg_net:
72+
ports:
73+
- 9083:9083
74+
environment:
75+
SERVICE_NAME: "metastore"
76+
SERVICE_OPTS: "-Dmetastore.warehouse.dir=s3a://warehouse/hive/"
77+
78+
networks:
79+
iceberg_net:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
connector.name=iceberg
2+
iceberg.catalog.type=hive_metastore
3+
iceberg.expire-snapshots.min-retention=0d
4+
iceberg.remove-orphan-files.min-retention=0d
5+
iceberg.register-table-procedure.enabled=true
6+
hive.metastore.uri=thrift://hive:9083
7+
iceberg.hive-catalog-name=hive
8+
fs.native-s3.enabled=true
9+
s3.region=us-east-1
10+
s3.aws-access-key=admin
11+
s3.aws-secret-key=password
12+
s3.endpoint=http://minio:9000
13+
s3.path-style-access=false
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
connector.name=iceberg
2+
iceberg.catalog.type=rest
3+
iceberg.rest-catalog.uri=http://rest:8181
4+
iceberg.rest-catalog.warehouse=s3://warehouse/default
5+
iceberg.rest-catalog.nested-namespace-enabled=false
6+
iceberg.rest-catalog.case-insensitive-name-matching=true
7+
iceberg.expire-snapshots.min-retention=0d
8+
iceberg.remove-orphan-files.min-retention=0d
9+
iceberg.register-table-procedure.enabled=true
10+
fs.native-s3.enabled=true
11+
s3.region=us-east-1
12+
s3.aws-access-key=admin
13+
s3.aws-secret-key=password
14+
s3.endpoint=http://minio:9000
15+
s3.path-style-access=false

0 commit comments

Comments
 (0)