Skip to content

Commit

Permalink
HELM-53 Provide support for custom infinispan cache
Browse files Browse the repository at this point in the history
  • Loading branch information
gsautner committed Dec 26, 2023
1 parent 44c8512 commit 04ae287
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/xwiki/Chart.yaml
@@ -1,7 +1,7 @@
apiVersion: v2
description: XWiki is a free wiki software platform written in Java with a design emphasis on extensibility. XWiki is an enterprise wiki. It includes WYSIWYG editing, OpenDocument based document import/export, semantic annotations and tagging, and advanced permissions management.
name: xwiki
version: 1.2.5-Beta.5
version: 1.2.5-Beta.6
type: application
keywords:
- xwiki
Expand Down
93 changes: 92 additions & 1 deletion charts/xwiki/templates/initialization-configmaps.yaml
Expand Up @@ -94,6 +94,10 @@ data:
cp /configmaps/logback.xml $AS_PATH/webapps/ROOT/WEB-INF/classes/logback.xml
{{- end }}
{{- if .Values.infinispan.enabled }}
cp /configmaps/infinispanConfig.xml $AS_PATH/webapps/ROOT/WEB-INF/cache/infinispan/config.xml
{{- end }}
# Replace the platform provenance to keep track of the image
sed -i 's/<id>org.xwiki.platform:xwiki-platform-distribution-war/<id>org.xwiki.contrib:xwiki-platform-distribution-helm-docker/' \
$AS_PATH/webapps/ROOT/META-INF/extension.xed
Expand Down Expand Up @@ -271,4 +275,91 @@ data:
<CENTRAL_LOCK />
<COUNTER/>
</config>
{{- end }}
{{- end }}

{{- if (.Values.infinispan.enabled) }}
infinispanConfig.xml: |
{{- if (.Values.infinispan.customConfig) }}
{{- .Values.infinispan.customConfig | nindent 4 }}
{{- else }}
<!--
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:14.0 https://infinispan.org/schemas/infinispan-config-14.0.xsd"
xmlns="urn:infinispan:config:14.0">

<!--
*****************************************************************************************************************

A summary of the format of this XML file and all available options can be see online:

https://infinispan.org/docs/11.0.x/titles/configuring/configuring.html

*****************************************************************************************************************
-->

<cache-container name="xwiki" statistics="true" default-cache="default" shutdown-hook="DEFAULT">
<!--
The default serializer since Infinispan 10 is Protostream which unfortunately support a very
limited set of type and more importantly not Serializable classes anymore.
Since this change is an important regression from XWiki point of view we switch back to
the deprecated JavaSerializationMarshaller (until they remove it completely...).
We don't use JBossUserMarshaller (the previous default) because it's now deprecated.
-->
<serialization marshaller="org.infinispan.commons.marshall.JavaSerializationMarshaller"/>

<!-- Expose Infinispan caches in the JMX server -->
<jmx enabled="true" domain="org.xwiki.infinispan" />

<!--
**************************************************************************************************************
All caches are named caches, and one of those is the default cache,
according to the default-cache attribute in the cache container.
Its configuration is inherited by all other named caches
**************************************************************************************************************
-->

<!--
The default cache.
-->
<local-cache-configuration name="default" statistics="true">
<memory max-count="{{ .Values.infinispan.defaultMemoryMaxCount }}"/>
</local-cache-configuration>

<!--
**************************************************************************************************************
Specific XWiki caches
**************************************************************************************************************
-->

<!-- LESS CSS cache -->
<local-cache-configuration name="lesscss.skinfiles.cache">
<persistence>
<!-- Let XWiki cache module set the proper path -->
<file-store purge="false" path="" />
</persistence>
</local-cache-configuration>

</cache-container>
</infinispan>
{{- end }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/xwiki/values.yaml
Expand Up @@ -409,3 +409,8 @@ probes:
# 5 minutes
failureThreshold: 10
successThreshold: 1

infinispan:
enabled: false
customConfig: ""
defaultMemoryMaxCount: 10000

0 comments on commit 04ae287

Please sign in to comment.