Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
9 changes: 9 additions & 0 deletions examples/iceberg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

this demo shows how to read/write iceberg table using proton.

quick start:
1. run `docker compose up` to start the whole stack
2. open `localhost:8888` from the broswer and run all the python code that create iceberg table and write read data from `IcebergPythonTest` notebook
3. run `proton-client --user proton --password proton@t+` to start a proton client cli in the proton container
4. run all the script in `script/proton.sql` to query the iceberg table and write some data into iceberg table
5. in the notebook, rerun the cell that read the iceberg table and check the newly inserted data from proton.
3 changes: 3 additions & 0 deletions examples/iceberg/conf/proton-server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
url_scheme_mappers:
s3:
to: http://minio:9000/{bucket}
83 changes: 83 additions & 0 deletions examples/iceberg/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
version: '3.8'

services:
# Iceberg REST Catalog
iceberg-rest:
image: tabulario/iceberg-rest:latest
container_name: iceberg-rest
ports:
- "8181:8181"
environment:
- CATALOG_WAREHOUSE=s3://warehouse/
- CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO
- CATALOG_S3_ENDPOINT=http://minio:9000
- CATALOG_S3_ACCESS__KEY__ID=admin
- CATALOG_S3_SECRET__ACCESS__KEY=Password!
- CATALOG_S3_PATH__STYLE__ACCESS=true
- AWS_REGION=us-east-1
- CATALOG_S3_REGION=us-east-1
- CATALOG_URI__MAPPING=s3://warehouse/:http://minio:9000/warehouse/
depends_on:
- minio

# MinIO for storage
minio:
image: minio/minio:latest
container_name: minio
ports:
- "9000:9000"
- "9001:9001"
environment:
MINIO_ROOT_USER: admin
MINIO_ROOT_PASSWORD: Password!
command: server /data --console-address ":9001"
volumes:
- minio-data:/data

minio-setup:
image: minio/mc:latest
depends_on:
- minio
entrypoint: >
/bin/sh -c "
sleep 5;
/usr/bin/mc alias set myminio http://minio:9000 admin Password!;
/usr/bin/mc mb myminio/warehouse;
exit 0;
"

proton:
image: d.timeplus.com/timeplus-io/proton:latest
platform: linux/amd64
ports:
- 8002:8000
- 8463:8463
- 8123:8123
- 3218:3218
environment:
- ENABLE_DATA_PREALLOCATE=false
volumes:
- proton_data:/var/lib/proton/
- ./conf/proton-server.yaml:/etc/proton-server/config.d/proton-server.yaml:ro

# Jupyter Notebook
jupyter:
image: jupyter/pyspark-notebook:latest
container_name: jupyter-iceberg
ports:
- "8888:8888"
environment:
- JUPYTER_ENABLE_LAB=yes
- GRANT_SUDO=yes
volumes:
- ./notebooks:/home/jovyan/work
command: start-notebook.sh --NotebookApp.token='' --NotebookApp.password=''
depends_on:
- iceberg-rest
- minio
user: root
working_dir: /home/jovyan/work

volumes:
minio-data:
proton_data:
Loading