-
Notifications
You must be signed in to change notification settings - Fork 1
v0preview exported API of all our locations #558
Comments
Here's what we have so far: https://vial-staging.calltheshots.us/api/searchLocations?size=20&format=v0preview {
"usage": {
"notice": "Please contact Vaccinate The States and let us know if you plan to rely on or publish this data. This data is provided with best-effort accuracy. If you are displaying this data, we expect you to display it responsibly. Please do not display it in a way that is easy to misread.",
"contact": {
"partnersEmail": "[email protected]"
}
},
"content": [
{
"id": "recAeW9YJKj2nslIV",
"name": "V N PHARMACY",
"state": "CA",
"latitude": 34.06234,
"longitude": -118.08878,
"location_type": "Pharmacy",
"phone_number": "626-307-2711",
"vaccines_offered": null,
"full_address": "8244 E GARVEY AVE STE B, ROSEMEAD, CA 91770",
"city": null,
"county": "Los Angeles",
"zip_code": null,
"hours": {
"unstructured": "Monday - Tuesday: 10:00 AM – 6:00 PM\nWednesday: Closed\nThursday - Friday: 10:00 AM – 6:00 PM\nSaturday: 10:00 AM – 2:00 PM\nSunday: Closed"
},
"website": null,
"concordances": [
"google_places:ChIJlQ2qLAvQwoARBGIUaM8HBGg"
],
"last_verified_by_vts": "2021-04-02T18:28:01+00:00",
"vts_url": "https://www.vaccinatethestates.com/?lng=-118.08878&lat=34.06234#recAeW9YJKj2nslIV"
}
]
} |
I implemented streaming upload in #554 last night, and changed the API to take |
I implemented the horrible vaccinefinder hack in #557 - need to get the export to GCS working next. |
Right now doing I'm concerned that the new export for Instead I'll set up |
I think the neatest way to run this may be to have the export endpoint make an internal call to the |
Here's the code I wrote for simulating an internal request to vial/vaccinate/core/exporter/__init__.py Lines 43 to 59 in edb24c4
I had to add mechanisms for skipping API logging and skipping JWT auth to get this to work. |
Tests there passed in GitHub Actions but failed in Cloud Build with this error:
|
Testing it by running this:
|
Took a while (I should have timed it) and returned an I tried doing this too:
To trigger the current export code. That also churned for a while before returning an |
Meanwhile running this:
Produced a 31MB https://static.simonwillison.net/static/2021/vial-staging-v0preview-locations.json |
I think I can improve performance a bunch by ditching the internal HTTP request trick, because then I can use the version of the expansion which loads all of the vaccine finder data in one go. |
https://ui.honeycomb.io/vaccinateca/datasets/vial-staging/result/HQwyAyHDYWw/trace/ffunx8PnUTP shows O(n) queries into |
Ah, confusion -- that was a short-term bucket used to test VIAL output when we were cutting over for airtable-export. The api.vaccinateca.com bucket is https://console.cloud.google.com/storage/browser/vaccinateca-api-staging |
I deployed that optimization to production just now. Here's a trace from before the optimization: https://ui.honeycomb.io/vaccinateca/datasets/vial-production/result/AEe2VaC1rDj/trace?trace_id=a23d6760ad921e1a9ae3777af8b183f2 - took 123 seconds and ran probably around 65,000 SQL queries (one per returned location). |
After deploying the optimization:
65s. Still a lot of traces, because I'm running a query per batch of 100 returned rows - and it returns 68,000 rows so likely executes 680 queries. Trace: https://ui.honeycomb.io/vaccinateca/datasets/vial-production/result/nT4E1WMMrGE/trace/pXbDF1yRMBq
I'm tempted to bump the default batch size up to 1000 here: vial/vaccinate/api/serialize.py Lines 27 to 29 in 7386fc8
|
Still took 63s - from this trace https://ui.honeycomb.io/vaccinateca/datasets/vial-production/result/wesawhore23/trace/4mmgAJNkwEE it's clear that actually it's the |
The new published API is at https://api.vaccinatethestates.com/v0/locations.json |
Work on this started in #392 but that's about a standard JSON representation, this is specifically about building our first v0 export of all locations (not just CA ones) which is on a tight deadline.
Originally posted by @simonw in #392 (comment)
The text was updated successfully, but these errors were encountered: