Skip to content

World's most powerful open data catalog for building a high-performance, geo-distributed and federated metadata lake.

4.3 KB
Raw Blame
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#  http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

services:

  hive:
    image: apache/gravitino-ci:hive-0.1.20
    networks:
      - default
    container_name: trino-ci-hive
    environment:
      - HADOOP_USER_NAME=anonymous
      - HIVE_RUNTIME_VERSION=${HIVE_RUNTIME_VERSION:-hive2}
      - TRINO_CONNECTOR_TEST=${TRINO_CONNECTOR_TEST:-false}
    entrypoint:  /bin/bash /tmp/hive/init.sh
    volumes:
      - ./init/hive:/tmp/hive
    healthcheck:
      test: ["CMD", "/tmp/check-status.sh"]
      interval: 10s
      timeout: 60s
      retries: 10

  postgresql:
    image: postgres:13
    container_name: trino-ci-postgresql
    restart: always
    environment:
      POSTGRES_USER: trino
      POSTGRES_PASSWORD: ds123
      ALLOW_IP_RANGE: 0.0.0.0/0
    networks:
      - default
    volumes:
      - ./init/postgres:/docker-entrypoint-initdb.d/
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 10s
      timeout: 60s
      retries: 5

  mysql:
    image: mysql:8.0
    container_name: trino-ci-mysql
    networks:
      - default
    volumes:
      - ./init/mysql:/docker-entrypoint-initdb.d/
    environment:
      MYSQL_ROOT_PASSWORD: ds123
      MYSQL_USER: trino
      MYSQL_PASSWORD: ds123
      MYSQL_DATABASE: gt_db
    command:
      --default-authentication-plugin=mysql_native_password
      --character-set-server=utf8mb4
      --collation-server=utf8mb4_general_ci
      --explicit_defaults_for_timestamp=true
      --lower_case_table_names=1
    healthcheck:
      test: ["CMD-SHELL", "mysqladmin ping"]
      interval: 10s
      timeout: 60s
      retries: 5

  trino:
    image: trinodb/trino:${TRINO_VERSION:-483}
    networks:
      - default
    container_name: trino-ci-trino
    environment:
      - HADOOP_USER_NAME=anonymous
      - GRAVITINO_HOST_IP=host.docker.internal
      - GRAVITINO_HOST_PORT=${GRAVITINO_SERVER_PORT:-8090}
      - GRAVITINO_METALAKE_NAME=test
      - HIVE_HOST_IP=hive
      - TRINO_WORKER_NUM=${TRINO_WORKER_NUM:-0}
      - TRINO_ROLE=coordinator
    entrypoint:  /bin/bash /tmp/trino/init.sh
    volumes:
      - ./init/trino:/tmp/trino
      - ${GRAVITINO_TRINO_CONNECTOR_DIR:-../../trino-connector/trino-connector-482-483/build/libs}:/usr/lib/trino/plugin/gravitino
    extra_hosts:
      - "host.docker.internal:host-gateway"
    healthcheck:
      test: ["CMD", "trino", "--execute", "SELECT 1"]
      interval: 10s
      timeout: 60s
      retries: 5
    depends_on:
      hive:
        condition: service_healthy
      postgresql:
        condition: service_healthy
      mysql:
        condition: service_healthy
      trino-worker:
        condition: service_healthy

  trino-worker:
    image: trinodb/trino:${TRINO_VERSION:-483}
    networks:
      - default
    deploy:
      replicas: ${TRINO_WORKER_NUM:-0}
    environment:
      - HADOOP_USER_NAME=anonymous
      - GRAVITINO_HOST_IP=host.docker.internal
      - GRAVITINO_HOST_PORT=${GRAVITINO_SERVER_PORT:-8090}
      - GRAVITINO_METALAKE_NAME=test
      - HIVE_HOST_IP=hive
      - TRINO_ROLE=worker
    entrypoint:  /bin/bash /tmp/trino/init.sh
    volumes:
      - ./init/trino:/tmp/trino
      - ${GRAVITINO_TRINO_CONNECTOR_DIR:-../../trino-connector/trino-connector-482-483/build/libs}:/usr/lib/trino/plugin/gravitino
    extra_hosts:
      - "host.docker.internal:host-gateway"
    depends_on:
      hive:
        condition: service_healthy
      postgresql:
        condition: service_healthy
      mysql:
        condition: service_healthy

networks:
  default:
    name: trino-net
    driver: bridge
    ipam:
      config:
        - subnet: 10.20.31.16/28