"docs/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "e2243de5f23a2dcae19e7583df6875b2513c9ac6"
Unverified Commit 39416e39 authored by Jiada Li's avatar Jiada Li Committed by GitHub
Browse files

fix lockfile and port_registry file permission error (#3598)


Co-authored-by: default avatarjiada li <jiada@lmsys.us-northcentral1-a.compute.internal>
Co-authored-by: default avatarzhaochenyang20 <zhaochen20@outlook.com>
parent 231c40d8
...@@ -308,13 +308,31 @@ def download_and_cache_file(url: str, filename: Optional[str] = None): ...@@ -308,13 +308,31 @@ def download_and_cache_file(url: str, filename: Optional[str] = None):
import fcntl import fcntl
LOCKFILE = "/tmp/port_lock"
PORT_REGISTRY = "/tmp/port_registry.json" def is_in_ci():
from sglang.test.test_utils import is_in_ci
return is_in_ci()
LOCKFILE = os.path.expanduser("~/.sglang_port_lock")
PORT_REGISTRY = os.path.expanduser("~/.sglang_port_registry.json")
if not os.path.exists(LOCKFILE):
with open(LOCKFILE, "w") as f:
pass
if not os.path.exists(PORT_REGISTRY):
with open(PORT_REGISTRY, "w") as f:
json.dump([], f)
def print_highlight(html_content: str): def print_highlight(html_content: str):
html_content = str(html_content).replace("\n", "<br>") if is_in_ci():
display(HTML(f"<strong style='color: #00008B;'>{html_content}</strong>")) html_content = str(html_content).replace("\n", "<br>")
display(HTML(f"<strong style='color: #00008B;'>{html_content}</strong>"))
else:
print(html_content)
def init_port_registry(): def init_port_registry():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment