-
Notifications
You must be signed in to change notification settings - Fork 830
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
bug: bentoml.bentos.build changes the cwd when passing build_ctx #3403
Comments
I believe this is not a bug, as we are aware of this, from this PR #2737. @bojiang iirc the reason for changing the cwd to make the imports order from service.py works correctly. We will have to try importing the service when creating the bento, therefore it is considered as a Maybe we want to fix this behaviour. Probably want to do something under Line 268 in 931dedc
try:
build_config = ...
finally:
restore_cwd But this would be a breaking change? cc @sauyon for thoughts on this as well. |
Maybe some more context: I use wandb and build the bento directly after training it. This leads to wandb failing on finish with an error, due to the cwd being set to the build_ctx directory, which is deleted after building. As a user, this seems odd as there is no indication in build that the cwd is changed. |
Er, this looks like a bug to me; the point of the |
We've discussed this internally and have decided this is indeed a bug that we'd like to fix, but since we now want only one Bento to be loaded per process to work around some limitations of the way we're (ab)using Python to load services, we want to wrap every build in its own process; contribution here is welcome! There would be two changes and it should be pretty straightforward:
|
Describe the bug
After running
bento.bentoml.build
and passing abuild_ctx
argument the cwd is changed to the build_ctx directory.I would have expected to return to cwd set before that after finishing the build.
To reproduce
Expected behavior
No response
Environment
bentoml: 1.0.12
python: 3.9.10
platform: ubuntu (WSL2)
The text was updated successfully, but these errors were encountered: