[bedrock] Install MaxMind database and python library maxminddb



4 years ago
3 years ago


(Reporter: pmac, Assigned: nmaul)



(Whiteboard: [kanban:https://webops.kanbanize.com/ctrl_board/2/618] )

We need server side geolocation by IP address for bedrock. Please install the MaxMind GeoIP2 Country database on the webheads and let us know the full path to the database file.

We also need IT to install the maxminddb python library as there are compiled C extensions that make it fast. To get the fast version requires installation at the OS level of libmaxminddb.

We'd like to use this on some work that is coming up very soon. In order that we can plan whether or not we should count on having this by launch of this work, please provide an estimated completion date for this before starting work on it.



4 years ago
Whiteboard: [kanban:https://webops.kanbanize.com/ctrl_board/2/618]

When do we think we'll have an estimated completion date for this?

Flags: needinfo?(srich)
Blocks: 1138659

Comment 2

4 years ago
Had a meeting on this just now...

TL;DR is: we'll have the admin node maintain the authoritative copy, update it periodically, and (one way or another) sync it out to the web nodes. Bedrock's code will include the proper python bindings, and we'll install the system package.

We already have a geoip puppet module suitable for putting on an admin node that handles all the configuration, updating, and licensing.

Syncing the data to the web nodes can be done in a number of ways The prevailing idea is to update the data from MaxMind on the admin node, then copy it into each app's /data/<env>/src/<app>/ directory. Leave it alone, and let it get pushed out whenever a deploy happens. Drift is purported to be around 1.5% per month according to MaxMind, so this should be just fine. Alternatively we can handle it like locales, and sync out on a regular basis, outside of normal code deploys.
Flags: needinfo?(srich)

Comment 3

4 years ago
Started work on this, ran into some yaks to shave.

Turns out all our stuff for GeoIP is very old... even upstream (EPEL, rpmforge). It's all for the older, legacy "GeoIP" format. The current hotness is "GeoIP2".

I've packaged up some modern stuff for this. 1) the current upstream "geoipupdate" package - which ultimately boils down to just a single binary and a manpage - and 2) libmaxminddb, the C library (and command line tool for looking up IPs).

Next up, I need to modify the puppet "geoip" module to ship these packages instead of the legacy "GeoIP" package. The admin node needs both (including libmaxminddb-devel, so really 3 packages), the web nodes need just libmaxminddb. This will have to be some sort of flag in the puppet module so it doesn't break anything that's already out there using the legacy stuff.

Simultaneously, @pmac, you should be good to add https://pypi.python.org/pypi/geoip2 to your requirements.txt. We'll put it in the virtualenv's for all the environments. Of course we can't actually install it in the virtualenv's until libmaxminddb is installed...
Hi Jake-

How is this stuff coming along?  Is it on track be done early next week so that we can have our Firefox OS pages live by March 26?

Flags: needinfo?(nmaul)
Blocks: 1133146


4 years ago
Assignee: server-ops-webops → nmaul

Comment 6

4 years ago
This is in place. All that's left is for you to add this library to the requirements/compiled.txt file and for us to install it into each virtualenv.

Let us know when it's added and I'll loop through them all to do the install. Don't forget the hash for peep. :)
Flags: needinfo?(nmaul)
WOO! Thanks Jake. I've already added it to the requirements in the PR[0], so it'll be ready as soon as that is merged and pushed. I'll ping you when that happens.

[0] https://github.com/mozilla/bedrock/pull/2840
Thanks, Jake!  This is great!!!

Comment 9

4 years ago
(In reply to Paul McLanahan [:pmac] from comment #7)
> WOO! Thanks Jake. I've already added it to the requirements in the PR[0], so
> it'll be ready as soon as that is merged and pushed. I'll ping you when that
> happens.
> [0] https://github.com/mozilla/bedrock/pull/2840

Hi :pmac, this was merged 11 days ago - has it been pushed?
Flags: needinfo?(pmac)
Yes! Thanks for the ping :atoll. Forgot to close this. We added the maxminddb peep install to the deploy script, so we're fully done with this. Thanks again all!
Last Resolved: 4 years ago
Flags: needinfo?(pmac)
Resolution: --- → FIXED
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in before you can comment on or make changes to this bug.