Skip to content

feat(framework): Enable FastAPI to manage SuperLinkLifespan#7453

Draft
danieljanes wants to merge 49 commits into
introduce-superlinklifespanfrom
add-fastapi-scaffold
Draft

feat(framework): Enable FastAPI to manage SuperLinkLifespan#7453
danieljanes wants to merge 49 commits into
introduce-superlinklifespanfrom
add-fastapi-scaffold

Conversation

@danieljanes

@danieljanes danieljanes commented Jun 21, 2026

Copy link
Copy Markdown
Member

Merge after #7499

Copilot AI review requested due to automatic review settings June 21, 2026 09:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an initial FastAPI-based HTTP API scaffold for SuperLink/SuperNode within framework/py/flwr, along with dependency updates to support running these apps via uvicorn.

Changes:

  • Add FastAPI app entrypoints for SuperLink and SuperNode, wiring in new router modules (health/control/runtime).
  • Update rest optional dependencies to include FastAPI (and bump Starlette/Uvicorn versions), and refresh uv.lock.
  • Add a short FASTAPI.md with install/run instructions.

Critical issues

  • Stub endpoints currently return HTTP 200 with a "not_implemented" body; they should return an HTTP error status (e.g., 501) so clients/tooling don’t treat these as successful responses. (PR comments: IDs 003–005)
  • FastAPI(..., version="1.32.0") is hard-coded in both apps and can drift from flwr.__version__. (PR comments: IDs 001–002)

Simplicity/readability suggestions

  • rest now depends on fastapi[standard], which pulls in significant transitive tooling not used by the scaffold in this PR; consider depending on plain fastapi (or splitting into a separate extra) to keep the optional dependency footprint smaller. (PR comment: ID 006)

Consistency concerns

  • framework/FASTAPI.md uses uv sync --all-extras; other framework docs recommend uv sync --locked ... for reproducible installs. (PR comment: ID 007)

Whether the PR should be split

No—these changes are all in service of introducing the FastAPI scaffold and its dependency/docs wiring.

Overall verdict

Changes are needed before approval.

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
framework/uv.lock Locks new REST/FastAPI dependency set (FastAPI, updated Starlette/Uvicorn, transitive deps).
framework/pyproject.toml Updates rest optional dependencies to include FastAPI and newer Starlette/Uvicorn pins.
framework/py/flwr/supercore/routers/__init__.py Introduces core router package for shared endpoints.
framework/py/flwr/supercore/routers/health/__init__.py Exposes the health router.
framework/py/flwr/supercore/routers/health/router.py Adds /health endpoint router.
framework/py/flwr/superlink/main.py Adds SuperLink FastAPI app and includes routers.
framework/py/flwr/superlink/routers/__init__.py Introduces SuperLink router package.
framework/py/flwr/superlink/routers/control/__init__.py Exposes the control router.
framework/py/flwr/superlink/routers/control/router.py Adds stub control route(s).
framework/py/flwr/superlink/routers/runtime/__init__.py Exposes the runtime router.
framework/py/flwr/superlink/routers/runtime/router.py Adds stub runtime route(s).
framework/py/flwr/supernode/main.py Adds SuperNode FastAPI app and includes routers.
framework/py/flwr/supernode/routers/__init__.py Introduces SuperNode router package.
framework/py/flwr/supernode/routers/runtime/__init__.py Exposes the runtime router.
framework/py/flwr/supernode/routers/runtime/router.py Adds stub runtime route(s).
framework/FASTAPI.md Adds install/run instructions for the new FastAPI apps.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread framework/py/flwr/superlink/main.py Outdated
Comment thread framework/py/flwr/supernode/main.py Outdated
Comment thread framework/py/flwr/superlink/routers/control/router.py Outdated
Comment thread framework/py/flwr/superlink/routers/runtime/router.py Outdated
Comment thread framework/py/flwr/supernode/routers/runtime/router.py Outdated
Comment thread framework/pyproject.toml
Comment on lines +71 to +75
rest = [
"starlette>=1.3.1,<1.4.0",
"uvicorn[standard]>=0.49.0,<0.50.0",
"fastapi[standard]>=0.138.0,<0.139.0",
]
Comment thread framework/FASTAPI.md Outdated
@github-actions github-actions Bot added the Maintainer Used to determine what PRs (mainly) come from Flower maintainers. label Jun 21, 2026
danieljanes and others added 20 commits June 21, 2026 11:23
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@danieljanes danieljanes changed the base branch from main to mv-cli-entrypoints June 24, 2026 07:57
Base automatically changed from mv-cli-entrypoints to main June 25, 2026 15:50
@danieljanes danieljanes changed the title feat(framework): Add FastAPI scaffold feat(framework): Add FastAPI prototype Jun 26, 2026
@danieljanes danieljanes changed the base branch from main to create-superlink-lifespan-config June 27, 2026 10:58
@danieljanes danieljanes changed the base branch from create-superlink-lifespan-config to introduce-superlinklifespan June 27, 2026 12:35
@danieljanes danieljanes changed the title feat(framework): Add FastAPI prototype feat(framework): Enable FastAPI to manage SuperLinkLifespan Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Used to determine what PRs (mainly) come from Flower maintainers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants