Skip to content

Commit

Permalink
[sophora server]: disable archive (#14)
Browse files Browse the repository at this point in the history
* [sophora server]: disable archive

* archiveType none
  • Loading branch information
tom-schoener authored May 16, 2023
1 parent 4bafe9c commit 3277e29
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 33 deletions.
2 changes: 1 addition & 1 deletion charts/sophora-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.1
version: 1.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
6 changes: 6 additions & 0 deletions charts/sophora-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

The required secrets must be present before you install the server.

## Archive repository persistence

Starting with Sophora 5 the archive repository is no longer available.
To disable all archive related storage options, set `sophora.server.persistence.archiveType` to `none`.
In later chart versions this will be the default.

## Tips for productive installations

### Cluster servers
Expand Down
4 changes: 3 additions & 1 deletion charts/sophora-server/templates/sophora-init-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,18 @@ data:
envsubst < /sophora-repository-template/workspace.live.xml > /sophora-repository/workspace.live.xml
echo "Generated repository.xml, workspace.default.xml, and workspace.live.xml from ENV"
# archive.xml
{{/* Archive */}}
{{- if eq .Values.sophora.server.persistence.archiveType "mysql" }}
eval "export ARCHIVE_MYSQL_HOST=\${ARCHIVE_MYSQL_HOST_${PODID}}"
eval "export ARCHIVE_MYSQL_USER=\${ARCHIVE_MYSQL_USER_${PODID}}"
eval "export ARCHIVE_MYSQL_PASSWORD=\${ARCHIVE_MYSQL_PASSWORD_${PODID}}"
export ARCHIVE_MYSQL_PASSWORD=$(echo $ARCHIVE_MYSQL_PASSWORD | sed "$SED_XML_ESCAPE")
{{- end }}
{{- if or (eq .Values.sophora.server.persistence.archiveType "mysql") (eq .Values.sophora.server.persistence.archiveType "localdb") }}
envsubst < /sophora-archive-template/repository.xml > /sophora-archive/repository.xml
envsubst < /sophora-archive-template/workspace.default.xml > /sophora-archive/workspace.default.xml
echo "Generated repository.xml and workspace.default.xml for archive from ENV"
{{- end }}
{{- if .Values.sophora.acs.url }}
acs.properties: |-
Expand Down
47 changes: 29 additions & 18 deletions charts/sophora-server/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,18 @@ spec:
mountPath: /sophora-repository-template
- name: {{ include "sophora-server.repositoryConfigName" . }}
mountPath: /sophora-repository
- name: {{ include "sophora-server.archiveConfigTemplateName" . }}
mountPath: /sophora-archive-template
- name: {{ include "sophora-server.archiveConfigName" . }}
mountPath: /sophora-archive
- name: {{ include "sophora-server.configs" . }}
mountPath: /configs
- name: {{ include "sophora-server.propertiesName" . }}
mountPath: /sophora-properties

{{- if not (eq .Values.sophora.server.persistence.archiveType "none") }}
# archive
- name: {{ include "sophora-server.archiveConfigTemplateName" . }}
mountPath: /sophora-archive-template
- name: {{ include "sophora-server.archiveConfigName" . }}
mountPath: /sophora-archive
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
Expand Down Expand Up @@ -153,6 +157,7 @@ spec:
mountPath: /sophora/repository/workspaces/live/db
subPath: repository.workspaces.live.db

{{- if not (eq .Values.sophora.server.persistence.archiveType "none") }}
# Repository Archive Structure
- name: sophora-server-storage
mountPath: /sophora/repository_archive/repository
Expand All @@ -167,6 +172,15 @@ spec:
mountPath: /sophora/repository_archive/workspaces/default/db
subPath: repository_archive.workspaces.default.db

# Archive Repo
- name: {{ include "sophora-server.archiveConfigName" . }}
subPath: repository.xml
mountPath: /sophora/repository_archive/repository.xml
- name: {{ include "sophora-server.archiveConfigName" . }}
subPath: workspace.default.xml
mountPath: /sophora/repository_archive/workspaces/default/workspace.xml
{{- end }}

# Main Repo
- name: {{ include "sophora-server.repositoryConfigName" . }}
subPath: repository.xml
Expand All @@ -178,14 +192,6 @@ spec:
subPath: workspace.live.xml
mountPath: /sophora/repository/workspaces/live/workspace.xml

# Archive Repo
- name: {{ include "sophora-server.archiveConfigName" . }}
subPath: repository.xml
mountPath: /sophora/repository_archive/repository.xml
- name: {{ include "sophora-server.archiveConfigName" . }}
subPath: workspace.default.xml
mountPath: /sophora/repository_archive/workspaces/default/workspace.xml

{{ if eq .Values.sophora.server.isClusterServer true -}}
# Shutdown-Hook
- name: tools
Expand Down Expand Up @@ -321,28 +327,33 @@ spec:
name: {{ include "sophora-server.repositoryConfigTemplateName" . }}
- name: {{ include "sophora-server.repositoryConfigName" . }}
emptyDir: {}
- name: {{ include "sophora-server.archiveConfigTemplateName" . }}
configMap:
name: {{ include "sophora-server.archiveConfigTemplateName" . }}
- name: {{ include "sophora-server.archiveConfigName" . }}
emptyDir: {}

- name: logback-xml-config
configMap:
name: {{ include "sophora-server.logbackConfigName" . }}

{{ if eq .Values.sophora.server.isClusterServer true -}}
- name: tools
emptyDir: {}
{{- end }}

- name: sophora-server-storage
persistentVolumeClaim:
claimName: sophora-server-storage
- name: sophora-server-repository
configMap:
name: {{ include "sophora-server.repositoryConfigName" . }}

{{- if not (eq .Values.sophora.server.persistence.archiveType "none") }}
# archive
- name: {{ include "sophora-server.archiveConfigTemplateName" . }}
configMap:
name: {{ include "sophora-server.archiveConfigTemplateName" . }}
- name: {{ include "sophora-server.archiveConfigName" . }}
emptyDir: {}
- name: sophora-server-archive
configMap:
name: {{ include "sophora-server.archiveConfigName" . }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: sophora-server-storage
Expand Down
33 changes: 20 additions & 13 deletions charts/sophora-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,20 +170,27 @@ sophora:
requests:
storage: 2Gi
persistence:
repositoryType: localdb # or mysql
archiveType: localdb # or mysql
# if clusterReplication.enabled is set to false the list of reposities and archieves should only contain one entry
## @param sophora.server.persistence.repositoryType string that identifies the archive persistence technology (localdb, or mysql)
repositoryType: localdb
## @param sophora.server.persistence.archiveType string that identifies the archive persistence technology (localdb, mysql or none)
archiveType: localdb
mysql:
repositories:
# secretName:
# hostnameKey: hostname
# usernameKey: username
# passwordKey: password
archives:
# secretName:
# hostnameKey: hostname
# usernameKey: username
# passwordKey: password
## @param sophora.server.persistence.mysql.repositories Array of server main repository connection configurations via secrets.
## If clusterReplication.enabled is set to false the list of repositories and archives should only contain one entry.
## e.g.
## - secretName:
# hostnameKey:
# usernameKey:
# passwordKey:
repositories: []
## @param sophora.server.persistence.mysql.archives Array of server archive connection configurations via secrets.
## If clusterReplication.enabled is set to false the list of repositories and archives should only contain one entry.
## e.g.
## - secretName:
## hostnameKey:
## usernameKey:
## passwordKey:
archives: []
binaryStore:
s3:
secret:
Expand Down

0 comments on commit 3277e29

Please sign in to comment.