Skip to content

Commit 3dd6f9e

Browse files
authored
Adapt helm chart for yaml configuration (#938)
* Fix docker entrypoint * Happy New Year * Add timeout config parameter in sample configuration file * Update helm chart for yaml configuration
1 parent ded916a commit 3dd6f9e

File tree

7 files changed

+131
-75
lines changed

7 files changed

+131
-75
lines changed

LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ The MIT License (MIT)
22
=====================
33

44
Copyright © 2010-2024 Tom Kralidis
5-
Copyright © 2011-2021 Angelos Tzotsos
5+
Copyright © 2011-2024 Angelos Tzotsos
66
Copyright © 2012-2015 Adam Hinz
77
Copyright © 2015-2021 Ricardo Garcia Silva
88

default-sample.yml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ server:
4242
#domaincounts: true
4343
#spatial_ranking: true
4444
#workers=2
45+
#timeout=30
4546

4647
logging:
4748
level: ERROR

docker/entrypoint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def launch_pycsw(pycsw_config, workers=2, reload=False):
127127

128128
args = parser.parse_args()
129129

130-
with open(os.getenv('PYCSW_CONFIG', encoding='utf8') as fh:
130+
with open(os.getenv('PYCSW_CONFIG', encoding='utf8')) as fh:
131131
config = yaml_load(fh)
132132

133133
level = config['logging'].get('level', 'WARNING')

docker/helm/Chart.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apiVersion: v2
2-
name: cs
3-
description: A Helm chart for Kubernetes of the Catalogue Server (CS)
4-
version: 0.3.0
2+
name: pycsw
3+
description: A Helm chart for pycsw
4+
version: 1.4.1
55
appVersion: 3.0.0-dev0

docker/helm/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ Debug with:
55
```bash
66
helm install --dry-run --debug pycsw .
77
```
8+
Test template rendering with:
9+
10+
```bash
11+
helm template --debug .
12+
```
813

914
Deploy with:
1015

docker/helm/templates/pycsw-configmap.yaml

+115-69
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,131 @@
11
apiVersion: v1
22
data:
33
pycsw.yml: |+
4+
# =================================================================
5+
#
6+
# Authors: Tom Kralidis <[email protected]>
7+
# Angelos Tzotsos <[email protected]>
8+
#
9+
# Copyright (c) 2023 Tom Kralidis
10+
# Copyright (c) 2024 Angelos Tzotsos
11+
#
12+
# Permission is hereby granted, free of charge, to any person
13+
# obtaining a copy of this software and associated documentation
14+
# files (the "Software"), to deal in the Software without
15+
# restriction, including without limitation the rights to use,
16+
# copy, modify, merge, publish, distribute, sublicense, and/or sell
17+
# copies of the Software, and to permit persons to whom the
18+
# Software is furnished to do so, subject to the following
19+
# conditions:
20+
#
21+
# The above copyright notice and this permission notice shall be
22+
# included in all copies or substantial portions of the Software.
23+
#
24+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
25+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
26+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
27+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
28+
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
29+
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30+
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
31+
# OTHER DEALINGS IN THE SOFTWARE.
32+
#
33+
# =================================================================
434
server:
5-
{{ if .Values.pycsw.config.server.home }} home: {{ .Values.pycsw.config.server.home }}
6-
{{ end }}{{ if .Values.pycsw.config.server.url }} url: {{ .Values.pycsw.config.server.url }}
7-
{{ end }}{{ if .Values.pycsw.config.server.mimetype }} mimetype: {{ .Values.pycsw.config.server.mimetype }}
8-
{{ end }}{{ if .Values.pycsw.config.server.encoding }} encoding:{{ .Values.pycsw.config.server.encoding }}
9-
{{ end }}{{ if .Values.pycsw.config.server.language }} language: {{ .Values.pycsw.config.server.language }}
10-
{{ end }}{{ if .Values.pycsw.config.server.maxrecords }} maxrecords: {{ .Values.pycsw.config.server.maxrecords }}
11-
{{ end }}{{ if .Values.pycsw.config.server.ogc_schemas_base }} ogc_schemas_base: {{ .Values.pycsw.config.server.ogc_schemas_base }}
12-
{{ end }}{{ if .Values.pycsw.config.server.federatedcatalogues }} federatedcatalogues: {{ .Values.pycsw.config.server.federatedcatalogues }}
13-
{{ end }}{{ if .Values.pycsw.config.server.pretty_print }} pretty_print: {{ .Values.pycsw.config.server.pretty_print }}
14-
{{ end }}{{ if .Values.pycsw.config.server.gzip_compresslevel }} gzip_compresslevel: {{ .Values.pycsw.config.server.gzip_compresslevel }}
15-
{{ end }}{{ if .Values.pycsw.config.server.domainquerytype }} domainquerytype: {{ .Values.pycsw.config.server.domainquerytype }}
16-
{{ end }}{{ if .Values.pycsw.config.server.domaincounts }} domaincounts: {{ .Values.pycsw.config.server.domaincounts }}
17-
{{ end }}{{ if .Values.pycsw.config.server.spatial_ranking }} spatial_ranking: {{ .Values.pycsw.config.server.spatial_ranking }}
18-
{{ end }}{{ if .Values.pycsw.config.server.workers }} workers: {{ .Values.pycsw.config.server.workers }}
19-
{{ end }}{{ if .Values.pycsw.config.server.timeout }} timeout: {{ .Values.pycsw.config.server.timeout }}
35+
{{ if .Values.pycsw.config.server.home }} home: {{ .Values.pycsw.config.server.home }}
36+
{{ end }}{{ if .Values.pycsw.config.server.url }} url: {{ .Values.pycsw.config.server.url }}
37+
{{ end }}{{ if .Values.pycsw.config.server.mimetype }} mimetype: {{ .Values.pycsw.config.server.mimetype }}
38+
{{ end }}{{ if .Values.pycsw.config.server.encoding }} encoding: {{ .Values.pycsw.config.server.encoding }}
39+
{{ end }}{{ if .Values.pycsw.config.server.language }} language: {{ .Values.pycsw.config.server.language }}
40+
{{ end }}{{ if .Values.pycsw.config.server.maxrecords }} maxrecords: {{ .Values.pycsw.config.server.maxrecords }}
41+
{{ end }}{{ if .Values.pycsw.config.server.ogc_schemas_base }} ogc_schemas_base: {{ .Values.pycsw.config.server.ogc_schemas_base }}
42+
{{ end }}{{ if .Values.pycsw.config.server.pretty_print }} pretty_print: {{ .Values.pycsw.config.server.pretty_print }}
43+
{{ end }}{{ if .Values.pycsw.config.server.gzip_compresslevel }} gzip_compresslevel: {{ .Values.pycsw.config.server.gzip_compresslevel }}
44+
{{ end }}{{ if .Values.pycsw.config.server.domainquerytype }} domainquerytype: {{ .Values.pycsw.config.server.domainquerytype }}
45+
{{ end }}{{ if .Values.pycsw.config.server.domaincounts }} domaincounts: {{ .Values.pycsw.config.server.domaincounts }}
46+
{{ end }}{{ if .Values.pycsw.config.server.spatial_ranking }} spatial_ranking: {{ .Values.pycsw.config.server.spatial_ranking }}
47+
{{ end }}{{ if .Values.pycsw.config.server.workers }} workers: {{ .Values.pycsw.config.server.workers }}
48+
{{ end }}{{ if .Values.pycsw.config.server.timeout }} timeout: {{ .Values.pycsw.config.server.timeout }}
2049
{{ end }}
21-
22-
{{ if .Values.pycsw.config.profiles }}
23-
profiles:
24-
{{ .Values.pycsw.config.profiles }}
25-
{{ end }}
26-
27-
{{ if .Values.pycsw.config.logging.level }}
2850
logging:
29-
level:{{ .Values.pycsw.config.logging.level }}
30-
{{ if .Values.pycsw.config.logging.logfile }} logfile: {{ .Values.pycsw.config.logging.logfile }}
51+
{{ if .Values.pycsw.config.logging.level }} level: {{ .Values.pycsw.config.logging.level }}
52+
{{ end }}{{ if .Values.pycsw.config.logging.logfile }} logfile: {{ .Values.pycsw.config.logging.logfile }}
53+
{{ end }}
54+
profiles:
55+
{{- range $.Values.pycsw.config.profiles }}
56+
- {{ . }}
57+
{{- end }}
58+
{{ if .Values.pycsw.config.federatedcatalogues }} federatedcatalogues:
59+
{{- range $.Values.pycsw.config.federatedcatalogues }}
60+
- {{ . }}
61+
{{- end }}
3162
{{ end }}
32-
3363
manager:
34-
{{ if .Values.pycsw.config.manager.transactions }} transactions: {{ .Values.pycsw.config.manager.transactions }}
35-
{{ end }}{{ if .Values.pycsw.config.manager.allowed_ips }} allowed_ips: {{ .Values.pycsw.config.manager.allowed_ips }}
36-
{{ end }}{{ if .Values.pycsw.config.manager.csw_harvest_pagesize }} csw_harvest_pagesize: {{ .Values.pycsw.config.manager.csw_harvest_pagesize }}
64+
{{ if .Values.pycsw.config.manager.transactions }} transactions: {{ .Values.pycsw.config.manager.transactions }}
65+
{{ end }}{{ if .Values.pycsw.config.manager.allowed_ips }} allowed_ips:
66+
{{- range $.Values.pycsw.config.manager.allowed_ips }}
67+
- {{ . }}
68+
{{- end }}
69+
{{ end }}{{ if .Values.pycsw.config.manager.csw_harvest_pagesize }} csw_harvest_pagesize: {{ .Values.pycsw.config.manager.csw_harvest_pagesize }}
3770
{{ end }}
3871
metadata:
3972
identification:
40-
{{ if .Values.pycsw.config.metadata.identification.title }} title: {{ .Values.pycsw.config.metadata.identification.title }}
41-
{{ end }}{{ if .Values.pycsw.config.metadata.identification.description }} description: {{ .Values.pycsw.config.metadata.identification.description }}
42-
{{ end }}{{ if .Values.pycsw.config.metadata.identification.keywords }} keywords: {{ .Values.pycsw.config.metadata.identification.keywords }}
43-
{{ end }}{{ if .Values.pycsw.config.metadata.identification.keywords_type }} keywords_type: {{ .Values.pycsw.config.metadata.identification.keywords_type }}
44-
{{ end }}{{ if .Values.pycsw.config.metadata.identification.fees }} fees: {{ .Values.pycsw.config.metadata.identification.fees }}
45-
{{ end }}{{ if .Values.pycsw.config.metadata.identification.accessconstraints }} accessconstraints: {{ .Values.pycsw.config.metadata.identification.accessconstraints }}
46-
{{ end }}
47-
provider:
48-
{{ end }}{{ if .Values.pycsw.config.metadata.provider.name }} name: {{ .Values.pycsw.config.metadata.provider.name }}
49-
{{ end }}{{ if .Values.pycsw.config.metadata.provider_url }} url: {{ .Values.pycsw.config.metadata.provider.url }}
50-
{{ end }}
51-
contact:
52-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.name }} name: {{ .Values.pycsw.config.metadata.contact.name }}
53-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.position }} position: {{ .Values.pycsw.config.metadata.contact.position }}
54-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.address }} address: {{ .Values.pycsw.config.metadata.contact.address }}
55-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.city }} city: {{ .Values.pycsw.config.metadata.contact.city }}
56-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.stateorprovince }} stateorprovince: {{ .Values.pycsw.config.metadata.contact.stateorprovince }}
57-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.postalcode }} postalcode: {{ .Values.pycsw.config.metadata.contact.postalcode }}
58-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.country }} country: {{ .Values.pycsw.config.metadata.contact.country }}
59-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.phone }} phone: {{ .Values.pycsw.config.metadata.contact.phone }}
60-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.fax }} fax: {{ .Values.pycsw.config.metadata.contact.fax }}
61-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.email }} email: {{ .Values.pycsw.config.metadata.contact.email }}
62-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.url }} url: {{ .Values.pycsw.config.metadata.contact.url }}
63-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.hours }} hours: {{ .Values.pycsw.config.metadata.contact.hours }}
64-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.instructions }} instructions: {{ .Values.pycsw.config.metadata.contact.instructions }}
65-
{{ end }}{{ if .Values.pycsw.config.metadata.contact.role }} role: {{ .Values.pycsw.config.metadata.contact.role }}
66-
{{ end }}
67-
inspire:
68-
{{ if .Values.pycsw.config.metadata.inspire.enabled }} enabled: {{ .Values.pycsw.config.metadata.inspire.enabled }}
69-
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.languages_supported }} languages_supported: {{ .Values.pycsw.config.metadata.inspire.languages_supported }}
70-
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.default_language }} default_language: {{ .Values.pycsw.config.metadata.inspire.default_language }}
71-
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.date }} date: {{ .Values.pycsw.config.metadata.inspire.date }}
72-
{{ end }}{{ if .Values.pycsw.config.inspire.gemet_keywords }} gemet_keywords: {{ .Values.pycsw.config.metadata.inspire.gemet_keywords }}
73-
{{ end }}{{ if .Values.pycsw.config.inspire.conformity_service }} conformity_service: {{ .Values.pycsw.config.metadata.inspire.conformity_service }}
74-
{{ end }}{{ if .Values.pycsw.config.inspire.contact_name }} contact_name: {{ .Values.pycsw.config.metadata.inspire.contact_name }}
75-
{{ end }}{{ if .Values.pycsw.config.inspire.contact_email }} contact_email: {{ .Values.pycsw.config.metadata.inspire.contact_email }}
76-
{{ end }}{{ if .Values.pycsw.config.inspire.temp_extent }} temp_extent: {{ .Values.pycsw.config.metadata.inspire.temp_extent }}
73+
{{ if .Values.pycsw.config.metadata.identification.title }} title: {{ .Values.pycsw.config.metadata.identification.title }}
74+
{{ end }}{{ if .Values.pycsw.config.metadata.identification.description }} description: {{ .Values.pycsw.config.metadata.identification.description }}
75+
{{ end }}{{ if .Values.pycsw.config.metadata.identification.keywords }} keywords:
76+
{{- range $.Values.pycsw.config.metadata.identification.keywords }}
77+
- {{ . }}
78+
{{- end }}
79+
{{ end }}{{ if .Values.pycsw.config.metadata.identification.keywords_type }} keywords_type: {{ .Values.pycsw.config.metadata.identification.keywords_type }}
80+
{{ end }}{{ if .Values.pycsw.config.metadata.identification.fees }} fees: {{ .Values.pycsw.config.metadata.identification.fees }}
81+
{{ end }}{{ if .Values.pycsw.config.metadata.identification.accessconstraints }} accessconstraints: {{ .Values.pycsw.config.metadata.identification.accessconstraints }}
82+
{{ end }} provider:
83+
{{ if .Values.pycsw.config.metadata.provider.name }} name: {{ .Values.pycsw.config.metadata.provider.name }}
84+
{{ end }}{{ if .Values.pycsw.config.metadata.provider_url }} url: {{ .Values.pycsw.config.metadata.provider.url }}
85+
{{ end }} contact:
86+
{{ if .Values.pycsw.config.metadata.contact.name }} name: {{ .Values.pycsw.config.metadata.contact.name }}
87+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.position }} position: {{ .Values.pycsw.config.metadata.contact.position }}
88+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.address }} address: {{ .Values.pycsw.config.metadata.contact.address }}
89+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.city }} city: {{ .Values.pycsw.config.metadata.contact.city }}
90+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.stateorprovince }} stateorprovince: {{ .Values.pycsw.config.metadata.contact.stateorprovince }}
91+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.postalcode }} postalcode: {{ .Values.pycsw.config.metadata.contact.postalcode }}
92+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.country }} country: {{ .Values.pycsw.config.metadata.contact.country }}
93+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.phone }} phone: {{ .Values.pycsw.config.metadata.contact.phone }}
94+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.fax }} fax: {{ .Values.pycsw.config.metadata.contact.fax }}
95+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.email }} email: {{ .Values.pycsw.config.metadata.contact.email }}
96+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.url }} url: {{ .Values.pycsw.config.metadata.contact.url }}
97+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.hours }} hours: {{ .Values.pycsw.config.metadata.contact.hours }}
98+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.instructions }} instructions: {{ .Values.pycsw.config.metadata.contact.instructions }}
99+
{{ end }}{{ if .Values.pycsw.config.metadata.contact.role }} role: {{ .Values.pycsw.config.metadata.contact.role }}
100+
{{ end }} inspire:
101+
{{ if .Values.pycsw.config.metadata.inspire.enabled }} enabled: {{ .Values.pycsw.config.metadata.inspire.enabled }}
102+
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.languages_supported }} languages_supported:
103+
{{- range $.Values.pycsw.config.metadata.inspire.languages_supported }}
104+
- {{ . }}
105+
{{- end }}
106+
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.default_language }} default_language: {{ .Values.pycsw.config.metadata.inspire.default_language }}
107+
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.date }} date: {{ .Values.pycsw.config.metadata.inspire.date }}
108+
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.gemet_keywords }} gemet_keywords:
109+
{{- range $.Values.pycsw.config.metadata.inspire.gemet_keywords }}
110+
- {{ . }}
111+
{{- end }}
112+
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.conformity_service }} conformity_service: {{ .Values.pycsw.config.metadata.inspire.conformity_service }}
113+
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.contact_name }} contact_name: {{ .Values.pycsw.config.metadata.inspire.contact_name }}
114+
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.contact_email }} contact_email: {{ .Values.pycsw.config.metadata.inspire.contact_email }}
115+
{{ end }}{{ if .Values.pycsw.config.metadata.inspire.temp_extent }} temp_extent:
116+
{{- range $.Values.pycsw.config.metadata.inspire.temp_extent }}
117+
- {{ . }}
118+
{{- end }}
77119
{{ end }}
78120
repository:
79-
{{ if .Values.pycsw.config.repository.database }} database: {{ .Values.pycsw.config.repository.database }}
80-
{{ end }}{{ if .Values.pycsw.config.repository.mappings }} mappings: {{ .Values.pycsw.config.repository.mappings }}
81-
{{ end }}{{ if .Values.pycsw.config.repository.table }} table: {{ .Values.pycsw.config.repository.table }}
82-
{{ end }}{{ if .Values.pycsw.config.repository.filter }} filter: {{ .Values.pycsw.config.repository.filter }}
121+
{{ if .Values.pycsw.config.repository.database }} database: {{ .Values.pycsw.config.repository.database }}
122+
{{ end }}{{ if .Values.pycsw.config.repository.mappings }} mappings: {{ .Values.pycsw.config.repository.mappings }}
123+
{{ end }}{{ if .Values.pycsw.config.repository.table }} table: {{ .Values.pycsw.config.repository.table }}
124+
{{ end }}{{ if .Values.pycsw.config.repository.filter }} filter: {{ .Values.pycsw.config.repository.filter }}
125+
{{ end }}{{ if .Values.pycsw.config.repository.facets }} facets:
126+
{{- range $.Values.pycsw.config.repository.facets }}
127+
- {{ . }}
128+
{{- end }}
83129
{{ end }}
84130

85131
kind: ConfigMap

docker/helm/values.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pycsw:
3737
maxrecords: 10
3838
# logfile: " "
3939
# ogc_schemas_base: http://foo
40-
# federatedcatalogues: http://catalog.data.gov/csw
4140
# pretty_print: true
4241
# gzip_compresslevel: 8
4342
# domainquerytype: range
@@ -47,6 +46,8 @@ pycsw:
4746
timeout: 30
4847
profiles:
4948
- apiso
49+
# federatedcatalogues:
50+
# - http://catalog.data.gov/csw
5051
logging:
5152
level: DEBUG
5253
manager:
@@ -103,3 +104,6 @@ pycsw:
103104
table: records
104105
# mappings: path/to/mappings.py
105106
# filter: type = 'http://purl.org/dc/dcmitype/Dataset'
107+
facets:
108+
- type
109+
- title

0 commit comments

Comments
 (0)