Skip to content

Commit

Permalink
doc: daemon and expose (#786)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingyang@tensorchord.ai>

Signed-off-by: Keming <kemingyang@tensorchord.ai>
  • Loading branch information
kemingy committed Aug 17, 2022
1 parent fd1d9dc commit 248fca3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion envd/api/config/__init__.py
Expand Up @@ -127,7 +127,7 @@ def cran_mirror(url: str):

def julia_pkg_server(url: str):
"""Configure the package server for Julia.
Since Julia 1.5, https://pkg.julialang.org` is the default pkg server.
Since Julia 1.5, https://pkg.julialang.org is the default pkg server.
Args:
url (str): Julia pkg server URL
Expand Down
1 change: 1 addition & 0 deletions envd/api/io/__init__.py
Expand Up @@ -21,6 +21,7 @@
:::
"""


def copy(src: str, dest: str):
"""Copy from host `src` to container `dest` (build time)
Expand Down
33 changes: 32 additions & 1 deletion envd/api/runtime/__init__.py
Expand Up @@ -21,7 +21,7 @@
:::
"""

from typing import Dict
from typing import Dict, Optional, List


def command(commands: Dict[str, str]):
Expand All @@ -30,3 +30,34 @@ def command(commands: Dict[str, str]):
Args:
commands (Dict[str, str]): map name to command, similar to Makefile
"""


def expose(envd_port: str, host_port: Optional[str], service: Optional[str]):
"""Expose port to host
Proposal: https://github.com/tensorchord/envd/pull/780
Args:
envd_port (str): port in `envd` container
host_port (Optional[str]): port in the host, if not provided, `envd` will
randomly choose a free port
service (Optional[str]): service name
"""


def daemon(commands: List[List[str]]):
"""Run daemon processes in the container
Proposal: https://github.com/tensorchord/envd/pull/769
It's better to redirect the logs to local files for debug purposes.
Args:
commands (List[List[str]]): run multiple commands in the background
Example usage:
```
runtime.daemon([
["jupyter-lab", "--port", "8080"],
["python3", "serving.py", ">>serving.log", "2>&1"],
])
```
"""

0 comments on commit 248fca3

Please sign in to comment.