-
Notifications
You must be signed in to change notification settings - Fork 332
docs: Add quickstart documentation #2976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dimas-b
merged 6 commits into
apache:main
from
adam-christian-software:adam-christian-1590-1
Nov 6, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
66be692
docs(1590): Add quickstart documentation
adam-christian-software 8787432
Update based on PR feedback
adam-christian-software 28a8a01
Update to MinIO Storage
adam-christian-software 7259f73
Update getting-started/quickstart/docker-compose.yml
adam-christian-software 58cb5dd
Update getting-started/quickstart/docker-compose.yml
adam-christian-software 0de3358
Update getting-started/quickstart/docker-compose.yml
adam-christian-software File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <!-- | ||
| 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. | ||
| --> | ||
|
|
||
| # Apache Polaris Quickstart | ||
|
|
||
| Please see the [quickstart guide](../../site/content/in-dev/unreleased/getting-started/quick-start.md) for more information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,259 @@ | ||
| # | ||
| # 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: | ||
|
|
||
| minio: | ||
| image: quay.io/minio/minio:latest | ||
| ports: | ||
| # API port | ||
| - "9000:9000" | ||
| # UI port | ||
| - "9001:9001" | ||
| environment: | ||
| MINIO_ROOT_USER: minio_root | ||
| MINIO_ROOT_PASSWORD: m1n1opwd | ||
| command: | ||
| - "server" | ||
| - "/data" | ||
| - "--console-address" | ||
| - ":9001" | ||
| healthcheck: | ||
| test: ["CMD", "curl", "http://127.0.0.1:9000/minio/health/live"] | ||
| interval: 1s | ||
| timeout: 10s | ||
|
|
||
| polaris: | ||
| image: apache/polaris:latest | ||
| ports: | ||
| # API port | ||
| - "8181:8181" | ||
| # Management port (metrics and health checks) | ||
| - "8182:8182" | ||
| # Optional, allows attaching a debugger to the Polaris JVM | ||
| - "5005:5005" | ||
| depends_on: | ||
| minio: | ||
| condition: service_healthy | ||
| environment: | ||
| JAVA_DEBUG: true | ||
| JAVA_DEBUG_PORT: "*:5005" | ||
| AWS_REGION: us-west-2 | ||
| AWS_ACCESS_KEY_ID: minio_root | ||
| AWS_SECRET_ACCESS_KEY: m1n1opwd | ||
| POLARIS_BOOTSTRAP_CREDENTIALS: POLARIS,${ROOT_CLIENT_ID:-root},${ROOT_CLIENT_SECRET:-s3cr3t} | ||
| polaris.realm-context.realms: ${POLARIS_REALM:-POLARIS} | ||
| quarkus.otel.sdk.disabled: "true" | ||
| healthcheck: | ||
| test: ["CMD", "curl", "http://localhost:8182/q/health"] | ||
| interval: 2s | ||
| timeout: 10s | ||
| retries: 10 | ||
| start_period: 10s | ||
|
|
||
| setup_bucket: | ||
| image: quay.io/minio/mc:latest | ||
| depends_on: | ||
| minio: | ||
| condition: service_healthy | ||
| entrypoint: "/bin/sh" | ||
| command: | ||
| - "-c" | ||
| - >- | ||
| echo Creating MinIO bucket...; | ||
| mc alias set pol http://minio:9000 minio_root m1n1opwd; | ||
| mc mb pol/bucket123; | ||
| mc ls pol; | ||
| echo Bucket setup complete.; | ||
|
|
||
| polaris-setup: | ||
| image: alpine/curl | ||
| depends_on: | ||
| polaris: | ||
| condition: service_healthy | ||
| environment: | ||
| - CLIENT_ID=${ROOT_CLIENT_ID:-root} | ||
| - CLIENT_SECRET=${ROOT_CLIENT_SECRET:-s3cr3t} | ||
| - CATALOG_NAME=${CATALOG_NAME:-quickstart_catalog} | ||
| - REALM=${POLARIS_REALM:-POLARIS} | ||
| entrypoint: /bin/sh | ||
| command: | ||
| - -c | ||
| - | | ||
| set -e | ||
| apk add --no-cache jq | ||
|
|
||
| echo "Obtaining root access token..." | ||
| TOKEN_RESPONSE=$$(curl -s -X POST http://polaris:8181/api/catalog/v1/oauth/tokens \ | ||
| -H 'Content-Type: application/x-www-form-urlencoded' \ | ||
| -d "grant_type=client_credentials&client_id=$${CLIENT_ID}&client_secret=$${CLIENT_SECRET}&scope=PRINCIPAL_ROLE:ALL") | ||
|
|
||
| TOKEN=$$(echo $$TOKEN_RESPONSE | jq -r '.access_token') | ||
| echo "Obtained access token" | ||
|
|
||
| echo "Creating catalog '$$CATALOG_NAME' in realm $$REALM..." | ||
| PAYLOAD='{ | ||
| "catalog": { | ||
| "name": "'$$CATALOG_NAME'", | ||
| "type": "INTERNAL", | ||
| "readOnly": false, | ||
| "properties": { | ||
| "default-base-location": "s3://bucket123" | ||
| }, | ||
| "storageConfigInfo": { | ||
| "storageType": "S3", | ||
| "allowedLocations": ["s3://bucket123"], | ||
| "endpoint": "http://localhost:9000", | ||
| "endpointInternal": "http://minio:9000", | ||
| "pathStyleAccess": true | ||
| } | ||
| } | ||
| }' | ||
|
|
||
| curl -s -X POST http://polaris:8181/api/management/v1/catalogs \ | ||
| -H "Authorization: Bearer $$TOKEN" \ | ||
| -H "Accept: application/json" \ | ||
| -H "Content-Type: application/json" \ | ||
| -H "Polaris-Realm: $$REALM" \ | ||
| -d "$$PAYLOAD" > /dev/null | ||
|
|
||
| echo "✅ Catalog created" | ||
|
|
||
| echo "" | ||
| echo "Creating principal 'quickstart_user'..." | ||
| PRINCIPAL_RESPONSE=$$(curl -s -X POST http://polaris:8181/api/management/v1/principals \ | ||
| -H "Authorization: Bearer $$TOKEN" \ | ||
| -H "Polaris-Realm: $$REALM" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"principal": {"name": "quickstart_user", "properties": {}}}') | ||
|
|
||
| USER_CLIENT_ID=$$(echo $$PRINCIPAL_RESPONSE | jq -r '.credentials.clientId') | ||
| USER_CLIENT_SECRET=$$(echo $$PRINCIPAL_RESPONSE | jq -r '.credentials.clientSecret') | ||
|
|
||
| echo "✅ Principal created with clientId: $$USER_CLIENT_ID" | ||
|
|
||
| echo "Creating principal role 'quickstart_user_role'..." | ||
| curl -s -X POST http://polaris:8181/api/management/v1/principal-roles \ | ||
| -H "Authorization: Bearer $$TOKEN" \ | ||
| -H "Polaris-Realm: $$REALM" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"principalRole": {"name": "quickstart_user_role", "properties": {}}}' > /dev/null | ||
|
|
||
| echo "✅ Principal role created" | ||
|
|
||
| echo "Creating catalog role 'quickstart_catalog_role'..." | ||
| curl -s -X POST http://polaris:8181/api/management/v1/catalogs/$$CATALOG_NAME/catalog-roles \ | ||
| -H "Authorization: Bearer $$TOKEN" \ | ||
| -H "Polaris-Realm: $$REALM" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"catalogRole": {"name": "quickstart_catalog_role", "properties": {}}}' > /dev/null | ||
|
|
||
| echo "✅ Catalog role created" | ||
|
|
||
| echo "Assigning principal role to principal..." | ||
| curl -s -X PUT http://polaris:8181/api/management/v1/principals/quickstart_user/principal-roles \ | ||
| -H "Authorization: Bearer $$TOKEN" \ | ||
| -H "Polaris-Realm: $$REALM" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"principalRole": {"name": "quickstart_user_role"}}' > /dev/null | ||
|
|
||
| echo "✅ Principal role assigned" | ||
|
|
||
| echo "Assigning catalog role to principal role..." | ||
| curl -s -X PUT http://polaris:8181/api/management/v1/principal-roles/quickstart_user_role/catalog-roles/$$CATALOG_NAME \ | ||
| -H "Authorization: Bearer $$TOKEN" \ | ||
| -H "Polaris-Realm: $$REALM" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"catalogRole": {"name": "quickstart_catalog_role"}}' > /dev/null | ||
|
|
||
| echo "✅ Catalog role assigned" | ||
|
|
||
| echo "Granting CATALOG_MANAGE_CONTENT privilege..." | ||
| curl -s -X PUT http://polaris:8181/api/management/v1/catalogs/$$CATALOG_NAME/catalog-roles/quickstart_catalog_role/grants \ | ||
| -H "Authorization: Bearer $$TOKEN" \ | ||
| -H "Polaris-Realm: $$REALM" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d '{"type": "catalog", "privilege": "CATALOG_MANAGE_CONTENT"}' > /dev/null | ||
|
|
||
| echo "✅ Privileges granted" | ||
|
|
||
| echo "" | ||
| echo "==========================================" | ||
| echo "🎉 Polaris Quickstart Setup Complete!" | ||
| echo "==========================================" | ||
| echo "" | ||
| echo "Catalog: $$CATALOG_NAME" | ||
| echo " Storage: S3 (MinIO)" | ||
| echo " Location: s3://bucket123" | ||
| echo " MinIO UI: http://localhost:9001" | ||
| echo "" | ||
| echo "Root credentials:" | ||
| echo " Client ID: $$CLIENT_ID" | ||
| echo " Client Secret: $$CLIENT_SECRET" | ||
| echo "" | ||
| echo "User credentials:" | ||
| echo " Client ID: $$USER_CLIENT_ID" | ||
| echo " Client Secret: $$USER_CLIENT_SECRET" | ||
| echo "" | ||
| echo "Polaris main APIs:" | ||
| echo " - Iceberg REST: http://localhost:8181/api/catalog/v1" | ||
| echo " - Management: http://localhost:8181/api/management/v1" | ||
| echo " - Generic Tables: http://localhost:8181/api/polaris/v1" | ||
| echo "" | ||
| echo "Polaris admin APIs:" | ||
| echo " - Health check: http://localhost:8182/q/health" | ||
| echo " - Metrics: http://localhost:8182/q/metrics" | ||
| echo "" | ||
| echo "To get started with Spark:" | ||
| echo " spark-sql \\" | ||
| echo " --packages org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.10.0,org.apache.iceberg:iceberg-aws-bundle:1.10.0 \\" | ||
| echo " --conf spark.sql.extensions=org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions \\" | ||
| echo " --conf spark.sql.catalog.polaris=org.apache.iceberg.spark.SparkCatalog \\" | ||
| echo " --conf spark.sql.catalog.polaris.type=rest \\" | ||
| echo " --conf spark.sql.catalog.polaris.warehouse=$$CATALOG_NAME \\" | ||
| echo " --conf spark.sql.catalog.polaris.uri=http://localhost:8181/api/catalog \\" | ||
| echo " --conf spark.sql.catalog.polaris.credential=$$USER_CLIENT_ID:$$USER_CLIENT_SECRET \\" | ||
| echo " --conf spark.sql.catalog.polaris.scope=PRINCIPAL_ROLE:ALL \\" | ||
| echo " --conf spark.sql.catalog.polaris.s3.endpoint=http://localhost:9000 \\" | ||
| echo " --conf spark.sql.catalog.polaris.s3.path-style-access=true \\" | ||
| echo " --conf spark.sql.catalog.polaris.s3.access-key-id=minio_root \\" | ||
| echo " --conf spark.sql.catalog.polaris.s3.secret-access-key=m1n1opwd \\" | ||
| echo " --conf spark.sql.catalog.polaris.client.region=irrelevant \\" | ||
| echo " --conf spark.sql.defaultCatalog=polaris" | ||
| echo "" | ||
| echo "To get started with REST API:" | ||
| echo " # Get a token" | ||
| echo " export TOKEN=\$$(curl -s -X POST http://localhost:8181/api/catalog/v1/oauth/tokens \\" | ||
| echo " -d 'grant_type=client_credentials' \\" | ||
| echo " -d 'client_id=$$USER_CLIENT_ID' \\" | ||
| echo " -d 'client_secret=$$USER_CLIENT_SECRET' \\" | ||
| echo " -d 'scope=PRINCIPAL_ROLE:ALL' \\" | ||
| echo " | jq -r '.access_token')" | ||
| echo "" | ||
| echo " # Create a namespace" | ||
| echo " curl -X POST http://localhost:8181/api/catalog/v1/$$CATALOG_NAME/namespaces \\" | ||
| echo " -H \"Authorization: Bearer \$$TOKEN\" \\" | ||
| echo " -H 'Content-Type: application/json' \\" | ||
| echo " -d '{\"namespace\": [\"my_namespace\"], \"properties\": {}}'" | ||
| echo "" | ||
| echo " # List namespaces" | ||
| echo " curl -X GET http://localhost:8181/api/catalog/v1/$$CATALOG_NAME/namespaces \\" | ||
| echo " -H \"Authorization: Bearer \$$TOKEN\"" | ||
| echo "" | ||
| echo "==========================================" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
site/content/in-dev/unreleased/getting-started/quick-start.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| --- | ||
| # | ||
| # 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. | ||
| # | ||
| Title: Quickstart | ||
| type: docs | ||
| weight: 99 | ||
| --- | ||
| Use this guide to quickly start running Polaris. This is not intended for production use. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Have Docker (with Docker Compose v2) installed & running on your machine | ||
|
|
||
| ## Running | ||
|
|
||
| Run the following command: | ||
|
|
||
| ```bash | ||
| curl -s https://raw.githubusercontent.com/apache/polaris/main/getting-started/quickstart/docker-compose.yml | docker compose -f - up | ||
|
|
||
| ``` | ||
| This command will: | ||
| 1. Create a Catalog named `quickstart_catalog` with MinIO-backed storage. | ||
| 2. Create a user principal `quickstart_user` with full access to the catalog. | ||
|
|
||
| Once the command has been run, you will see examples on how to interact with this Polaris server in the logs. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.