-
Notifications
You must be signed in to change notification settings - Fork 529
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
Mods to run from Modal #3908
Mods to run from Modal #3908
Changes from 48 commits
d69848a
df30ac7
8d93356
f27df54
5be67a7
df2bc33
b69c583
7c57122
dab6ab3
d1b7b67
fb1b621
9395450
03d9c32
1805834
c60a5b5
a24b2df
5de6aee
e278cab
272f6ef
f234c5b
0ff8ba1
4246672
ed4570f
6ab5f31
0c8205f
c4c7c2c
a9fff3c
ff9b36a
7aa32ee
a22c884
48fe52b
6120952
63c7eb1
36dcbcb
f288ebe
5d04ba8
e1793be
468cf51
742875a
3613c38
7a1bdc3
dfd6e33
0386507
e57714c
2ed568f
29c4b46
75aa402
dfb501a
0581e15
68b005d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,49 @@ | ||||||
"""Utils to check if the ssh control master should be disabled.""" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would prefer renaming it to |
||||||
|
||||||
from functools import lru_cache | ||||||
|
||||||
from sky import sky_logging | ||||||
from sky.utils import subprocess_utils | ||||||
|
||||||
logger = sky_logging.init_logger(__name__) | ||||||
|
||||||
|
||||||
def is_tmp_9p_filesystem() -> bool: | ||||||
"""Check if the /tmp filesystem is 9p. | ||||||
|
||||||
Returns: | ||||||
bool: True if the /tmp filesystem is 9p, False otherwise. | ||||||
""" | ||||||
|
||||||
result = subprocess_utils.run(['df', '-T', '/tmp'], | ||||||
capture_output=True, | ||||||
text=True, | ||||||
shell=None, | ||||||
check=None, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
executable=None) | ||||||
|
||||||
if result.returncode != 0: | ||||||
return False | ||||||
|
||||||
filesystem_infos = result.stdout.strip().split('\n') | ||||||
if len(filesystem_infos) < 2: | ||||||
return False | ||||||
filesystem_types = filesystem_infos[1].split() | ||||||
if len(filesystem_types) < 2: | ||||||
return False | ||||||
return filesystem_types[1].lower() == '9p' | ||||||
|
||||||
|
||||||
@lru_cache | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. style: import module instead of functions
Suggested change
|
||||||
def should_disable_control_master() -> bool: | ||||||
"""Whether disable ssh control master based on file system. | ||||||
|
||||||
Returns: | ||||||
bool: True if the ssh control master should be disabled, | ||||||
False otherwise. | ||||||
""" | ||||||
if is_tmp_9p_filesystem(): | ||||||
return True | ||||||
# there may be additional criteria to disable ssh control master | ||||||
# in the future. They should be checked here | ||||||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment for in what case this will not exist? Or should we remove this change for this PR?