Skip to content

Commit

Permalink
fix: use a specific manylinux version as build platform for better co…
Browse files Browse the repository at this point in the history
…mpatibility (#5185)

* fix: use a specific manylinux version as build platform for better compatibility

Signed-off-by: Frost Ming <[email protected]>
  • Loading branch information
frostming authored Jan 16, 2025
1 parent 2cc4977 commit 722bdc5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/_bentoml_sdk/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from bentoml._internal.bento.bento import ImageInfo
from bentoml._internal.bento.build_config import BentoBuildConfig
from bentoml._internal.configuration import DEFAULT_LOCK_PLATFORM
from bentoml._internal.configuration import get_bentoml_requirement
from bentoml._internal.configuration import get_debug_mode
from bentoml._internal.configuration import get_quiet_mode
Expand Down Expand Up @@ -132,7 +133,7 @@ def _freeze_python_requirements(self, platform_: str | None = None) -> str:
"Locking packages for x86_64-unknown-linux-gnu. "
"Pass `--platform` option to specify the platform."
)
lock_args.extend(["--python-platform", "linux"])
lock_args.extend(["--python-platform", DEFAULT_LOCK_PLATFORM])
cmd = [sys.executable, "-m", "uv", "pip", "compile", *lock_args]
try:
subprocess.check_call(
Expand Down
3 changes: 2 additions & 1 deletion src/bentoml/_internal/bento/build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from ...exceptions import BentoMLException
from ...exceptions import InvalidArgument
from ..configuration import DEFAULT_LOCK_PLATFORM
from ..configuration import clean_bentoml_version
from ..configuration import get_bentoml_requirement
from ..configuration import get_debug_mode
Expand Down Expand Up @@ -670,7 +671,7 @@ def write_to_bento(
"Locking packages for x86_64-unknown-linux-gnu. "
"Pass `--platform` option to specify the platform."
)
pip_compile_args.extend(["--python-platform", "linux"])
pip_compile_args.extend(["--python-platform", DEFAULT_LOCK_PLATFORM])
cmd = [sys.executable, "-m", "uv", "pip", "compile"]
cmd.extend(pip_compile_args)
try:
Expand Down
2 changes: 2 additions & 0 deletions src/bentoml/_internal/configuration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
CONFIG_OVERRIDE_JSON_ENV_VAR = "BENTOML_CONFIG_OVERRIDES"
# https://github.com/grpc/grpc/blob/master/doc/environment_variables.md
GRPC_DEBUG_ENV_VAR = "GRPC_VERBOSITY"
# The glibc version of python:3.11-slim image
DEFAULT_LOCK_PLATFORM = "x86_64-manylinux_2_36"


def get_bentoml_version() -> str:
Expand Down
18 changes: 18 additions & 0 deletions src/bentoml_cli/bentos.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,27 @@
"x86_64-manylinux_2_17",
"x86_64-manylinux_2_28",
"x86_64-manylinux_2_31",
"x86_64-manylinux_2_32",
"x86_64-manylinux_2_33",
"x86_64-manylinux_2_34",
"x86_64-manylinux_2_35",
"x86_64-manylinux_2_36",
"x86_64-manylinux_2_37",
"x86_64-manylinux_2_38",
"x86_64-manylinux_2_39",
"x86_64-manylinux_2_40",
"aarch64-manylinux_2_17",
"aarch64-manylinux_2_28",
"aarch64-manylinux_2_31",
"aarch64-manylinux_2_32",
"aarch64-manylinux_2_33",
"aarch64-manylinux_2_34",
"aarch64-manylinux_2_35",
"aarch64-manylinux_2_36",
"aarch64-manylinux_2_37",
"aarch64-manylinux_2_38",
"aarch64-manylinux_2_39",
"aarch64-manylinux_2_40",
]


Expand Down

0 comments on commit 722bdc5

Please sign in to comment.