Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra committed Jan 25, 2025
1 parent a45be42 commit f71b14f
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Apache Polaris is built using Gradle with Java 21+ and Docker 27+.
- `./gradlew build` - To build and run tests. Make sure Docker is running, as the integration tests depend on it.
- `./gradlew assemble` - To skip tests.
- `./gradlew test` - To run unit tests and integration tests.
- `./gradlew polarisServerRun` - To run the Polaris server locally, with profile `prod`; the server
is reachable at localhost:8181. This configuration is also suitable for running regression tests,
or for connecting with Spark. See below for more information on regression tests.
- `./gradlew polarisServerRun` - To run the Polaris server locally; the server is reachable at
localhost:8181. This is also suitable for running regression tests, or for connecting with Spark.
See below for more information on regression tests.

- `./regtests/run_spark_sql.sh` - To connect from Spark SQL. Here are some example commands to run in the Spark SQL shell:
```sql
Expand Down
4 changes: 2 additions & 2 deletions regtests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,14 @@ The client can be generated using two commands:

```shell
# generate the management api client
$ docker run --rm \
docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/spec/polaris-management-service.yml \
-g python \
-o /local/regtests/client/python --additional-properties=packageName=polaris.management --additional-properties=apiNamePrefix=polaris

# generate the iceberg rest client
$ docker run --rm \
docker run --rm \
-v ${PWD}:/local openapitools/openapi-generator-cli generate \
-i /local/spec/rest-catalog-open-api.yaml \
-g python \
Expand Down
2 changes: 1 addition & 1 deletion regtests/t_cli/src/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_salt(length=8) -> str:


def root_cli(*args):
return cli(os.getenv('REGTEST_ROOT_BEARER_TOKEN', 'principal:root;realm:POLARIS'))(*args)
return cli(os.getenv('REGTEST_ROOT_BEARER_TOKEN'))(*args)


def cli(access_token):
Expand Down
4 changes: 2 additions & 2 deletions regtests/t_pyspark/src/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def catalog_client(polaris_catalog_url):
:return:
"""
client = CatalogApiClient(
Configuration(access_token=os.getenv('REGTEST_ROOT_BEARER_TOKEN', 'principal:root;realm:POLARIS'),
Configuration(access_token=os.getenv('REGTEST_ROOT_BEARER_TOKEN'),
host=polaris_catalog_url))
return IcebergCatalogAPI(client)

Expand Down Expand Up @@ -143,7 +143,7 @@ def format_namespace(namespace):

@pytest.fixture
def root_client(polaris_host, polaris_url):
client = ApiClient(Configuration(access_token=os.getenv('REGTEST_ROOT_BEARER_TOKEN', 'principal:root;realm:POLARIS'),
client = ApiClient(Configuration(access_token=os.getenv('REGTEST_ROOT_BEARER_TOKEN'),
host=polaris_url))
api = PolarisDefaultApi(client)
return api
2 changes: 1 addition & 1 deletion regtests/t_spark_sql/src/spark_sql_azure_blob.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# under the License.
#

SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN:-principal:root;realm:POLARIS}"
SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"

curl -i -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
Expand Down
2 changes: 1 addition & 1 deletion regtests/t_spark_sql/src/spark_sql_azure_dfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# under the License.
#

SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN:-principal:root;realm:POLARIS}"
SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"

curl -i -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
Expand Down
2 changes: 1 addition & 1 deletion regtests/t_spark_sql/src/spark_sql_basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# under the License.
#

SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN:-principal:root;realm:POLARIS}"
SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"

curl -i -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
Expand Down
2 changes: 1 addition & 1 deletion regtests/t_spark_sql/src/spark_sql_gcp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# under the License.
#

SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN:-principal:root;realm:POLARIS}"
SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"

curl -i -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
Expand Down
2 changes: 1 addition & 1 deletion regtests/t_spark_sql/src/spark_sql_s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ -z "$AWS_TEST_ENABLED" ] || [ "$AWS_TEST_ENABLED" != "true" ]; then
exit 0
fi

SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN:-principal:root;realm:POLARIS}"
SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"

curl -i -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
Expand Down
2 changes: 1 addition & 1 deletion regtests/t_spark_sql/src/spark_sql_s3_cross_region.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if [ -z "$AWS_CROSS_REGION_TEST_ENABLED" ] || [ "$AWS_CROSS_REGION_TEST_ENABLED"
exit 0
fi

SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN:-principal:root;realm:POLARIS}"
SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"
BUCKET="${AWS_CROSS_REGION_BUCKET}"
ROLE_ARN="${AWS_ROLE_FOR_CROSS_REGION_BUCKET}"

Expand Down
2 changes: 1 addition & 1 deletion regtests/t_spark_sql/src/spark_sql_views.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# under the License.
#

SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN:-principal:root;realm:POLARIS}"
SPARK_BEARER_TOKEN="${REGTEST_ROOT_BEARER_TOKEN}"

curl -i -X POST -H "Authorization: Bearer ${SPARK_BEARER_TOKEN}" -H 'Accept: application/json' -H 'Content-Type: application/json' \
http://${POLARIS_HOST:-localhost}:8181/api/management/v1/catalogs \
Expand Down

0 comments on commit f71b14f

Please sign in to comment.