Skip to content

Commit

Permalink
Catch error in ulimit check (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
parasj authored Jun 29, 2022
1 parent a4c6d58 commit 1598038
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ gateway = ["flask", "lz4", "pyopenssl", "werkzeug"]
solver = ["cvxpy", "graphviz", "matplotlib", "numpy"]

[tool.poetry.dev-dependencies]
black = ">21.1.0"
black = ">21.3.0"
pytest = ">=6.0.0"
pytest-cov = ">=2.10.0"
pytest-xdist = ">=2.0.0"
Expand Down
10 changes: 5 additions & 5 deletions skyplane/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ def is_plausible_local_path(path_test: str):
raise ValueError(f"Parse error {path}")


def check_limits(hard_limit=1024 * 1024, soft_limit=1024 * 1024):
check_ulimit(hard_limit=1024 * 1024)


def check_ulimit(hard_limit=1024 * 1024):
# Get the current fs.file-max limit
check_hard_limit = ["sysctl", "--values", "fs.file-max"]
fs_hard_limit = subprocess.check_output(check_hard_limit)
try:
fs_hard_limit = subprocess.check_output(check_hard_limit)
except subprocess.CalledProcessError:
typer.secho(f"Failed to get fs.file-max limit", fg="yellow")
return
current_limit_hard = int(fs_hard_limit.decode("UTF-8"))

# check/update fs.file-max limit
Expand Down

0 comments on commit 1598038

Please sign in to comment.