Trying to create my own version of openpoiservice

I am trying to follow the description in README.

I first tried to create the docker from a windows 11 machine, but it fails to execute the run.sh script

I then followed the advice from someone here to do this in my virtual Ubuntu environment instead and that error disappeared.

But when it start working the sequence of steps to do becomes a bit unclear.

I start by updating categories_docker.yml file with some additional tags and download a pdf file for Sweden and store it in the osm folder

I then use the all-in-one docker container command

docker-compose -f /path/to/docker-compose.yml up api -d

And it works and creates an openpoiservice-api image, an openpoiservice-api container (called charming_mestof) and a kortoza/postgis image and a obs-db container.

The log for the charming_mestof (openpoiservice-api) contains the following:

2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [7] [INFO] Starting gunicorn 20.0.4
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [7] [INFO] Listening at: http://0.0.0.0:5000 (7)
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [7] [INFO] Using worker: gevent
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [8] [INFO] Booting worker with pid: 8
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [9] [INFO] Booting worker with pid: 9
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [10] [INFO] Booting worker with pid: 10
2023-01-09 18:23:19 [2023-01-09 17:23:19 +0000] [11] [INFO] Booting worker with pid: 11

I then run the command init command
docker-compose -f /path/to/docker-compose.yml up init
which runs awhile and I assume updates the database according to the configuration. It completes successfully.

An image is created called openpoiservice-init and a container ops_init is created. The logfile for that is:

2023-01-09 17:24:43 INFO     Found directory: /deploy/app/osm
2023-01-09 17:24:43 INFO     Starting to import OSM data (1 files in batch)
2023-01-09 17:24:43 INFO     Starting to read /deploy/app/osm/sweden-latest.osm.pbf
2023-01-09 17:24:43 INFO     Parsing and importing nodes...
2023-01-09 17:31:48 INFO     Found 404460 nodes
2023-01-09 17:31:48 INFO     Parsing relations...
2023-01-09 17:31:52 INFO     Found 18891 ways in relations
2023-01-09 17:31:52 INFO     Parsing ways...
2023-01-09 17:32:20 INFO     Found 981135 ways (including the ones found in relations)
2023-01-09 17:32:20 INFO     Importing ways...
2023-01-09 17:55:16 INFO     Found 1385595 POIs
2023-01-09 17:55:16 INFO     Finished import of /deploy/app/osm/sweden-latest.osm.pbf
2023-01-09 17:55:16 INFO     File import completed in 1832688.6 ms
2023-01-09 17:55:16 INFO     Import complete.
2023-01-09 17:55:16 INFO     Batch of 1 files completed in 1832704.51 ms
2023-01-09 17:24:42 Initializing POI database

Which looks great !!

Then it becomes confusing. Am I done now or should I run any more commands.
There is talk about BuufProtocolers (protobuf) for imposm.parser which is unclear if I need to do something

There is also talk about the openpoiservice/server/ops_settings.yml and to export these settings, but I did the settings needed in the ops_setting_docker.yml

After this comes a section with c´Creating, Dropping and Parsing and importing data, which I assume is not necessary. And if I try to run any of those I need to install a lot of other python packages.

And then it is mentioned that I can access the application at localhost:5000. If i put this in the browser, it states that it cannot be found.

What did I do wrong?

When I run my application to use the api, I get this error:

HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: //pois (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000022B8D21AB80>: Failed to establish a new connection: [WinError 10061]

Hey,

as far as I understand, the app will not respond to a GET request (which is what you’re issuing when trying to access localhost:5000.

However, running a POST request as stated in the example in the README or having a look at the apidocs at http://localhost:5000/apidocs/ should work.

Best regards

Thanks but
http://localhost:5000/apidocs/ does not work. Connection is refused.

The log for the container openpoiservice is this, which look ok. What else coud it be?

2023-01-11 16:40:13 [2023-01-11 15:40:13 +0000] [7] [INFO] Starting gunicorn 20.0.4
2023-01-11 16:40:13 [2023-01-11 15:40:13 +0000] [7] [INFO] Listening at: http://0.0.0.0:5000 (7)
2023-01-11 16:40:13 [2023-01-11 15:40:13 +0000] [7] [INFO] Using worker: gevent
2023-01-11 16:40:13 [2023-01-11 15:40:13 +0000] [8] [INFO] Booting worker with pid: 8
2023-01-11 16:40:14 [2023-01-11 15:40:14 +0000] [9] [INFO] Booting worker with pid: 9
2023-01-11 16:40:14 [2023-01-11 15:40:14 +0000] [10] [INFO] Booting worker with pid: 10
2023-01-11 16:40:14 [2023-01-11 15:40:14 +0000] [11] [INFO] Booting worker with pid: 11

I got both openrouteservice and openpoiservice to work on one server. Not really sure how. Installed a new version of Ubuntu and started from scratch. And they both work

But now I want to move the docker images to another server and run them there. So I added the images to the docker hub and push them down to the other server and nothing worked.

openrouteservice:
Had problems with the car directory, could not create a lock file there. What can I do about that?

openpoiservice:
Even more an issue here. I can move the openpoiservice-api over and I can move the postgis image. But nothing happens. They just sit there listening !

Then I moved openpoiservice-init over as well hoping it would start loading the database, but It just sits there listening to localhost:5000.

So now I do not know how to continue from here. One assumtion is that there must be a connection between openpoiservice-api/openpoiservice-init and the postgis database, but do not know how to connected them

Please help!!!

What can I do about the issue with openpoiservice in docker. How deploy them in a new environment?

Hi @MatsGej

the image might only be there for easier deployment and not necessarily contain all the stuff to run the service.
Is this the same problem as the issue you created?

For now there might be no way around setting it up natively on the server as well -.-

Best regards