Skip to content

Commit

Permalink
fix: improve the bentoml build progress (#4582)
Browse files Browse the repository at this point in the history
* fix: make the bentoml build progress more visible

Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Mar 15, 2024
1 parent 9d3f677 commit 4909488
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/bentoml/_internal/bento/build_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from ...exceptions import InvalidArgument
from ..configuration import BENTOML_VERSION
from ..configuration import clean_bentoml_version
from ..configuration import get_debug_mode
from ..configuration import get_quiet_mode
from ..container import generate_containerfile
from ..container.frontend.dockerfile import ALLOWED_CUDA_VERSION_ARGS
Expand Down Expand Up @@ -654,14 +655,17 @@ def write_to_bento(self, bento_fs: FS, build_ctx: str) -> None:
pip_compile_args.extend(pip_compile_compat)
pip_compile_args.extend(
[
"--quiet",
"--allow-unsafe",
"--no-header",
f"--output-file={pip_compile_out}",
"--resolver=backtracking",
"--no-annotate",
]
)
if get_quiet_mode():
pip_compile_args.append("--quiet")
elif get_debug_mode():
pip_compile_args.append("--verbose")
logger.info("Locking PyPI package versions.")
cmd = [sys.executable, "-m", "piptools", "compile"]
cmd.extend(pip_compile_args)
Expand Down Expand Up @@ -903,9 +907,10 @@ class BentoPathSpec:
_exclude: PathSpec = attr.field(
converter=lambda x: PathSpec.from_lines("gitwildmatch", x)
)
# we want to ignore .git folder in cases the .git folder is very large.
git: PathSpec = attr.field(
default=PathSpec.from_lines("gitwildmatch", [".git"]), init=False
# we want to ignore .git and venv folders in cases they are very large.
extra: PathSpec = attr.field(
default=PathSpec.from_lines("gitwildmatch", [".git/", ".venv/", "venv/"]),
init=False,
)

def includes(
Expand All @@ -919,7 +924,7 @@ def includes(
to_include = (
self._include.match_file(path)
and not self._exclude.match_file(path)
and not self.git.match_file(path)
and not self.extra.match_file(path)
)
if to_include:
if recurse_exclude_spec is not None:
Expand Down

0 comments on commit 4909488

Please sign in to comment.