Skip to content

stats: bundle the IP-to-country table in the image - #1479

Merged
aaylward merged 4 commits into
mainfrom
stats-geo-bundle
Sep 2, 2026
Merged

stats: bundle the IP-to-country table in the image#1479
aaylward merged 4 commits into
mainfrom
stats-geo-bundle

Conversation

@aaylward

@aaylward aaylward commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #1476. DB-IP's country CSV is now an http_file pinned by URL and sha256 and laid into the stats image at /geo, where the service reads it at boot; GEO_DB_PATH points elsewhere or, empty, switches geo off. That removes the hand upload, the geo/* 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 under ZZ; 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 test on stats (both gated suites against a local postgres:18) and the deploy config, and the image builds with the layer in it.

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.
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.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 2, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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.
@aaylward
aaylward merged commit 6d8805c into main Sep 2, 2026
4 checks passed
@aaylward
aaylward deleted the stats-geo-bundle branch September 2, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant