Skip to content

Commit

Permalink
feat(example): Add streamlit hello and remove bash -c in entrypoint (#…
Browse files Browse the repository at this point in the history
…794)

feat(example): Add streamlit hello

Signed-off-by: Ce Gao <cegao@tensorchord.ai>

Signed-off-by: Ce Gao <cegao@tensorchord.ai>
  • Loading branch information
gaocegege authored Aug 18, 2022
1 parent 8e17307 commit 7bf801b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions examples/streamlit-hello/build.envd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def build():
base(os="ubuntu20.04", language="python")
configure_streamlit(8501)

def configure_streamlit(port):
config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
install.python_packages([
"streamlit"
])
runtime.daemon(commands=[
["streamlit", "hello", "--server.port", str(port)],
])
runtime.expose(envd_port=port, host_port=port, service="streamlit")
2 changes: 1 addition & 1 deletion pkg/lang/ir/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ wait -n`
workingDir := filepath.Join("/home/envd", filepath.Base(buildContextDir))
if g.RuntimeDaemon != nil {
for _, command := range g.RuntimeDaemon {
customCmd.WriteString(fmt.Sprintf("%s -c %s &\n", g.Shell, strings.Join(command, " ")))
customCmd.WriteString(fmt.Sprintf("%s &\n", strings.Join(command, " ")))
}
}
if g.JupyterConfig != nil {
Expand Down

0 comments on commit 7bf801b

Please sign in to comment.