Skip to content

Commit

Permalink
feat: update examples to v1 syntax (#1965)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingyang@tensorchord.ai>
  • Loading branch information
kemingy authored Feb 1, 2025
1 parent 3bfd29a commit 1519667
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 22 deletions.
4 changes: 3 additions & 1 deletion examples/conda/build.envd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ custom_channels:
],
channel=["pytorch"],
)
base(os="ubuntu22.04", language="python3.8")
base(dev=True)
install.conda()
install.python()
install.python_packages(name=["flask"])
install.cuda(version="11.2.2", cudnn="8")
2 changes: 1 addition & 1 deletion examples/custom-image/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def build():
base(language="python", image="python:3.11-slim")
base(image="python:3.11-slim", dev=True)
install.python_packages(
name=[
"via",
Expand Down
12 changes: 8 additions & 4 deletions examples/dgl/build.envd
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
def build():
# Use ubuntu22.04 as base image and install python
base(os="ubuntu22.04", language="python3")
# Use ubuntu:22.04 as base image and install python
base(image="ubuntu:22.04", dev=True)
install.conda()
install.python()

# Add the packages you are using here
install.python_packages(["numpy", "dgl", "torch"])
Expand All @@ -13,8 +15,10 @@ def build():


def build_gpu():
# Use ubuntu22.04 as base image and install python
base(os="ubuntu22.04", language="python3")
# Use ubuntu:22.04 as base image and install python
base(dev=True)
install.conda()
install.python()

# install cuda
install.cuda(version="11.2.2", cudnn="8")
Expand Down
4 changes: 3 additions & 1 deletion examples/download_files/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def build():
base(os="ubuntu22.04", language="python")
base(dev=True)
install.conda()
install.python()
io.http(
url="https://github.com/tensorchord/envd/releases/download/v0.2.0-alpha.18/envd-ssh_0.2.0-alpha.18_Linux_x86_64",
checksum="sha256:163fa5d9775a3666ec91e2422a794277cc8575147f15767d364cc40157888cfb",
Expand Down
4 changes: 3 additions & 1 deletion examples/dpgen2/build.envd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def install_kubectl_kind(env_name):


def build():
base(os="ubuntu22.04", language="python3.11")
base(dev=True)
install.conda()
install.python()
install.python_packages(
name=[
"pydflow",
Expand Down
4 changes: 3 additions & 1 deletion examples/ianvs/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def build():
base(os="ubuntu22.04", language="python3.6")
base(dev=True)
install.conda()
install.python()
shell("zsh")
install.apt_packages(name=["git", "libgl1-mesa-glx", "zip"])
run(
Expand Down
4 changes: 3 additions & 1 deletion examples/include_pkg/build.envd
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ envdlib = include("https://github.com/tensorchord/envdlib")


def build():
base(os="ubuntu22.04", language="python")
base(dev=True)
install.conda()
install.python()
envdlib.tensorboard(8888)
3 changes: 2 additions & 1 deletion examples/julia-basic/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
def build():
base(os="ubuntu22.04", language="julia")
base(dev=True)
install.julia()
# config.julia_pkg_server(url="https://mirrors.tuna.tsinghua.edu.cn/julia")
install.julia_packages(["Example"])
shell("zsh")
2 changes: 0 additions & 2 deletions examples/llm-inference/build.envd
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# syntax=v1
def build():
# base(os="ubuntu22.04", language="python3")
base(dev=True)
install.conda()
install.python()
Expand Down
4 changes: 3 additions & 1 deletion examples/mnist/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def base_env():
base(os="ubuntu22.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.vscode_extensions(
[
"ms-python.python",
Expand Down
4 changes: 3 additions & 1 deletion examples/python-basic/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def build():
base(os="ubuntu22.04", language="python")
base(dev=True)
install.conda()
install.python()
# config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
install.python_packages(
[
Expand Down
4 changes: 3 additions & 1 deletion examples/pytorch-profiler/build.envd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ envdlib = include("https://github.com/tensorchord/envdlib")


def build():
base(os="ubuntu22.04", language="python3")
base(dev=True)
install.conda()
install.python()
shell("zsh")
install.cuda(version="11.2.2", cudnn="8")
install.python_packages(
Expand Down
2 changes: 1 addition & 1 deletion examples/pytorch2/build.envd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ envdlib = include("https://github.com/tensorchord/envdlib")


def build():
base(language="python3", image="ghcr.io/pytorch/pytorch-nightly:latest")
base(image="ghcr.io/pytorch/pytorch-nightly:latest", dev=True)
shell("zsh")

install.python_packages(
Expand Down
3 changes: 2 additions & 1 deletion examples/r-basic/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
def build():
base(os="ubuntu22.04", language="r")
base(dev=True)
install.r_lang()
install.r_packages(
[
"remotes",
Expand Down
4 changes: 3 additions & 1 deletion examples/stable-diffusion/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def build():
base(os="ubuntu22.04", language="python")
base(dev=True)
install.conda()
install.python()
# config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
install.python_packages(
[
Expand Down
4 changes: 3 additions & 1 deletion examples/streamlit-hello/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def build():
base(os="ubuntu22.04", language="python")
base(dev=True)
install.conda()
install.python()
configure_streamlit(8501)


Expand Down
7 changes: 5 additions & 2 deletions examples/streamlit-mnist/build.envd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
def build():
base(os="ubuntu22.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.vscode_extensions(
[
"ms-python.python",
Expand All @@ -14,7 +16,8 @@ def build():


def serve():
base(os="ubuntu22.04", language="python3")
base(dev=False)
install.python()
configure_streamlit(8501)
configure_mnist()

Expand Down

0 comments on commit 1519667

Please sign in to comment.