flip_api.db.seed.fl_nets
Attributes
Functions
|
Upsert FL nets in the database from |
Module Contents
- flip_api.db.seed.fl_nets.seed_fl_nets(session: sqlmodel.Session) list[flip_api.db.models.main_models.FLNets]
Upsert FL nets in the database from
NET_ENDPOINTSandFL_BACKEND.Rows are matched by
nameand theirendpointreconciled to the value inNET_ENDPOINTSon every startup. The previous behaviour was insert-only and skipped on name conflict, which silently stranded stale endpoints after the EC2-compose → ECS Cloud Map migration (rows seeded with the old http://flip-fl-api-net-1:8000 docker-compose hostname survived alongside the new http://fl-api-net-1.flip.local:8000 service discovery URL in the env, breaking /api/fl/status with Name or service not known). NET_ENDPOINTS is the canonical source — operator changes to the row’s endpoint via SQL would also be overwritten on the next start, which is the intended behaviour.fl_backendis likewise canonical: every row is set to the currentFL_BACKENDon every startup. There is no runtime reconciliation — the way to switch frameworks ismake restart-fl FL_BACKEND=..., which recreates flip-api so this seeding re-runs and overwrites the backend.- Parameters:
session (Session) – The SQLModel session used to read existing FL nets and upsert entries from
NET_ENDPOINTS.- Returns:
All FL net rows present after seeding.
- Return type:
list[FLNets]
- flip_api.db.seed.fl_nets.nets