kartoza / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
http://geonode.org/
GNU General Public License v3.0
8 stars 17 forks source link

Create Tile seeder management command #513

Closed lucernae closed 5 years ago

lucernae commented 5 years ago

Related with #422

New bounds and can be recalculated by triggering save signals. But the tile cache can not.

lucernae commented 5 years ago

I made this, but honestly I think it is still better to do it on demand because it's quite fast. For OSM Buildings, there will be lots of tiles to generate, it doesn't make sense to generate all.

Anyway, how to use:

./manage.py tile_seeder -z <zoom min, 10> <zoom max, 12> [layer slug name]
NyakudyaA commented 5 years ago

@lucernae were you not going to manage the seeding through rancher ie like a cron job maybe daily or twice daily

lucernae commented 5 years ago

Yes @NyakudyaA I'm currently writing on it in this ticket to explain

lucernae commented 5 years ago

The plan to use this management command in Rancher is to clone service from django and create a run once service for each layer. Then with --noinput option, provide the command like this:

Screen Shot 2018-11-02 at 15.28.27.png

(Important settings, will be run once, command and entry point. We uses celery entry point because it will not deal with migrate and collectstatic instance.)

Last, define the schedule here:

Screen Shot 2018-11-02 at 15.36.01.png

Unlike regular cron job, Rancher cron schedule starts from seconds. So 0 0 3 * * ? means every day at 3 A.M.

lucernae commented 5 years ago

If executed from command line, it will look like something like this.

Screen Shot 2018-11-01 at 02.23.38.png

I'm currently trying it on testing using above plan, but the command doesn't execute. I'm trying to figure out why. The command execute normally through django console at testing.

lucernae commented 5 years ago

Ok, I think I understand. The log output in rancher only shows up after the command finished, so we can't see the progress. But the command ran

NyakudyaA commented 5 years ago

The seeding is working fine screenshot 2018-11-13 at 21 00 40