This is an automated email from the ASF dual-hosted git repository.
snazy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git
The following commit(s) were added to refs/heads/main by this push:
new 5ae0f0ff Helm chart: add CI tests for Eclipse Link (#375)
5ae0f0ff is described below
commit 5ae0f0ff88f7ad96202e27573201ea3453a71e04
Author: Alexandre Dutra <[email protected]>
AuthorDate: Thu Oct 17 11:26:21 2024 +0200
Helm chart: add CI tests for Eclipse Link (#375)
* Helm chart: add CI tests for Eclipse Link
* license
---------
Co-authored-by: Robert Stupp <[email protected]>
---
.github/workflows/helm.yml | 11 ++++++-
helm/polaris/ci/fixtures/persistence.yaml | 50 +++++++++++++++++++++++++++++++
helm/polaris/ci/persistence-values.yaml | 33 ++++++++++++++++++++
helm/polaris/templates/job.yaml | 2 +-
helm/polaris/values.yaml | 4 ++-
5 files changed, 97 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml
index 07e6e196..9851c2e7 100644
--- a/.github/workflows/helm.yml
+++ b/.github/workflows/helm.yml
@@ -81,11 +81,20 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
run: |
eval $(minikube docker-env)
- docker build -f ./Dockerfile -t polaris:latest .
+ docker build -f ./Dockerfile \
+ --build-arg ECLIPSELINK=true \
+ --build-arg ECLIPSELINK_DEPS=com.h2database:h2:2.3.232 \
+ -t polaris:latest .
+
+ - name: Install fixtures
+ run: |
+ kubectl create namespace polaris-ns
+ kubectl apply --namespace polaris-ns $(find helm/polaris/ci/fixtures
-name "*.yaml" -exec echo -n "-f {} " \;)
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: |
ct install --target-branch ${{
github.event.repository.default_branch }} \
+ --namespace polaris-ns \
--helm-extra-set-args "--set=image.repository=polaris
--set=image.tag=latest" \
--debug --charts ./helm/polaris
diff --git a/helm/polaris/ci/fixtures/persistence.yaml
b/helm/polaris/ci/fixtures/persistence.yaml
new file mode 100644
index 00000000..70e8f941
--- /dev/null
+++ b/helm/polaris/ci/fixtures/persistence.yaml
@@ -0,0 +1,50 @@
+#
+# 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.
+#
+
+apiVersion: v1
+kind: Secret
+metadata:
+ name: polaris-persistence
+type: Opaque
+stringData:
+ persistence.xml: |-
+ <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
+ <persistence-unit name="polaris" transaction-type="RESOURCE_LOCAL">
+ <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+ <class>org.apache.polaris.core.persistence.models.ModelEntity</class>
+
<class>org.apache.polaris.core.persistence.models.ModelEntityActive</class>
+
<class>org.apache.polaris.core.persistence.models.ModelEntityChangeTracking</class>
+
<class>org.apache.polaris.core.persistence.models.ModelEntityDropped</class>
+
<class>org.apache.polaris.core.persistence.models.ModelGrantRecord</class>
+
<class>org.apache.polaris.core.persistence.models.ModelPrincipalSecrets</class>
+
<class>org.apache.polaris.core.persistence.models.ModelSequenceId</class>
+ <shared-cache-mode>NONE</shared-cache-mode>
+ <properties>
+ <property name="jakarta.persistence.jdbc.url"
value="jdbc:h2:mem:polaris-{realm}"/>
+ <property name="jakarta.persistence.jdbc.user" value="sa"/>
+ <property name="jakarta.persistence.jdbc.password" value=""/>
+ <property
name="jakarta.persistence.schema-generation.database.action" value="create"/>
+ <property name="eclipselink.logging.level.sql" value="FINE"/>
+ <property name="eclipselink.logging.parameters" value="true"/>
+ <property name="eclipselink.persistence-context.flush-mode"
value="auto"/>
+ </properties>
+ </persistence-unit>
+ </persistence>
\ No newline at end of file
diff --git a/helm/polaris/ci/persistence-values.yaml
b/helm/polaris/ci/persistence-values.yaml
new file mode 100644
index 00000000..5c196bb7
--- /dev/null
+++ b/helm/polaris/ci/persistence-values.yaml
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+
+image:
+ repository: polaris
+ tag: latest
+ pullPolicy: Never
+
+bootstrapMetastoreManager: true
+
+persistenceConfigSecret: polaris-persistence
+
+polarisServerConfig:
+ metaStoreManager:
+ type: eclipse-link
+ persistence-unit: polaris
+ conf-file: /eclipselink-config/conf.jar!/persistence.xml
diff --git a/helm/polaris/templates/job.yaml b/helm/polaris/templates/job.yaml
index 79d51bf2..9d252faa 100644
--- a/helm/polaris/templates/job.yaml
+++ b/helm/polaris/templates/job.yaml
@@ -77,7 +77,7 @@ spec:
- name: config-volume
mountPath: /app/config/polaris-server.yml
subPath: polaris-server.yml
- {{- if .Values.persistenceConfigSecret }}
+ {{- if and .Values.persistenceConfigSecret (index
.Values.polarisServerConfig.metaStoreManager "conf-file") }}
- name: eclipselink-config-volume
mountPath: /eclipselink-config
{{- end }}
diff --git a/helm/polaris/values.yaml b/helm/polaris/values.yaml
index bbba26af..a4977836 100644
--- a/helm/polaris/values.yaml
+++ b/helm/polaris/values.yaml
@@ -306,8 +306,10 @@ polarisServerConfig:
metaStoreManager:
type: in-memory
- # type: eclipse-link # uncomment to use eclipse-link as metastore
+ # uncomment below to use eclipse-link as metastore
+ # type: eclipse-link
# persistence-unit: polaris
+ # conf-file: /eclipselink-config/conf.jar!/persistence.xml
io:
factoryType: default