hyrax 3.0.0.pre.rc4 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (271) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +41 -8
  3. data/.dassie/Gemfile +10 -5
  4. data/.dassie/config/cable.yml +1 -1
  5. data/.dassie/config/environments/development.rb +2 -0
  6. data/.dassie/config/environments/production.rb +1 -1
  7. data/.dassie/config/initializers/hyrax.rb +5 -0
  8. data/.dassie/config/initializers/riiif.rb +22 -20
  9. data/.dassie/config/redis.yml +1 -0
  10. data/.dassie/config/role_map.yml +2 -0
  11. data/.dassie/db/seeds.rb +9 -1
  12. data/.dassie/package.json +3 -5
  13. data/.dockerignore +4 -0
  14. data/.env +1 -2
  15. data/.rubocop.yml +4 -0
  16. data/CONTAINERS.md +21 -1
  17. data/Dockerfile +46 -17
  18. data/Gemfile +21 -27
  19. data/app/actors/hyrax/actors/base_actor.rb +1 -1
  20. data/app/actors/hyrax/actors/create_with_remote_files_actor.rb +89 -41
  21. data/app/actors/hyrax/actors/create_with_remote_files_ordered_members_actor.rb +7 -42
  22. data/app/actors/hyrax/actors/file_actor.rb +4 -2
  23. data/app/actors/hyrax/actors/file_set_actor.rb +18 -11
  24. data/app/controllers/concerns/hyrax/collections_controller_behavior.rb +20 -8
  25. data/app/controllers/concerns/hyrax/embargoes_controller_behavior.rb +21 -9
  26. data/app/controllers/concerns/hyrax/leases_controller_behavior.rb +14 -5
  27. data/app/controllers/concerns/hyrax/works_controller_behavior.rb +38 -8
  28. data/app/controllers/hyrax/admin/permission_template_accesses_controller.rb +0 -4
  29. data/app/controllers/hyrax/admin/workflows_controller.rb +8 -2
  30. data/app/controllers/hyrax/dashboard/collection_members_controller.rb +13 -9
  31. data/app/controllers/hyrax/dashboard/collections_controller.rb +14 -14
  32. data/app/controllers/hyrax/file_sets_controller.rb +49 -13
  33. data/app/controllers/hyrax/permissions_controller.rb +3 -4
  34. data/app/controllers/hyrax/workflow_actions_controller.rb +3 -1
  35. data/app/forms/hyrax/forms/collection_form.rb +12 -6
  36. data/app/forms/hyrax/forms/dashboard/nest_collection_form.rb +24 -2
  37. data/app/forms/hyrax/forms/file_set_form.rb +46 -0
  38. data/app/forms/hyrax/forms/permission.rb +23 -0
  39. data/app/forms/hyrax/forms/permission_template_form.rb +8 -2
  40. data/app/forms/hyrax/forms/resource_form.rb +31 -13
  41. data/app/forms/hyrax/forms/work_form.rb +5 -2
  42. data/app/helpers/hyrax/batch_edits_helper.rb +3 -1
  43. data/app/helpers/hyrax/collections_helper.rb +88 -2
  44. data/app/helpers/hyrax/dashboard_helper_behavior.rb +16 -5
  45. data/app/helpers/hyrax/embargo_helper.rb +4 -0
  46. data/app/helpers/hyrax/file_set_helper.rb +25 -6
  47. data/app/helpers/hyrax/hyrax_helper_behavior.rb +8 -0
  48. data/app/helpers/hyrax/lease_helper.rb +4 -0
  49. data/app/helpers/hyrax/url_helper.rb +4 -1
  50. data/app/helpers/hyrax/work_form_helper.rb +53 -0
  51. data/app/indexers/hyrax/administrative_set_indexer.rb +18 -0
  52. data/app/indexers/hyrax/valkyrie_file_set_indexer.rb +118 -0
  53. data/app/indexers/hyrax/valkyrie_indexer.rb +10 -4
  54. data/app/indexers/hyrax/valkyrie_work_indexer.rb +3 -1
  55. data/app/inputs/controlled_vocabulary_input.rb +2 -5
  56. data/app/jobs/attach_files_to_work_job.rb +19 -10
  57. data/app/jobs/attach_files_to_work_with_ordered_members_job.rb +6 -5
  58. data/app/jobs/embargo_expiry_job.rb +7 -5
  59. data/app/jobs/file_set_attached_event_job.rb +6 -1
  60. data/app/jobs/ingest_local_file_job.rb +18 -2
  61. data/app/jobs/inherit_permissions_job.rb +9 -5
  62. data/app/jobs/lease_expiry_job.rb +6 -4
  63. data/app/models/admin_set.rb +6 -25
  64. data/app/models/collection_branding_info.rb +25 -9
  65. data/app/models/concerns/hyrax/ability.rb +14 -1
  66. data/app/models/concerns/hyrax/collection_behavior.rb +17 -44
  67. data/app/models/concerns/hyrax/embargoable.rb +24 -0
  68. data/app/models/concerns/hyrax/file_set/characterization.rb +18 -12
  69. data/app/models/concerns/hyrax/solr_document_behavior.rb +9 -46
  70. data/app/models/concerns/hyrax/suppressible.rb +5 -0
  71. data/app/models/concerns/hyrax/user.rb +9 -3
  72. data/app/models/concerns/hyrax/work_behavior.rb +1 -1
  73. data/app/models/hyrax/file_set.rb +7 -0
  74. data/app/models/hyrax/pcdm_collection.rb +1 -0
  75. data/app/models/hyrax/permission_template.rb +98 -12
  76. data/app/models/hyrax/virus_scanner.rb +27 -18
  77. data/app/models/hyrax/work.rb +2 -0
  78. data/app/models/job_io_wrapper.rb +1 -1
  79. data/app/models/sipity/agent.rb +1 -0
  80. data/app/models/sipity/entity.rb +30 -8
  81. data/app/models/sipity/workflow.rb +1 -0
  82. data/app/models/sipity.rb +42 -0
  83. data/app/presenters/hyrax/admin_set_options_presenter.rb +12 -8
  84. data/app/presenters/hyrax/admin_set_presenter.rb +5 -1
  85. data/app/presenters/hyrax/admin_set_selection_presenter.rb +116 -0
  86. data/app/presenters/hyrax/collection_presenter.rb +41 -20
  87. data/app/presenters/hyrax/file_set_presenter.rb +6 -1
  88. data/app/presenters/hyrax/file_usage.rb +3 -2
  89. data/app/presenters/hyrax/pcdm_member_presenter_factory.rb +119 -0
  90. data/app/presenters/hyrax/stats_usage_presenter.rb +2 -1
  91. data/app/presenters/hyrax/trophy_presenter.rb +33 -4
  92. data/app/presenters/hyrax/user_profile_presenter.rb +11 -1
  93. data/app/presenters/hyrax/version_list_presenter.rb +19 -0
  94. data/app/presenters/hyrax/version_presenter.rb +3 -2
  95. data/app/presenters/hyrax/work_show_presenter.rb +30 -5
  96. data/app/presenters/hyrax/work_usage.rb +5 -3
  97. data/app/renderers/hyrax/renderers/attribute_renderer.rb +10 -2
  98. data/app/search_builders/hyrax/admin_set_search_builder.rb +1 -1
  99. data/app/search_builders/hyrax/collection_member_search_builder.rb +6 -1
  100. data/app/search_builders/hyrax/my/collections_search_builder.rb +2 -2
  101. data/app/search_builders/hyrax/nested_collections_parent_search_builder.rb +1 -1
  102. data/app/search_builders/hyrax/single_collection_search_builder.rb +1 -1
  103. data/app/services/hyrax/access_control_list.rb +1 -1
  104. data/app/services/hyrax/adapters/nesting_index_adapter.rb +1 -1
  105. data/app/services/hyrax/admin_set_create_service.rb +3 -1
  106. data/app/services/hyrax/collections/collection_member_search_service.rb +72 -0
  107. data/app/services/hyrax/collections/collection_member_service.rb +112 -27
  108. data/app/services/hyrax/collections/migration_service.rb +4 -2
  109. data/app/services/hyrax/collections/nested_collection_persistence_service.rb +12 -13
  110. data/app/services/hyrax/collections/nested_collection_query_service.rb +2 -0
  111. data/app/services/hyrax/collections/permissions_create_service.rb +6 -4
  112. data/app/services/hyrax/contextual_path.rb +24 -1
  113. data/app/services/hyrax/custom_queries/find_file_metadata.rb +7 -5
  114. data/app/services/hyrax/custom_queries/navigators/parent_collections_navigator.rb +46 -0
  115. data/app/services/hyrax/edit_permissions_service.rb +74 -41
  116. data/app/services/hyrax/embargo_manager.rb +1 -1
  117. data/app/services/hyrax/find_objects_via_solr_service.rb +31 -0
  118. data/app/services/hyrax/graph_exporter.rb +1 -1
  119. data/app/services/hyrax/listeners/member_cleanup_listener.rb +26 -0
  120. data/app/services/hyrax/listeners/metadata_index_listener.rb +18 -1
  121. data/app/services/hyrax/listeners/object_lifecycle_listener.rb +1 -1
  122. data/app/services/hyrax/listeners/trophy_cleanup_listener.rb +17 -0
  123. data/app/services/hyrax/listeners.rb +2 -0
  124. data/app/services/hyrax/multiple_membership_checker.rb +53 -29
  125. data/app/services/hyrax/persist_derivatives.rb +3 -1
  126. data/app/services/hyrax/resource_status.rb +7 -0
  127. data/app/services/hyrax/search_service.rb +4 -2
  128. data/app/services/hyrax/solr_query_builder_service.rb +45 -8
  129. data/app/services/hyrax/solr_query_service.rb +224 -0
  130. data/app/services/hyrax/solr_service.rb +8 -1
  131. data/app/services/hyrax/statistics/depositors/summary.rb +2 -1
  132. data/app/services/hyrax/thumbnail_path_service.rb +1 -1
  133. data/app/services/hyrax/versioning_service.rb +1 -1
  134. data/app/services/hyrax/visibility_intention.rb +20 -2
  135. data/app/services/hyrax/visibility_propagator.rb +30 -1
  136. data/app/services/hyrax/work_uploads_handler.rb +22 -4
  137. data/app/services/hyrax/workflow/actionable_objects.rb +70 -0
  138. data/app/services/hyrax/workflow/object_in_workflow_decorator.rb +31 -0
  139. data/app/services/hyrax/workflow/status_list_service.rb +43 -13
  140. data/app/views/hyrax/admin/admin_sets/_show_document_list_row.html.erb +1 -1
  141. data/app/views/hyrax/base/_form_child_work_relationships.html.erb +1 -1
  142. data/app/views/hyrax/base/_form_relationships.html.erb +1 -2
  143. data/app/views/hyrax/base/_form_rendering.html.erb +1 -1
  144. data/app/views/hyrax/base/_form_representative.html.erb +1 -1
  145. data/app/views/hyrax/base/_form_share.html.erb +1 -5
  146. data/app/views/hyrax/base/_form_thumbnail.html.erb +1 -1
  147. data/app/views/hyrax/base/_form_visibility_error.html.erb +2 -0
  148. data/app/views/hyrax/base/_guts4form.html.erb +3 -3
  149. data/app/views/hyrax/base/_representative_media.html.erb +1 -1
  150. data/app/views/hyrax/base/_show_actions.html.erb +2 -2
  151. data/app/views/hyrax/base/_work_button_row.html.erb +1 -1
  152. data/app/views/hyrax/base/_workflow_actions.html.erb +1 -1
  153. data/app/views/hyrax/batch_edits/edit.html.erb +2 -2
  154. data/app/views/hyrax/batch_uploads/_form.html.erb +1 -1
  155. data/app/views/hyrax/collections/_list_collections.html.erb +1 -1
  156. data/app/views/hyrax/collections/_search_form.html.erb +1 -1
  157. data/app/views/hyrax/collections/show.html.erb +1 -1
  158. data/app/views/hyrax/dashboard/collections/_form.html.erb +3 -3
  159. data/app/views/hyrax/dashboard/collections/_form_branding.html.erb +1 -1
  160. data/app/views/hyrax/dashboard/collections/_list_collections.html.erb +1 -1
  161. data/app/views/hyrax/dashboard/collections/edit.html.erb +4 -2
  162. data/app/views/hyrax/dashboard/collections/new.html.erb +4 -2
  163. data/app/views/hyrax/dashboard/collections/show.html.erb +1 -1
  164. data/app/views/hyrax/file_sets/_actions.html.erb +10 -0
  165. data/app/views/hyrax/file_sets/edit.html.erb +1 -1
  166. data/app/views/hyrax/file_sets/media_display/_audio.html.erb +1 -1
  167. data/app/views/hyrax/file_sets/media_display/_default.html.erb +1 -1
  168. data/app/views/hyrax/file_sets/media_display/_image.html.erb +1 -1
  169. data/app/views/hyrax/file_sets/media_display/_office_document.html.erb +1 -1
  170. data/app/views/hyrax/file_sets/media_display/_pdf.html.erb +1 -1
  171. data/app/views/hyrax/file_sets/media_display/_video.html.erb +1 -1
  172. data/app/views/hyrax/file_sets/show.html.erb +1 -1
  173. data/app/views/hyrax/my/_admin_set_action_menu.html.erb +0 -11
  174. data/app/views/hyrax/my/_collection_action_menu.html.erb +1 -2
  175. data/app/views/hyrax/my/collections/_list_collections.html.erb +1 -1
  176. data/app/views/hyrax/my/collections/_modal_add_subcollection.html.erb +3 -5
  177. data/app/views/hyrax/stats/file.html.erb +1 -1
  178. data/app/views/hyrax/stats/work.html.erb +1 -1
  179. data/app/views/hyrax/uploads/_js_templates.html.erb +4 -4
  180. data/app/views/hyrax/uploads/_js_templates_versioning.html.erb +4 -4
  181. data/app/views/hyrax/users/_contributions.html.erb +1 -1
  182. data/app/views/hyrax/users/_profile_tabs.html.erb +2 -2
  183. data/app/views/hyrax/users/_search_form.html.erb +1 -1
  184. data/app/views/hyrax/users/_user.html.erb +1 -1
  185. data/app/views/hyrax/users/_user_info.html.erb +9 -9
  186. data/bin/db-migrate-seed.sh +6 -2
  187. data/bin/hyrax-entrypoint.sh +0 -14
  188. data/bin/solrcloud-assign-configset.sh +35 -0
  189. data/bin/solrcloud-upload-configset.sh +42 -0
  190. data/chart/hyrax/Chart.yaml +12 -8
  191. data/chart/hyrax/README.md +94 -11
  192. data/chart/hyrax/templates/NOTES.txt +1 -1
  193. data/chart/hyrax/templates/_helpers.tpl +98 -0
  194. data/chart/hyrax/templates/branding-pvc.yaml +14 -0
  195. data/chart/hyrax/templates/configmap-env.yaml +21 -11
  196. data/chart/hyrax/templates/cron-embargo.yaml +24 -0
  197. data/chart/hyrax/templates/cron-lease.yaml +24 -0
  198. data/chart/hyrax/templates/deployment-worker.yaml +129 -0
  199. data/chart/hyrax/templates/deployment.yaml +125 -4
  200. data/chart/hyrax/templates/derivatives-pvc.yaml +14 -0
  201. data/chart/hyrax/templates/ingress.yaml +13 -4
  202. data/chart/hyrax/templates/secrets.yaml +12 -2
  203. data/chart/hyrax/templates/uploads-pvc.yaml +14 -0
  204. data/chart/hyrax/values.yaml +186 -2
  205. data/config/brakeman.ignore +2 -2
  206. data/config/features.rb +47 -43
  207. data/config/initializers/listeners.rb +4 -0
  208. data/config/initializers/valkryrie_storage.rb +7 -0
  209. data/config/locales/hyrax.de.yml +1 -1
  210. data/config/locales/hyrax.en.yml +1 -1
  211. data/config/locales/hyrax.es.yml +1 -1
  212. data/config/locales/hyrax.fr.yml +1 -1
  213. data/config/locales/hyrax.it.yml +1 -1
  214. data/config/locales/hyrax.pt-BR.yml +1 -1
  215. data/config/locales/hyrax.zh.yml +1 -1
  216. data/docker-compose.yml +39 -8
  217. data/documentation/developing-your-hyrax-based-app.md +4 -4
  218. data/documentation/legacyREADME.md +3 -3
  219. data/lib/generators/hyrax/templates/config/initializers/hyrax.rb +5 -0
  220. data/lib/generators/hyrax/templates/config/initializers/riiif.rb +22 -20
  221. data/lib/hyrax/active_fedora_dummy_model.rb +62 -0
  222. data/lib/hyrax/configuration.rb +28 -0
  223. data/lib/hyrax/engine.rb +3 -1
  224. data/lib/hyrax/errors.rb +2 -0
  225. data/lib/hyrax/resource_name.rb +1 -0
  226. data/lib/hyrax/specs/capybara.rb +5 -3
  227. data/lib/hyrax/specs/shared_specs/valkyrie_storage_versions.rb +9 -0
  228. data/lib/hyrax/transactions/container.rb +32 -1
  229. data/lib/hyrax/transactions/file_set_destroy.rb +21 -0
  230. data/lib/hyrax/transactions/steps/add_file_sets.rb +3 -2
  231. data/lib/hyrax/transactions/steps/add_to_parent.rb +36 -0
  232. data/lib/hyrax/transactions/steps/delete_resource.rb +38 -0
  233. data/lib/hyrax/transactions/steps/destroy_work.rb +1 -0
  234. data/lib/hyrax/transactions/steps/remove_file_set_from_work.rb +47 -0
  235. data/lib/hyrax/transactions/work_create.rb +2 -1
  236. data/lib/hyrax/transactions/work_destroy.rb +20 -0
  237. data/lib/hyrax/valkyrie_can_can_adapter.rb +3 -0
  238. data/lib/hyrax/valkyrie_simple_path_generator.rb +20 -0
  239. data/lib/hyrax/version.rb +1 -1
  240. data/lib/hyrax.rb +9 -0
  241. data/lib/tasks/collection_type_global_id.rake +1 -1
  242. data/lib/tasks/embargo_lease.rake +27 -0
  243. data/lib/tasks/regenerate_derivatives.rake +12 -0
  244. data/lib/wings/active_fedora_converter/default_work.rb +19 -0
  245. data/lib/wings/attribute_transformer.rb +29 -19
  246. data/lib/wings/converter_value_mapper.rb +2 -2
  247. data/lib/wings/model_transformer.rb +21 -20
  248. data/lib/wings/orm_converter.rb +42 -23
  249. data/lib/wings/setup.rb +2 -0
  250. data/lib/wings/valkyrie/persister.rb +8 -5
  251. data/lib/wings/valkyrie/query_service.rb +96 -41
  252. data/lib/wings/valkyrie/storage.rb +56 -1
  253. data/lib/wings.rb +0 -21
  254. data/template.rb +1 -1
  255. metadata +41 -21
  256. data/chart/fcrepo/.gitignore +0 -2
  257. data/chart/fcrepo/.helmignore +0 -23
  258. data/chart/fcrepo/Chart.yaml +0 -11
  259. data/chart/fcrepo/README.md +0 -50
  260. data/chart/fcrepo/templates/NOTES.txt +0 -21
  261. data/chart/fcrepo/templates/_helpers.tpl +0 -68
  262. data/chart/fcrepo/templates/configmap-env.yaml +0 -19
  263. data/chart/fcrepo/templates/deployment.yaml +0 -109
  264. data/chart/fcrepo/templates/ingress.yaml +0 -41
  265. data/chart/fcrepo/templates/pvc.yaml +0 -20
  266. data/chart/fcrepo/templates/secret.yaml +0 -12
  267. data/chart/fcrepo/templates/service.yaml +0 -15
  268. data/chart/fcrepo/templates/serviceaccount.yaml +0 -12
  269. data/chart/fcrepo/templates/tests/test-connection.yaml +0 -15
  270. data/chart/fcrepo/values.yaml +0 -79
  271. data/chart/hyrax/templates/fcrepo-secret.yaml +0 -13
@@ -0,0 +1,14 @@
1
+ {{- if and .Values.brandingVolume.enabled (not .Values.brandingVolume.existingClaim) }}
2
+ apiVersion: v1
3
+ kind: PersistentVolumeClaim
4
+ metadata:
5
+ name: {{ template "hyrax.fullname" . }}-branding
6
+ labels:
7
+ {{- include "hyrax.labels" . | nindent 4 }}
8
+ spec:
9
+ {{ include "hyrax.sharedPvcAccessModes" . | nindent 2 }}
10
+ resources:
11
+ requests:
12
+ storage: {{ .Values.brandingVolume.size }}
13
+ storageClassName: {{ .Values.brandingVolume.storageClass }}
14
+ {{- end }}
@@ -8,25 +8,35 @@ 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 }}
13
+ DB_USERNAME: {{ template "hyrax.postgresql.database" . }}
15
14
  {{- if .Values.memcached.enabled }}
16
15
  MEMCACHED_HOST: {{ template "hyrax.memcached.fullname" . }}
17
16
  {{- end }}
17
+ {{- if .Values.derivativesVolume.enabled }}
18
+ HYRAX_BRANDING_PATH: "/app/samvera/branding"
19
+ HYRAX_DERIVATIVES_PATH: "/app/samvera/derivatives"
20
+ HYRAX_CACHE_PATH: "/app/samvera/file_cache"
21
+ HYRAX_UPLOAD_PATH: "/app/samvera/uploads"
22
+ {{- end }}
18
23
  RACK_ENV: production
19
24
  RAILS_ENV: production
20
25
  {{- if .Values.redis.enabled }}
21
- REDIS_HOST: {{ template "hyrax.redis.fullname" . }}-master
26
+ REDIS_HOST: {{ template "hyrax.redis.host" . }}
22
27
  {{- end }}
23
- {{- if .Values.fcrepo.enabled }}
28
+ FCREPO_HOST: {{ template "hyrax.fcrepo.host" . }}
29
+ FCREPO_BASE_PATH: {{ .Values.fcrepoBasePathOverride | default (printf "/%s" (include "hyrax.fullname" .)) | quote }}
24
30
  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" }}
31
+ FCREPO_REST_PATH: {{ .Values.fcrepo.restPath | default "rest" }}
32
+ REDIS_PROVIDER: SIDEKIQ_REDIS_URL
33
+ {{- if .Values.minio.enabled }}
34
+ MINIO_ENDPOINT: {{ template "hyrax.minio.fullname" . }}
27
35
  {{- end }}
28
- {{- if .Values.solr.enabled }}
29
- SOLR_HOST: {{ template "hyrax.solr.fullname" . }}-svc
36
+ SKIP_HYRAX_ENGINE_SEED: {{ .Values.skipHyraxEngineSeed | default 0 | quote }}
37
+ SOLR_ADMIN_USER: {{ template "hyrax.solr.username" . }}
38
+ SOLR_COLLECTION_NAME: {{ template "hyrax.solr.collectionName" . }}
39
+ SOLR_CONFIGSET_NAME: {{ template "hyrax.fullname" . }}
40
+ SOLR_HOST: {{ template "hyrax.solr.host" . }}
30
41
  SOLR_PORT: "8983"
31
- SOLR_URL: http://{{ template "hyrax.solr.fullname" . }}-svc:8983/solr/hyrax
32
- {{- end }}
42
+ 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 }}
@@ -0,0 +1,129 @@
1
+ {{- if .Values.worker.enabled }}
2
+ apiVersion: apps/v1
3
+ kind: Deployment
4
+ metadata:
5
+ name: {{ include "hyrax.fullname" . }}-worker
6
+ labels:
7
+ {{- include "hyrax.labels" . | nindent 4 }}
8
+ spec:
9
+ replicas: {{ .Values.worker.replicaCount }}
10
+ selector:
11
+ matchLabels:
12
+ {{- include "hyrax.selectorLabels" . | nindent 6 }}
13
+ template:
14
+ metadata:
15
+ {{- with .Values.podAnnotations }}
16
+ annotations:
17
+ {{- toYaml . | nindent 8 }}
18
+ {{- end }}
19
+ labels:
20
+ {{- include "hyrax.selectorLabels" . | nindent 8 }}
21
+ spec:
22
+ initContainers:
23
+ - name: db-wait
24
+ image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Chart.AppVersion }}"
25
+ imagePullPolicy: {{ .Values.worker.image.pullPolicy }}
26
+ envFrom:
27
+ - configMapRef:
28
+ name: {{ include "hyrax.fullname" . }}-env
29
+ - secretRef:
30
+ name: {{ template "hyrax.fullname" . }}
31
+ env:
32
+ {{- toYaml .Values.worker.extraEnvVars | nindent 12 }}
33
+ command:
34
+ - sh
35
+ - -c
36
+ - db-wait.sh "$REDIS_HOST:6379"
37
+ {{- if .Values.worker.extraInitContainers }}
38
+ {{- toYaml .Values.worker.extraInitContainers | nindent 8 }}
39
+ {{- end }}
40
+ {{- with .Values.imagePullSecrets }}
41
+ imagePullSecrets:
42
+ {{- toYaml . | nindent 8 }}
43
+ {{- end }}
44
+ serviceAccountName: {{ include "hyrax.serviceAccountName" . }}
45
+ securityContext:
46
+ {{- toYaml .Values.worker.podSecurityContext | nindent 8 }}
47
+ containers:
48
+ - name: {{ .Chart.Name }}-worker
49
+ securityContext:
50
+ {{- toYaml .Values.worker.securityContext | nindent 12 }}
51
+ image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag | default .Chart.AppVersion }}"
52
+ imagePullPolicy: {{ .Values.worker.image.pullPolicy }}
53
+ envFrom:
54
+ - configMapRef:
55
+ name: {{ include "hyrax.fullname" . }}-env
56
+ - secretRef:
57
+ name: {{ template "hyrax.fullname" . }}
58
+ {{- if .Values.solrExistingSecret }}
59
+ - secretRef:
60
+ name: {{ .Values.solrExistingSecret }}
61
+ {{- end }}
62
+ {{- with .Values.worker.extraEnvFrom }}
63
+ {{- toYaml . | nindent 12 }}
64
+ {{- end }}
65
+ env:
66
+ {{- toYaml .Values.worker.extraEnvVars | nindent 12 }}
67
+ volumeMounts:
68
+ - name: derivatives
69
+ mountPath: /app/samvera/derivatives
70
+ - name: uploads
71
+ subPath: file_cache
72
+ mountPath: /app/samvera/file_cache
73
+ - name: uploads
74
+ subPath: uploads
75
+ mountPath: /app/samvera/uploads
76
+ {{- if .Values.applicationExistingClaim }}
77
+ - name: application
78
+ mountPath: /app/samvera/hyrax-webapp
79
+ {{- end }}
80
+ {{- with .Values.worker.extraVolumeMounts }}
81
+ {{- toYaml . | nindent 12 }}
82
+ {{- end }}
83
+ resources:
84
+ {{- toYaml .Values.worker.resources | nindent 12 }}
85
+ {{- with .Values.extraContainerConfiguration }}
86
+ {{- toYaml . | nindent 10 }}
87
+ {{- end }}
88
+ volumes:
89
+ - name: "derivatives"
90
+ {{- if and .Values.derivativesVolume.enabled .Values.derivativesVolume.existingClaim }}
91
+ persistentVolumeClaim:
92
+ claimName: {{ .Values.derivativesVolume.existingClaim }}
93
+ {{- else if .Values.derivativesVolume.enabled }}
94
+ persistentVolumeClaim:
95
+ claimName: {{ template "hyrax.fullname" . }}-derivatives
96
+ {{ else }}
97
+ emptyDir: {}
98
+ {{ end }}
99
+ - name: "uploads"
100
+ {{- if and .Values.uploadsVolume.enabled .Values.uploadsVolume.existingClaim }}
101
+ persistentVolumeClaim:
102
+ claimName: {{ .Values.uploadsVolume.existingClaim }}
103
+ {{- else if .Values.uploadsVolume.enabled }}
104
+ persistentVolumeClaim:
105
+ claimName: {{ template "hyrax.fullname" . }}-uploads
106
+ {{ else }}
107
+ emptyDir: {}
108
+ {{ end }}
109
+ {{- if .Values.applicationExistingClaim }}
110
+ - name: "application"
111
+ persistentVolumeClaim:
112
+ claimName: {{ .Values.applicationExistingClaim }}
113
+ {{- end }}
114
+ {{- with .Values.worker.extraVolumes }}
115
+ {{- toYaml . | nindent 8 }}
116
+ {{- end }}
117
+ {{- with .Values.worker.nodeSelector }}
118
+ nodeSelector:
119
+ {{- toYaml . | nindent 8 }}
120
+ {{- end }}
121
+ {{- with .Values.worker.affinity }}
122
+ affinity:
123
+ {{- toYaml . | nindent 8 }}
124
+ {{- end }}
125
+ {{- with .Values.worker.tolerations }}
126
+ tolerations:
127
+ {{- toYaml . | nindent 8 }}
128
+ {{- end }}
129
+ {{- end }}
@@ -21,6 +21,29 @@ 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
+ {{- if .Values.solrExistingSecret }}
34
+ - secretRef:
35
+ name: {{ .Values.solrExistingSecret }}
36
+ {{- end }}
37
+ env:
38
+ {{- toYaml .Values.extraEnvVars | nindent 12 }}
39
+ command:
40
+ - sh
41
+ - -c
42
+ - >
43
+ solrcloud-upload-configset.sh /app/samvera/hyrax-webapp/solr/conf &&
44
+ solrcloud-assign-configset.sh
45
+ {{- end }}
46
+ {{- if not .Values.skipDbMigrateSeed }}
24
47
  - name: db-setup
25
48
  image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
26
49
  imagePullPolicy: {{ .Values.image.pullPolicy }}
@@ -29,10 +52,23 @@ spec:
29
52
  name: {{ include "hyrax.fullname" . }}-env
30
53
  - secretRef:
31
54
  name: {{ template "hyrax.fullname" . }}
55
+ {{- if .Values.solrExistingSecret }}
56
+ - secretRef:
57
+ name: {{ .Values.solrExistingSecret }}
58
+ {{- end }}
59
+ {{- with .Values.extraEnvFrom }}
60
+ {{- toYaml . | nindent 12 }}
61
+ {{- end }}
62
+ env:
63
+ {{- toYaml .Values.extraEnvVars | nindent 12 }}
32
64
  command:
33
65
  - sh
34
66
  - -c
35
67
  - db-migrate-seed.sh
68
+ {{- end }}
69
+ {{- if .Values.extraInitContainers }}
70
+ {{- toYaml .Values.extraInitContainers | nindent 8 }}
71
+ {{- end }}
36
72
  {{- with .Values.imagePullSecrets }}
37
73
  imagePullSecrets:
38
74
  {{- toYaml . | nindent 8 }}
@@ -51,20 +87,105 @@ spec:
51
87
  name: {{ include "hyrax.fullname" . }}-env
52
88
  - secretRef:
53
89
  name: {{ template "hyrax.fullname" . }}
90
+ {{- if .Values.solrExistingSecret }}
91
+ - secretRef:
92
+ name: {{ .Values.solrExistingSecret }}
93
+ {{- end }}
94
+ {{- with .Values.extraEnvFrom }}
95
+ {{- toYaml . | nindent 12 }}
96
+ {{- end }}
97
+ env:
98
+ {{- toYaml .Values.extraEnvVars | nindent 12 }}
54
99
  ports:
55
100
  - name: http
56
101
  containerPort: 3000
57
102
  protocol: TCP
103
+ {{- if .Values.livenessProbe.enabled }}
58
104
  livenessProbe:
105
+ initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 5 }}
106
+ timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5 }}
107
+ failureThreshold: {{ .Values.livenessProbe.failureThreshold | default 3 }}
108
+ periodSeconds: {{ .Values.livenessProbe.periodSeconds | default 10}}
109
+ successThreshold: {{ .Values.livenessProbe.successThreshold | default 1 }}
59
110
  httpGet:
60
- path: /
61
- port: http
111
+ scheme: "HTTP"
112
+ path: {{ .Values.livenessProbe.path | default "/" }}
113
+ port: 3000
114
+ {{- end }}
115
+ {{- if .Values.readinessProbe.enabled }}
62
116
  readinessProbe:
117
+ initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5 }}
118
+ timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 5 }}
119
+ failureThreshold: {{ .Values.readinessProbe.failureThreshold | default 3 }}
120
+ periodSeconds: {{ .Values.readinessProbe.periodSeconds | default 10 }}
121
+ successThreshold: {{ .Values.readinessProbe.successThreshold | default 1 }}
63
122
  httpGet:
64
- path: /
65
- port: http
123
+ scheme: "HTTP"
124
+ path: {{ .Values.readinessProbe.path | default "/" }}
125
+ port: 3000
126
+ {{- end }}
127
+ volumeMounts:
128
+ - name: branding
129
+ mountPath: /app/samvera/branding
130
+ - name: derivatives
131
+ mountPath: /app/samvera/derivatives
132
+ - name: uploads
133
+ subPath: file_cache
134
+ mountPath: /app/samvera/file_cache
135
+ - name: uploads
136
+ subPath: uploads
137
+ mountPath: /app/samvera/uploads
138
+ {{- if .Values.applicationExistingClaim }}
139
+ - name: application
140
+ mountPath: /app/samvera/hyrax-webapp
141
+ {{- end }}
142
+ {{- with .Values.extraVolumeMounts }}
143
+ {{- toYaml . | nindent 12 }}
144
+ {{- end }}
66
145
  resources:
67
146
  {{- toYaml .Values.resources | nindent 12 }}
147
+ {{- with .Values.extraContainerConfiguration }}
148
+ {{- toYaml . | nindent 10 }}
149
+ {{- end }}
150
+ volumes:
151
+ - name: "branding"
152
+ {{- if and .Values.brandingVolume.enabled .Values.brandingVolume.existingClaim }}
153
+ persistentVolumeClaim:
154
+ claimName: {{ .Values.brandingVolume.existingClaim }}
155
+ {{- else if .Values.brandingVolume.enabled }}
156
+ persistentVolumeClaim:
157
+ claimName: {{ template "hyrax.fullname" . }}-branding
158
+ {{ else }}
159
+ emptyDir: {}
160
+ {{ end }}
161
+ - name: "derivatives"
162
+ {{- if and .Values.derivativesVolume.enabled .Values.derivativesVolume.existingClaim }}
163
+ persistentVolumeClaim:
164
+ claimName: {{ .Values.derivativesVolume.existingClaim }}
165
+ {{- else if .Values.derivativesVolume.enabled }}
166
+ persistentVolumeClaim:
167
+ claimName: {{ template "hyrax.fullname" . }}-derivatives
168
+ {{ else }}
169
+ emptyDir: {}
170
+ {{ end }}
171
+ - name: "uploads"
172
+ {{- if and .Values.uploadsVolume.enabled .Values.uploadsVolume.existingClaim }}
173
+ persistentVolumeClaim:
174
+ claimName: {{ .Values.uploadsVolume.existingClaim }}
175
+ {{- else if .Values.uploadsVolume.enabled }}
176
+ persistentVolumeClaim:
177
+ claimName: {{ template "hyrax.fullname" . }}-uploads
178
+ {{ else }}
179
+ emptyDir: {}
180
+ {{ end }}
181
+ {{- if .Values.applicationExistingClaim }}
182
+ - name: "application"
183
+ persistentVolumeClaim:
184
+ claimName: {{ .Values.applicationExistingClaim }}
185
+ {{- end }}
186
+ {{- with .Values.extraVolumes }}
187
+ {{- toYaml . | nindent 8 }}
188
+ {{- end }}
68
189
  {{- with .Values.nodeSelector }}
69
190
  nodeSelector:
70
191
  {{- toYaml . | nindent 8 }}
@@ -0,0 +1,14 @@
1
+ {{- if and .Values.derivativesVolume.enabled (not .Values.derivativesVolume.existingClaim) }}
2
+ apiVersion: v1
3
+ kind: PersistentVolumeClaim
4
+ metadata:
5
+ name: {{ template "hyrax.fullname" . }}-derivatives
6
+ labels:
7
+ {{- include "hyrax.labels" . | nindent 4 }}
8
+ spec:
9
+ {{ include "hyrax.sharedPvcAccessModes" . | nindent 2 }}
10
+ resources:
11
+ requests:
12
+ storage: {{ .Values.derivativesVolume.size }}
13
+ storageClassName: {{ .Values.derivativesVolume.storageClass }}
14
+ {{- end }}
@@ -1,10 +1,11 @@
1
1
  {{- if .Values.ingress.enabled -}}
2
2
  {{- $fullName := include "hyrax.fullname" . -}}
3
3
  {{- $svcPort := .Values.service.port -}}
4
- {{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
4
+ {{- $beta := semverCompare "<1.19-0" (default .Capabilities.KubeVersion.Version .Values.kubeVersion) -}}
5
+ {{- if $beta }}
5
6
  apiVersion: networking.k8s.io/v1beta1
6
- {{- else -}}
7
- apiVersion: extensions/v1beta1
7
+ {{- else }}
8
+ apiVersion: networking.k8s.io/v1
8
9
  {{- end }}
9
10
  kind: Ingress
10
11
  metadata:
@@ -32,10 +33,18 @@ spec:
32
33
  http:
33
34
  paths:
34
35
  {{- range .paths }}
35
- - path: {{ . }}
36
+ - path: {{ .path }}
37
+ pathType: {{ .pathType | default "ImplementationSpecific" }}
36
38
  backend:
39
+ {{- if $beta }}
37
40
  serviceName: {{ $fullName }}
38
41
  servicePort: {{ $svcPort }}
42
+ {{- else }}
43
+ service:
44
+ name: {{ $fullName }}
45
+ port:
46
+ number: {{ $svcPort }}
47
+ {{- end }}
39
48
  {{- end }}
40
49
  {{- end }}
41
50
  {{- end }}