-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmonitoring.envd
30 lines (28 loc) · 1014 Bytes
/
monitoring.envd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
def tensorboard(
envd_port=6006, envd_dir="/home/envd/logs", host_port=0, host_dir="/tmp"
):
"""Configure TensorBoard.
Make sure you have permission for `host_dir`
Args:
envd_port (Optional[int]): port used by envd container
envd_dir (Optional[str]): log storage mount path in the envd container
host_port (Optional[int]): port used by the host, if not specified or equals to 0,
envd will randomly choose a free port
host_dir (Optional[str]): log storage mount path in the host
"""
install.python_packages(["tensorboard"])
runtime.mount(host_path=host_dir, envd_path=envd_dir)
runtime.daemon(
commands=[
[
"tensorboard",
"--logdir",
envd_dir,
"--port",
str(envd_port),
"--host",
"0.0.0.0",
]
]
)
runtime.expose(envd_port=envd_port, host_port=host_port, service="tensorboard")