SFMS: Provide Daily FWI endpoint#5573
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5573 +/- ##
==========================================
+ Coverage 67.26% 67.38% +0.11%
==========================================
Files 382 384 +2
Lines 22688 22811 +123
Branches 3107 3112 +5
==========================================
+ Hits 15262 15371 +109
- Misses 6256 6267 +11
- Partials 1170 1173 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
Why the rename of aps-publish to gw-config-publish? I find the new naming a bit confusing, being so similar to gwa-publish. In my mind gwa-publish installs/runs gwa, while aps-publish tied it together for the higher level APS flow. Could we keep the aps-publish name and just generalize the inputs instead?
| "${OUTPUT_DIR}" | ||
|
|
||
| - name: Apply SFMS FWI dataset and product | ||
| uses: ./.github/actions/gwa-apply |
There was a problem hiding this comment.
The gwa-apply custom action is only used once here, do you think it's worth having a custom action for?
Side note: I think in our workflows we're now installing the gwa cli 3 times. Maybe we should just install it once as an explicit step?
| ], | ||
| ): | ||
| """Download the daily FWI actuals raster for the given date and parameter.""" | ||
| key = _addresser.get_calculated_index_key(datetime(for_date.year, for_date.month, for_date.day, tzinfo=timezone.utc), parameter, RunType.ACTUAL) |
There was a problem hiding this comment.
These endpoints are getting the incorrect data, they need to be getting data from the current SFMS
| col = int((x - geotransform[0]) / geotransform[1]) | ||
| row = int((y - geotransform[3]) / geotransform[5]) |
There was a problem hiding this comment.
| col = int((x - geotransform[0]) / geotransform[1]) | |
| row = int((y - geotransform[3]) / geotransform[5]) | |
| inverse_geotransform = gdal.InvGeoTransform(geotransform) | |
| pixel_x, pixel_y = gdal.ApplyGeoTransform(inverse_geotransform, x, y) | |
| col = math.floor(pixel_x) | |
| row = math.floor(pixel_y) |
There was a problem hiding this comment.
We might want to do something like to avoid returning values from pixels that are just fractionally outside the raster
| suffix: ${{ env.SUFFIX }} | ||
| qualifier-prefix: fwi- | ||
|
|
||
| - name: Publish SFMS FWI dataset and product to test API Directory |
There was a problem hiding this comment.
Useful for testing to see the dataset/product this time for sure, but do you think we want this regularly? I think this will list every PR we have as a dataset and product in the API Directory
There was a problem hiding this comment.
It might be worth adding something to launch.json so we can easily run the SFMS api locally



Adds
/api/sfms/daily-fwiendpoints to download SFMS daily FWI actuals rasters (FFMC, DMC, DC, ISI, FWI, BUI) and hourly FFMC rasters, and to query raster values by lat/lon.Endpoints
GET/api/sfms/daily-fwi/{date}/{parameter}GET/api/sfms/daily-fwi/{date}/hffmc?hour=GET/api/sfms/daily-fwi/{date}/{parameter}/value?lat=&lon=GET/api/sfms/daily-fwi/{date}/hffmc/value?hour=&lat=&lon=Endpoints are open at the Python level and protected via the BC Government APS gateway (Kong
key-authplugin, 60 req/min rate limit per consumer) consumers register for an API key through the APS portal rather than using a Keycloak IDIR token. Public URL:psu.api.gov.bc.ca/api/sfms/daily-fwi/....Standalone service (not publicly exposed)
The daily FWI routes are served by a dedicated
wps-sfms-fwi-apideployment rather than the main API:app/sfms_fwi_main.py— separate FastAPI entrypoint including only thesfms_fwirouter; the shared API image selects it via theAPP_MODULEenv var. The main API no longer serves these routes (guarded by a test).openshift/templates/sfms_fwi_api.yaml— Deployment + ClusterIP Service with no Route; the only ingress is a NetworkPolicy allowing the APS gateway namespace (allow_gateway_to_wps_sfms_fwi_api.yaml). Uses the same Crunchy DB credentials as the other API pods so startup migrations work.object_store_proxy._proxymethod for raster streaming.CI / gateway publishing
publish-aps-gateway-devjob (depending on both) publishes gateway config, so Kong never routes to a not-yet-deployed upstream.gw-config-publishcomposite action consolidates the two previous publish actions; render scripts standardized onGW_HOST. Gateway configs publish under independent qualifiers (pr-N/prodfor ASA Go,fwi-pr-N/fwi-prodfor SFMS FWI) and are pruned on PR cleanup.gwa apply.Closes #5502
Test Links:
Landing Page
MoreCast
Percentile Calculator
C-Haines
FireCalc
FireCalc bookmark
Auto Spatial Advisory (ASA)
HFI Calculator
SFMS Insights
Fire Watch
Weather Toolkit