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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Dockerfile.agent
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ ARG VERSION
RUN apt-get update && apt-get install build-essential -y \
&& pip install uv

RUN uv pip install --system --no-cache-dir -U flytekit==$VERSION \
RUN uv pip install --system --no-cache-dir -U flytekit[agent]==$VERSION \
flytekitplugins-airflow==$VERSION \
flytekitplugins-bigquery==$VERSION \
flytekitplugins-k8sdataservice==$VERSION \
flytekitplugins-openai==$VERSION \
flytekitplugins-snowflake==$VERSION \
flytekitplugins-awssagemaker==$VERSION \
prometheus-client \
grpcio-health-checking \
&& apt-get clean autoclean \
&& apt-get autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/ \
Expand Down
10 changes: 7 additions & 3 deletions flytekit/clis/sdk_in_container/serve.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def agent(_: click.Context, port, prometheus_port, worker, timeout, modules):
"""
import asyncio

from flytekit.extras.webhook import WebhookTask # noqa: F401

working_dir = os.getcwd()
if all(os.path.realpath(path) != working_dir for path in sys.path):
sys.path.append(working_dir)
Expand All @@ -80,7 +78,13 @@ def agent(_: click.Context, port, prometheus_port, worker, timeout, modules):


async def _start_grpc_server(port: int, prometheus_port: int, worker: int, timeout: int):
from flytekit.extend.backend.agent_service import AgentMetadataService, AsyncAgentService, SyncAgentService
try:
from flytekit.extend.backend.agent_service import AgentMetadataService, AsyncAgentService, SyncAgentService
from flytekit.extras.webhook import WebhookAgent # noqa: F401 Webhook Agent Registration
except ImportError as e:
raise ImportError(
"Flyte agent dependencies are not installed. Please install it using `pip install flytekit[agent]`"
) from e

click.secho("🚀 Starting the agent service...")
_start_http_server(prometheus_port)
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,10 @@ extend-exclude = ["tests/", "**/tests/**"]
[tool.codespell]
ignore-words-list = "ot,te,raison,fo,lits,assertIn"
skip = "./docs/build,./.git,*.txt"

[project.optional-dependencies]
agent = [
"grpcio-health-checking<=1.68.0",
"httpx",
"prometheus-client",
]
Loading