Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
18 changes: 9 additions & 9 deletions docker-compose/iceberg/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Licensed to the Apache Software Foundation (ASF) under one
= Redpanda Iceberg Docker Compose Example
:env-docker: true
:page-categories: Iceberg, Tiered Storage, Management, High Availability, Data Replication, Integration
:description: Pair Redpanda with MinIO for Tiered Storage and write data in the Iceberg format to enable seamless analytics workflows on data in Redpanda topics.
:description: Pair Redpanda with RustFS for Tiered Storage and write data in the Iceberg format to enable seamless analytics workflows on data in Redpanda topics.
:page-layout: lab
// Set up attributes to hold the latest version of Redpanda and Redpanda Console.
// For GitHub, hard-code the latest version to these values:
Expand All @@ -33,12 +33,12 @@ ifdef::env-site[]
// All pages already have access to {latest-console-version} on the docs site.
endif::[]

This lab provides a Docker Compose environment to help you quickly get started with Redpanda and its integration with Apache Iceberg. It showcases how Redpanda, when paired with a Tiered Storage solution like MinIO, can write data in the Iceberg format, enabling seamless analytics workflows. The lab also includes a Spark environment configured for querying the Iceberg tables using SQL within a Jupyter Notebook interface.
This lab provides a Docker Compose environment to help you quickly get started with Redpanda and its integration with Apache Iceberg. It showcases how Redpanda, when paired with a Tiered Storage solution like RustFS, can write data in the Iceberg format, enabling seamless analytics workflows. The lab also includes a Spark environment configured for querying the Iceberg tables using SQL within a Jupyter Notebook interface.

In this setup, you will:

- Produce data to Redpanda topics that are Iceberg-enabled.
- Observe how Redpanda writes this data in Iceberg format to MinIO as the Tiered Storage backend.
- Observe how Redpanda writes this data in Iceberg format to RustFS as the Tiered Storage backend.
- Use Spark to query the Iceberg tables, demonstrating a complete pipeline from data production to querying.

This environment is ideal for experimenting with Redpanda's Iceberg and Tiered Storage capabilities, enabling you to test end-to-end workflows for analytics and data lake architectures.
Expand Down Expand Up @@ -87,13 +87,13 @@ For example:
export REDPANDA_CONSOLE_VERSION=v{latest-console-version}
----

. Start the Docker Compose environment, which includes Redpanda, MinIO, Spark, and Jupyter Notebook:
. Start the Docker Compose environment, which includes Redpanda, RustFS, Spark, and Jupyter Notebook:
+
```bash
docker compose build && docker compose up
docker compose up -d
```
+
The build process may take a few minutes to complete, as it builds the Spark image with the necessary dependencies for Iceberg.
The first Spark session you start downloads the Iceberg libraries, so your first query can take a minute.

. Create and switch to a new `rpk` profile that connects to your Redpanda broker:
+
Expand All @@ -116,12 +116,12 @@ echo "hello world" | rpk topic produce key_value --format='%k %v\n'

. Open Redpanda Console at http://localhost:8081/topics to see that the topics exist in Redpanda.

. Open MinIO at http://localhost:9001/browser to view your data stored in the S3-compatible object store.
. Open the https://rustfs.com/[RustFS^] console at http://localhost:9001/rustfs/console/ to view your data stored in the S3-compatible object store.
+
Login credentials:
+
- Username: `minio`
- Password: `minio123`
- Account: `rustfs`
- Key: `rustfs123`

. Open the Jupyter Notebook server at http://localhost:8888. The notebook guides you through querying Iceberg tables created from Redpanda topics. Complete the next two steps first before running the code in the notebook.

Expand Down
92 changes: 54 additions & 38 deletions docker-compose/iceberg/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ networks:
driver: bridge
volumes:
redpanda-0: null
minio: null
rustfs: null
services:
redpanda-0:
container_name: redpanda-0
Expand Down Expand Up @@ -34,9 +34,9 @@ services:
# Enable Tiered Storage (TS)
- --set redpanda.cloud_storage_enabled=true
- --set redpanda.cloud_storage_region=local
- --set redpanda.cloud_storage_access_key=minio
- --set redpanda.cloud_storage_secret_key=minio123
- --set redpanda.cloud_storage_api_endpoint=minio
- --set redpanda.cloud_storage_access_key=rustfs
- --set redpanda.cloud_storage_secret_key=rustfs123
- --set redpanda.cloud_storage_api_endpoint=rustfs
- --set redpanda.cloud_storage_api_endpoint_port=9000
- --set redpanda.cloud_storage_disable_tls=true
- --set redpanda.cloud_storage_bucket=redpanda
Expand All @@ -63,45 +63,56 @@ services:
- 18082:18082
- 19092:19092
- 19644:9644
# Not just rustfs started: Redpanda checks the bucket at startup and
# aborts if it does not exist yet.
depends_on:
- minio
- catalog
minio:
container_name: minio
image: minio/minio
command: server --console-address ":9001" /data
createbucket:
condition: service_completed_successfully
catalog:
condition: service_started
rustfs:
container_name: rustfs
image: rustfs/rustfs:1.0.0
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
MINIO_SERVER_URL: "http://minio:9000"
MINIO_REGION_NAME: local
MINIO_DOMAIN: minio
RUSTFS_ACCESS_KEY: rustfs
RUSTFS_SECRET_KEY: rustfs123
RUSTFS_CONSOLE_ENABLE: "true"
RUSTFS_REGION: local
# Lets clients address the bucket virtual-host style, as redpanda.rustfs.
RUSTFS_SERVER_DOMAINS: rustfs
volumes:
- minio:/data
- rustfs:/data
networks:
redpanda_network:
aliases:
- redpanda.minio
mc:
- redpanda.rustfs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/health"]
interval: 5s
timeout: 5s
retries: 10
# Creates the bucket and makes it anonymously readable, then exits. Skips
# the create when the bucket survives a restart with the volumes kept.
createbucket:
depends_on:
- minio
image: minio/mc:RELEASE.2025-05-21T01-59-54Z
container_name: mc
rustfs:
condition: service_healthy
image: amazon/aws-cli:2.37.1
container_name: createbucket
networks:
- redpanda_network
environment:
- AWS_ACCESS_KEY_ID=minio
- AWS_SECRET_ACCESS_KEY=minio123
- AWS_ACCESS_KEY_ID=rustfs
- AWS_SECRET_ACCESS_KEY=rustfs123
- AWS_REGION=local
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc alias set minio http://minio:9000 minio minio123) do echo '...waiting...' && sleep 1; done;
/usr/bin/mc mb minio/redpanda;
/usr/bin/mc anonymous set download minio/redpanda;
tail -f /dev/null
aws --endpoint-url http://rustfs:9000 s3api head-bucket --bucket redpanda 2>/dev/null ||
aws --endpoint-url http://rustfs:9000 s3 mb s3://redpanda &&
aws --endpoint-url http://rustfs:9000 s3api put-bucket-policy --bucket redpanda --policy '{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":[\"s3:GetObject\",\"s3:ListBucket\",\"s3:GetBucketLocation\"],\"Resource\":[\"arn:aws:s3:::redpanda\",\"arn:aws:s3:::redpanda/*\"]}]}'
"
console:
container_name: redpanda-console
Expand Down Expand Up @@ -132,30 +143,35 @@ services:
networks:
- redpanda_network
depends_on:
- minio
- rustfs
ports:
- 8181:8181
environment:
- AWS_ACCESS_KEY_ID=minio
- AWS_SECRET_ACCESS_KEY=minio123
- AWS_ACCESS_KEY_ID=rustfs
- AWS_SECRET_ACCESS_KEY=rustfs123
- AWS_REGION=local
- CATALOG_WAREHOUSE=s3://redpanda/
- CATALOG_IO__IMPL=org.apache.iceberg.aws.s3.S3FileIO
- CATALOG_S3_ENDPOINT=http://minio:9000
- CATALOG_S3_ENDPOINT=http://rustfs:9000
# Jupyter with PySpark, from the Jupyter Docker Stacks. The Iceberg jars
# are fetched from Maven when the first Spark session starts; see
# spark/spark-defaults.conf.
spark-iceberg:
container_name: spark-iceberg
build: spark/
image: quay.io/jupyter/pyspark-notebook:spark-4.1.2
command: start-notebook.py --IdentityProvider.token='' --ServerApp.root_dir=/home/jovyan/notebooks
networks:
- redpanda_network
depends_on:
- minio
- rustfs
- catalog
environment:
- AWS_ACCESS_KEY_ID=minio
- AWS_SECRET_ACCESS_KEY=minio123
- AWS_ACCESS_KEY_ID=rustfs
- AWS_SECRET_ACCESS_KEY=rustfs123
- AWS_REGION=local
volumes:
- ./spark/spark-defaults.conf:/usr/local/spark/conf/spark-defaults.conf:ro
- ./spark/notebooks:/home/jovyan/notebooks
ports:
- 8888:8888
- 8080:8080
- 10000:10000
- 10001:10001
- 4040:4040
24 changes: 0 additions & 24 deletions docker-compose/iceberg/spark/.pyiceberg.yaml

This file was deleted.

117 changes: 0 additions & 117 deletions docker-compose/iceberg/spark/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions docker-compose/iceberg/spark/entrypoint.sh

This file was deleted.

Loading
Loading