|
| 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 | + ozone-datanode: |
| 23 | + image: &ozone-image apache/ozone:2.0.0 |
| 24 | + ports: |
| 25 | + - 9864 |
| 26 | + command: ["ozone","datanode"] |
| 27 | + environment: |
| 28 | + &ozone-common-config |
| 29 | + OZONE-SITE.XML_hdds.datanode.dir: "/data/hdds" |
| 30 | + OZONE-SITE.XML_ozone.metadata.dirs: "/data/metadata" |
| 31 | + OZONE-SITE.XML_ozone.om.address: "ozone-om" |
| 32 | + OZONE-SITE.XML_ozone.om.http-address: "ozone-om:9874" |
| 33 | + OZONE-SITE.XML_ozone.recon.address: "ozone-recon:9891" |
| 34 | + OZONE-SITE.XML_ozone.recon.db.dir: "/data/metadata/recon" |
| 35 | + OZONE-SITE.XML_ozone.replication: "1" |
| 36 | + OZONE-SITE.XML_ozone.scm.block.client.address: "ozone-scm" |
| 37 | + OZONE-SITE.XML_ozone.scm.client.address: "ozone-scm" |
| 38 | + OZONE-SITE.XML_ozone.scm.datanode.id.dir: "/data/metadata" |
| 39 | + OZONE-SITE.XML_ozone.scm.names: "ozone-scm" |
| 40 | + no_proxy: "ozone-om,ozone-recon,ozone-scm,ozone-s3g,localhost,127.0.0.1" |
| 41 | + ozone-om: |
| 42 | + image: *ozone-image |
| 43 | + ports: |
| 44 | + - 9874:9874 |
| 45 | + environment: |
| 46 | + <<: *ozone-common-config |
| 47 | + CORE-SITE.XML_hadoop.proxyuser.hadoop.hosts: "*" |
| 48 | + CORE-SITE.XML_hadoop.proxyuser.hadoop.groups: "*" |
| 49 | + ENSURE_OM_INITIALIZED: /data/metadata/om/current/VERSION |
| 50 | + WAITFOR: ozone-scm:9876 |
| 51 | + command: ["ozone","om"] |
| 52 | + ozone-scm: |
| 53 | + image: *ozone-image |
| 54 | + ports: |
| 55 | + - 9876:9876 |
| 56 | + environment: |
| 57 | + <<: *ozone-common-config |
| 58 | + ENSURE_SCM_INITIALIZED: /data/metadata/scm/current/VERSION |
| 59 | + command: ["ozone","scm"] |
| 60 | + ozone-recon: |
| 61 | + image: *ozone-image |
| 62 | + ports: |
| 63 | + - 9888:9888 |
| 64 | + environment: |
| 65 | + <<: *ozone-common-config |
| 66 | + command: ["ozone","recon"] |
| 67 | + ozone-s3g: |
| 68 | + image: *ozone-image |
| 69 | + ports: |
| 70 | + - 9878:9878 |
| 71 | + environment: |
| 72 | + <<: *ozone-common-config |
| 73 | + command: ["ozone","s3g"] |
| 74 | + |
| 75 | + polaris: |
| 76 | + image: apache/polaris:latest |
| 77 | + ports: |
| 78 | + # API port |
| 79 | + - "8181:8181" |
| 80 | + # Optional, allows attaching a debugger to the Polaris JVM |
| 81 | + - "5005:5005" |
| 82 | + environment: |
| 83 | + JAVA_DEBUG: true |
| 84 | + JAVA_DEBUG_PORT: "*:5005" |
| 85 | + AWS_REGION: us-west-2 |
| 86 | + AWS_ACCESS_KEY_ID: minio_root |
| 87 | + AWS_SECRET_ACCESS_KEY: m1n1opwd |
| 88 | + POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,root,s3cr3t |
| 89 | + polaris.realm-context.realms: POLARIS |
| 90 | + quarkus.otel.sdk.disabled: "true" |
| 91 | + healthcheck: |
| 92 | + test: ["CMD", "curl", "http://localhost:8182/q/health"] |
| 93 | + interval: 2s |
| 94 | + timeout: 10s |
| 95 | + retries: 10 |
| 96 | + start_period: 10s |
| 97 | + |
| 98 | + polaris-setup: |
| 99 | + image: alpine/curl |
| 100 | + depends_on: |
| 101 | + polaris: |
| 102 | + condition: service_healthy |
| 103 | + environment: |
| 104 | + - CLIENT_ID=root |
| 105 | + - CLIENT_SECRET=s3cr3t |
| 106 | + volumes: |
| 107 | + - ../assets/:/assets/ |
| 108 | + entrypoint: "/bin/sh" |
| 109 | + command: |
| 110 | + - "-c" |
| 111 | + - >- |
| 112 | + /assets/cloud_providers/await-s3.sh http://ozone-s3g:9878/ ; |
| 113 | + source /assets/polaris/obtain-token.sh; |
| 114 | + echo Creating bucket...; |
| 115 | + curl -X PUT --user "invalidKey:secret" --aws-sigv4 "aws:amz:us-west-1:s3" \ |
| 116 | + http://ozone-s3g:9878/bucket123 ; |
| 117 | + echo Creating catalog...; |
| 118 | + export STORAGE_CONFIG_INFO='{"storageType":"S3", |
| 119 | + "endpoint":"http://localhost:9878", |
| 120 | + "endpointInternal":"http://ozone-s3g:9878", |
| 121 | + "stsUnavailable":true, |
| 122 | + "pathStyleAccess":true}'; |
| 123 | + export STORAGE_LOCATION='s3://bucket123'; |
| 124 | + /assets/polaris/create-catalog.sh POLARIS $$TOKEN; |
| 125 | + echo Extra grants...; |
| 126 | + curl -H "Authorization: Bearer $$TOKEN" -H 'Content-Type: application/json' \ |
| 127 | + -X PUT \ |
| 128 | + http://polaris:8181/api/management/v1/catalogs/quickstart_catalog/catalog-roles/catalog_admin/grants \ |
| 129 | + -d '{"type":"catalog", "privilege":"CATALOG_MANAGE_CONTENT"}'; |
| 130 | + echo Done.; |
| 131 | +
|
0 commit comments