Closed2

Apache Polaris(incubating) quickstart

sisiodossisiodos

⚠️ Note: These steps work on the main branch, but may not be fully functional on the 0.9.0 release version.

create test env.

git clone https://github.com/apache/polaris.git

Java

install and setup openjdk@21.

Python

cd polaris
pip install -r regtests/requirements.txt
poetry install

build Polaris

cd polaris
./gradlew :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true

run Polaris

java -jar quarkus/server/build/quarkus-app/quarkus-run.jar

note root principal credentials and set them to environment variables. for example:

... from Polaris process stdout:
realm: POLARIS root principal credentials: 3d6716dd2a4183eb:9ff546bb55ca2b5a94e90bc7520a2a1c
...

export CLIENT_ID=3d6716dd2a4183eb
export CLIENT_SECRET=9ff546bb55ca2b5a94e90bc7520a2a1c

bootstrap

tried to create the catalog quickstart_catalog working on the local environment with --storage-type file and --default-base-location /tmp/polaris.

# create catalog
./polaris catalogs create --storage-type file --default-base-location /tmp/polaris quickstart_catalog
# create principal for testing
./polaris principals create quickstart_user
# ... and user role
./polaris principal-roles create quickstart_user_role
# create catalog-role
./polaris catalog-roles create --catalog quickstart_catalog quickstart_catalog_role
# grant user role to principal for testing
./polaris principal-roles grant --principal quickstart_user quickstart_user_role
# grant catalog role to user role
./polaris catalog-roles grant --catalog quickstart_catalog --principal-role quickstart_user_role quickstart_catalog_role
# grant CATALOG_MANAGE_CONTENT at testing catalog to catalog role
./polaris privileges catalog grant --catalog quickstart_catalog --catalog-role quickstart_catalog_role CATALOG_MANAGE_CONTENT
sisiodossisiodos

Polaris log during setup

Polaris looks working well.

$ java -jar quarkus/server/build/quarkus-app/quarkus-run.jar
realm: POLARIS root principal credentials: 3d6716dd2a4183eb:9ff546bb55ca2b5a94e90bc7520a2a1c

 @@@@   @@@  @       @    @@@@   @  @@@@    @@@@    @  @@@@@  @    @     @@@   @@@@
 @   @ @   @ @      @ @   @   @  @  @@     @       @ @   @   @ @   @    @   @ @
 @@@@  @   @ @     @@@@@  @@@@   @    @@   @      @@@@@  @  @@@@@  @    @   @ @  @@@
 @      @@@  @@@@ @     @ @  @@  @  @@@@    @@@@ @     @ @ @@   @@ @@@@  @@@   @@@@

                     *


                                      /////\
                                   //\\///T\\\
                                ///\\\////\\\\\\
                               //\\\\T////\\\\\\\\\
                          /T\ //\\\\\T///T\\//T\\\\\\
                        //\\\/////T\\////\\/////\\\\\\\  //\\
                     //\\\\\\T///////////////////T\\\\\\\T\\\\\
                  //\\\\/////T\//////////\///////T\\\\\T\\\\\\\\
                 //\\\\\/////\\\T////////////////\\\\\\/\\\\\\\\\
,,..,,,..,,,..,//\\\\////////\\\\\\\\\\/////////\\\\\///\\\\\\\\\\,,,..,,..,,,..,,,.
,,..,,,..,,,..,,,..,,,..,,,..,,,..,,,..,,,..,,,..,,,..,,,..,,,..,,,..,,,.,,,..,,,..,

                                                           Powered by Quarkus 3.18.3
2025-02-15 14:17:15,782 WARN  [org.apa.pol.ser.qua.con.ProductionReadinessChecks] [,] [,,,] (main) ⚠️ Production readiness checks failed! Check the warnings below.
2025-02-15 14:17:15,783 WARN  [org.apa.pol.ser.qua.con.ProductionReadinessChecks] [,] [,,,] (main) - The current metastore is intended for tests only. Offending configuration option: 'polaris.persistence.type'.
2025-02-15 14:17:15,783 WARN  [org.apa.pol.ser.qua.con.ProductionReadinessChecks] [,] [,,,] (main) - The realm context resolver is configured to map requests without a realm header to the default realm. Offending configuration option: 'polaris.realm-context.require-header'.
2025-02-15 14:17:15,783 WARN  [org.apa.pol.ser.qua.con.ProductionReadinessChecks] [,] [,,,] (main) - A public key file wasn't provided and will be generated. Offending configuration option: 'polaris.authentication.token-broker.rsa-key-pair.public-key-file'.
2025-02-15 14:17:15,783 WARN  [org.apa.pol.ser.qua.con.ProductionReadinessChecks] [,] [,,,] (main) Refer to https://polaris.apache.org/in-dev/unreleased/configuring-polaris-for-production for more information.
2025-02-15 14:17:15,858 WARN  [io.mic.cor.ins.MeterRegistry] [,] [,,,] (vert.x-acceptor-thread-0) This Gauge has been already registered (MeterId{name='http.server.active.requests', tags=[tag(application=Polaris)]}), the Gauge registration will be ignored. Note that subsequent logs will be logged at debug level.
2025-02-15 14:17:15,859 INFO  [io.quarkus] [,] [,,,] (main) Apache Polaris Server (incubating) 1.0.0-incubating-SNAPSHOT on JVM (powered by Quarkus 3.18.3) started in 1.216s. Listening on: http://0.0.0.0:8181. Management interface listening on http://0.0.0.0:8182.
2025-02-15 14:17:15,860 INFO  [io.quarkus] [,] [,,,] (main) Profile prod activated.
2025-02-15 14:17:15,861 INFO  [io.quarkus] [,] [,,,] (main) Installed features: [cdi, hibernate-validator, micrometer, opentelemetry, reactive-routes, rest, rest-jackson, smallrye-context-propagation, smallrye-health, vertx]
2025-02-15 14:17:40,185 INFO  [org.apa.pol.ser.exc.IcebergExceptionMapper] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) Handling runtimeException HTTP 401 Unauthorized
2025-02-15 14:17:40,255 INFO  [org.apa.pol.ser.qua.con.QuarkusJacksonConfig] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) Limiting request body size to 10485760 bytes
2025-02-15 14:17:40,288 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:17:40 +0900] "GET / HTTP/1.1" 401 88
2025-02-15 14:17:40,346 INFO  [org.apa.pol.ser.exc.IcebergExceptionMapper] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) Handling runtimeException HTTP 401 Unauthorized
2025-02-15 14:17:40,352 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:17:40 +0900] "GET /favicon.ico HTTP/1.1" 401 88
2025-02-15 14:17:47,916 INFO  [org.apa.pol.ser.exc.IcebergExceptionMapper] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) Handling runtimeException HTTP 401 Unauthorized
2025-02-15 14:17:47,918 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:17:47 +0900] "GET / HTTP/1.1" 401 88
2025-02-15 14:17:47,950 INFO  [org.apa.pol.ser.exc.IcebergExceptionMapper] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) Handling runtimeException HTTP 401 Unauthorized
2025-02-15 14:17:47,955 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:17:47 +0900] "GET /favicon.ico HTTP/1.1" 401 88
2025-02-15 14:38:22,235 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:38:22 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:41:47,699 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:41:47 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:42:11,000 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:42:11 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:42:11,027 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-2) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:42:11,093 INFO  [org.apa.pol.ser.exc.IcebergExceptionMapper] [,POLARIS] [,,,] (executor-thread-1) Handling runtimeException Location prefix not allowed: '.', expected prefix: file:// or / or *
2025-02-15 14:42:11,094 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:42:11 +0900] "POST /api/management/v1/catalogs HTTP/1.1" 400 137
2025-02-15 14:42:25,950 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:42:25 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:42:25,955 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-1) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:42:25,966 INFO  [org.apa.pol.ser.con.RealmEntityManagerFactory] [,POLARIS] [,,,] (executor-thread-1) Initializing new PolarisEntityManager for realm POLARIS
2025-02-15 14:42:26,011 INFO  [org.apa.pol.ser.adm.PolarisServiceImpl] [,POLARIS] [,,,] (executor-thread-1) Created new catalog class PolarisCatalog {
    class Catalog {
        type: INTERNAL
        name: quickstart_catalog
        properties: class CatalogProperties {
            {default-base-location=/tmp/polaris}
            defaultBaseLocation: /tmp/polaris
        }
        createTimestamp: 1739598146003
        lastUpdateTimestamp: 1739598146003
        entityVersion: 1
        storageConfigInfo: class FileStorageConfigInfo {
            class StorageConfigInfo {
                storageType: FILE
                allowedLocations: [/tmp/polaris]
            }
        }
    }
}
2025-02-15 14:42:26,011 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:42:26 +0900] "POST /api/management/v1/catalogs HTTP/1.1" 201 -
2025-02-15 14:43:01,484 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:43:01 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:43:01,489 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:43:01,497 INFO  [org.apa.pol.ser.exc.IcebergExceptionMapper] [,POLARIS] [,,,] (executor-thread-1) Handling runtimeException Cannot create Catalog quickstart_catalog. Catalog already exists or resolution failed
2025-02-15 14:43:01,498 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:43:01 +0900] "POST /api/management/v1/catalogs HTTP/1.1" 409 152
2025-02-15 14:43:46,763 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:43:46 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:43:46,769 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-7) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:43:46,773 INFO  [org.apa.pol.ser.adm.PolarisServiceImpl] [,POLARIS] [,,,] (executor-thread-1) Created new principal class PrincipalWithCredentials {
    principal: class Principal {
        name: quickstart_user
        clientId: 84ac91d3cffeac89
        properties: {}
        createTimestamp: 1739598226773
        lastUpdateTimestamp: 1739598226773
        entityVersion: 1
    }
    credentials: class PrincipalWithCredentialsCredentials {
        clientId: 84ac91d3cffeac89
        clientSecret: *
    }
}
2025-02-15 14:43:46,776 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:43:46 +0900] "POST /api/management/v1/principals HTTP/1.1" 201 268
2025-02-15 14:44:08,744 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:44:08 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:44:08,749 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-2) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:44:08,753 INFO  [org.apa.pol.ser.adm.PolarisServiceImpl] [,POLARIS] [,,,] (executor-thread-1) Created new principalRole class PrincipalRole {
    name: quickstart_user_role
    properties: {}
    createTimestamp: 1739598248753
    lastUpdateTimestamp: 1739598248753
    entityVersion: 1
}
2025-02-15 14:44:08,753 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:44:08 +0900] "POST /api/management/v1/principal-roles HTTP/1.1" 201 -
2025-02-15 14:44:42,916 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:44:42 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:44:42,921 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-1) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:44:42,928 INFO  [org.apa.pol.ser.adm.PolarisServiceImpl] [,POLARIS] [,,,] (executor-thread-1) Created new catalogRole class CatalogRole {
    name: quickstart_catalog_role
    properties: {}
    createTimestamp: 1739598282928
    lastUpdateTimestamp: 1739598282928
    entityVersion: 1
}
2025-02-15 14:44:42,929 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:44:42 +0900] "POST /api/management/v1/catalogs/quickstart_catalog/catalog-roles HTTP/1.1" 201 -
2025-02-15 14:45:51,389 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:45:51 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:45:51,398 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-4) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:45:51,401 INFO  [org.apa.pol.ser.adm.PolarisServiceImpl] [,POLARIS] [,,,] (executor-thread-1) Assigning principalRole quickstart_user_role to principal quickstart_user
2025-02-15 14:45:51,405 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:45:51 +0900] "PUT /api/management/v1/principals/quickstart_user/principal-roles HTTP/1.1" 201 -
2025-02-15 14:46:48,751 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:46:48 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:46:48,756 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-7) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:46:48,757 INFO  [org.apa.pol.ser.adm.PolarisServiceImpl] [,POLARIS] [,,,] (executor-thread-1) Assigning catalogRole quickstart_catalog_role in catalog quickstart_catalog to principalRole quickstart_user_role
2025-02-15 14:46:48,760 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:46:48 +0900] "PUT /api/management/v1/principal-roles/quickstart_user_role/catalog-roles/quickstart_catalog HTTP/1.1" 201 -
2025-02-15 14:47:50,690 INFO  [io.qua.htt.access-log] [,POLARIS] [,,,] (executor-thread-1) 0:0:0:0:0:0:0:1 - - [15/Feb/2025:14:47:50 +0900] "POST /api/catalog/v1/oauth/tokens HTTP/1.1" 200 769
2025-02-15 14:47:50,696 WARN  [org.apa.pol.ser.aut.DefaultActiveRolesProvider] [,POLARIS] [,,,] (vert.x-eventloop-thread-2) principal=root scopes=[] roles=[] Some principal roles were not found in the principal's grants
2025-02-15 14:47:50,699 INFO  [org.apa.pol.ser.adm.PolarisServiceImpl] [,POLARIS] [,,,] (executor-thread-1) Adding grant class AddGrantRequest {
    grant: class CatalogGrant {
        class GrantResource {
            type: catalog
        }
        privilege: CATALOG_MANAGE_CONTENT
    }
} to catalogRole quickstart_catalog_role in catalog quickstart_catalog
このスクラップは6ヶ月前にクローズされました