Skip to content

fix: add /app/.venv/bin to PATH to support Kubernetes exec-style entrypoints #5315

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

Merged
merged 1 commit into from
Apr 11, 2025

Conversation

restato
Copy link
Contributor

@restato restato commented Apr 10, 2025

What does this PR address?

This PR fixes an issue where BentoML containers fail to start in Kubernetes when using an exec-style entrypoint like:

command: ["bentoml", "serve"]

The failure occurs because the bentoml CLI binary is installed inside a virtual environment at /app/.venv/bin, which is not included in the default $PATH. While the binary is available interactively (e.g., via kubectl exec), it is not found during container startup using Kubernetes command: override.

This PR updates the Dockerfile generation logic to include /app/.venv/bin in the $PATH by injecting it through the bento__envs mechanism. This ensures that the Bento container works seamlessly with Kubernetes-style overrides.

Fixes

Fixes #5310

Before submitting:

@restato restato requested a review from a team as a code owner April 10, 2025 14:12
@restato restato requested review from ssheng and removed request for a team April 10, 2025 14:12
@aarnphm aarnphm merged commit 316d60c into bentoml:main Apr 11, 2025
51 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.

bug: bentoml not found when using command: ["bentoml"] due to missing venv path in $PATH
3 participants