Skip to content

Commit

Permalink
docs: change to v1
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <[email protected]>
  • Loading branch information
kemingy committed Feb 6, 2025
1 parent b5402b5 commit 9c6a82d
Show file tree
Hide file tree
Showing 29 changed files with 332 additions and 150 deletions.
4 changes: 3 additions & 1 deletion docs-zh/blog/2022.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ introduction: 'Ce Gao 是 envd 的维护者之一。与此之外,他还是机

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
# Configure the pip index if needed.
# config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
install.python_packages(name = [
Expand Down
12 changes: 9 additions & 3 deletions docs-zh/blog/envd.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ introduction: 'Ce Gao 是 envd 的维护者之一。与此之外,他还是机

```python
def build():
base(os="ubuntu20.04", language="python")
base(dev=True)
install.conda()
install.python()
install.cuda(version="11.2.2", cudnn="8")
install.python_packages(name=[
"tensorflow-gpu"
Expand Down Expand Up @@ -76,7 +78,9 @@ def build():

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.vscode_extensions([
"ms-python.python",
])
Expand Down Expand Up @@ -144,7 +148,9 @@ envd 不只是面向个人使用者设计的,它更是要解决算法团队在
envdlib = include("https://github.com/tensorchord/envdlib")

def build():
base(os="ubuntu20.04", language="python")
base(dev=True)
install.conda()
install.python()
envdlib.tensorboard(8888)
```

Expand Down
4 changes: 3 additions & 1 deletion docs-zh/blog/stable-diffusion-cpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ touch build.envd

```python
def build():
base(os="ubuntu20.04", language="python")
base(dev=True)
install.conda()
install.python()
#config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
install.python_packages([
"torch",
Expand Down
4 changes: 3 additions & 1 deletion docs-zh/envs/monitoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def tensorboard(port):


def build():
base(os="ubuntu20.04", language="python")
base(dev=True)
install.conda()
install.python()
install.python_packages(name=["tensorboard"])
tensorboard(8888)
```
Expand Down
8 changes: 6 additions & 2 deletions docs-zh/envs/multitarget.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def serve():

```py
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.vscode_extensions([
"ms-python.python",
])
Expand All @@ -39,7 +41,9 @@ def build():
shell("zsh")

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

Expand Down
4 changes: 3 additions & 1 deletion docs-zh/faq/why.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,9 @@ ENTRYPOINT ["tini", "--", "bash", "init.bash"]

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.vscode_extensions([
"ms-python.python",
])
Expand Down
43 changes: 29 additions & 14 deletions docs-zh/guide/build-envd.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ $ envd build --path examples/mnist

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.python_packages(name = [
"numpy",
])
Expand All @@ -57,7 +59,9 @@ def build():

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
```

</custom-title>
Expand All @@ -76,17 +80,17 @@ $ envd up
=> => exporting manifest sha256:7ef2e8571485ce51d966b4cf5fe83232520f 0.0s
=> => exporting config sha256:abec960de30fce69dc19126577c7aaae3f9b62 0.0s
=> => sending tarball 0.4s
envd@588f26349c61 $
⬢ [envd]❯
```

</custom-title>

3. 重新进入您的环境,如果您退出了当前 `shell`,使用 `ssh <project-directory-name>.envd` 命令将重新进入环境。

```bash
envd@588f26349c61 $ exit
⬢ [envd]❯ exit
$ ssh demo.envd
envd@588f26349c61 $ # 欢迎回来!
⬢ [envd]❯ # 欢迎回来!
```

4. 删除环境,如果您不再使用它,请不要忘记使用 `envd destroy` 命令来删除环境。使用 `-p` 参数指定要删除的环境的路径。
Expand All @@ -108,7 +112,9 @@ INFO[2022-06-10T19:09:49+08:00] <project-directory-name> is destroyed

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
```

</custom-title>
Expand All @@ -131,7 +137,9 @@ def build():

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.python_packages(name = [
"numpy",
])
Expand All @@ -153,9 +161,8 @@ def build():

```
$ envd up
envd@2c14bff847f8:$ python3
Python 3.8.10 (default, Mar 15 2022, 12:22:08)
[GCC 9.4.0] on linux
⬢ [envd]❯ python3
Python 3.11.11 (main, Dec 11 2024, 16:28:39) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> a = np.array([2, 3, 4])
Expand All @@ -171,7 +178,9 @@ array([2, 3, 4])

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.python_packages(name = [
"numpy",
])
Expand All @@ -195,7 +204,9 @@ Jupyter Notebook 是使用 Python 进行数据分析的互动计算环境。`env

```python
def build():
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.python_packages(name = [
"numpy",
])
Expand Down Expand Up @@ -225,7 +236,9 @@ envd-quick-start http://localhost:48484 envd-quick-start.envd /home/g
```python
def build():
config.pip_index(url="https://pypi.tuna.tsinghua.edu.cn/simple")
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.python_packages(name = [
"numpy",
])
Expand Down Expand Up @@ -256,7 +269,9 @@ deb https://mirror.sjtu.edu.cn/ubuntu focal-security main restricted universe mu
install.vscode_extensions([
"ms-python.python",
])
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
install.python_packages(name = [
"numpy",
])
Expand Down
3 changes: 3 additions & 0 deletions docs-zh/guide/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def build():
# build.envd
# 默认调用 `build` 函数。
def build():
base(dev=True)
install.conda()
install.python()
version = "2.9.1"
dev_env(version, "zsh")

Expand Down
78 changes: 47 additions & 31 deletions docs-zh/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ envd(`ɪnˈvdɪ`)是一个命令行工具,可以帮助你为 AI/ML 创建
envdlib = include("https://github.com/tensorchord/envdlib")

def build():
base(os="ubuntu20.04", language="python")
base(dev=True)
install.conda()
install.python()
envdlib.tensorboard(8888)
```

Expand Down Expand Up @@ -92,7 +94,12 @@ def tensorboard(envd_port=6006, envd_dir="/home/envd/logs",
```bash [pip]
# envd 也可以用 pip 来安装。

pip3 install --upgrade envd
pip install --upgrade envd
```

```bash [uv]
# if you are using `uv`
uv tool install envd
```

```bash [Homebrew]
Expand Down Expand Up @@ -135,7 +142,7 @@ envd bootstrap --dockerhub-mirror https://docker.mirrors.sjtug.sjtu.edu.cn

先克隆仓库[`envd-quick-start`](https://github.com/tensorchord/envd-quick-start):

```
```bash
git clone https://github.com/tensorchord/envd-quick-start.git
```

Expand All @@ -144,13 +151,15 @@ git clone https://github.com/tensorchord/envd-quick-start.git
```python title=build.envd
def build():
config.repo(url="https://github.com/tensorchord/envd", description="envd quick start example")
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
# Configure pip index if needed.
# config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
install.python_packages(name = [
"numpy",
])
shell("zsh")
shell("fish")
```

:::tip
Expand All @@ -159,35 +168,40 @@ def build():

然后可以运行下面的命令来建立一个新的环境:

```
```bash
cd envd-quick-start && envd up
```

```
```bash
$ cd envd-quick-start && envd up
[+] ⌚ parse build.envd and download/cache dependencies 2.8s ✅ (finished)
=> download oh-my-zsh 2.8s
[+] 🐋 build envd environment 18.3s (25/25) ✅ (finished)
=> create apt source dir 0.0s
=> local://cache-dir 0.1s
=> => transferring cache-dir: 5.12MB 0.1s
...
=> pip install numpy 13.0s
=> copy /oh-my-zsh /home/envd/.oh-my-zsh 0.1s
=> mkfile /home/envd/install.sh 0.0s
=> install oh-my-zsh 0.1s
=> mkfile /home/envd/.zshrc 0.0s
=> install shell 0.0s
=> install PyPI packages 0.0s
=> merging all components into one 0.3s
=> => merging 0.3s
=> mkfile /home/envd/.gitconfig 0.0s
=> exporting to oci image format 2.4s
=> => exporting layers 2.0s
=> => exporting manifest sha256:7dbe9494d2a7a39af16d514b997a5a8f08b637f 0.0s
=> => exporting config sha256:1da06b907d53cf8a7312c138c3221e590dedc2717 0.0s
=> => sending tarball 0.4s
envd-quick-start via Py v3.9.13 via 🅒 envd
[+] ⌚ parse build.envd and download/cache dependencies 6.2s ✅ (finished)
[+] build envd environment 19.0s (47/47) FINISHED
=> CACHED [internal] setting pip cache mount permissions 0.0s
=> docker-image://docker.io/tensorchord/envd-sshd-from-scratch:v0.4.3 2.3s
=> => resolve docker.io/tensorchord/envd-sshd-from-scratch:v0.4.3 2.3s
=> docker-image://docker.io/library/ubuntu:22.04 0.0s
......
=> [internal] pip install numpy 2.5s
=> CACHED [internal] download fish shell 0.0s
=> [internal] configure user permissions for /opt/conda 1.0s
=> [internal] create dir for ssh key 0.5s
=> [internal] install ssh keys 0.2s
=> [internal] copy fish shell from the builder image 0.2s
=> [internal] install fish shell 0.5s
......
=> [internal] create work dir: /home/envd/envd-quick-start 0.2s
=> exporting to image 7.7s
=> => exporting layers 7.7s
=> => writing image sha256:464a0c12759d3d1732404f217d5c6e06d0ee4890cccd66391a608daf2bd314e4 0.0s
=> => naming to docker.io/library/envd-quick-start:dev 0.0s
------
> importing cache manifest from docker.io/tensorchord/python-cache:envd-v0.4.3:
------
⣽ [5/5] attach the environment [2s]
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish

envd-quick-start on git master [!] via Py v3.11.11 via 🅒 envd as sudo
⬢ [envd]❯ # You are in the container-based environment!
```

Expand All @@ -198,7 +212,9 @@ envd-quick-start via Py v3.9.13 via 🅒 envd
```python title=build.envd
def build():
config.repo(url="https://github.com/tensorchord/envd", description="envd quick start example")
base(os="ubuntu20.04", language="python3")
base(dev=True)
install.conda()
install.python()
# Configure pip index if needed.
# config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
install.python_packages(name = [
Expand Down
4 changes: 3 additions & 1 deletion docs-zh/guide/modularize.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ envdlib = include("https://github.com/tensorchord/envdlib")

# use it in your build function
def build():
base(os="ubuntu20.04", language="python")
base(dev=True)
install.conda()
install.python()
envdlib.tensorboard(host_port=8888)
```

Expand Down
Loading

0 comments on commit 9c6a82d

Please sign in to comment.