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

[Storage] Storage mounting tool permissions fix #3215

Merged
merged 2 commits into from
Feb 22, 2024

Conversation

romilbhardwaj
Copy link
Collaborator

@romilbhardwaj romilbhardwaj commented Feb 22, 2024

Fixes test_aws_custom_image for #3211.

On certain images, chmod +x on /usr doesn't work:

e.g. on ami-062ddd90fb6f8267a

(base) ubuntu@ip-172-31-4-126:~/.sky$ sudo chmod 700 /usr/local/bin/goofys
(base) ubuntu@ip-172-31-4-126:~/.sky$ ls -lah /usr/local/bin/goofys
-rwx------ 1 root root 28M Apr  6  2022 /usr/local/bin/goofys

(base) ubuntu@ip-172-31-4-126:~/.sky$ sudo chmod +x /usr/local/bin/goofys
(base) ubuntu@ip-172-31-4-126:~/.sky$ ls -lah /usr/local/bin/goofys
-rwx------ 1 root root 28M Apr  6  2022 /usr/local/bin/goofys # Didn't work

(base) ubuntu@ip-172-31-4-126:~/.sky$ sudo chmod 755 /usr/local/bin/goofys
(base) ubuntu@ip-172-31-4-126:~/.sky$ ls -lah /usr/local/bin/goofys
-rwxr-xr-x 1 root root 28M Apr  6  2022 /usr/local/bin/goofys # chmod 755 works

same on gcp debian image and aws ubuntu image:

(base) gcpuser@mymntgcp-2ea4-head-arrpfaio-compute:/$ sudo chmod 700 /usr/local/bin/goofys
(base) gcpuser@mymntgcp-2ea4-head-arrpfaio-compute:/$ ls -lah /usr/local/bin/goofys
-rwx------ 1 root root 28M Apr  6  2022 /usr/local/bin/goofys

(base) gcpuser@mymntgcp-2ea4-head-arrpfaio-compute:/$ sudo chmod +x /usr/local/bin/goofys
(base) gcpuser@mymntgcp-2ea4-head-arrpfaio-compute:/$ ls -lah /usr/local/bin/goofys
-rwx--x--x 1 root root 28M Apr  6  2022 /usr/local/bin/goofys # Works!

This PR changes to use chmod 755.

Tested:

  • pytest tests/test_smoke.py::test_aws_custom_image --aws
  • pytest tests/test_smoke.py -k "test_aws_storage_mounts_with_stop" --aws
  • pytest tests/test_smoke.py -k "test_gcp_storage_mounts_with_stop"

@@ -19,7 +19,7 @@ def get_s3_mount_install_cmd() -> str:
install_cmd = ('sudo wget -nc https://github.com/romilbhardwaj/goofys/'
'releases/download/0.24.0-romilb-upstream/goofys '
'-O /usr/local/bin/goofys && '
'sudo chmod +x /usr/local/bin/goofys')
'sudo chmod 755 /usr/local/bin/goofys')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it because the user we create on AWS is not in the same group as the root account, causing the sudo chmod +x only changes the permission for the root user, but not the current user (ubuntu)?
I think making it 755 should be fine, but just wondering if chmod +x without sudo will make it work?

Also it might be possible to add some config in the following to add the user into the same group, e.g.,

users:
- name: skypilot:ssh_user
shell: /bin/bash
sudo: ALL=(ALL) NOPASSWD:ALL
ssh_authorized_keys:
- |-
skypilot:ssh_public_key_content

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm sudo chmod +x should grant execute permissions to all three -(u)ser, (g)roup and (o)thers. I tried with just chmod +x, but that won't work since the owner of the file is root. We could chown then chmod, but generally files in /usr are supposed to be owned by root...

@Michaelvll Michaelvll mentioned this pull request Feb 22, 2024
14 tasks
@romilbhardwaj romilbhardwaj merged commit 3eb9305 into master Feb 22, 2024
19 checks passed
@romilbhardwaj romilbhardwaj deleted the storage_mounttool_permissions branch February 22, 2024 22:55
shethhriday29 pushed a commit to shethhriday29/skypilot that referenced this pull request Feb 26, 2024
romilbhardwaj added a commit that referenced this pull request Feb 29, 2024
* initial commit

* newline

* comments

* run linter

* reminder for down

* tentatively done with example

* formatting

* yapf

* [Storage] Storage mounting tool permissions fix (#3215)

* fix permissions

* fix permissions

* [LLM] Example for Serving Gemma (#3207)

* Add serve for gemma and fix mixtral dependency

* Add hf token

* fix model len

* Add comment

* Serve your private gemma

* fix serve yaml

* readme

* Remove chat completion due to the wrong template

* add readme

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* address comments

* Update README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Change to it

* Add chat API

* use HF_TOKEN env

* typo

---------

Co-authored-by: Zongheng Yang <[email protected]>

* [LLM] Add logo for Gemma (#3220)

* Minor fixes for release 0.5.0 (#3212)

* when removing cudo credential, sky check fails

* remove tips

* minor hint fix

* fix cluster version for k8s

* fix typo

* [Docker] Add retry for docker pull due to daemon not ready (#3218)

* Add retry for docker pull due to daemon not ready

* longer wait time

* longer wait time

* retry earlier

* add retry for retries as well

* longer wait time

* change wait time

* format

* Add comment

* Fix

* Fix indent for azure docker config

* Fix docker login config

* Fix comments

* More robust docker login config

* Add retry for docker check

* minor fix

* Add additional test for stop and start with docker

* Fix cancelled

* added comments

* quick fix

* finished pip issues

* fix

* fix storage error message, add example link to docs

---------

Co-authored-by: Sheth <[email protected]>
Co-authored-by: Romil Bhardwaj <[email protected]>
Co-authored-by: Zhanghao Wu <[email protected]>
Co-authored-by: Zongheng Yang <[email protected]>
Co-authored-by: Romil Bhardwaj <[email protected]>
romilbhardwaj added a commit that referenced this pull request Mar 21, 2024
* initial commit

* newline

* comments

* run linter

* reminder for down

* tentatively done with example

* formatting

* yapf

* [Storage] Storage mounting tool permissions fix (#3215)

* fix permissions

* fix permissions

* [LLM] Example for Serving Gemma (#3207)

* Add serve for gemma and fix mixtral dependency

* Add hf token

* fix model len

* Add comment

* Serve your private gemma

* fix serve yaml

* readme

* Remove chat completion due to the wrong template

* add readme

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* address comments

* Update README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Change to it

* Add chat API

* use HF_TOKEN env

* typo

---------

Co-authored-by: Zongheng Yang <[email protected]>

* [LLM] Add logo for Gemma (#3220)

* Minor fixes for release 0.5.0 (#3212)

* when removing cudo credential, sky check fails

* remove tips

* minor hint fix

* fix cluster version for k8s

* fix typo

* [Docker] Add retry for docker pull due to daemon not ready (#3218)

* Add retry for docker pull due to daemon not ready

* longer wait time

* longer wait time

* retry earlier

* add retry for retries as well

* longer wait time

* change wait time

* format

* Add comment

* Fix

* Fix indent for azure docker config

* Fix docker login config

* Fix comments

* More robust docker login config

* Add retry for docker check

* minor fix

* Add additional test for stop and start with docker

* Fix cancelled

* added comments

* quick fix

* finished pip issues

* fix

* fix storage error message, add example link to docs

* logging for SSH when doing kubernetes provision

* romil edits

* took out todo commnt

* removed extra file

* renamed file

* restored right version of file

* simplify things

* newline

* more formatting

* formatting

* minor fixes

* set x and logging

* fixes

* docstr

---------

Co-authored-by: Sheth <[email protected]>
Co-authored-by: Romil Bhardwaj <[email protected]>
Co-authored-by: Zhanghao Wu <[email protected]>
Co-authored-by: Zongheng Yang <[email protected]>
Co-authored-by: Romil Bhardwaj <[email protected]>
romilbhardwaj added a commit that referenced this pull request Apr 15, 2024
* initial commit

* newline

* comments

* run linter

* reminder for down

* tentatively done with example

* formatting

* yapf

* [Storage] Storage mounting tool permissions fix (#3215)

* fix permissions

* fix permissions

* [LLM] Example for Serving Gemma (#3207)

* Add serve for gemma and fix mixtral dependency

* Add hf token

* fix model len

* Add comment

* Serve your private gemma

* fix serve yaml

* readme

* Remove chat completion due to the wrong template

* add readme

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* address comments

* Update README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Update llm/gemma/README.md

Co-authored-by: Zongheng Yang <[email protected]>

* Change to it

* Add chat API

* use HF_TOKEN env

* typo

---------

Co-authored-by: Zongheng Yang <[email protected]>

* [LLM] Add logo for Gemma (#3220)

* Minor fixes for release 0.5.0 (#3212)

* when removing cudo credential, sky check fails

* remove tips

* minor hint fix

* fix cluster version for k8s

* fix typo

* [Docker] Add retry for docker pull due to daemon not ready (#3218)

* Add retry for docker pull due to daemon not ready

* longer wait time

* longer wait time

* retry earlier

* add retry for retries as well

* longer wait time

* change wait time

* format

* Add comment

* Fix

* Fix indent for azure docker config

* Fix docker login config

* Fix comments

* More robust docker login config

* Add retry for docker check

* minor fix

* Add additional test for stop and start with docker

* Fix cancelled

* added comments

* quick fix

* finished pip issues

* fix

* fix storage error message, add example link to docs

* changed error message if default nc installed on mac

* refactored check_port_forward_mode_dependencies function

* update comment

---------

Co-authored-by: Sheth <[email protected]>
Co-authored-by: Romil Bhardwaj <[email protected]>
Co-authored-by: Zhanghao Wu <[email protected]>
Co-authored-by: Zongheng Yang <[email protected]>
Co-authored-by: Romil Bhardwaj <[email protected]>
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.

2 participants