test: cover custom base_image without python_version (#5198)#5629
Open
Bharath-970 wants to merge 1 commit into
Open
test: cover custom base_image without python_version (#5198)#5629Bharath-970 wants to merge 1 commit into
Bharath-970 wants to merge 1 commit into
Conversation
A custom docker base_image with no python_version must not generate `uv venv -p None`, which crashes `bentoml containerize`, and uv must be auto-installed rather than assumed present on the base image. Add a regression test over the generated Dockerfile guarding this behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a regression test for the Dockerfile generation path used by custom
base_image.What
When a custom
docker.base_imageis set without apython_version,generate_containerfilemust not emituv venv -p None(which crashesbentoml containerize), anduvmust be auto-installed rather than assumed present on the base image.This behavior is currently correct on
main(thebase.j2template guards-pbehind{% if __options__python_version %}and runscommand -v uv >/dev/null || pip install uv), but it was not covered by a test — the scenario originally reported in #5198.Test
test_generate_containerfile_custom_base_image_without_python_versionrenders the containerfile forDockerOptions(base_image=...)(wherepython_versiondefaults toNone) and asserts:uv venvis present-p None/--python Noneare absentuvis auto-installed (command -v uv >/dev/null || pip install uv)Verified as a true regression guard: it fails if the
{% if %}guard inbase.j2is removed, and passes with it intact. Full file passes:Closes #5198.