Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions getting-started/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@

This getting started guide provides a `docker-compose` file to set up [Trino](https://trino.io/) with Apache Polaris. Apache Polaris is configured as an Iceberg REST Catalog in Trino.

## Build Polaris Image
Build Polaris Image while Docker is running
```
./gradlew :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General question (not about this PR specificaly): should not we rename polaris-quarkus-server to polaris-server now ? @adutra thoughts ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not opposed to a global renaming and removing the quarkus token from all module names 👍

```

## Run the `docker-compose` file
To start the `docker-compose` file, run this command from the repo's root directory:
```
Expand Down
5 changes: 5 additions & 0 deletions getting-started/trino/create-polaris-catalog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ curl -i -X POST -H "Authorization: Bearer $PRINCIPAL_TOKEN" -H 'Accept: applicat
}
}
}'

# Add TABLE_WRITE_DATA to the catalog's catalog_admin role since by default it can only manage access and metadata
curl -i -X PUT -H "Authorization: Bearer $PRINCIPAL_TOKEN" -H 'Accept: application/json' -H 'Content-Type: application/json' \
http://polaris:8181/api/management/v1/catalogs/polaris/catalog-roles/catalog_admin/grants \
-d '{"type": "catalog", "privilege": "TABLE_WRITE_DATA"}'
16 changes: 12 additions & 4 deletions getting-started/trino/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,27 @@

services:
polaris:
build:
context: ../../
image: apache/polaris:latest
ports:
- "8181:8181"
- "8182"
environment:
AWS_REGION: us-west-2
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
GOOGLE_APPLICATION_CREDENTIALS: $GOOGLE_APPLICATION_CREDENTIALS
AZURE_TENANT_ID: $AZURE_TENANT_ID
AZURE_CLIENT_ID: $AZURE_CLIENT_ID
AZURE_CLIENT_SECRET: $AZURE_CLIENT_SECRET
# add aws keys as dropwizard config
JAVA_OPTS: -Ddw.awsAccessKey=$AWS_ACCESS_KEY_ID -Ddw.awsSecretKey=$AWS_SECRET_ACCESS_KEY
polaris.persistence.type: in-memory
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I missed that docker-compose file, I should have adapted it to Quarkus earlier. My bad.

polaris.authentication.authenticator.type: test
polaris.authentication.token-service.type: test
polaris.authentication.token-broker.type: symmetric-key
polaris.authentication.token-broker.symmetric-key.secret: polaris
polaris.features.defaults."SUPPORTED_CATALOG_STORAGE_TYPES": '["FILE","S3","GCS","AZURE"]'
polaris.realm-context.realms: default-realm,realm1
quarkus.log.file.enable: false
quarkus.otel.sdk.disabled: "true"

healthcheck:
test: ["CMD", "curl", "http://localhost:8182/healthcheck"]
Expand Down
2 changes: 2 additions & 0 deletions getting-started/trino/trino-config/catalog/iceberg.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ iceberg.rest-catalog.uri=http://polaris:8181/api/catalog
iceberg.rest-catalog.security=OAUTH2
iceberg.rest-catalog.oauth2.token=principal:root;realm:default-realm
iceberg.rest-catalog.warehouse=polaris
# Required to support local filesystem: https://trino.io/docs/current/object-storage.html#configuration
fs.hadoop.enabled=true
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to a breaking change in Trino iceberg connector: link

We have to explicitly enable filesystem support : https://trino.io/docs/current/object-storage.html#configuration

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch ! Thanks !

Loading