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 httpx dependency for webhook agent in flytekit dependency #3158

Merged
merged 10 commits into from
Feb 27, 2025

Conversation

Future-Outlier
Copy link
Member

@Future-Outlier Future-Outlier commented Feb 26, 2025

Tracking issue

Why are the changes needed?

we want to enable user to install agent in flytekit by pip install flytekit[agent].

What changes were proposed in this pull request?

How was this patch tested?

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

Docs link

Summary by Bito

This PR includes two main components: 1) Restructuring Flytekit's dependency management by moving httpx and other dependencies to the optional 'agent' extras package, improving webhook agent functionality and error handling. 2) Enhancing FlyteTask configuration with support for security context, kubernetes pod settings, SQL configurations, and extended resources, along with improved testing framework.

Unit tests added: True

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

@Future-Outlier Future-Outlier changed the title add httpx dependency for webhook agent in default flytekit add httpx dependency for webhook agent in flytekit dependency Feb 26, 2025
@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 26, 2025

Code Review Agent Run #2de2f5

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 2ad2f28..2ad2f28
    • pyproject.toml
  • 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

@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 26, 2025

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Dependency Management Restructuring

Dockerfile.agent - Moved prometheus-client and grpcio-health-checking to agent extras, updated flytekit installation

pyproject.toml - Added new optional dependencies section for agent-specific packages

serve.py - Added graceful error handling for missing agent dependencies and reorganized imports

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.58%. Comparing base (2e12f43) to head (d4a7398).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3158   +/-   ##
=======================================
  Coverage   83.58%   83.58%           
=======================================
  Files           3        3           
  Lines         195      195           
=======================================
  Hits          163      163           
  Misses         32       32           

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

@Future-Outlier Future-Outlier enabled auto-merge (squash) February 26, 2025 03:22
@Future-Outlier
Copy link
Member Author

before (httpx not installed, not webhook agent)
image
after (httpx not installed, have webhook agent)

image image

@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 27, 2025

Code Review Agent Run #bddc3a

Actionable Suggestions - 1
  • pyproject.toml - 1
    • Consider adding version constraints for dependencies · Line 153-154
Review Details
  • Files reviewed - 2 · Commit Range: 2ad2f28..4dfd84d
    • flytekit/clis/sdk_in_container/serve.py
    • pyproject.toml
  • 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

pyproject.toml Outdated
Comment on lines 153 to 154
"httpx",
]
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding version constraints for dependencies

Consider adding version constraints to the httpx dependency in the optional dependencies section. This helps ensure compatibility and reproducible builds.

Code suggestion
Check the AI-generated fix before applying
Suggested change
"httpx",
]
"httpx>=0.24.0",
]

Code Review Run #bddc3a


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
Signed-off-by: Future-Outlier <[email protected]>
@Future-Outlier Future-Outlier enabled auto-merge (squash) February 27, 2025 07:25
@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 27, 2025

Code Review Agent Run #e0c684

Actionable Suggestions - 4
  • pyproject.toml - 3
    • Consider more specific version constraint · Line 153-153
    • Consider more specific version constraint · Line 153-153
    • Consider adding version constraint for prometheus-client · Line 155-155
  • flytekit/clis/sdk_in_container/serve.py - 1
    • Consider extracting import error handling · Line 81-87
Review Details
  • Files reviewed - 3 · Commit Range: 4dfd84d..e00bab3
    • Dockerfile.agent
    • flytekit/clis/sdk_in_container/serve.py
    • pyproject.toml
  • 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

@Future-Outlier Future-Outlier merged commit 43a940f into master Feb 27, 2025
113 of 114 checks passed
@flyte-bot
Copy link
Contributor

flyte-bot commented Feb 27, 2025

Code Review Agent Run #727732

Actionable Suggestions - 0
Additional Suggestions - 1
  • tests/flytekit/unit/remote/test_remote.py - 1
    • Consider reordering mock parameters for clarity · Line 864-864
Review Details
  • Files reviewed - 3 · Commit Range: e00bab3..d4a7398
    • flytekit/remote/entities.py
    • plugins/flytekit-spark/tests/test_remote_register.py
    • tests/flytekit/unit/remote/test_remote.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

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.

4 participants