diff --git a/Dockerfile b/Dockerfile index 69d88c8..afd261c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,9 +28,6 @@ RUN groupadd -r geodata -g 2500 && \ useradd -u 2500 -r -g geodata -s /sbin/nologin --create-home geodata && \ # create mountpoint for Amazon EFS CSI driver install -o geodata -g geodata -d /var/local/ && \ - # create mountpoint for EFS mount in infra-vhost - # TODO: this mountpoint can be removed after the migration to k8s - install -o geodata -p geodata -d /var/lib/sphinxsearch/data/index_efs/ && \ # create mountpoint folder for infra-vhost/k8s ebs/ssd volume install -o geodata -g geodata -d /var/lib/sphinxsearch/data/index/ && \ # change ownerships to geodata which will run the service or the maintenance scripts diff --git a/conf/lubis.conf.part b/conf/lubis.conf.part index 6478578..842c8b2 100644 --- a/conf/lubis.conf.part +++ b/conf/lubis.conf.part @@ -26,7 +26,7 @@ source src_ch_swisstopo_lubis_luftbilder_schraegaufnahmen : def_searchable_featu SELECT row_number() OVER(ORDER BY ebkey asc) as id \ , concat_ws(' ',flightdate::date, ebkey::text) as label \ , 'feature' as origin \ - , concat_ws(' ',flightdate::date, ebkey::text) as detail \ + , concat_ws(' ',flightdate::date, ebkey::text, ebkey_old) as detail \ , 'ch.swisstopo.lubis-luftbilder_schraegaufnahmen' as layer \ , bgdi_quadindex as geom_quadindex \ , st_y(st_transform(st_centroid(the_geom),4326)) as lat \ @@ -81,7 +81,7 @@ source src_ch_swisstopo_lubis_luftbilder_infrarot: def_searchable_features_with_ sql_db = lubis_${DBSTAGING} sql_query = \ SELECT row_number() OVER(ORDER BY ebkey asc) as id \ - , concat(flugdatum, ' ', bildnummer, ' (', concat_ws(', ', ort, ebkey), ')' ) as label \ + , concat(flugdatum, ' ', bildnummer, ' (', concat_ws(', ', ort, ebkey, ebkey_old), ')' ) as label \ , 'feature' as origin \ , remove_accents(concat_ws(' ', ebkey, ort)) as detail \ , 'ch.swisstopo.lubis-luftbilder_infrarot' as layer \ @@ -140,7 +140,7 @@ source src_ch_swisstopo_lubis_terrestrische_aufnahmen : def_searchable_features_ SELECT row_number() OVER(ORDER BY inventory_number asc) as id \ , lpad(bilder.inventory_number::text, 14, '0'::text) as label \ , 'feature' as origin \ - , remove_accents(concat_ws(' ', inventory_number, image_number, station, operate_name, year)) as detail \ + , remove_accents(concat_ws(' ', inventory_number, image_number, station, operate_name, year, inventarnummer_old)) as detail \ , 'ch.swisstopo.lubis-terrestrische_aufnahmen' as layer \ , bgdi_quadindex as geom_quadindex \ , st_y(st_transform(st_centroid(the_geom),4326)) as lat \ @@ -149,7 +149,7 @@ source src_ch_swisstopo_lubis_terrestrische_aufnahmen : def_searchable_features_ , box2d(st_transform(the_geom_hilight, 2056)) as geom_st_box2d_lv95 \ , year \ , lpad(bilder.inventory_number::text, 14, '0'::text)::text as feature_id \ - FROM swisstopo_terrestrial.bilder + FROM swisstopo_terrestrial.view_bilder bilder } ## INDICES diff --git a/conf/stopo.conf.part b/conf/stopo.conf.part index 6205ad6..2e728a1 100644 --- a/conf/stopo.conf.part +++ b/conf/stopo.conf.part @@ -77,7 +77,7 @@ source src_ch_swisstopo_vd_ortschaftenverzeichnis_plz : def_searchable_features { sql_db = stopo_${DBSTAGING} sql_query = \ - SELECT bgdi_id::int as id \ + SELECT os_uuid::int as id \ , 'feature' as origin \ , remove_accents(concat_ws(' ', plz, langtext)) as detail \ , 'ch.swisstopo-vd.ortschaftenverzeichnis_plz' as layer \ @@ -88,7 +88,7 @@ source src_ch_swisstopo_vd_ortschaftenverzeichnis_plz : def_searchable_features , box2d(st_transform(the_geom, 2056)) as geom_st_box2d_lv95 \ , plz::text as label \ , os_uuid::text as feature_id \ - FROM vd.gabmo_plz + FROM vd.amtovz_ortschaften } source src_ch_swisstopo_vec200_names_namedlocation : def_searchable_features diff --git a/scripts/docker-cmd.sh b/scripts/docker-cmd.sh index fb9654f..6f2b19e 100755 --- a/scripts/docker-cmd.sh +++ b/scripts/docker-cmd.sh @@ -7,16 +7,7 @@ green='\e[0;32m' NC='\e[0m' # No Color SPHINXINDEX_VOLUME="/var/lib/sphinxsearch/data/index/" -SPHINXINDEX_EFS="/var/lib/sphinxsearch/data/index_efs/" -K8S_EFS="/var/local/geodata/service-sphinxsearch/${DBSTAGING}/index/" - -# TODO: This switch can be removed after the migration to k8s -# in k8s we have to use /var/local/ as mountpoint for the index files from geodata efs -# /var/local/geodata/service-sphinxsearch/${DBSTAGING}/index/ -if [ -d "${K8S_EFS}" ]; then - echo "service is running on k8s, index files have been found on ${K8S_EFS}." - SPHINXINDEX_EFS="${K8S_EFS}" -fi +SPHINXINDEX_EFS="/var/local/geodata/service-sphinxsearch/${DBSTAGING}/index/" # remove lock files in volume rm ${SPHINXINDEX_VOLUME}*.spl 2> /dev/null || : diff --git a/scripts/index-sync-rotate.sh b/scripts/index-sync-rotate.sh index 3729610..1d0c5bf 100755 --- a/scripts/index-sync-rotate.sh +++ b/scripts/index-sync-rotate.sh @@ -2,8 +2,7 @@ # executed as cronjob every 15 minutes # shellcheck disable=SC2068 set -eu -SPHINX_EFS="/var/lib/sphinxsearch/data/index_efs/" -K8S_EFS="/var/local/geodata/service-sphinxsearch/${DBSTAGING}/index/" +SPHINX_EFS="/var/local/geodata/service-sphinxsearch/${DBSTAGING}/index/" SPHINX_VOLUME="/var/lib/sphinxsearch/data/index/" SPHINXCONFIG="/etc/sphinxsearch/sphinx.conf" @@ -36,7 +35,6 @@ RSYNC_INCLUDE="/tmp/include.txt" # .spp # .sps - json_logger() { log_level=$1 timestamp=$(date --utc +%FT%T.%3NZ) @@ -79,22 +77,6 @@ exlock_now() { _lock xn; } # obtain an exclusive lock immediately or fai exlock_now || { echo "locked" | json_logger INFO; exit 1; } echo "start" | json_logger INFO -# TODO: This switch can be removed after the migration to k8s -# in k8s we have to use /var/local/ as mountpoint for the index files from geodata efs -# /var/local/geodata/service-sphinxsearch/${DBSTAGING}/index/ -set_efs_source() { - # input: - # ${SPHINX_EFS} mountpoint of efs index files - #  - # output: SPHINX_EFS - # if the index files are available on the k8s mountpoint, the k8s mountpoint will be used - # as efs index source - if [ -d "${K8S_EFS}" ]; then - echo "service is running on k8s, index files have been found on ${K8S_EFS}." | json_logger INFO - SPHINX_EFS="${K8S_EFS}" - fi -} - check_if_efs_index_is_ready() { # input: # $1: index name @@ -159,8 +141,6 @@ check_if_local_index_is_ready() { return ${ready} } -set_efs_source - # loop through all indexes from sphinx config and sync them if the have been fully updated on efs for sphinx_index in ${SPHINX_INDEXES[@]}; do # create include-from file from sphinx config for selective rsync from EFS -> LOCAL