E2.2: cut legacy hardware API, make backend run on SQLite - #69
Draft
RaapTechllc wants to merge 1 commit into
Draft
RaapTechllc wants to merge 1 commit into
RaapTechllc wants to merge 1 commit into
Conversation
Remove the Era 1 benchmarks/hardware_specs/reference_profiles/model_quality models, schemas, seed data and the /benchmarks, /submit, /leaderboard, /hardware, /profiles, /compare, /stats, /models routes. Tables are left in place for the E2.5 drop migration. Make column types portable (JSON with a JSONB variant, generic Uuid, Integer PK variant for SQLite) and add aiosqlite so the API runs without Postgres. Validate VARCHAR lengths in Python so the 422 storage-limit contract holds on both backends, and set submitted_at client-side at microsecond precision so latest-run ordering is deterministic everywhere. Tests pick Postgres when reachable and otherwise a temp SQLite file (MINIBENCH_TEST_DB=auto|postgres|sqlite); the migration replay is Postgres-only and skips on SQLite. Co-authored-by: RaapTechllc <RaapTechllc@users.noreply.github.com>
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.
Second step of the Era 2 cut (plan in #67; frontend half in #68). Backend + docs only. Independent of #68 at the code level; merge in either order.
Deleted
Benchmark,HardwareSpec,ReferenceProfile,ModelQualityand their seed data (HARDWARE_SPECS,REFERENCE_PROFILES,MODEL_QUALITY,SAMPLE_BENCHMARKS)BenchmarkSubmit,BenchmarkResponse,HardwareSpecResponse,ReferenceProfileResponse,ModelQualityResponse,LeaderboardEntry,CompareResponse,StatsResponse/api/v1/{submit,benchmarks,benchmarks/{id},leaderboard,hardware,profiles,compare,stats,models}andcompute_heitest_api.pycases; replaced by three smoke tests asserting the routes and OpenAPI schemas are goneExisting Postgres tables are left in place; the drop migration is E2.5.
SQLite support
models.py:JSON().with_variant(JSONB, "postgresql"), genericUuid,BigInteger().with_variant(Integer, "sqlite")for autoincrement PKsaiosqliteadded torequirements.txt;DATABASE_URL=sqlite+aiosqlite:///./minibench.dbnow works for local devconftest.py:MINIBENCH_TEST_DB=auto|postgres|sqlite(defaultauto: Postgres if reachable, else a temp SQLite file). Rawpsycopg2helpers replaced by SQLAlchemyexecute/table_count. CI still runs Postgres.submitted_atis set client-side at microsecond precision so "latest run wins" ordering is deterministic (SQLite'sCURRENT_TIMESTAMPis second-granular)test_migrations.pyis marked Postgres-only (replays rawALTER TABLESQL)Verification
cd backend && pyteston SQLite: 69 passed, 1 skipped. Postgres run pending CI on this PR.