Skip to content

Commit 362f847

Browse files
authored
Merge pull request #238 from DataONEorg/develop
3.1.4/chart-1.3.1 Release: merge develop to main
2 parents 4438658 + 0492e6e commit 362f847

Some content is hidden

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

41 files changed

+448
-422
lines changed

RELEASE-NOTES.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,48 @@
11
# dataone-indexer Release Notes
22

3+
## dataone-indexer version 3.1.4 & helm chart version 1.3.1
4+
5+
### Release date: 2025-05-20
6+
7+
### dataone-indexer version 3.1.4
8+
9+
This is a patch release with the following minor fixes and upgrades:
10+
11+
* Use `org.apache.commons.logging` throughout; removed direct references to
12+
`org.apache.log4j.Logger` ([Issue #178](https://github.com/DataONEorg/dataone-indexer/issues/178))
13+
* Remove the spring-web component from the dependency library. ([Issue #216](https://github.com/DataONEorg/dataone-indexer/issues/216))
14+
* Disable `livenessProbe` check for non-k8s deployments. ([Issue
15+
#225](https://github.com/DataONEorg/dataone-indexer/issues/225))
16+
* Bump `log4j-layout-template-json` version to 2.24.3
17+
18+
### helm chart version 1.3.1
19+
20+
* Add a "warm up" postStart hook for Lustre/HPC Filesystems (disabled by default - see
21+
`idxworker.enableMountWarmupHook` in values.yaml. Addresses visibility issues with Lustre and
22+
similar HPC filesystems. ([Issue #227](https://github.com/DataONEorg/dataone-indexer/issues/227))
23+
* Remove `subPath` for log4j properties configmap to allow dynamic reloading ([Issue
24+
#210](https://github.com/DataONEorg/dataone-indexer/issues/210#issuecomment-2859717382))
25+
* Allow configuration of Java Heap Memory for index workers, via values.yaml (`idxworker.javaMem`)
26+
([Issue #231](https://github.com/DataONEorg/dataone-indexer/issues/231))
27+
* Added `extraVolumes` and `extraVolumeMounts` to values.yaml, allowing users to specify additional
28+
volumes and mounts in their deployments ([Issue
29+
#223](https://github.com/DataONEorg/dataone-indexer/issues/223))
30+
* Full Support for granular configuration of security context in Containers and InitContainers
31+
([Issue #224](https://github.com/DataONEorg/dataone-indexer/issues/224))
32+
* Add `podSecurityContext.runAsUser: 59997` (applies to dependencies initContainer and indexer
33+
container)
34+
* Add `runAsNonRoot: true` to dependencies initContainer (was previously applied only to indexer
35+
container)
36+
* Introduced `idxworker.tripleDbStorageDefinition` in values.yaml to allow custom storage
37+
configurations for the tripleDB volume. Supports alternative storage types such as hostPath and
38+
emptyDir ([Issue #228](https://github.com/DataONEorg/dataone-indexer/issues/228)).
39+
* Bump indexer App version to 3.1.4
40+
41+
> [!CAUTION]
42+
> **If upgrading from 1.2.0, note the section entitled:
43+
> `Caution - ENSURE THAT THE RABBITMQ QUEUE IS EMPTY,` [in the release notes for helm chart v1.3.0
44+
> below!](#helm-chart-version-130)**,
45+
346
## dataone-indexer version 3.1.3 & helm chart version 1.3.0
447

548
### Release date: 2025-05-01

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG TAG="NO-TAG"
77
ENV TAG=${TAG}
88
ENV DATAONE_INDEXER_CONFIG=/etc/dataone/dataone-indexer.properties
99

10-
# Set the working directory
10+
# Set the working directory
1111
WORKDIR /var/lib/dataone-indexer
1212

1313
RUN apt update && apt -y install \

docker/entrypoint.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ then
66
echo "Starting infinite loop, ctrl-c to interrupt..."
77
sh -c 'trap "exit" TERM; while true; do sleep 1; done'
88
else
9+
echo "Starting DataONE Indexer from jar file: ./dataone-index-worker-${TAG}-shaded.jar,"
10+
echo "using memory options: [${IDX_JAVA_MEM}]"
11+
912
java -Dlog4j2.formatMsgNoLookups=true \
1013
-XX:+UnlockExperimentalVMOptions \
11-
-XX:+UseContainerSupport \
14+
-XX:+UseContainerSupport $IDX_JAVA_MEM \
1215
-XX:+UseSerialGC \
1316
-cp /etc/dataone/:./dataone-index-worker-${TAG}-shaded.jar \
1417
org.dataone.cn.indexer.IndexWorker

helm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ type: application
2121
# This is the chart version. This version number should be incremented each time you make changes
2222
# to the chart and its templates, including the app version.
2323
# Versions are expected to follow Semantic Versioning (https://semver.org/)
24-
version: "1.3.0"
24+
version: "1.3.1"
2525

2626
# This is the version number of the application being deployed. This version number should be
2727
# incremented each time you make changes to the application. Versions are not expected to
2828
# follow Semantic Versioning. They should reflect the version the application is using.
2929
# It is recommended to use it with quotes.
30-
appVersion: "3.1.3"
30+
appVersion: "3.1.4"
3131

3232
# Chart dependencies
3333
dependencies:

helm/templates/deployment.yaml

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ spec:
1919
{{- end }}
2020
labels:
2121
{{- include "idxworker.selectorLabels" . | nindent 8 }}
22+
namespace: {{ .Release.Namespace }}
2223
spec:
2324
{{- with .Values.imagePullSecrets }}
2425
imagePullSecrets:
@@ -47,8 +48,29 @@ spec:
4748
{{- toYaml .Values.podSecurityContext | nindent 8 }}
4849
containers:
4950
- name: {{ .Chart.Name }}
51+
{{- if .Values.idxworker.enableMountWarmupHook }}
52+
lifecycle:
53+
postStart:
54+
exec:
55+
command:
56+
- sh
57+
- -c
58+
- |
59+
{
60+
## This is a workaround for the Lustre file system
61+
echo "$(date '+%Y-%m-%d %H:%M:%S.%3N') - Warming up mounted directories..." >> /tmp/postStart.log
62+
ls -1 {{ .Values.idxworker.storage.hashStoreRootDir }}/metadata/tmp > /dev/null 2>&1 || true
63+
ls -1 {{ .Values.idxworker.storage.hashStoreRootDir }}/refs/tmp > /dev/null 2>&1 || true
64+
ls -1 {{ .Values.idxworker.storage.hashStoreRootDir }}/objects > /dev/null 2>&1 || true
65+
ls -1 {{ .Values.idxworker.storage.hashStoreRootDir }}/refs/pids > /dev/null 2>&1 || true
66+
ls -1 {{ .Values.idxworker.storage.hashStoreRootDir }}/refs/cids > /dev/null 2>&1 || true
67+
echo "$(date '+%Y-%m-%d %H:%M:%S.%3N') - Warm-up complete." >> /tmp/postStart.log
68+
}
69+
{{- end }}
70+
{{- if .Values.securityContext }}
5071
securityContext:
5172
{{- toYaml .Values.securityContext | nindent 12 }}
73+
{{- end }}
5274
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
5375
imagePullPolicy: {{ .Values.image.pullPolicy }}
5476
{{- if .Values.idxworker.readinessProbe.enabled }}
@@ -74,12 +96,12 @@ spec:
7496
resources:
7597
{{- toYaml .Values.resources | nindent 12 }}
7698
volumeMounts:
77-
- mountPath: /etc/dataone/dataone-indexer.properties
78-
subPath: dataone-indexer.properties
79-
name: {{ .Release.Name }}-config-volume
80-
- mountPath: /etc/dataone/log4j2.properties
81-
subPath: log4j2.properties
99+
{{- if .Values.extraVolumeMounts }}
100+
{{- tpl (toYaml .Values.extraVolumeMounts) . | nindent 12 }}
101+
{{- end }}
102+
- mountPath: /etc/dataone
82103
name: {{ .Release.Name }}-config-volume
104+
readOnly: true
83105
- mountPath: {{ .Values.persistence.mountPath }}
84106
name: indexer-metacat-pv
85107
{{- if .Values.persistence.subPath }}
@@ -91,6 +113,10 @@ spec:
91113
env:
92114
- name: DEBUG
93115
value: "{{ .Values.idxworker.debug }}"
116+
{{- if .Values.idxworker.javaMem }}
117+
- name: IDX_JAVA_MEM
118+
value: {{ .Values.idxworker.javaMem | quote }}
119+
{{- end }}
94120
- name: DATAONE_AUTH_TOKEN
95121
valueFrom:
96122
secretKeyRef:
@@ -116,6 +142,10 @@ spec:
116142
initContainers:
117143
- name: dependencies
118144
image: busybox:latest
145+
{{- if .Values.securityContext }}
146+
securityContext:
147+
{{- toYaml .Values.securityContext | nindent 12 }}
148+
{{- end }}
119149
command:
120150
- sh
121151
- -c
@@ -144,6 +174,9 @@ spec:
144174
echo waiting for Solr Schema to be accessible at http://{{ $solrHost }}:
145175
{{- $solrPort }}$SOLRURI; sleep 1; done;
146176
volumes:
177+
{{- if .Values.extraVolumes }}
178+
{{- tpl (toYaml .Values.extraVolumes) . | nindent 8 }}
179+
{{- end }}
147180
- name: {{ .Release.Name }}-config-volume
148181
configMap:
149182
name: {{ .Release.Name }}-indexer-configfiles
@@ -159,6 +192,9 @@ spec:
159192
readOnly: true
160193
{{- end }}
161194
- name: {{ .Release.Name }}-temp-tripledb-volume
195+
{{- if .Values.idxworker.tripleDbStorageDefinition }}
196+
{{- tpl (toYaml .Values.idxworker.tripleDbStorageDefinition) . | nindent 10 }}
197+
{{- else }}
162198
ephemeral:
163199
volumeClaimTemplate:
164200
spec:
@@ -169,3 +205,4 @@ spec:
169205
resources:
170206
requests:
171207
storage: 1Gi
208+
{{- end }}

helm/values.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ serviceAccount:
7373
podAnnotations: {}
7474

7575
podSecurityContext:
76+
runAsUser: 59997
7677
fsGroup: 1000 # must match metacat group for shared volume at /var/metacat
7778

79+
## @param securityContext Security context for the container (This will be applied to all containers)
7880
securityContext:
7981
runAsNonRoot: true
8082

@@ -106,6 +108,11 @@ tolerations: []
106108

107109
affinity: {}
108110

111+
## @param extraVolumes Additional volumes to be added to the pod
112+
extraVolumes: []
113+
## @param extraVolumeMounts Additional volume mounts to be added to the pod
114+
extraVolumeMounts: []
115+
109116
persistence:
110117
## @param persistence.claimName Name of existing PVC to use (typically shared with metacat)
111118
## Set a value for 'claimName' only if you want to re-use a Persistent Volume Claim that has
@@ -203,6 +210,28 @@ idxworker:
203210
##
204211
tripleDbDirectory: /etc/dataone/tdb-cache
205212

213+
## @param idxworker.tripleDbStorageDefinition type of storage for the triple store (default is "ephemeral"). Other
214+
## options are "hostPath" and "emptyDir". Must give full definition for hostPath or emptyDir.
215+
## For example:
216+
## tripleDbStorageDefinition:
217+
## emptyDir: {}
218+
##
219+
## For the emptyDir option you will need to think about specifying the ephemeral-storage limit in the
220+
## resources section.
221+
##
222+
## For example:
223+
## resources:
224+
## requests:
225+
## ephemeral-storage: 1Gi
226+
## limits:
227+
## ephemeral-storage: 2Gi
228+
tripleDbStorageDefinition: {}
229+
230+
## @param idxworker.enableMountWarmupHook Enable or disable the mount warmup hook. This is a workaround for
231+
## specifically Lustre filesystems. This workaround addresses known behavior with Lustre and other HPC
232+
## file systems that require access within the container runtime to finalize mount visibility.
233+
enableMountWarmupHook: false
234+
206235
storage:
207236
hashStoreClassName: "org.dataone.hashstore.filehashstore.FileHashStore"
208237
hashStoreRootDir: "/var/metacat/hashstore"
@@ -219,6 +248,12 @@ idxworker:
219248
readinessProbe:
220249
enabled: true
221250

251+
## @param idxworker.javaMem Java memory options to pass to the index worker container
252+
## (format: "-Xms512m -Xmx2g"). If you do not set a value, the JVM will default to using 1/4 of
253+
## the available memory as the maximum
254+
##
255+
javaMem: ""
256+
222257
## @section RabbitMQ Bitnami Sub-Chart Configuration
223258
##
224259
rabbitmq:

pom.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.dataone</groupId>
55
<artifactId>dataone-index-worker</artifactId>
6-
<version>3.1.3</version>
6+
<version>3.1.4</version>
77
<packaging>jar</packaging>
88
<name>dataone-index-worker</name>
99
<url>http://maven.apache.org</url>
@@ -184,11 +184,6 @@
184184
<artifactId>spring-jdbc</artifactId>
185185
<version>${spring.version}</version>
186186
</dependency>
187-
<dependency>
188-
<groupId>org.springframework</groupId>
189-
<artifactId>spring-web</artifactId>
190-
<version>${spring.version}</version>
191-
</dependency>
192187
<dependency>
193188
<groupId>org.springframework</groupId>
194189
<artifactId>spring-test</artifactId>
@@ -283,7 +278,7 @@
283278
<dependency>
284279
<groupId>org.apache.logging.log4j</groupId>
285280
<artifactId>log4j-layout-template-json</artifactId>
286-
<version>2.17.2</version>
281+
<version>${log4j.version}</version>
287282
</dependency>
288283
<dependency>
289284
<groupId>org.apache.solr</groupId>

src/main/java/org/dataone/cn/indexer/IndexWorker.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,21 @@ public class IndexWorker {
106106
public static void main(String[] args) {
107107
logger.info("IndexWorker.main - Starting index worker...");
108108
String propertyFile = null;
109+
if (args != null && args.length == 1) {
110+
// The args should be a property file which the dataone-indexer will use
111+
propertyFile = args[0];
112+
logger.debug("The external property file specified in the argument is " + propertyFile);
113+
}
109114
loadExternalPropertiesFile(propertyFile);
110115
try {
111116
IndexWorker worker = new IndexWorker();
112117
worker.start();
113118
worker.startReadinessProbe();
119+
worker.startLivenessProbe();
114120
} catch (Exception e) {
115121
logger.fatal("IndexWorker.main() exiting due to fatal error: " + e.getMessage(), e);
116122
System.exit(1);
117123
}
118-
startLivenessProbe();
119124
}
120125

121126
/**
@@ -483,7 +488,11 @@ private void indexObject(IndexQueueMessageParser parser, boolean multipleThread)
483488
}
484489
}
485490

486-
private static void startLivenessProbe() {
491+
private void startLivenessProbe() {
492+
if (!isK8s) {
493+
logger.debug("This is a non-k8s deployment and LivenessProbe do nothing.");
494+
return;
495+
}
487496
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
488497
Path path = Paths.get("./livenessprobe");
489498
Runnable task = () -> {

src/main/java/org/dataone/cn/indexer/XmlDocumentUtility.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,15 @@
3131
import javax.xml.parsers.DocumentBuilderFactory;
3232
import javax.xml.parsers.ParserConfigurationException;
3333

34-
import org.apache.log4j.Logger;
34+
import org.apache.commons.logging.Log;
35+
import org.apache.commons.logging.LogFactory;
3536
import org.w3c.dom.Document;
3637
import org.xml.sax.InputSource;
3738
import org.xml.sax.SAXException;
3839

3940
public class XmlDocumentUtility {
4041

41-
private static Logger log = Logger.getLogger(XmlDocumentUtility.class);
42+
private static Log log = LogFactory.getLog(XmlDocumentUtility.class);
4243

4344
private static final String INPUT_ENCODING = "UTF-8";
4445

src/main/java/org/dataone/cn/indexer/annotation/AnnotatorSubprocessor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
import org.apache.commons.codec.EncoderException;
2020
import org.apache.commons.io.IOUtils;
21-
import org.apache.log4j.Logger;
21+
import org.apache.commons.logging.Log;
22+
import org.apache.commons.logging.LogFactory;
2223
import org.dataone.cn.indexer.parser.IDocumentSubprocessor;
2324
import org.dataone.cn.indexer.parser.ISolrDataField;
2425
import org.dataone.cn.indexer.parser.SubprocessorUtility;
@@ -45,7 +46,7 @@ public class AnnotatorSubprocessor implements IDocumentSubprocessor {
4546
public static final String FIELD_ANNOTATED_BY = "sem_annotated_by";
4647
public static final String FIELD_COMMENT = "sem_comment";
4748

48-
private static Logger log = Logger.getLogger(AnnotatorSubprocessor.class.getName());
49+
private static Log log = LogFactory.getLog(AnnotatorSubprocessor.class.getName());
4950

5051
private SubprocessorUtility processorUtility;
5152

0 commit comments

Comments
 (0)