Skip to content

Commit d8c1804

Browse files
committed
Merge remote-tracking branch 'apache/main' into pass-internal-properties-to-fileio
2 parents c89e831 + 22201d0 commit d8c1804

File tree

102 files changed

+1844
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1844
-549
lines changed

.github/workflows/helm.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ jobs:
4343
with:
4444
fetch-depth: 0
4545

46+
- name: Set up JDK 21
47+
uses: actions/setup-java@v4
48+
with:
49+
java-version: '21'
50+
distribution: 'temurin'
51+
4652
- name: Set up Helm
4753
uses: azure/[email protected]
4854
with:
@@ -83,25 +89,30 @@ jobs:
8389
if: steps.list-changed.outputs.changed == 'true'
8490
uses: medyagh/[email protected]
8591

86-
- name: Docker build
92+
- name: Print Docker info
93+
if: steps.list-changed.outputs.changed == 'true'
94+
run: |
95+
docker -v
96+
minikube docker-env
97+
98+
- name: Image build
8799
if: steps.list-changed.outputs.changed == 'true'
88100
run: |
89-
eval $(minikube docker-env)
90-
docker build -f ./Dockerfile \
91-
--build-arg ECLIPSELINK=true \
92-
--build-arg ECLIPSELINK_DEPS=com.h2database:h2:2.3.232 \
93-
-t polaris:latest .
101+
eval $(minikube -p minikube docker-env)
102+
./gradlew :polaris-quarkus-server:assemble \
103+
-Dquarkus.container-image.build=true \
104+
-PeclipseLinkDeps=com.h2database:h2:2.3.232
105+
minikube image ls
94106
95107
- name: Install fixtures
96108
if: steps.list-changed.outputs.changed == 'true'
97109
run: |
98110
kubectl create namespace polaris-ns
99-
kubectl apply --namespace polaris-ns $(find helm/polaris/ci/fixtures -name "*.yaml" -exec echo -n "-f {} " \;)
111+
kubectl apply --namespace polaris-ns -f helm/polaris/ci/fixtures
100112
101113
- name: Run chart-testing (install)
102114
if: steps.list-changed.outputs.changed == 'true'
103115
run: |
104116
ct install --target-branch ${{ github.event.repository.default_branch }} \
105117
--namespace polaris-ns \
106-
--helm-extra-set-args "--set=image.repository=polaris --set=image.tag=latest" \
107118
--debug --charts ./helm/polaris

.github/workflows/regtest.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,23 @@ jobs:
3333

3434
steps:
3535
- uses: actions/checkout@v4
36-
- name: fix permissions
36+
37+
- name: Set up JDK 21
38+
uses: actions/setup-java@v4
39+
with:
40+
java-version: '21'
41+
distribution: 'temurin'
42+
43+
- name: Fix permissions
3744
run: mkdir -p regtests/output && chmod 777 regtests/output && chmod 777 regtests/t_*/ref/*
45+
46+
- name: Image build
47+
run: |
48+
./gradlew :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true
49+
3850
- name: Regression Test
3951
env:
4052
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
4153
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
42-
run: docker compose up --build --exit-code-from regtest
54+
run: |
55+
docker compose -f regtests/docker-compose.yml up --build --exit-code-from regtest

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
stale:
2323
runs-on: ubuntu-24.04
2424
steps:
25-
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639
25+
- uses: actions/stale@ee7ef89499a3de6e4fe1fc1acb994e67c64e0a2a
2626
with:
2727
days-before-close: 5
2828
days-before-stale: 30

Dockerfile

Lines changed: 0 additions & 67 deletions
This file was deleted.

README.md

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,30 @@ for contribution guidelines.
3939
## Building and Running
4040

4141
Apache Polaris is organized into the following modules:
42+
4243
- `polaris-core` - The main Polaris entity definitions and core business logic
43-
- `polaris-server` - The Polaris REST API server
44-
- `polaris-eclipselink` - The Eclipselink implementation of the MetaStoreManager interface
44+
- API modules (implementing the Iceberg REST API and Polaris management API):
45+
- `polaris-api-management-model` - The Polaris management model
46+
- `polaris-api-management-service` - The Polaris management service
47+
- `polaris-api-iceberg-service` - The Iceberg REST service
48+
- Service modules:
49+
- `polaris-service-common` - The main components of the Polaris server
50+
- Quarkus runtime modules:
51+
- `polaris-quarkus-service` - The Quarkus-specific components of the Polaris server
52+
- `polaris-quarkus-defaults` - The Quarkus-specific configuration defaults
53+
- `polaris-quarkus-server` - The Polaris server runtime
54+
- `polaris-quarkus-admin-tool` - The Polaris admin & maintenance tool
55+
- Persistence modules:
56+
- `polaris-jpa-model` - The JPA entity definitions
57+
- `polaris-eclipselink` - The Eclipselink implementation of the MetaStoreManager interface
4558

4659
Apache Polaris is built using Gradle with Java 21+ and Docker 27+.
60+
4761
- `./gradlew build` - To build and run tests. Make sure Docker is running, as the integration tests depend on it.
4862
- `./gradlew assemble` - To skip tests.
4963
- `./gradlew test` - To run unit tests and integration tests.
50-
- `./gradlew runApp` - To run the Polaris server locally on localhost:8181.
64+
- `./gradlew run` - To run the Polaris server locally; the server is reachable at
65+
localhost:8181. This is also suitable for running regression tests, or for connecting with Spark.
5166
- `./regtests/run_spark_sql.sh` - To connect from Spark SQL. Here are some example commands to run in the Spark SQL shell:
5267
```sql
5368
create database db1;
@@ -56,37 +71,33 @@ create table db1.table1 (id int, name string);
5671
insert into db1.table1 values (1, 'a');
5772
select * from db1.table1;
5873
```
74+
- `env POLARIS_HOST=localhost ./regtests/run.sh` - To run regression tests locally, see more options [here](./regtests/README.md).
75+
### More build and run options
5976

60-
Apache Polaris supports the following optional build options:
61-
- `-PeclipseLink=true` – Enables the EclipseLink extension.
62-
- `-PeclipseLinkDeps=[groupId]:[artifactId]:[version],...` – Specifies one or more additional dependencies for EclipseLink (e.g., JDBC drivers) separated by commas.
77+
#### Running in Docker
6378

64-
### More build and run options
65-
Running in Docker
66-
- `docker build -t localhost:5001/polaris:latest .` - To build the image.
67-
- Optional build options:
68-
- `docker build -t localhost:5001/polaris:latest --build-arg ECLIPSELINK=true .` - Enables the EclipseLink extension.
69-
- `docker build -t localhost:5001/polaris:latest --build-arg ECLIPSELINK=true --build-arg ECLIPSELINK_DEPS=[groupId]:[artifactId]:[version],... .` – Enables the EclipseLink extension with one or more additional dependencies for EclipseLink (e.g. JDBC drivers) separated by commas.
70-
- `docker run -p 8181:8181 localhost:5001/polaris:latest` - To run the image in standalone mode.
71-
72-
Running in Kubernetes
73-
- `./run.sh` - To run Polaris as a mini-deployment locally. This will create one pod that bind itself to ports `8181` and `8182`.
74-
- Optional run options:
75-
- `./run.sh -b "ECLIPSELINK=true"` - Enables the EclipseLink extension.
76-
- `./run.sh -b "ECLIPSELINK=true;ECLIPSELINK_DEPS=[groupId]:[artifactId]:[version],..."` – Enables the EclipseLink extension with one or more additional dependencies for EclipseLink (e.g. JDBC drivers) separated by commas.
77-
- `kubectl port-forward svc/polaris-service -n polaris 8181:8181 8182:8182` - To create secure connections between a local machine and a pod within the cluster for both service and metrics endpoints.
78-
- Currently supported metrics endpoints:
79-
- localhost:8182/metrics
80-
- localhost:8182/healthcheck
79+
- `./gradlew clean :polaris-quarkus-server:assemble -Dquarkus.container-image.build=true` - To
80+
build the image locally.
81+
- `docker run -p 8181:8181 -p 8182:8182 apache/polaris:latest` - To run the image.
82+
83+
The Polaris codebase contains some docker compose examples to quickly get started with Polaris,
84+
using different configurations. Check the `./getting-started` directory for more information.
85+
86+
#### Running in Kubernetes
87+
88+
- `./run.sh` - To run Polaris as a mini-deployment locally. This will create a Kind cluster,
89+
then deploy one pod and one service. The service is available on ports `8181` and `8182`.
90+
- `kubectl port-forward svc/polaris-service -n polaris 8181:8181 8182:8182` - To create secure
91+
connections between a local machine and a pod within the cluster for both service and
92+
health/metrics endpoints:
93+
- http://localhost:8182/q/metrics
94+
- http://localhost:8182/q/health
8195
- `kubectl get pods -n polaris` - To check the status of the pods.
8296
- `kubectl get deployment -n polaris` - To check the status of the deployment.
8397
- `kubectl describe deployment polaris-deployment -n polaris` - To troubleshoot if things aren't working as expected.
8498

85-
Running regression tests
86-
- `./regtests/run.sh` - To run regression tests in another terminal.
87-
- `docker compose up --build --exit-code-from regtest` - To run regression tests in a Docker environment.
99+
#### Building docs
88100

89-
Building docs
90101
- Docs are generated using [Hugo](https://gohugo.io/) using the [Docsy](https://www.docsy.dev/docs/) theme.
91102
- To view the site locally, run
92103
```bash

build.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ tasks.named<RatTask>("rat").configure {
9090

9191
excludes.add("logs/**")
9292
excludes.add("service/common/src/**/banner.txt")
93-
excludes.add("quarkus/service/logs")
9493

9594
excludes.add("site/node_modules/**")
9695
excludes.add("site/layouts/robots.txt")

getting-started/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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+
# Getting Started with Apache Polaris
21+
22+
You can quickly get started with Polaris by playing with the docker-compose examples provided in
23+
this directory. Each example has detailed instructions.
24+
25+
## Prerequisites
26+
27+
- [Docker](https://docs.docker.com/get-docker/)
28+
- [Docker Compose](https://docs.docker.com/compose/install/)
29+
- [jq](https://stedolan.github.io/jq/download/) (for some examples)
30+
31+
## Getting Started Examples
32+
33+
- [Spark](spark): An example that uses an in-memory metastore, automatically bootstrapped, with
34+
Apache Spark and a Jupyter notebook.
35+
36+
- [Trino](trino): An example that uses Trino with Polaris.
37+
38+
- [Telemetry](telemetry): An example that includes Prometheus and Jaeger to collect metrics and
39+
traces from Apache Polaris. This example automatically creates a `polaris_demo` catalog.
40+
41+
- [Eclipselink](elipselink): An example that uses an Eclipselink metastore and a Postgres
42+
database. The realm is bootstrapped with the Polaris Admin tool. This example also creates a
43+
`polaris_demo` catalog, and offers the ability to run Spark SQL queries. Finally, it shows how to
44+
attach a debugger to the Polaris server.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
21+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
23+
24+
<persistence-unit name="polaris" transaction-type="RESOURCE_LOCAL">
25+
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
26+
<class>org.apache.polaris.jpa.models.ModelEntity</class>
27+
<class>org.apache.polaris.jpa.models.ModelEntityActive</class>
28+
<class>org.apache.polaris.jpa.models.ModelEntityChangeTracking</class>
29+
<class>org.apache.polaris.jpa.models.ModelEntityDropped</class>
30+
<class>org.apache.polaris.jpa.models.ModelGrantRecord</class>
31+
<class>org.apache.polaris.jpa.models.ModelPrincipalSecrets</class>
32+
<class>org.apache.polaris.jpa.models.ModelSequenceId</class>
33+
<shared-cache-mode>NONE</shared-cache-mode>
34+
<properties>
35+
<property name="jakarta.persistence.jdbc.url"
36+
value="jdbc:postgresql://postgres:5432/{realm}"/>
37+
<property name="jakarta.persistence.jdbc.user" value="postgres"/>
38+
<property name="jakarta.persistence.jdbc.password" value="postgres"/>
39+
<property name="jakarta.persistence.schema-generation.database.action" value="create"/>
40+
<property name="eclipselink.persistence-context.flush-mode" value="auto"/>
41+
</properties>
42+
</persistence-unit>
43+
</persistence>

0 commit comments

Comments
 (0)