wirelessr / trino-iceberg-playground

Query Iceberg in Trino, Nessie as Catalog, and use minio to replace AWS S3
https://lazypro.medium.com/7f4a1f7713ca
5 stars 2 forks source link

Adjusted .yml docker for WSL2 #1

Open clementlefevre opened 3 weeks ago

clementlefevre commented 3 weeks ago

Using your cool demo on WSL2 / Docker i had to adjust :

version: "3"

services:
  catalog:
    image: projectnessie/nessie
    container_name: catalog
    networks:
      iceberg-nessie-net:
    ports:
      - 19120:19120

  trino:
    image: trinodb/trino
    container_name: trino
    networks:
      iceberg-nessie-net:
    ports:
      - 8080:8080
    volumes:
      - "./example.properties:/etc/trino/catalog/example.properties"
      - "./post-init.sh:/tmp/post-init.sh"
      - "./post-init.sql:/tmp/post-init.sql"
    command:
      - "/tmp/post-init.sh"

  storage:
    image: minio/minio
    container_name: storage
    environment:
      - MINIO_ROOT_USER=admin
      - MINIO_ROOT_PASSWORD=password
      - MINIO_DOMAIN=storage
      - MINIO_REGION_NAME=us-east-1
      - MINIO_REGION=us-east-1
    networks:
      iceberg-nessie-net:
    ports:
      - 9100:9000
      - 9101:9001
    volumes:
      - ./data:/data
    command: ["server", "/data", "--address", ":9000", "--console-address", ":9001"]
  # Minio Client Container
  mc:
    depends_on:
      - storage
    image: minio/mc
    container_name: mc
    networks:
      iceberg-nessie-net:
        aliases:
          - minio.storage
    environment:
      - AWS_ACCESS_KEY_ID=admin
      - AWS_SECRET_ACCESS_KEY=password
      - AWS_REGION=us-east-1
      - AWS_DEFAULT_REGION=us-east-1
    entrypoint: >
      /bin/sh -c "
      until (/usr/bin/mc config host add minio http://storage:9000 admin password) do echo '...waiting...' && sleep 5; done;
      /usr/bin/mc rm -r --force minio/warehouse;
      /usr/bin/mc mb minio/warehouse;
      /usr/bin/mc mb minio/iceberg;
      /usr/bin/mc anonymous set public minio/warehouse;
      /usr/bin/mc anonymous set public minio/iceberg;
      tail -f /dev/null
      "

networks:
  iceberg-nessie-net:
wirelessr commented 3 weeks ago

the sql queries did not work on start

If you mean post init, I believe sleeping for 10 seconds is too short in your use case. Maybe you can adjust: sleep 10 at post-init.sh.