stats: bundle the IP-to-country table in the image - #1479
Merged
Conversation
DB-IP's country CSV is an http_file pinned by URL and sha256, laid into the stats image at /geo, and read from disk at boot; GEO_DB_PATH points elsewhere or, empty, switches geo off. A new month is a pin bump. The image rule takes extra layers for data a binary reads.
aaylward
force-pushed
the
stats-geo-bundle
branch
from
September 2, 2026 15:24
9f33a07 to
961b33e
Compare
The pinned DB-IP file goes through the real parser in a test with the file as data, placing known addresses and loading without skips, and the geo layer's path is checked against the binary's default. DB-IP marks reserved and private space ZZ; those rows read as unplaced rather than as a country.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
1d4-web | 41e90ff | Commit Preview URL Branch Preview URL |
Sep 02 2026, 03:41 PM |
Shipped objects in a memory bucket, the real loop with the real vendor geo file, the real store on Postgres, and every endpoint read over HTTP through NewRouter, which main now serves too. The pattern for the next endpoint or source: a few lines in e2e_test.go, no new harness.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1476. DB-IP's country CSV is now an
http_filepinned by URL and sha256 and laid into the stats image at/geo, where the service reads it at boot;GEO_DB_PATHpoints elsewhere or, empty, switches geo off. That removes the hand upload, thegeo/*IAM grant, and the S3 fetch with its retries — a new month is a pin bump. The pinned file goes through the real parser in a test, which is how it turned out DB-IP files reserved space underZZ; those rows now read as unplaced. Also the first end-to-end test for this service: a memory bucket of shipped objects through the real loop, store, and router, the pattern to copy for the next endpoint. A hosted fallback for the pinned file is #1478.Tested with
bazel teston stats (both gated suites against a local postgres:18) and the deploy config, and the image builds with the layer in it.