hyrax 3.0.0.pre.rc4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/.dassie/config/cable.yml +1 -1
  3. data/.dassie/config/environments/development.rb +2 -0
  4. data/.dassie/config/environments/production.rb +1 -1
  5. data/.dassie/config/redis.yml +1 -0
  6. data/.dassie/db/seeds.rb +8 -0
  7. data/.dockerignore +1 -0
  8. data/Dockerfile +7 -4
  9. data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +27 -1
  10. data/app/actors/hyrax/actors/file_actor.rb +4 -2
  11. data/app/actors/hyrax/actors/file_set_actor.rb +8 -6
  12. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +16 -5
  13. data/app/forms/hyrax/forms/resource_form.rb +15 -0
  14. data/app/helpers/hyrax/hyrax_helper_behavior.rb +8 -0
  15. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +116 -0
  16. data/app/indexers/hyrax/valkyrie_indexer.rb +6 -1
  17. data/app/indexers/hyrax/valkyrie_work_indexer.rb +2 -0
  18. data/app/jobs/embargo_expiry_job.rb +7 -5
  19. data/app/jobs/file_set_attached_event_job.rb +6 -1
  20. data/app/jobs/lease_expiry_job.rb +6 -4
  21. data/app/models/concerns/hyrax/ability.rb +11 -0
  22. data/app/models/concerns/hyrax/solr_document_behavior.rb +7 -1
  23. data/app/models/hyrax/file_set.rb +1 -0
  24. data/app/models/hyrax/work.rb +2 -0
  25. data/app/models/job_io_wrapper.rb +1 -1
  26. data/app/services/hyrax/access_control_list.rb +1 -1
  27. data/app/services/hyrax/adapters/nesting_index_adapter.rb +1 -1
  28. data/app/services/hyrax/embargo_manager.rb +1 -1
  29. data/app/services/hyrax/graph_exporter.rb +1 -1
  30. data/app/services/hyrax/listeners/metadata_index_listener.rb +18 -1
  31. data/app/services/hyrax/versioning_service.rb +1 -1
  32. data/app/services/hyrax/work_uploads_handler.rb +5 -2
  33. data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +1 -1
  34. data/app/views/hyrax/base/_form_share.html.erb +1 -5
  35. data/app/views/hyrax/base/_workflow_actions.html.erb +1 -1
  36. data/app/views/hyrax/batch_edits/edit.html.erb +2 -2
  37. data/app/views/hyrax/collections/_list_collections.html.erb +1 -1
  38. data/app/views/hyrax/collections/_search_form.html.erb +1 -1
  39. data/app/views/hyrax/stats/file.html.erb +1 -1
  40. data/app/views/hyrax/stats/work.html.erb +1 -1
  41. data/app/views/hyrax/uploads/_js_templates.html.erb +4 -4
  42. data/app/views/hyrax/uploads/_js_templates_versioning.html.erb +4 -4
  43. data/app/views/hyrax/users/_contributions.html.erb +1 -1
  44. data/app/views/hyrax/users/_profile_tabs.html.erb +2 -2
  45. data/app/views/hyrax/users/_search_form.html.erb +1 -1
  46. data/app/views/hyrax/users/_user.html.erb +1 -1
  47. data/app/views/hyrax/users/_user_info.html.erb +9 -9
  48. data/bin/db-migrate-seed.sh +3 -1
  49. data/bin/solrcloud-assign-configset.sh +27 -0
  50. data/bin/solrcloud-upload-configset.sh +31 -0
  51. data/chart/hyrax/Chart.yaml +8 -8
  52. data/chart/hyrax/README.md +42 -6
  53. data/chart/hyrax/templates/NOTES.txt +1 -1
  54. data/chart/hyrax/templates/_helpers.tpl +76 -0
  55. data/chart/hyrax/templates/configmap-env.yaml +10 -11
  56. data/chart/hyrax/templates/cron-embargo.yaml +24 -0
  57. data/chart/hyrax/templates/cron-lease.yaml +24 -0
  58. data/chart/hyrax/templates/deployment.yaml +36 -4
  59. data/chart/hyrax/templates/secrets.yaml +3 -2
  60. data/chart/hyrax/values.yaml +72 -1
  61. data/config/initializers/listeners.rb +2 -0
  62. data/documentation/developing-your-hyrax-based-app.md +3 -3
  63. data/lib/hyrax/transactions/container.rb +11 -1
  64. data/lib/hyrax/transactions/steps/delete_resource.rb +38 -0
  65. data/lib/hyrax/transactions/steps/destroy_work.rb +1 -0
  66. data/lib/hyrax/transactions/work_destroy.rb +20 -0
  67. data/lib/hyrax/version.rb +1 -1
  68. data/lib/tasks/embargo_lease.rake +27 -0
  69. data/lib/wings/active_fedora_converter/default_work.rb +4 -0
  70. data/lib/wings/attribute_transformer.rb +29 -19
  71. data/lib/wings/model_transformer.rb +4 -19
  72. data/lib/wings/orm_converter.rb +24 -21
  73. data/lib/wings/valkyrie/persister.rb +1 -0
  74. data/lib/wings/valkyrie/query_service.rb +36 -24
  75. data/template.rb +1 -1
  76. metadata +14 -20
  77. data/chart/fcrepo/.gitignore +0 -2
  78. data/chart/fcrepo/.helmignore +0 -23
  79. data/chart/fcrepo/Chart.yaml +0 -11
  80. data/chart/fcrepo/README.md +0 -50
  81. data/chart/fcrepo/templates/NOTES.txt +0 -21
  82. data/chart/fcrepo/templates/_helpers.tpl +0 -68
  83. data/chart/fcrepo/templates/configmap-env.yaml +0 -19
  84. data/chart/fcrepo/templates/deployment.yaml +0 -109
  85. data/chart/fcrepo/templates/ingress.yaml +0 -41
  86. data/chart/fcrepo/templates/pvc.yaml +0 -20
  87. data/chart/fcrepo/templates/secret.yaml +0 -12
  88. data/chart/fcrepo/templates/service.yaml +0 -15
  89. data/chart/fcrepo/templates/serviceaccount.yaml +0 -12
  90. data/chart/fcrepo/templates/tests/test-connection.yaml +0 -15
  91. data/chart/fcrepo/values.yaml +0 -79
  92. data/chart/hyrax/templates/fcrepo-secret.yaml +0 -13
@@ -2,8 +2,10 @@
2
2
  set -e
3
3
 
4
4
  db-wait.sh "$DB_HOST:$DB_PORT"
5
+ bundle exec rails db:create
6
+ bundle exec rails db:migrate
7
+
5
8
  db-wait.sh "$FCREPO_HOST:$FCREPO_PORT"
6
9
  db-wait.sh "$SOLR_HOST:$SOLR_PORT"
7
10
 
8
- bundle exec rails db:migrate
9
11
  bundle exec rails db:seed
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env sh
2
+ COUNTER=0;
3
+
4
+ if [ "$SOLR_ADMIN_USER" ]; then
5
+ solr_user_settings="--user $SOLR_ADMIN_USER:$SOLR_ADMIN_PASSWORD"
6
+ fi
7
+
8
+ # Solr Cloud Collection API URLs
9
+ solr_collection_list_url="$SOLR_HOST:$SOLR_PORT/solr/admin/collections?action=LIST"
10
+ solr_collection_modify_url="$SOLR_HOST:$SOLR_PORT/solr/admin/collections?action=MODIFYCOLLECTION&collection=$SOLR_COLLECTION_NAME&collection.configName=$SOLR_CONFIGSET_NAME"
11
+
12
+ while [ $COUNTER -lt 30 ]; do
13
+ if nc -z "${SOLR_HOST}" "${SOLR_PORT}"; then
14
+ if curl --silent $solr_user_settings "$solr_collection_list_url" | grep -q "$SOLR_COLLECTION_NAME"; then
15
+ echo "-- Collection ${SOLR_COLLECTION_NAME} exists; setting ${SOLR_CONFIGSET_NAME} ConfigSet ..."
16
+ echo $solr_collection_modify_url
17
+ curl $solr_user_settings "$solr_collection_modify_url"
18
+ exit
19
+ fi
20
+ fi
21
+ echo "-- Looking for Solr (${SOLR_HOST}:${SOLR_PORT})..."
22
+ COUNTER=$(( COUNTER+1 ));
23
+ sleep 5s
24
+ done
25
+
26
+ echo "--- ERROR: failed to create/update Solr collection after 5 minutes";
27
+ exit 1
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env sh
2
+
3
+ COUNTER=0;
4
+ # /app/samvera/hyrax-webapp/solr/conf
5
+ CONFDIR="${1}"
6
+
7
+ if [ "$SOLR_ADMIN_USER" ]; then
8
+ solr_user_settings="--user $SOLR_ADMIN_USER:$SOLR_ADMIN_PASSWORD"
9
+ fi
10
+
11
+ # Solr Cloud ConfigSet API URLs
12
+ solr_config_list_url="http://$SOLR_HOST:$SOLR_PORT/api/cluster/configs?omitHeader=true"
13
+ solr_config_upload_url="http://$SOLR_HOST:$SOLR_PORT/solr/admin/configs?action=UPLOAD&name=$SOLR_CONFIGSET_NAME"
14
+
15
+ while [ $COUNTER -lt 30 ]; do
16
+ echo "-- Looking for Solr (${SOLR_HOST}:${SOLR_PORT})..."
17
+ if nc -z "${SOLR_HOST}" "${SOLR_PORT}"; then
18
+ if curl --silent $solr_user_settings "$solr_config_list_url" | grep -q "$SOLR_CONFIGSET_NAME"; then
19
+ echo "-- ConfigSet already exists; skipping creation ...";
20
+ else
21
+ echo "-- ConfigSet for ${CONFDIR} does not exist; creating ..."
22
+ (cd "$CONFDIR" && zip -r - *) | curl -X POST $solr_user_settings --header "Content-Type:application/octet-stream" --data-binary @- "$solr_config_upload_url"
23
+ fi
24
+ exit
25
+ fi
26
+ COUNTER=$(( COUNTER+1 ));
27
+ sleep 5s
28
+ done
29
+
30
+ echo "--- ERROR: failed to create Solr ConfigSet after 5 minutes";
31
+ exit 1
@@ -2,18 +2,19 @@ apiVersion: v2
2
2
  name: hyrax
3
3
  description: An open-source, Samvera-powered digital repository system
4
4
  type: application
5
- version: 0.5.0
6
- appVersion: 3.0.0-rc4
5
+ version: 0.6.0
6
+ appVersion: 3.0.0
7
7
  dependencies:
8
8
  - name: fcrepo
9
- version: 0.4.1
10
- repository: file://../fcrepo
9
+ version: 0.6.0
10
+ repository: https://samvera-labs.github.com/fcrepo-charts
11
+ condition: fcrepo.enabled
11
12
  - name: memcached
12
13
  version: 4.2.21
13
14
  repository: https://charts.bitnami.com/bitnami
14
15
  condition: memcached.enabled
15
16
  - name: postgresql
16
- version: 9.3.3
17
+ version: 10.3.13
17
18
  repository: https://charts.bitnami.com/bitnami
18
19
  condition: postgresql.enabled
19
20
  - name: redis
@@ -21,7 +22,6 @@ dependencies:
21
22
  repository: https://charts.bitnami.com/bitnami
22
23
  condition: redis.enabled
23
24
  - name: solr
24
- version: 1.5.2
25
- repository: http://storage.googleapis.com/kubernetes-charts-incubator
25
+ version: 0.2.2
26
+ repository: https://charts.bitnami.com/bitnami
26
27
  condition: solr.enabled
27
- # need something for fcrepo
@@ -39,14 +39,50 @@ The chart populates the following environment variables:
39
39
  | RACK_ENV | app environment ('production') | n/a |
40
40
  | RAILS_ENV | app environment ('production') | n/a |
41
41
  | REDIS_HOST | Redis service host | `redis.enabled` |
42
- | FCREPO_HOST | Fedora Commons host | `fcrepo.enabled` |
43
- | FCREPO_PORT | Fedora Commons port | `fcrepo.enabled` |
44
- | FCREPO_REST_PATH | Fedora Commons REST endpoint | `fcrepo.enabled` |
45
- | SOLR_HOST | Solr service host | `solr.enabled` |
46
- | SOLR_PORT | Solr service port | `solr.enabled` |
47
- | SOLR_URL | Solr service full URL | `solr.enabled` |
42
+ | FCREPO_BASE_PATH | Fedora Commons root path | n/a |
43
+ | FCREPO_HOST | Fedora Commons host | n/a |
44
+ | FCREPO_PORT | Fedora Commons port | n/a |
45
+ | FCREPO_REST_PATH | Fedora Commons REST endpoint | n/a |
46
+ | SOLR_ADMIN_USER | Solr user for basic auth | n/a |
47
+ | SOLR_ADMIN_PASSWORD | Solr password for basic auth | n/a |
48
+ | SOLR_COLLECTION_NAME | The name of the solr collection to use | n/a |
49
+ | SOLR_CONFIGSET_NAME | The name of the solr configset to use for config management tasks | n/a |
50
+ | SOLR_HOST | Solr service host | n/a |
51
+ | SOLR_PORT | Solr service port | n/a |
52
+ | SOLR_URL | Solr service full URL | n/a |
48
53
  |----------------- -|--------------------------------|------------------------|
49
54
 
55
+ ## With an external SolrCloud
56
+
57
+ By default, this chart deploys and manages an internal SolrCloud deployment,
58
+ complete with its own ZooKeeper service.
59
+
60
+ To use an existing or externally managed SolrCloud, use the chart values:
61
+
62
+ - `solr.enabled`: false
63
+ - `externalSolrHost`: "mySolr.hostname.example.com"
64
+ - `externalSolrUser`: "admin"
65
+ - `externalSolrPassword`: "the_admin_password"
66
+ - `externalSolrCollection`: "a_collection_name"
67
+
68
+ The chart will attempt to upload a ConfigSet for Hyrax matching the deployment's
69
+ "fullname" and assign it to the collection. This is achieved through the Solr
70
+ Collections API, and authentication _must_ be enabled in the external Solr for
71
+ this to work.
72
+
73
+ If you want to manage your ConfigSet manually, disable this behavior with
74
+ `--set loadSolrConfigSet=false`.
75
+
76
+ ## With an external Fedora Commons Repository
77
+
78
+ By default, this chart deploys a local Fedora Repository, backed by the
79
+ application's Postgresql system.
80
+
81
+ To use an existing or external `fcrepo` instance, use the chart values:
82
+
83
+ - `fcrepo.enabled`: false
84
+ - `externalFcrepoHost`: "myfedora.hostname.example.com"
85
+
50
86
  ## For DevOps:
51
87
 
52
88
  For those interested in trying out or contributing to this Chart, it's helpful
@@ -2,7 +2,7 @@
2
2
  {{- if .Values.ingress.enabled }}
3
3
  {{- range $host := .Values.ingress.hosts }}
4
4
  {{- range .paths }}
5
- http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
5
+ http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}
6
6
  {{- end }}
7
7
  {{- end }}
8
8
  {{- else if contains "NodePort" .Values.service.type }}
@@ -70,6 +70,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
70
70
  {{- printf "%s-%s" .Release.Name "fcrepo" | trunc 63 | trimSuffix "-" -}}
71
71
  {{- end -}}
72
72
 
73
+ {{- define "hyrax.fcrepo.host" -}}
74
+ {{- if .Values.fcrepo.enabled }}
75
+ {{- include "hyrax.fcrepo.fullname" . }}
76
+ {{- else }}
77
+ {{- .Values.externalFcrepoHost }}
78
+ {{- end }}
79
+ {{- end -}}
80
+
73
81
  {{- define "hyrax.memcached.fullname" -}}
74
82
  {{- printf "%s-%s" .Release.Name "memcached" | trunc 63 | trimSuffix "-" -}}
75
83
  {{- end -}}
@@ -78,6 +86,37 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
78
86
  {{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
79
87
  {{- end -}}
80
88
 
89
+ {{- define "hyrax.postgresql.host" -}}
90
+ {{- if .Values.postgresql.enabled }}
91
+ {{- include "hyrax.postgresql.fullname" . }}
92
+ {{- else }}
93
+ {{- .Values.externalPostgresql.host }}
94
+ {{- end }}
95
+ {{- end -}}
96
+
97
+ {{- define "hyrax.postgresql.database" -}}
98
+ {{- if .Values.postgresql.enabled }}
99
+ {{- .Values.postgresql.postgresqlDatabase }}
100
+ {{- else }}
101
+ {{- .Values.externalPostgresql.database | default ( include "hyrax.fullname" . ) }}
102
+ {{- end }}
103
+ {{- end -}}
104
+
105
+ {{- define "hyrax.postgresql.username" -}}
106
+ {{- if .Values.postgresql.enabled }}
107
+ {{- .Values.postgresql.postgresqlUsername }}
108
+ {{- else }}
109
+ {{- .Values.externalPostgresql.username | default "postgres" }}
110
+ {{- end }}
111
+ {{- end -}}
112
+
113
+ {{- define "hyrax.postgresql.password" -}}
114
+ {{- if .Values.postgresql.enabled }}
115
+ {{- .Values.postgresql.postgresqlPassword }}
116
+ {{- else }}
117
+ {{- .Values.externalPostgresql.password }}
118
+ {{- end }}
119
+ {{- end -}}
81
120
 
82
121
  {{- define "hyrax.redis.fullname" -}}
83
122
  {{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}}
@@ -87,6 +126,43 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
87
126
  {{- define "hyrax.solr.fullname" -}}
88
127
  {{- printf "%s-%s" .Release.Name "solr" | trunc 63 | trimSuffix "-" -}}
89
128
  {{- end -}}
129
+
130
+ {{- define "hyrax.solr.host" -}}
131
+ {{- if .Values.solr.enabled }}
132
+ {{- include "hyrax.solr.fullname" . }}
133
+ {{- else }}
134
+ {{- .Values.externalSolrHost }}
135
+ {{- end }}
136
+ {{- end -}}
137
+
138
+ {{- define "hyrax.solr.collectionName" -}}
139
+ {{- if .Values.solr.enabled }}
140
+ {{- .Values.solr.collection | default "hyrax" }}
141
+ {{- else }}
142
+ {{- .Values.externalSolrCollection | default "hyrax" }}
143
+ {{- end }}
144
+ {{- end -}}
145
+
146
+ {{- define "hyrax.solr.username" -}}
147
+ {{- if .Values.solr.enabled }}
148
+ {{- .Values.solr.authentication.adminUsername }}
149
+ {{- else }}
150
+ {{- .Values.externalSolrUser }}
151
+ {{- end }}
152
+ {{- end -}}
153
+
154
+ {{- define "hyrax.solr.password" -}}
155
+ {{- if .Values.solr.enabled }}
156
+ {{- .Values.solr.authentication.adminPassword }}
157
+ {{- else }}
158
+ {{- .Values.externalSolrPassword }}
159
+ {{- end }}
160
+ {{- end -}}
161
+
162
+ {{- define "hyrax.solr.url" -}}
163
+ {{- printf "http://%s:%s@%s:%s/solr/%s" (include "hyrax.solr.username" .) (include "hyrax.solr.password" .) (include "hyrax.solr.host" .) "8983" (include "hyrax.solr.collectionName" .) -}}
164
+ {{- end -}}
165
+
90
166
  {{- define "hyrax.zk.fullname" -}}
91
167
  {{- printf "%s-%s" .Release.Name "zookeeper" | trunc 63 | trimSuffix "-" -}}
92
168
  {{- end -}}
@@ -8,10 +8,8 @@ metadata:
8
8
  app.kubernetes.io/instance: {{ .Release.Name }}
9
9
  app.kubernetes.io/managed-by: {{ .Release.Service }}
10
10
  data:
11
- {{- if .Values.postgresql.enabled }}
12
- DB_HOST: {{ template "hyrax.postgresql.fullname" . }}
11
+ DB_HOST: {{ template "hyrax.postgresql.host" . }}
13
12
  DB_PORT: "5432"
14
- {{- end }}
15
13
  {{- if .Values.memcached.enabled }}
16
14
  MEMCACHED_HOST: {{ template "hyrax.memcached.fullname" . }}
17
15
  {{- end }}
@@ -20,13 +18,14 @@ data:
20
18
  {{- if .Values.redis.enabled }}
21
19
  REDIS_HOST: {{ template "hyrax.redis.fullname" . }}-master
22
20
  {{- end }}
23
- {{- if .Values.fcrepo.enabled }}
21
+ FCREPO_BASE_PATH: {{ .Values.fcrepoBasePathOverride | default (printf "/%s" (include "hyrax.fullname" .)) | quote }}
22
+ FCREPO_HOST: {{ template "hyrax.fcrepo.host" . }}
24
23
  FCREPO_PORT: {{ .Values.fcrepo.servicePort | default 8080 | quote }}
25
- FCREPO_HOST: {{ template "hyrax.fcrepo.fullname" . }}
26
- FCREPO_REST_PATH: {{ .Values.fcrepo.restPath | default "fcrepo/rest" }}
27
- {{- end }}
28
- {{- if .Values.solr.enabled }}
29
- SOLR_HOST: {{ template "hyrax.solr.fullname" . }}-svc
24
+ FCREPO_REST_PATH: {{ .Values.fcrepo.restPath | default "rest" }}
25
+ SOLR_ADMIN_USER: {{ template "hyrax.solr.username" . }}
26
+ SOLR_ADMIN_PASSWORD: {{ template "hyrax.solr.password" . }}
27
+ SOLR_COLLECTION_NAME: {{ template "hyrax.solr.collectionName" . }}
28
+ SOLR_CONFIGSET_NAME: {{ template "hyrax.fullname" . }}
29
+ SOLR_HOST: {{ template "hyrax.solr.host" . }}
30
30
  SOLR_PORT: "8983"
31
- SOLR_URL: http://{{ template "hyrax.solr.fullname" . }}-svc:8983/solr/hyrax
32
- {{- end }}
31
+ SOLR_URL: {{ template "hyrax.solr.url" . }}
@@ -0,0 +1,24 @@
1
+ {{- if .Values.embargoRelease.enabled }}
2
+ apiVersion: batch/v1beta1
3
+ kind: CronJob
4
+ metadata:
5
+ metadata:
6
+ name: {{ include "hyrax.fullname" . }}-embargo-task
7
+ labels:
8
+ {{- include "hyrax.labels" . | nindent 4 }}
9
+ spec:
10
+ schedule: {{ .Values.embargoRelease.schedule | default "*0 0 * * *" | quote }}
11
+ jobTemplate:
12
+ spec:
13
+ template:
14
+ spec:
15
+ containers:
16
+ - name: embargo-release
17
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
18
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
19
+ command:
20
+ - /bin/sh
21
+ - -c
22
+ - bundle exec rake hyrax:embargo:deactivate_expired
23
+ restartPolicy: OnFailure
24
+ {{- end }}
@@ -0,0 +1,24 @@
1
+ {{- if .Values.leaseRelease.enabled }}
2
+ apiVersion: batch/v1beta1
3
+ kind: CronJob
4
+ metadata:
5
+ metadata:
6
+ name: {{ include "hyrax.fullname" . }}-lease-task
7
+ labels:
8
+ {{- include "hyrax.labels" . | nindent 4 }}
9
+ spec:
10
+ schedule: {{ .Values.leaseRelease.schedule | default "0 0 * * *" | quote }}
11
+ jobTemplate:
12
+ spec:
13
+ template:
14
+ spec:
15
+ containers:
16
+ - name: lease-release
17
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
18
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
19
+ command:
20
+ - /bin/sh
21
+ - -c
22
+ - bundle exec rake hyrax:lease:deactivate_expired
23
+ restartPolicy: OnFailure
24
+ {{- end }}
@@ -21,6 +21,22 @@ spec:
21
21
  {{- include "hyrax.selectorLabels" . | nindent 8 }}
22
22
  spec:
23
23
  initContainers:
24
+ {{- if .Values.loadSolrConfigSet }}
25
+ - name: load-solr-config
26
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
27
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
28
+ envFrom:
29
+ - configMapRef:
30
+ name: {{ include "hyrax.fullname" . }}-env
31
+ - secretRef:
32
+ name: {{ include "hyrax.fullname" . }}
33
+ command:
34
+ - sh
35
+ - -c
36
+ - >
37
+ solrcloud-upload-configset.sh /app/samvera/hyrax-webapp/solr/conf &&
38
+ solrcloud-assign-configset.sh
39
+ {{- end }}
24
40
  - name: db-setup
25
41
  image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
26
42
  imagePullPolicy: {{ .Values.image.pullPolicy }}
@@ -55,14 +71,30 @@ spec:
55
71
  - name: http
56
72
  containerPort: 3000
57
73
  protocol: TCP
74
+ {{- if .Values.livenessProbe.enabled }}
58
75
  livenessProbe:
76
+ initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5 }}
77
+ timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5 }}
78
+ failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 3 }}
79
+ periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 10}}
80
+ successThreshold: {{ .Values.livenessProbe.successThreshold | default 1 }}
59
81
  httpGet:
60
- path: /
61
- port: http
82
+ scheme: "HTTP"
83
+ path: {{ .Values.livenessProbe.path | default "/" }}
84
+ port: 3000
85
+ {{- end }}
86
+ {{- if .Values.readinessProbe.enabled }}
62
87
  readinessProbe:
88
+ initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5 }}
89
+ timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 5 }}
90
+ failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 3 }}
91
+ periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 10 }}
92
+ successThreshold: {{ .Values.readinessProbe.successThreshold | default 1 }}
63
93
  httpGet:
64
- path: /
65
- port: http
94
+ scheme: "HTTP"
95
+ path: {{ .Values.readinessProbe.path | default "/" }}
96
+ port: 3000
97
+ {{- end }}
66
98
  resources:
67
99
  {{- toYaml .Values.resources | nindent 12 }}
68
100
  {{- with .Values.nodeSelector }}
@@ -7,6 +7,7 @@ metadata:
7
7
  type: Opaque
8
8
  data:
9
9
  SECRET_KEY_BASE: {{ randAlphaNum 20 | b64enc | quote }}
10
- {{- if .Values.postgresql.enabled }}
11
- DATABASE_URL: {{ printf "postgresql://%s:%s@%s/%s?pool=5" .Values.postgresql.postgresqlUsername .Values.postgresql.postgresqlPassword (include "hyrax.postgresql.fullname" .) .Values.postgresql.postgresqlDatabase | b64enc }}
10
+ DATABASE_URL: {{ printf "postgresql://%s:%s@%s/%s?pool=5" ( include "hyrax.postgresql.username" . ) ( include "hyrax.postgresql.password" . ) ( include "hyrax.postgresql.host" . ) ( include "hyrax.postgresql.database" . ) | b64enc }}
11
+ {{- if .Values.redis.enabled }}
12
+ REDIS_PASSWORD: {{ .Values.redis.password | b64enc}}
12
13
  {{- end }}
@@ -10,6 +10,34 @@ image:
10
10
  # Overrides the image tag whose default is the chart appVersion.
11
11
  tag: ""
12
12
 
13
+ # use false to skip the configset management init container
14
+ loadSolrConfigSet: true
15
+ # the host and auth details for an external solr service;
16
+ # ignored if `solr.enabled` is true
17
+ externalSolrHost: ""
18
+ externalSolrUser: ""
19
+ externalSolrPassword: ""
20
+ externalSolrCollection: "hyrax"
21
+
22
+ # configuration for an external/existing fcrepo service;
23
+ # ignored if `fcrepo.enabled` is true
24
+ externalFcrepoHost: ""
25
+ fcrepoBasePathOverride: ""
26
+
27
+ # database configuration for an external postgresql;
28
+ # ignored if `postgresql.enabled` is true
29
+ externalPostgresql: {}
30
+ # username:
31
+ # password:
32
+ # database:
33
+
34
+ embargoRelease:
35
+ enabled: true
36
+ schedule: "0 0 * * *"
37
+ leaseRelease:
38
+ enabled: true
39
+ schedule: "0 0 * * *"
40
+
13
41
  imagePullSecrets: []
14
42
  nameOverride: ""
15
43
  fullnameOverride: ""
@@ -50,15 +78,35 @@ ingress:
50
78
  paths: []
51
79
  tls: []
52
80
 
81
+ livenessProbe:
82
+ enabled: true
83
+ # path: "/healthz"
84
+ # initialDelaySeconds: 0
85
+ # periodSeconds: 10
86
+ # timeoutSeconds: 10
87
+ # failureThreshold: 3
88
+ # successThreshold: 1
89
+
90
+ readinessProbe:
91
+ enabled: true
92
+ # path: "/healthz"
93
+ # initialDelaySeconds: 5
94
+ # periodSeconds: 10
95
+ # timeoutSeconds: 5
96
+ # failureThreshold: 6
97
+ # successThreshold: 1
98
+
53
99
  resources: {}
54
100
 
55
101
  fcrepo:
56
102
  enabled: true
57
- fcrepoSecretName: "hyrax.fcrepo.fullname"
58
103
  externalDatabaseUsername: "hyrax"
59
104
  servicePort: 8080
60
105
  postgresql:
61
106
  enabled: false
107
+ image:
108
+ repository: bitnami/postgresql
109
+ tag: 12.3.0
62
110
 
63
111
  memcached:
64
112
  enabled: false
@@ -79,9 +127,27 @@ postgresql:
79
127
 
80
128
  redis:
81
129
  enabled: true
130
+ password: mysecret
82
131
 
83
132
  solr:
84
133
  enabled: true
134
+ image:
135
+ repository: bitnami/solr
136
+ tag: 8.8.1
137
+ authentication:
138
+ enabled: true
139
+ adminUsername: admin
140
+ adminPassword: admin
141
+ coreName: hyrax
142
+ collection: hyrax
143
+ cloudBootstrap: true
144
+ cloudEnabled: true
145
+ persistence:
146
+ enabled: true
147
+ zookeeper:
148
+ enabled: true
149
+ persistence:
150
+ enabled: true
85
151
 
86
152
  autoscaling:
87
153
  enabled: false
@@ -90,6 +156,11 @@ autoscaling:
90
156
  targetCPUUtilizationPercentage: 80
91
157
  # targetMemoryUtilizationPercentage: 80
92
158
 
159
+ global:
160
+ postgresql:
161
+ postgresqlUsername: hyrax
162
+ postgresqlPassword: hyrax_pass
163
+
93
164
  nodeSelector: {}
94
165
 
95
166
  tolerations: []