Skip to content

Fastapi conversion#2071

Draft
bfoley12 wants to merge 175 commits into
devfrom
fastapi-conversion
Draft

Fastapi conversion#2071
bfoley12 wants to merge 175 commits into
devfrom
fastapi-conversion

Conversation

@bfoley12

@bfoley12 bfoley12 commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

Start of major rewrite of the API server to FastAPI and other modern frameworks (pydantic, Beanie, etc.)

This PR is the essential groundwork of the rewrite. However, further PRs are necessary for full functionality.

Major TODOs after this PR

  • Downloads
    • This involves infra design to push data from Contributions and Components into S3 as parquet (maybe delta tables if it goes that far)
  • Unit normalization (Pint/Unyt)
    • Also entails making input data formatted strings, then internally parsing the formats into better representations (objects) before storage
  • Greatly expand telemetry

Minor TODOs after this PR:

  • Add indices to Beanie models
  • Remove notebooks
  • Remove CIF
  • Email notifications

@bfoley12 bfoley12 self-assigned this Jun 16, 2026
@bfoley12 bfoley12 added this to the API Server Rewrite milestone Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing jupyter and local datadog reference

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing jupyter and local datadog reference

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruff formatting

Comment thread mpcontribs-api/gunicorn.conf.py Outdated

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fastapi uses uvicorn

Comment thread mpcontribs-api/justfile

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Convenient command runner

Comment thread mpcontribs-api/Dockerfile

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switch from pip building to uv.
!! Needs further verification

Comment thread mpcontribs-api/main.py

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ruff formatting

Comment thread mpcontribs-api/maintenance.py Outdated

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using MongoEngine.
!! Still need to implement unit checks, but will be outside of this scope

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgrade python to 3.14; move to uv, ruff, and basedpyright; removed outdated/unnecessary packages

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the base stack is still at python 3.11

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I have a note in the Dockerfile about requiring a 3.14 image build - I assumed it would be a good time to bump our python version and use up to date package versions.
Do you think this should be in the scope of the rewrite?

bfoley12 added 30 commits June 18, 2026 12:18
…ser - users can no longer operate on components that their contributions dontown
…from Document instead of DocumentWithSoftDelet
…eporting the successes and failures via BulkWriteSummary
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.

2 participants