Skip to content

Commit

Permalink
Helm chart: add CI tests for Eclipse Link (#375)
Browse files Browse the repository at this point in the history
* Helm chart: add CI tests for Eclipse Link

* license

---------

Co-authored-by: Robert Stupp <[email protected]>
  • Loading branch information
adutra and snazy authored Oct 17, 2024
1 parent 96cc221 commit 5ae0f0f
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
50 changes: 50 additions & 0 deletions helm/polaris/ci/fixtures/persistence.yaml
Original file line number Diff line number Diff line change
@@ -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>
33 changes: 33 additions & 0 deletions helm/polaris/ci/persistence-values.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion helm/polaris/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
4 changes: 3 additions & 1 deletion helm/polaris/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ae0f0f

Please sign in to comment.