Skip to content
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

fix: remove chmod install scripts #2830

Merged
merged 11 commits into from
Aug 9, 2022
Merged

fix: remove chmod install scripts #2830

merged 11 commits into from
Aug 9, 2022

Conversation

aarnphm
Copy link
Member

@aarnphm aarnphm commented Jul 28, 2022

Signed-off-by: Aaron Pham 29749331+aarnphm@users.noreply.github.com

What does this PR address?

install.sh and all related scripts generated by BentoML should use bash to run
instead of chmod +x.

Usually chmod +x are not recommended for container application.

Before submitting:

Who can help review?

cc @sauyon

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Jul 28, 2022

Codecov Report

Merging #2830 (70cadcd) into main (2fecb29) will increase coverage by 0.16%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2830      +/-   ##
==========================================
+ Coverage   70.08%   70.25%   +0.16%     
==========================================
  Files         130      116      -14     
  Lines       10153    10190      +37     
==========================================
+ Hits         7116     7159      +43     
+ Misses       3037     3031       -6     
Impacted Files Coverage Δ
bentoml/_internal/bento/build_config.py 67.62% <33.33%> (-0.60%) ⬇️
bentoml/_internal/frameworks/torchscript.py 0.00% <0.00%> (-95.92%) ⬇️
bentoml/_internal/frameworks/common/pytorch.py 0.00% <0.00%> (-73.12%) ⬇️
bentoml/_internal/utils/formparser.py 20.00% <0.00%> (-57.94%) ⬇️
bentoml/_internal/runner/strategy.py 74.13% <0.00%> (-8.63%) ⬇️
bentoml/_internal/runner/runner_handle/local.py 76.00% <0.00%> (-8.00%) ⬇️
bentoml/_internal/models/model.py 88.07% <0.00%> (-1.76%) ⬇️
bentoml/_internal/runner/utils.py 90.16% <0.00%> (-1.70%) ⬇️
bentoml/_internal/context.py 85.45% <0.00%> (-1.59%) ⬇️
bentoml/_internal/runner/runner.py 90.90% <0.00%> (-0.91%) ⬇️
... and 38 more

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
@aarnphm aarnphm requested a review from sauyon July 29, 2022 04:48
sauyon
sauyon previously approved these changes Jul 29, 2022
Copy link
Contributor

@sauyon sauyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; I assume you've tested this?

@parano parano self-requested a review July 29, 2022 05:15
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
@aarnphm aarnphm requested a review from a team as a code owner August 4, 2022 01:52
@aarnphm aarnphm requested review from jjmachan and removed request for a team August 4, 2022 01:52
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
@aarnphm
Copy link
Member Author

aarnphm commented Aug 5, 2022

cc @sauyon

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
Co-authored-by: Sauyon Lee <2347889+sauyon@users.noreply.github.com>
Copy link
Contributor

@sauyon sauyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@aarnphm aarnphm merged commit 0477d10 into bentoml:main Aug 9, 2022
@aarnphm aarnphm deleted the fix/chmod branch August 9, 2022 06:04
@@ -225,6 +226,13 @@ def write_to_bento(
setup_script = resolve_user_filepath(self.setup_script, build_ctx)
except FileNotFoundError as e:
raise InvalidArgument(f"Invalid setup_script file: {e}")
if not os.access(setup_script, os.X_OK):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this required? don't we do chmod +x in the dockerfile with the changes below? @aarnphm @sauyon

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The chmod in the dockerfile are just docker related, we want to have a executable check here so that users make sure the script is runnable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aarnphm it's not necessary, right? since we only run that script in docker?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intention for this is to check whether a script is executable or not. But that evolve using a library like python-magic. I think we end up just doing this as a first pass.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure what we want to do here. But the check is indeed not required.

Copy link
Member Author

@aarnphm aarnphm Aug 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 We can remove this if this means less friction for user.

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.

None yet

3 participants