Skip to content

Commit

Permalink
invenio: add vocabularies
Browse files Browse the repository at this point in the history
* Adds the option to customize vocabularies (closes inveniosoftware#135)
  • Loading branch information
egabancho committed Dec 16, 2024
1 parent 97c071b commit e072dcd
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 1 deletion.
12 changes: 12 additions & 0 deletions charts/invenio/templates/install-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,22 @@ spec:
secretKeyRef:
name: invenio-secrets
key: INVENIO_CSRF_SECRET_SALT
volumeMounts:
{{- range $key, $value := .Values.invenio.vocabularies }}
- name: vocabularies
mountPath: "/opt/invenio/var/instance/app_data/vocabularies/{{ $key }}"
subPath: "{{ $key }}"
{{- end }}
{{- if .Values.web.resources }}
resources: {{- toYaml .Values.web.resources | nindent 10 }}
{{- end }}
restartPolicy: OnFailure
{{- if .Values.invenio.vocabularies }}
volumes:
- name: vocabularies
configMap:
name: "invenio-vocabularies"
{{- end }}
{{- if .Values.web.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.web.imagePullSecret }}
Expand Down
10 changes: 10 additions & 0 deletions charts/invenio/templates/vocabularies-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- with .Values.invenio.vocabularies }}
apiVersion: v1
kind: ConfigMap
metadata:
name: invenio-vocabularies
labels:
{{- include "invenio.labels" $ | nindent 4 }}
data:
{{- toYaml . | nindent 2 }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/invenio/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ spec:
- name: kerberos-credentials-cache
mountPath: /tmp
{{- end }}
{{- range $key, $value := .Values.invenio.vocabularies }}
- name: vocabularies
mountPath: "/opt/invenio/var/instance/app_data/vocabularies/{{ $key }}"
subPath: "{{ $key }}"
{{- end }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down Expand Up @@ -279,6 +284,11 @@ spec:
- name: kerberos-credentials-cache
emptyDir: {}
{{- end }}
{{- if .Values.invenio.vocabularies }}
- name: vocabularies
configMap:
name: "invenio-vocabularies"
{{- end }}
{{- if .Values.web.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.web.imagePullSecret }}
Expand Down
10 changes: 10 additions & 0 deletions charts/invenio/templates/worker-beat-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ spec:
- mountPath: /opt/invenio/var/instance/data
name: shared-volume
{{- end }}
{{- range $key, $value := .Values.invenio.vocabularies }}
- name: vocabularies
mountPath: "/opt/invenio/var/instance/app_data/vocabularies/{{ $key }}"
subPath: "{{ $key }}"
{{- end }}
envFrom:
- configMapRef:
name: invenio-config
Expand Down Expand Up @@ -127,6 +132,11 @@ spec:
persistentVolumeClaim:
claimName: {{ .Values.persistence.name }}
{{- end }}
{{- if .Values.invenio.vocabularies }}
- name: vocabularies
configMap:
name: "invenio-vocabularies"
{{- end }}
{{- if .Values.worker.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.worker.imagePullSecret }}
Expand Down
11 changes: 10 additions & 1 deletion charts/invenio/templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ spec:
- name: kerberos-credentials-cache
mountPath: /tmp
{{- end }}
{{- range $key, $value := .Values.invenio.vocabularies }}
- name: vocabularies
mountPath: "/opt/invenio/var/instance/app_data/vocabularies/{{ $key }}"
subPath: "{{ $key }}"
{{- end }}
{{- if .Values.kerberos.enabled }}
- name: kerberos-credentials
image: {{ required "Missing .Values.kerberos.image" .Values.kerberos.image }}
Expand Down Expand Up @@ -165,7 +170,11 @@ spec:
- name: kerberos-credentials-cache
emptyDir: {}
{{- end }}

{{- if .Values.invenio.vocabularies }}
- name: vocabularies
configMap:
name: "invenio-vocabularies"
{{- end }}
{{- if .Values.worker.imagePullSecret }}
imagePullSecrets:
- name: {{ .Values.worker.imagePullSecret }}
Expand Down
25 changes: 25 additions & 0 deletions charts/invenio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,31 @@ invenio:
# name: name-of-my-secret
# key: KEY_IN_MY_SECRET

## @param invenio.vocabularies Vocabularies to be loaded as files under /app_data/vocabularies
## Example
## vocabularies:
## resource_types.yaml: |
## - id: publication
## icon: file alternate
## props:
## csl: report
## datacite_general: Text
## datacite_type: ""
## openaire_resourceType: "0017"
## openaire_type: publication
## eurepo: info:eu-repo/semantics/other
## schema.org: https://schema.org/CreativeWork
## subtype: ""
## type: publication
## marc21_type: publication
## marc21_subtype: ""
## title:
## en: Publication
## tags:
## - depositable
## - linkable
vocabularies: {}

haproxy:
enabled: true
image: "haproxy:2.8.3"
Expand Down

0 comments on commit e072dcd

Please sign in to comment.