I've been trying to set up an OSRM-backend instance within Fargate. However, I haven't been able to successfully do so. I've read in other places on how to host in EC2 instances, however, none on how to host this on AWS Fargate.
I've been able to modify the base docker image of OSRM-backend below (base image exposes port 5000):
FROM osrm/osrm-backend
WORKDIR /data
RUN apt-get update && apt-get install -y --no-install-recommends curl
RUN curl http://download.geofabrik.de/europe/ireland-and-northern-ireland-latest.osm.pbf --output ni-latest.osm.pbf && \
osrm-extract -p /opt/car.lua ni-latest.osm.pbf && \
osrm-partition ni-latest.osrm && \
osrm-customize ni-latest.osrm
CMD ["osrm-routed", "--algorithm", "mld", "ni-latest.osrm", "--max-matching-size","50000"]
Once I've pushed this into the container registry, setting up the task definition within the elastic container service, the status code 200 was given and the following:
[info] starting up engines, v5.22.0
[info] Threads: 4
[info] IP address: 0.0.0.0
[info] IP port: 5000
[info] http 1.1 compression handled by zlib version 1.2.11
[info] Listening on: 0.0.0.0:5000
[info] running and waiting for requests
Which runs as expected, however, after given the public IP within the ECS task, and trying to call it within sagemaker notebook:
response = requests.get('http://{ECSpublicIP}:80/match/v1/driving/13.388860,52.517037;13.397634,52.529407?overview=full&geometries=geojson')
It gives a connection error code 111 and I have not been able to figure out why. Is hosting OSRM on Fargate possible?
Thanks