Skip to content

feat(framework): Add runtime dependency installation option#6741

Merged
danieljanes merged 24 commits intomainfrom
runtime-dependency-installation
Apr 9, 2026
Merged

feat(framework): Add runtime dependency installation option#6741
danieljanes merged 24 commits intomainfrom
runtime-dependency-installation

Conversation

@psfoley
Copy link
Copy Markdown
Member

@psfoley psfoley commented Mar 11, 2026

No description provided.

psfoley added 3 commits March 10, 2026 16:54
…t, and ability to limit to a local pypi repo with --index-url argument. Creates an ephemeral virtual environment for each run, and cleans it up after execution

Signed-off-by: Patrick Foley <patrick@flower.ai>
Signed-off-by: Patrick Foley <patrick@flower.ai>
Signed-off-by: Patrick Foley <patrick@flower.ai>
Copilot AI review requested due to automatic review settings March 11, 2026 00:04
@psfoley psfoley requested a review from jafermarq as a code owner March 11, 2026 00:04
@psfoley psfoley marked this pull request as draft March 11, 2026 00:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 opt-in mechanism for installing application dependencies at runtime (via uv sync) and threads the corresponding CLI/config options through SuperNode/SuperExec and the various flwr-* app processes.

Changes:

  • Introduces --allow-runtime-dependency-installation and propagates it through SuperLink/SuperNode/SuperExec process launching.
  • Adds a new dependency_installer utility to create/activate a per-run/per-launch runtime environment and install dependencies via uv.
  • Updates ClientApp/ServerApp/Simulation processes to optionally install dependencies and clean up the runtime environment on exit.

Reviewed changes

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

Show a summary per file
File Description
framework/py/flwr/supernode/start_client_internal.py Forwards runtime dependency install flags to the flower-superexec subprocess.
framework/py/flwr/supernode/runtime/run_clientapp.py Optionally installs app dependencies before loading/running the ClientApp and cleans up on exit.
framework/py/flwr/supernode/cli/flwr_clientapp.py Passes new runtime dependency install parameters into run_clientapp/superexec wrapper.
framework/py/flwr/supernode/cli/flower_supernode.py Adds parsing/forwarding of runtime dependency installation CLI args for SuperNode.
framework/py/flwr/supercore/superexec/run_superexec.py Plumbs index_url/runtime_dependency_install into plugin construction and deprecation log output.
framework/py/flwr/supercore/superexec/plugin/exec_plugin.py Extends ExecPlugin to store index_url and runtime install toggle.
framework/py/flwr/supercore/superexec/plugin/base_exec_plugin.py Adds forwarding of runtime install flags when launching app subprocesses.
framework/py/flwr/supercore/superexec/dependency_installer.py New module implementing uv installation, dependency sync, env activation, and cleanup.
framework/py/flwr/supercore/cli/flower_superexec.py Adds runtime dependency installation CLI args to flower-superexec.
framework/py/flwr/simulation/app.py Optionally installs simulation app dependencies and cleans up runtime env on exit.
framework/py/flwr/server/serverapp/app.py Optionally installs server app dependencies and cleans up runtime env on exit.
framework/py/flwr/server/app.py Forwards runtime dependency install flags when spawning flower-superexec in subprocess isolation mode.
framework/py/flwr/common/constant.py Adds RUNTIME_DEPENDENCY_INSTALL default toggle constant.
framework/py/flwr/common/args.py Introduces shared CLI arg helper add_args_runtime_dependency_install and includes it in common app args.
framework/py/flwr/cli/log.py Changes log streaming loop behavior (notably error handling wrapper removal).

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread framework/py/flwr/cli/log.py Outdated
Comment thread framework/py/flwr/supercore/superexec/dependency_installer.py
Comment thread framework/py/flwr/supercore/superexec/dependency_installer.py Outdated
Comment thread framework/py/flwr/supercore/superexec/dependency_installer.py
Comment thread framework/py/flwr/supercore/superexec/dependency_installer.py
Comment thread framework/py/flwr/supercore/superexec/run_superexec.py Outdated
Comment thread framework/py/flwr/supercore/superexec/dependency_installer.py Outdated
@github-actions github-actions Bot added the Maintainer Used to determine what PRs (mainly) come from Flower maintainers. label Mar 11, 2026
@psfoley psfoley marked this pull request as ready for review March 12, 2026 22:17
@psfoley psfoley changed the title feat(framework): runtime dependency installation option feat(framework): Add runtime dependency installation option Mar 12, 2026
Signed-off-by: Patrick Foley <patrick@flower.ai>
Comment thread framework/py/flwr/supercore/superexec/dependency_installer.py Outdated
Signed-off-by: Patrick Foley <patrick@flower.ai>
Comment thread framework/py/flwr/cli/log.py
Comment thread framework/py/flwr/supercore/superexec/dependency_installer.py
Comment thread framework/py/flwr/supercore/superexec/dependency_installer.py
Co-authored-by: Javier <jafermarq@users.noreply.github.com>
psfoley and others added 7 commits April 8, 2026 09:57
…d on provided flag

Signed-off-by: Patrick Foley <patrick@flower.ai>
Signed-off-by: Patrick Foley <patrick@flower.ai>
Signed-off-by: Patrick Foley <patrick@flower.ai>
…dependencies are needed, also report that

Signed-off-by: Patrick Foley <patrick@flower.ai>
Signed-off-by: Patrick Foley <patrick@flower.ai>
jafermarq
jafermarq previously approved these changes Apr 8, 2026
jafermarq
jafermarq previously approved these changes Apr 9, 2026
danieljanes
danieljanes previously approved these changes Apr 9, 2026
@danieljanes danieljanes enabled auto-merge (squash) April 9, 2026 17:19
@jafermarq jafermarq dismissed stale reviews from danieljanes and themself via b7b836a April 9, 2026 17:30
@danieljanes danieljanes merged commit e1b78d2 into main Apr 9, 2026
70 checks passed
@danieljanes danieljanes deleted the runtime-dependency-installation branch April 9, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants