diff --git a/chart/Chart.yaml b/chart/Chart.yaml index 676d4188ef8388805df66e3e98c4382200797f8f..b3372b4f1f7ebae1aa3e8618560e0d885a84e65a 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -7,7 +7,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: 0.3.1 +version: 0.3.11 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. diff --git a/chart/files/mapcache.xml b/chart/files/mapcache.xml index 51a6b3790005a8b37f9dee216b88463c0db3155c..913a37627955560ad2039fc391a7f8a64043bb1b 100644 --- a/chart/files/mapcache.xml +++ b/chart/files/mapcache.xml @@ -88,14 +88,14 @@ </cache> {{- end }} - {{- define "mapcache-layerid" -}}{{ .collection_name }}{{ if .level_name }}__{{ .level_name }}{{ end }}{{ if .sub_layer_name }}__{{ .sub_layer_name }}{{ end }}{{- end }} + {{- define "mapcache-layerid" -}}{{ .collection_name }}{{ if .level_name }}_{{ .level_name }}{{ end }}{{ if .sub_type_name }}__{{ .sub_type_name }}{{ end }}{{- end }} {{- range $collection_name, $collection := .Values.config.collections -}} {{- $sub_types := list nil -}} {{- range $product_type_name := $collection.product_types }} - {{- $sub_types := concat $sub_types (get (get $.Values.config.products.types $product_type_name | default dict) "browses" | default dict | keys) }} - {{- $sub_types := concat $sub_types (get (get $.Values.config.products.types $product_type_name | default dict) "masks" | default dict | keys) }} + {{- $sub_types = concat $sub_types ((get $.Values.config.products.types $product_type_name | default dict).browses | default dict | keys) }} + {{- $sub_types = concat $sub_types ((get $.Values.config.products.types $product_type_name | default dict).masks | default dict | keys) }} {{- end -}} <!-- Sources for {{ $collection_name }} --> @@ -111,7 +111,7 @@ </params> </getmap> <http> - <url>http://renderer/ows</url> + <url>http://{{ include "vs.fullname" $ }}-renderer/ows</url> <connection_timeout>{{ $.Values.config.cache.connection_timeout | default 10 }}</connection_timeout> <timeout>{{ $.Values.config.cache.timeout | default 120 }}</timeout> </http> @@ -139,7 +139,7 @@ <store_assemblies>false</store_assemblies> <subdimensions_read_only>false</subdimensions_read_only> <dimension type="postgresql" name="time" default="2017/2019" time="true" unit="ISO8601"> - <connection>host={{ $.Values.config.database.host }} user={{ $.Values.config.database.user }} password={{ $.Values.config.database.password }} dbname={{ $.Values.config.database.name }} port={{ $.Values.config.database.port | default 5432 }}</connection> + <connection>host={{ $.Release.Name }}-database user={{ $.Values.config.database.DB_USER }} password={{ $.Values.config.database.DB_PW }} dbname={{ $.Values.config.database.DB_NAME }} port={{ $.Values.config.database.DB_PORT | default 5432 }}</connection> <list_query>SELECT to_char(MIN(mapcache_items.begin_time), 'YYYY-MM-DD"T"HH24:MI:SS"Z"') || '/' || to_char(MAX(mapcache_items.end_time), 'YYYY-MM-DD"T"HH24:MI:SS"Z"') FROM mapcache_items WHERE mapcache_items.collection = '{{ $layer_id }}';</list_query> <validate_query>SELECT * FROM (SELECT to_char(mapcache_items.begin_time, 'YYYY-MM-DD"T"HH24:MI:SS"Z"') || '/' || to_char(mapcache_items.end_time, 'YYYY-MM-DD"T"HH24:MI:SS"Z"') AS "interval" FROM mapcache_items WHERE (mapcache_items.collection = '{{ $layer_id }}' AND ((mapcache_items."begin_time" < to_timestamp(:end_timestamp) AND mapcache_items."end_time" > to_timestamp(:start_timestamp)) or (mapcache_items."begin_time" = mapcache_items."end_time" AND mapcache_items."begin_time" <= to_timestamp(:end_timestamp) AND mapcache_items."end_time" >= to_timestamp(:start_timestamp)))) AND mapcache_items."footprint" && ST_MakeEnvelope(:minx, :miny, :maxx, :maxy, 4326) ORDER BY mapcache_items."end_time" DESC LIMIT 20) AS sub ORDER BY interval ASC;</validate_query> </dimension> diff --git a/chart/templates/cache-configmap.yaml b/chart/templates/cache-config-configmap.yaml similarity index 100% rename from chart/templates/cache-configmap.yaml rename to chart/templates/cache-config-configmap.yaml diff --git a/chart/templates/cache-deployment.yaml b/chart/templates/cache-deployment.yaml index f97370c6a9010b4dd0a449a7da5aec2eeff49418..8516361ca777ee5b1f72da0fbe1c98dddd6a768d 100644 --- a/chart/templates/cache-deployment.yaml +++ b/chart/templates/cache-deployment.yaml @@ -69,17 +69,15 @@ spec: value: {{ $value | quote }} {{- end }} - name: RENDERER_HOST - value: {{ .Release.Name }}-renderer + value: {{ include "vs.fullname" . }}-renderer - name: INSTANCE_ID value: prism-view-server_cache - name: WAIT_SERVICES - value: "{{ .Release.Name }}-database:{{ .Values.config.database.DB_PORT }} {{ .Release.Name }}-renderer:80" - - name: WAIT_TIMEOUT - value: "300" + value: "{{ .Release.Name }}-database:{{ .Values.config.database.DB_PORT }} {{ include "vs.fullname" . }}-renderer:80" volumeMounts: - mountPath: /mapcache-template.xml - name: cache-config.xml - subPath: cache-config.xml + name: cache-config + subPath: mapcache.xml {{- with .Values.cache.affinity | default .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} @@ -87,7 +85,7 @@ spec: volumes: - configMap: items: - - key: cache-config.xml - path: cache-config.xml + - key: mapcache.xml + path: mapcache.xml name: {{ include "vs.fullname" . }}-cache-config name: cache-config diff --git a/core/registrar/post_handlers.py b/core/registrar/post_handlers.py index f5ec789ffaadb2aef8bb13b0138e3501fcf3fe3b..f24cda091f4e3eb9861dc41070ae97a7a5c5ea9a 100644 --- a/core/registrar/post_handlers.py +++ b/core/registrar/post_handlers.py @@ -42,11 +42,11 @@ xsi:schemaLocation="http://www.telespazio.com/CSCDA/CDD/PDAS PDAS_interfaces%202 identifier=escape(context.identifier), availability_time=escape(isoformat(inserted)), wcs_capabilities_url=escape( - '%s/ows?service=wcs&request=GetCapabilities&cql=identifier="%s"' + '//%s/ows?service=wcs&request=GetCapabilities&cql=identifier="%s"' % (self.service_url, context.identifier) ), wms_capabilities_url=escape( - '%s/ows?service=wms&request=GetCapabilities&cql=identifier="%s"' + '//%s/ows?service=wms&request=GetCapabilities&cql=identifier="%s"' % (self.service_url, context.identifier) ), ))) diff --git a/docker-compose.emg.staging.yml b/docker-compose.emg.staging.yml index 03aac6d017a4b46a85ee21ee7663aaabb8c94704..a718e8c08970ebcc5a0408b87c865de52b55dd71 100644 --- a/docker-compose.emg.staging.yml +++ b/docker-compose.emg.staging.yml @@ -23,16 +23,6 @@ services: - "traefik.http.routers.emg-renderer-redirect-shib.rule=Host(`emg.pass.copernicus.eu`, `a.emg.pass.copernicus.eu`, `b.emg.pass.copernicus.eu`, `c.emg.pass.copernicus.eu`, `d.emg.pass.copernicus.eu`, `e.emg.pass.copernicus.eu`, `f.emg.pass.copernicus.eu`, `g.emg.pass.copernicus.eu`, `h.emg.pass.copernicus.eu`) && PathPrefix(`/ows`, `/opensearch`, `/admin`)" - "traefik.http.routers.emg-renderer-redirect-shib.middlewares=redirect@file" - "traefik.http.routers.emg-renderer-redirect-shib.entrypoints=http" - # router for referrer based access (https) - - "traefik.http.routers.emg-renderer_referer.rule=Host(`emg.pdas.prism.eox.at`, `a.emg.pdas.prism.eox.at`, `b.emg.pdas.prism.eox.at`, `c.emg.pdas.prism.eox.at`, `d.emg.pdas.prism.eox.at`, `e.emg.pdas.prism.eox.at`, `f.emg.pdas.prism.eox.at`, `g.emg.pdas.prism.eox.at`, `h.emg.pdas.prism.eox.at`, `emg.pass.copernicus.eu`, `a.emg.pass.copernicus.eu`, `b.emg.pass.copernicus.eu`, `c.emg.pass.copernicus.eu`, `d.emg.pass.copernicus.eu`, `e.emg.pass.copernicus.eu`, `f.emg.pass.copernicus.eu`, `g.emg.pass.copernicus.eu`, `h.emg.pass.copernicus.eu`) && PathPrefix(`/ows`, `/opensearch`, `/admin`) && HeadersRegexp(`Referer`, `(https?://)?(panda.copernicus.eu|panda.cdsv3.eu|panda-demo.ondaprism.eu|panda-demo.copernicus.eu|cdsportal-demo.copernicus.eu|ocqc-demo.copernicus.eu|spdm-intservices.cds.esa.int|spdm-intservices-adm.cds.esa.int|emg.pdas.prism.eox.at|emg.pass.copernicus.eu)/?`)" - - "traefik.http.routers.emg-renderer_referer.middlewares=compress@file,cors@file" - - "traefik.http.routers.emg-renderer_referer.tls=true" - - "traefik.http.routers.emg-renderer_referer.tls.certresolver=default" - - "traefik.http.routers.emg-renderer_referer.entrypoints=https" - # router for referrer based access (http) - - "traefik.http.routers.emg-renderer_referer-redirect.rule=Host(`emg.pdas.prism.eox.at`, `a.emg.pdas.prism.eox.at`, `b.emg.pdas.prism.eox.at`, `c.emg.pdas.prism.eox.at`, `d.emg.pdas.prism.eox.at`, `e.emg.pdas.prism.eox.at`, `f.emg.pdas.prism.eox.at`, `g.emg.pdas.prism.eox.at`, `h.emg.pdas.prism.eox.at`, `emg.pass.copernicus.eu`, `a.emg.pass.copernicus.eu`, `b.emg.pass.copernicus.eu`, `c.emg.pass.copernicus.eu`, `d.emg.pass.copernicus.eu`, `e.emg.pass.copernicus.eu`, `f.emg.pass.copernicus.eu`, `g.emg.pass.copernicus.eu`, `h.emg.pass.copernicus.eu`) && PathPrefix(`/ows`, `/opensearch`, `/admin`) && HeadersRegexp(`Referer`, `(https?://)?(panda.copernicus.eu|panda.cdsv3.eu|panda-demo.ondaprism.eu|panda-demo.copernicus.eu|cdsportal-demo.copernicus.eu|ocqc-demo.copernicus.eu|spdm-intservices.cds.esa.int|spdm-intservices-adm.cds.esa.int|emg.pdas.prism.eox.at|emg.pass.copernicus.eu)/?`)" - - "traefik.http.routers.emg-renderer_referer-redirect.middlewares=redirect@file" - - "traefik.http.routers.emg-renderer_referer-redirect.entrypoints=http" # router for basic auth based access (https) - "traefik.http.routers.emg-renderer.rule=Host(`emg.pdas.prism.eox.at`, `a.emg.pdas.prism.eox.at`, `b.emg.pdas.prism.eox.at`, `c.emg.pdas.prism.eox.at`, `d.emg.pdas.prism.eox.at`, `e.emg.pdas.prism.eox.at`, `f.emg.pdas.prism.eox.at`, `g.emg.pdas.prism.eox.at`, `h.emg.pdas.prism.eox.at`) && PathPrefix(`/ows`, `/opensearch`, `/admin`)" - "traefik.http.routers.emg-renderer.middlewares=auth@file,compress@file,cors@file" @@ -73,16 +63,6 @@ services: - "traefik.http.routers.emg-cache-redirect-shib.rule=Host(`emg.pass.copernicus.eu`, `a.emg.pass.copernicus.eu`, `b.emg.pass.copernicus.eu`, `c.emg.pass.copernicus.eu`, `d.emg.pass.copernicus.eu`, `e.emg.pass.copernicus.eu`, `f.emg.pass.copernicus.eu`, `g.emg.pass.copernicus.eu`, `h.emg.pass.copernicus.eu`) && PathPrefix(`/cache`)" - "traefik.http.routers.emg-cache-redirect-shib.middlewares=redirect@file" - "traefik.http.routers.emg-cache-redirect-shib.entrypoints=http" - # router for referrer based access (https) - - "traefik.http.routers.emg-cache_referer.rule=Host(`emg.pdas.prism.eox.at`, `a.emg.pdas.prism.eox.at`, `b.emg.pdas.prism.eox.at`, `c.emg.pdas.prism.eox.at`, `d.emg.pdas.prism.eox.at`, `e.emg.pdas.prism.eox.at`, `f.emg.pdas.prism.eox.at`, `g.emg.pdas.prism.eox.at`, `h.emg.pdas.prism.eox.at`, `emg.pass.copernicus.eu`, `a.emg.pass.copernicus.eu`, `b.emg.pass.copernicus.eu`, `c.emg.pass.copernicus.eu`, `d.emg.pass.copernicus.eu`, `e.emg.pass.copernicus.eu`, `f.emg.pass.copernicus.eu`, `g.emg.pass.copernicus.eu`, `h.emg.pass.copernicus.eu`) && PathPrefix(`/cache`) && HeadersRegexp(`Referer`, `(https?://)?(panda.copernicus.eu|panda.cdsv3.eu|panda-demo.ondaprism.eu|panda-demo.copernicus.eu|cdsportal-demo.copernicus.eu|ocqc-demo.copernicus.eu|spdm-intservices.cds.esa.int|spdm-intservices-adm.cds.esa.int|emg.pdas.prism.eox.at|emg.pass.copernicus.eu)/?`)" - - "traefik.http.routers.emg-cache_referer.middlewares=cache-stripprefix,compress@file,cors@file" - - "traefik.http.routers.emg-cache_referer.tls=true" - - "traefik.http.routers.emg-cache_referer.tls.certresolver=default" - - "traefik.http.routers.emg-cache_referer.entrypoints=https" - # router for referrer based access (http) - - "traefik.http.routers.emg-cache_referer-redirect.rule=Host(`emg.pdas.prism.eox.at`, `a.emg.pdas.prism.eox.at`, `b.emg.pdas.prism.eox.at`, `c.emg.pdas.prism.eox.at`, `d.emg.pdas.prism.eox.at`, `e.emg.pdas.prism.eox.at`, `f.emg.pdas.prism.eox.at`, `g.emg.pdas.prism.eox.at`, `h.emg.pdas.prism.eox.at`, `emg.pass.copernicus.eu`, `a.emg.pass.copernicus.eu`, `b.emg.pass.copernicus.eu`, `c.emg.pass.copernicus.eu`, `d.emg.pass.copernicus.eu`, `e.emg.pass.copernicus.eu`, `f.emg.pass.copernicus.eu`, `g.emg.pass.copernicus.eu`, `h.emg.pass.copernicus.eu`) && PathPrefix(`/cache`) && HeadersRegexp(`Referer`, `(https?://)?(panda.copernicus.eu|panda.cdsv3.eu|panda-demo.ondaprism.eu|panda-demo.copernicus.eu|cdsportal-demo.copernicus.eu|ocqc-demo.copernicus.eu|spdm-intservices.cds.esa.int|spdm-intservices-adm.cds.esa.int|emg.pdas.prism.eox.at|emg.pass.copernicus.eu)/?`)" - - "traefik.http.routers.emg-cache_referer-redirect.middlewares=redirect@file" - - "traefik.http.routers.emg-cache_referer-redirect.entrypoints=http" # router for basic auth based access (https) - "traefik.http.routers.emg-cache.rule=Host(`emg.pdas.prism.eox.at`, `a.emg.pdas.prism.eox.at`, `b.emg.pdas.prism.eox.at`, `c.emg.pdas.prism.eox.at`, `d.emg.pdas.prism.eox.at`, `e.emg.pdas.prism.eox.at`, `f.emg.pdas.prism.eox.at`, `g.emg.pdas.prism.eox.at`, `h.emg.pdas.prism.eox.at`) && PathPrefix(`/cache`)" - "traefik.http.routers.emg-cache.middlewares=auth@file,cache-stripprefix,compress@file,cors@file" diff --git a/testing/registrar_test.py b/testing/registrar_test.py index 098643af6ecca5f885a50e12fe467770a27f79f0..907e6445f98285fa242e8485ec4c63198de0ed4d 100644 --- a/testing/registrar_test.py +++ b/testing/registrar_test.py @@ -68,8 +68,8 @@ def compare_links(sftp, product_xml, product): wms_link = urls[1].find('{http://www.telespazio.com/CSCDA/CDD/PDAS}URL').text wcs_link = urls[0].find('{http://www.telespazio.com/CSCDA/CDD/PDAS}URL').text - wms_capabilities = 'emg.pass.copernicus.eu/ows?service=wms&request=GetCapabilities&&cql=identifier=' - wcs_capabilities = 'emg.pass.copernicus.eu/ows?service=wcs&request=GetCapabilities&&cql=identifier=' + wms_capabilities = '//emg.pass.copernicus.eu/ows?service=wms&request=GetCapabilities&&cql=identifier=' + wcs_capabilities = '//emg.pass.copernicus.eu/ows?service=wcs&request=GetCapabilities&&cql=identifier=' expected_wms_link = '%s"%s"' % (wms_capabilities, product) expected_wcs_link = '%s"%s"' % (wcs_capabilities, product)