Skip to content

Commit

Permalink
fix: daemon command (#1185)
Browse files Browse the repository at this point in the history
* fix: daemon command

Signed-off-by: Keming <[email protected]>

* update readme

Signed-off-by: Keming <[email protected]>

* specify host port

Signed-off-by: Keming <[email protected]>

Signed-off-by: Keming <[email protected]>
  • Loading branch information
kemingy authored Nov 14, 2022
1 parent e69351f commit 4a7d6cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ envdlib = include("https://github.com/tensorchord/envdlib")

def build():
base(os="ubuntu20.04", language="python")
envdlib.tensorboard(8888)
envdlib.tensorboard(host_port=8888)
```

<details>
<summary><code>envdlib.tensorboard</code> is defined in <a href="https://github.com/tensorchord/envdlib/blob/main/src/monitoring.envd">github.com/tensorchord/envdlib</a></summary>

```python
def tensorboard(envd_port=6006, envd_dir="/home/envd/logs",
host_port=0, host_dir="/var/log/tensorboard"):
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`
Expand All @@ -72,13 +76,11 @@ def tensorboard(envd_port=6006, envd_dir="/home/envd/logs",
[
"tensorboard",
"--logdir",
"/home/envd/logs",
envd_dir,
"--port",
str(envd_port),
"--host",
"0.0.0.0",
">>tensorboard.log",
"2>&1",
],
]
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/lang/ir/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (g Graph) compileEntrypoint(root llb.State) (llb.State, error) {

if g.RuntimeDaemon != nil {
for i, command := range g.RuntimeDaemon {
entrypoint = g.addNewProcess(entrypoint, fmt.Sprintf("daemon_%d", i), fmt.Sprintf("%s &\n", strings.Join(command, " ")), deps)
entrypoint = g.addNewProcess(entrypoint, fmt.Sprintf("daemon_%d", i), strings.Join(command, " "), deps)
}
}

Expand Down

0 comments on commit 4a7d6cc

Please sign in to comment.