Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker] Add tiles server #2928

Closed
OnkelTem opened this issue Nov 5, 2017 · 12 comments
Closed

[docker] Add tiles server #2928

OnkelTem opened this issue Nov 5, 2017 · 12 comments

Comments

@OnkelTem
Copy link

OnkelTem commented Nov 5, 2017

This is to stake out a place for an upcoming PR with further enhancements of docker infrastructure - adding a tiles server, because currently we don't have one. Let me briefly describe what we have now and what I'm doing.

Currently we use the following containers:

  • db - with postgis
  • import - with osm2pgsql
  • kosmtik - with nodejs, kosmtik, carto, python and fonts.

They currently live in the root directory but after finishing works on #2913 (#2914) they will hopefully reside in the docker/ subdirectory (making the mess in the root directory a bit less overwhelming :) ).

While these facilities are enough for developing styles, we can't do one simple thing: serve tiles for whatever software takes them, including for example web applications or QGis. (There's one more thing we can't do atm: print maps using Nik4 for example, but this is a topic for another discussion.)

So the idea is to create one more image to run a container with tiles server:

  • tiles - with Apache 2 and mod_tile/renderd

Thinking about the contents of this image makes it obvious that it shouldn't depend on the kosmtik container but since it uses the same set of fonts it's imagined that fonts should be shared between these two containers via a separate fonts volume.

Another thing to consider - is how to cache renderd tiles. I think a new volume should be introduced for that.

There are other things to think about. Soon I'll post a PR and we can see at how docker environment works and organized.

@kocio-pl kocio-pl added this to the New features milestone Nov 5, 2017
@kocio-pl
Copy link
Collaborator

kocio-pl commented Nov 5, 2017

In my opinion that can be very useful tools, but it's outside the scope of this style. Docker image was meant as a simple installation of the development environment and I think it should stay like this in general.

But of course Docker architecture makes it easy to build bigger services composed of small, well defined boxes (microservices) and it would be good to use the full potential of this tool.

I think you could start a new project, named like osm-docker (probably under OSM account) to make it easy to find it and add more such images. More styles using the same database comes to mind, but also different editing tools (TileMill?) or different outputs (Magnacarto instead of Mapnik, serving different vector tiles...). That would make it easier to develop, test and deploy new tools.

@OnkelTem
Copy link
Author

OnkelTem commented Nov 5, 2017

More styles using the same database comes to mind, but also different editing tools (TileMill?) or different outputs (Magnacarto instead of Mapnik, serving different vector tiles...).

That's exactly what I started with few days ago :) But then I realized that I can barely imagine that someone would want to install all the styles. Also I faced a problem I couldn't really overcame: openstreetmap carto comes with its own tagging tool and osm2pgsql style. I don't have any deep knowledge of them and what they would really affect, but this signaled to me that even database would be different for different styles. So is there really a way to build such a universal system with one database and many styles?

And while I still think it would be really good idea to develop a pluggable architecture where you can add styles in an ad-hoc manner (or even edit tools - like your said and that's cool!), this task I postponed for later when I get at least openstreetmap-carto working at full power. That's why I focused here.

As for this particular change - adding a tiles server - it doesn't look for me like a big deal really. I consider it more like a missing chain. I personally can't make much use of kosmtik as my goal was to create a tiles-layer in QGis to draw a map of some ancient cultures and for that I needed BOLD rivers seen from far distances/low zoom-levels :)

@matthijsmelissen
Copy link
Collaborator

In my opinion that can be very useful tools, but it's outside the scope of this style. Docker image was meant as a simple installation of the development environment and I think it should stay like this in general.

+1 I believe the thing you're proposing would be very useful, but only tangentially related to what we're working on within the scope of this repository. It might be only a couple of lines of code, but it might be a large maintenance burden (just look at the number of support questions we already get related to the Docker installation we currently have, I'd only expect it to increase).

@OnkelTem
Copy link
Author

OnkelTem commented Nov 5, 2017

@math1985
Sounds reasonable for me.

So let's move then all docker stuff into a new project called osm-docker as @kocio-pl proposed? I don't mean that it's gonna be an immediate change - far from that thought. But later, the goal. What do you think?

@randyhbh
Copy link

randyhbh commented Nov 5, 2017

@OnkelTem You think that using Docker and QGis, will be posible to translate osm-style raster tiles to vectorial ones?

@OnkelTem
Copy link
Author

OnkelTem commented Nov 5, 2017

@randyhbh No, I didn't think about using vector in QGis except of my own - the map I'm drawing. I just want to feed QGis with tiles. Also note that I'm very new to QGis and might not know some really cool things it can do.

@kocio-pl
Copy link
Collaborator

kocio-pl commented Nov 5, 2017

Some remarks from me:

  • the name of the project should be distinctive yet descriptive (easy to find by search engine, see also What is the name of this map style? #2927 😄 ), but it needs to be checked if "OSM" in the name is accepted (there was some discussion about it on mailing lists) - maybe general "Docker Mapping Toolbox", "Instant Map" (avoiding "Docker") or something similar makes more sense
  • it's not about running all the styles, but having the template to add new tools to a toolbox; even if database format is different for osm-carto v4, the v3 format (with hstore probably) was the same for few styles (including vector osm-carto fork by @rory) and creating new database scheme might be done with just changing a line in the Dockerfile of database and import containers
  • on the longer run we could even drop the Docker code from this repository, we just made it because there was nothing ready for our purposes (for example there's a popular Docker container for serving tiles, but it lacks licensing information)
  • there's more to serving than mod_tile 😄

@kocio-pl
Copy link
Collaborator

kocio-pl commented Nov 7, 2017

I think we can safely close this issue here. Some things can be still discussed here if needed, but I prefer it to be in the new project as soon as it's established.

@kocio-pl kocio-pl closed this as completed Nov 7, 2017
@OnkelTem
Copy link
Author

OnkelTem commented Nov 7, 2017

Ok. Thank you for the feedback. Actually I expected that this area is much bigger under the surface, then it looks at first.

So I really eager to start building this "Lego". Would it be fine to start with openstreepmap-carto as the first/default style? And what tools do you think I should consider to add in that default setup?

Let me enumerate some obvious things:

  • postgis
  • db importer
  • font downloader
  • coastline shapefiles downloader
  • kosmtik
  • tile server

anything else?

I think that depending on a used style almost every step can go differently, e.g.

  • db importer depends on osm2pgsql style & lua tagger and there is also imposm as an alternative way to load data
  • font downloader can download fonts really used by the style
  • coastline shapefiles downloader can also use some alternative shapefiles

@kocio-pl
Copy link
Collaborator

kocio-pl commented Nov 7, 2017

So I really eager to start building this "Lego".

Great! I would be happy to test it.

Would it be fine to start with openstreepmap-carto as the first/default style?

I guess this is the obvious choice. 😄

@d3netxer
Copy link

@OnkelTem Did you get started with this yet?

@kocio-pl
Copy link
Collaborator

See this project:

https://github.com/OnkelTem/osmcarto-docker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants