From f90d891fc4ee6f9ee26c0585f3f86cebd49a380c Mon Sep 17 00:00:00 2001 From: Patrick Qian Date: Mon, 12 Feb 2024 11:26:36 +0100 Subject: [PATCH] fix when poi are missing and install aws --- docker/debian10/Dockerfile-tyr-worker | 6 ++++++ docker/debian8/Dockerfile-tyr-worker | 6 ++++++ source/tyr/tyr/poi_to_excluded_zones.py | 11 ++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docker/debian10/Dockerfile-tyr-worker b/docker/debian10/Dockerfile-tyr-worker index 8bc14a7f38..f905364a18 100644 --- a/docker/debian10/Dockerfile-tyr-worker +++ b/docker/debian10/Dockerfile-tyr-worker @@ -13,6 +13,12 @@ RUN apt-get update \ ./mimirsbrunn7_buster-*.deb ./cosmogony2cities*.deb + +RUN apt install -y --force-yes unzip +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +RUN unzip awscliv2.zip +RUN ./aws/install + # install tyr requirements RUN pip install --no-cache-dir -r /usr/share/tyr/requirements.txt diff --git a/docker/debian8/Dockerfile-tyr-worker b/docker/debian8/Dockerfile-tyr-worker index 992e3c6765..d4481e99f0 100644 --- a/docker/debian8/Dockerfile-tyr-worker +++ b/docker/debian8/Dockerfile-tyr-worker @@ -48,6 +48,12 @@ RUN rm navitia-common_*deb \ # install tyr requirements RUN pip install --no-cache-dir -r /usr/share/tyr/requirements.txt +RUN apt install -y --force-yes unzip +RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" +RUN unzip awscliv2.zip +RUN ./aws/install + + EXPOSE 5000 diff --git a/source/tyr/tyr/poi_to_excluded_zones.py b/source/tyr/tyr/poi_to_excluded_zones.py index 8f25678e40..17f73c1523 100644 --- a/source/tyr/tyr/poi_to_excluded_zones.py +++ b/source/tyr/tyr/poi_to_excluded_zones.py @@ -5,6 +5,8 @@ def poi_to_excluded_zones(poi_file, output_dir, instance_name): + logger = logging.getLogger(__name__) + tmp_path = "tmp/poi_{}".format(instance_name) import zipfile @@ -31,9 +33,9 @@ def poi_to_excluded_zones(poi_file, output_dir, instance_name): excluded_geometries_ids[row[0]] = row[7] if excluded_geometries_ids.keys() != excluded_zones.keys(): - logger.error("not all excluded zone's pois are found in poi.txt") - logger.error("excluded_geometries_ids: {}".format(excluded_geometries_ids.keys())) - logger.error("excluded_zones: {}".format(excluded_zones.keys())) + logger.warning("not all excluded zone's pois are found in poi.txt") + logger.warning("excluded_geometries_ids: {}".format(excluded_geometries_ids.keys())) + logger.warning("excluded_zones: {}".format(excluded_zones.keys())) # read geometries geometries_shapes = {} @@ -46,9 +48,12 @@ def poi_to_excluded_zones(poi_file, output_dir, instance_name): geometry_id = excluded_geometries_ids.get(poi_id) if not geometry_id: logger.error("{} could not be found in poi.txt".format(row[0])) + continue + shape = geometries_shapes.get(geometry_id) if not shape: logger.error("{} could not be found in geometries.txt".format(geometry_id)) + continue for i, zone in enumerate(zones): output_id = "{}_{}_{}".format(poi_id, i, instance_name)