Skip to content

Commit f90d891

Browse files
committed
fix when poi are missing and install aws
1 parent f779528 commit f90d891

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

docker/debian10/Dockerfile-tyr-worker

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ RUN apt-get update \
1313
./mimirsbrunn7_buster-*.deb ./cosmogony2cities*.deb
1414

1515

16+
17+
RUN apt install -y --force-yes unzip
18+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
19+
RUN unzip awscliv2.zip
20+
RUN ./aws/install
21+
1622
# install tyr requirements
1723
RUN pip install --no-cache-dir -r /usr/share/tyr/requirements.txt
1824

docker/debian8/Dockerfile-tyr-worker

+6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ RUN rm navitia-common_*deb \
4848
# install tyr requirements
4949
RUN pip install --no-cache-dir -r /usr/share/tyr/requirements.txt
5050

51+
RUN apt install -y --force-yes unzip
52+
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
53+
RUN unzip awscliv2.zip
54+
RUN ./aws/install
55+
56+
5157
EXPOSE 5000
5258

5359

source/tyr/tyr/poi_to_excluded_zones.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66

77
def poi_to_excluded_zones(poi_file, output_dir, instance_name):
8+
logger = logging.getLogger(__name__)
9+
810
tmp_path = "tmp/poi_{}".format(instance_name)
911
import zipfile
1012

@@ -31,9 +33,9 @@ def poi_to_excluded_zones(poi_file, output_dir, instance_name):
3133
excluded_geometries_ids[row[0]] = row[7]
3234

3335
if excluded_geometries_ids.keys() != excluded_zones.keys():
34-
logger.error("not all excluded zone's pois are found in poi.txt")
35-
logger.error("excluded_geometries_ids: {}".format(excluded_geometries_ids.keys()))
36-
logger.error("excluded_zones: {}".format(excluded_zones.keys()))
36+
logger.warning("not all excluded zone's pois are found in poi.txt")
37+
logger.warning("excluded_geometries_ids: {}".format(excluded_geometries_ids.keys()))
38+
logger.warning("excluded_zones: {}".format(excluded_zones.keys()))
3739

3840
# read geometries
3941
geometries_shapes = {}
@@ -46,9 +48,12 @@ def poi_to_excluded_zones(poi_file, output_dir, instance_name):
4648
geometry_id = excluded_geometries_ids.get(poi_id)
4749
if not geometry_id:
4850
logger.error("{} could not be found in poi.txt".format(row[0]))
51+
continue
52+
4953
shape = geometries_shapes.get(geometry_id)
5054
if not shape:
5155
logger.error("{} could not be found in geometries.txt".format(geometry_id))
56+
continue
5257

5358
for i, zone in enumerate(zones):
5459
output_id = "{}_{}_{}".format(poi_id, i, instance_name)

0 commit comments

Comments
 (0)