|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +# or more contributor license agreements. See the NOTICE file |
| 4 | +# distributed with this work for additional information |
| 5 | +# regarding copyright ownership. The ASF licenses this file |
| 6 | +# to you under the Apache License, Version 2.0 (the |
| 7 | +# "License"); you may not use this file except in compliance |
| 8 | +# with the License. You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, |
| 13 | +# software distributed under the License is distributed on an |
| 14 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +# KIND, either express or implied. See the License for the |
| 16 | +# specific language governing permissions and limitations |
| 17 | +# under the License. |
| 18 | +# |
| 19 | + |
| 20 | +services: |
| 21 | + |
| 22 | + polaris: |
| 23 | + # IMPORTANT: the image MUST contain the Postgres JDBC driver and EclipseLink dependencies, see README for instructions |
| 24 | + image: apache/polaris:postgres-latest |
| 25 | + ports: |
| 26 | + # API port |
| 27 | + - "8181:8181" |
| 28 | + # Management port (metrics and health checks) |
| 29 | + - "8182:8182" |
| 30 | + # Optional, allows attaching a debugger to the Polaris JVM |
| 31 | + - "5005:5005" |
| 32 | + depends_on: |
| 33 | + polaris-bootstrap: |
| 34 | + condition: service_completed_successfully |
| 35 | + postgres: |
| 36 | + condition: service_healthy |
| 37 | + environment: |
| 38 | + JAVA_DEBUG: "true" |
| 39 | + JAVA_DEBUG_PORT: "*:5005" |
| 40 | + polaris.persistence.type: eclipse-link |
| 41 | + polaris.persistence.eclipselink.configuration-file: /deployments/config/eclipselink/persistence.xml |
| 42 | + polaris.realm-context.realms: POLARIS |
| 43 | + quarkus.otel.sdk.disabled: "true" |
| 44 | + volumes: |
| 45 | + - ../assets/eclipselink/:/deployments/config/eclipselink |
| 46 | + healthcheck: |
| 47 | + test: ["CMD", "curl", "http://localhost:8182/q/health"] |
| 48 | + interval: 2s |
| 49 | + timeout: 10s |
| 50 | + retries: 10 |
| 51 | + |
| 52 | + polaris-bootstrap: |
| 53 | + # IMPORTANT: the image MUST contain the Postgres JDBC driver and EclipseLink dependencies, see README for instructions |
| 54 | + image: apache/polaris-admin-tool:postgres-latest |
| 55 | + depends_on: |
| 56 | + postgres: |
| 57 | + condition: service_healthy |
| 58 | + environment: |
| 59 | + polaris.persistence.type: eclipse-link |
| 60 | + polaris.persistence.eclipselink.configuration-file: /deployments/config/eclipselink/persistence.xml |
| 61 | + volumes: |
| 62 | + - ../assets/eclipselink/:/deployments/config/eclipselink |
| 63 | + command: |
| 64 | + - "bootstrap" |
| 65 | + - "--realm=POLARIS" |
| 66 | + - "--credential=POLARIS,root,s3cr3t" |
| 67 | + |
| 68 | + polaris-setup: |
| 69 | + image: alpine/curl |
| 70 | + depends_on: |
| 71 | + polaris: |
| 72 | + condition: service_healthy |
| 73 | + volumes: |
| 74 | + - ../assets/polaris/:/polaris |
| 75 | + entrypoint: '/bin/sh -c "chmod +x /polaris/create-catalog.sh && /polaris/create-catalog.sh"' |
| 76 | + |
| 77 | + postgres: |
| 78 | + image: postgres:17.2 |
| 79 | + ports: |
| 80 | + - "5432:5432" |
| 81 | + # set shared memory limit when using docker-compose |
| 82 | + shm_size: 128mb |
| 83 | + environment: |
| 84 | + POSTGRES_USER: postgres |
| 85 | + POSTGRES_PASSWORD: postgres |
| 86 | + POSTGRES_DB: POLARIS |
| 87 | + POSTGRES_INITDB_ARGS: "--encoding UTF8 --data-checksums" |
| 88 | + healthcheck: |
| 89 | + test: "pg_isready -U postgres" |
| 90 | + interval: 5s |
| 91 | + timeout: 2s |
| 92 | + retries: 15 |
| 93 | + |
| 94 | + spark-sql: |
| 95 | + image: apache/spark:3.5.4-java17-python3 |
| 96 | + depends_on: |
| 97 | + polaris-setup: |
| 98 | + condition: service_completed_successfully |
| 99 | + stdin_open: true |
| 100 | + tty: true |
| 101 | + ports: |
| 102 | + - "4040-4045:4040-4045" |
| 103 | + healthcheck: |
| 104 | + test: "curl localhost:4040" |
| 105 | + interval: 5s |
| 106 | + retries: 15 |
| 107 | + command: [ |
| 108 | + /opt/spark/bin/spark-sql, |
| 109 | + --packages, "org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.7.0,software.amazon.awssdk:bundle:2.28.17,software.amazon.awssdk:url-connection-client:2.28.17", |
| 110 | + --conf, "spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions", |
| 111 | + --conf, "spark.sql.catalog.polaris=org.apache.iceberg.spark.SparkCatalog", |
| 112 | + --conf, "spark.sql.catalog.polaris.type=rest", |
| 113 | + --conf, "spark.sql.catalog.polaris.warehouse=polaris_demo", |
| 114 | + --conf, "spark.sql.catalog.polaris.uri=http://polaris:8181/api/catalog", |
| 115 | + --conf, "spark.sql.catalog.polaris.credential=root:s3cr3t", |
| 116 | + --conf, "spark.sql.catalog.polaris.scope=PRINCIPAL_ROLE:ALL", |
| 117 | + --conf, "spark.sql.defaultCatalog=polaris", |
| 118 | + --conf, "spark.sql.catalogImplementation=in-memory", |
| 119 | + ] |
| 120 | + volumes: |
| 121 | + - ~/.ivy2:/home/spark/.ivy2 |
0 commit comments