Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add module loading support to pyflyte serve #3147

Merged
merged 6 commits into from
Feb 20, 2025
Merged

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Feb 19, 2025

Tracking issue

NA

Why are the changes needed?

Add support loading the module while running the agent server so that users don't need to publish their plugin to Pypi

What changes were proposed in this pull request?

Add new option --modules to pyflyte serve

How was this patch tested?

pyflyte serve agent --modules agent

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

NA

Docs link

NA

Summary by Bito

This PR enhances both PyFlyte serve functionality and Flytekit core features. It introduces a new --modules option for dynamic module loading without PyPI publication, while also implementing comprehensive improvements including enhanced caching system, strict type matching, improved error handling, and worker queue management. Additional features include shared memory support, improved launch plan handling, and standardized plugin outputs.

Unit tests added: True

Estimated effort to review (1-5, lower is better): 5

@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 19, 2025

Code Review Agent Run #ff1a1e

Actionable Suggestions - 1
  • flytekit/clis/sdk_in_container/serve.py - 1
    • Consider adding error handling for imports · Line 74-75
Review Details
  • Files reviewed - 1 · Commit Range: 8a269d7..c4ac1a3
    • flytekit/clis/sdk_in_container/serve.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

Copy link

codecov bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.84%. Comparing base (80ddcda) to head (321b89e).
Report is 3 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (80ddcda) and HEAD (321b89e). Click for more details.

HEAD has 24 uploads less than BASE
Flag BASE (80ddcda) HEAD (321b89e)
25 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3147       +/-   ##
===========================================
- Coverage   92.24%   76.84%   -15.40%     
===========================================
  Files         118      206       +88     
  Lines        4991    21851    +16860     
  Branches        0     2837     +2837     
===========================================
+ Hits         4604    16792    +12188     
- Misses        387     4270     +3883     
- Partials        0      789      +789     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 19, 2025

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Enhanced Module Loading in PyFlyte Serve

serve.py - Added module loading support with new --modules option for dynamic plugin loading

test_remote.py - Increased timeout duration from 5 to 15 minutes in remote execution tests

Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 20, 2025

Code Review Agent Run #8d6a5c

Actionable Suggestions - 0
Additional Suggestions - 10
  • flytekit/core/python_auto_container.py - 1
    • Consider adding shared memory validation · Line 55-55
  • tests/flytekit/integration/remote/workflows/basic/deep_child_workflow.py - 1
    • Consider using constant for label key · Line 20-30
  • tests/flytekit/unit/interaction/test_string_literals.py - 1
    • Consider adding error handling test case · Line 89-90
  • flytekit/core/task.py - 2
  • flytekit/clis/sdk_in_container/run.py - 1
  • tests/flytekit/unit/core/test_cache.py - 2
    • Consider parameterizing similar test cases · Line 72-103
    • Consider consolidating duplicate test cases · Line 158-166
  • flytekit/remote/remote.py - 2
Review Details
  • Files reviewed - 56 · Commit Range: c4ac1a3..67a7655
    • flytekit/__init__.py
    • flytekit/clis/sdk_in_container/init.py
    • flytekit/clis/sdk_in_container/run.py
    • flytekit/configuration/plugin.py
    • flytekit/core/cache.py
    • flytekit/core/constants.py
    • flytekit/core/node.py
    • flytekit/core/promise.py
    • flytekit/core/python_auto_container.py
    • flytekit/core/python_function_task.py
    • flytekit/core/resources.py
    • flytekit/core/task.py
    • flytekit/core/type_engine.py
    • flytekit/core/type_match_checking.py
    • flytekit/core/worker_queue.py
    • flytekit/core/workflow.py
    • flytekit/interaction/click_types.py
    • flytekit/interaction/string_literals.py
    • flytekit/loggers.py
    • flytekit/models/core/workflow.py
    • flytekit/models/execution.py
    • flytekit/models/task.py
    • flytekit/remote/data.py
    • flytekit/remote/remote.py
    • flytekit/utils/rate_limiter.py
    • plugins/flytekit-aws-sagemaker/flytekitplugins/awssagemaker_inference/boto3_agent.py
    • plugins/flytekit-aws-sagemaker/tests/test_boto3_agent.py
    • plugins/flytekit-greatexpectations/tests/test_schema.py
    • plugins/flytekit-onnx-pytorch/dev-requirements.txt
    • plugins/flytekit-openai/flytekitplugins/openai/batch/agent.py
    • plugins/flytekit-openai/tests/openai_batch/test_agent.py
    • plugins/flytekit-pandera/flytekitplugins/pandera/pandas_transformer.py
    • plugins/flytekit-pandera/setup.py
    • plugins/flytekit-ray/flytekitplugins/ray/task.py
    • plugins/flytekit-ray/tests/test_ray.py
    • pyproject.toml
    • tests/flytekit/integration/remote/test_remote.py
    • tests/flytekit/integration/remote/workflows/basic/dataclass_wf.py
    • tests/flytekit/integration/remote/workflows/basic/deep_child_workflow.py
    • tests/flytekit/unit/bin/test_python_entrypoint.py
    • tests/flytekit/unit/cli/pyflyte/test_run.py
    • tests/flytekit/unit/cli/pyflyte/test_run_lps.py
    • tests/flytekit/unit/core/test_array_node_map_task.py
    • tests/flytekit/unit/core/test_cache.py
    • tests/flytekit/unit/core/test_node_creation.py
    • tests/flytekit/unit/core/test_resources.py
    • tests/flytekit/unit/core/test_type_engine.py
    • tests/flytekit/unit/core/test_type_match_checking.py
    • tests/flytekit/unit/core/test_worker_queue.py
    • tests/flytekit/unit/interaction/test_click_types.py
    • tests/flytekit/unit/interaction/test_string_literals.py
    • tests/flytekit/unit/models/core/test_workflow.py
    • tests/flytekit/unit/models/test_execution.py
    • tests/flytekit/unit/models/test_tasks.py
    • tests/flytekit/unit/types/structured_dataset/test_structured_dataset.py
    • tests/flytekit/unit/utils/test_rate_limiter.py
  • Files skipped - 4
    • .github/workflows/build_image.yml - Reason: Filter setting
    • .github/workflows/pythonbuild.yml - Reason: Filter setting
    • .github/workflows/pythonpublish.yml - Reason: Filter setting
    • .gitignore - Reason: Filter setting
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful

AI Code Review powered by Bito Logo

@Future-Outlier Future-Outlier merged commit 9acab29 into master Feb 20, 2025
110 checks passed
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.

3 participants