envd

tensorchordApache-2.0活跃维护

用声明式配置为人类和 AI Agent 构建可复现的开发环境,基于 Docker 和 BuildKit 打包依赖,解决环境不一致、难以复现的问题。

🏕️ Reproducible development environment for humans and agents

v1.3.6发布于 2026-10-02 11:49 UTC2,243star169fork同步于 2026-11-10 11:44 UTC

怎么上手

由 README 提炼,执行前请确认
pip install --upgrade envd
envd bootstrap
cd envd-quick-start && envd up
硬件要求按 README 说明

README 未说明显存或 GPU 型号要求;仅要求 Docker 20.10.0 或以上,构建与运行都在容器内完成。

需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 Python 声明式脚本构建 AI/ML 容器开发环境,一条 envd up 即可复现

用声明式配置为人类和 AI Agent 构建可复现的开发环境,基于 Docker 和 BuildKit 打包依赖,解决环境不一致、难以复现的问题。

核心能力

  • 用 build.envd 中的 Python 函数声明依赖与配置
  • 基于 buildkit 构建,复用 pip/apt 缓存加速
  • 产出兼容 OCI 镜像规范的镜像,可推送到镜像仓库
  • 支持 local 与 Kubernetes cluster 两种 context 切换
  • 通过 include 导入 Git 仓库复用团队构建函数

容易踩的坑

必须先装 Docker 20.10.0+ 并执行 envd bootstrap 初始化,否则无法构建;国内拉取 docker.io 镜像慢时可在 bootstrap 时加 --dockerhub-mirror 指定镜像源;envd v1.0 起 build.envd 默认使用 v1 语法且默认 builder 为 moby-worker,旧 v0 脚本需注意语法差异。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v1.3.6
  1. v1.3.6最新正式版2026-10-02 · 2026-10-02 11:49 UTC

    Changelog

    Bug Fix 🛠

    • 9d575b354ce17a02ef9698b6ff0d5d14296c5734: fix: prevent TOCTOU in requirements file reads (#2119) (@kemingy)

    Documentation 🖊️

    • 64bfe688f2a55173366a3eccb877622991dae41d: docs: updated CHANGELOG.md (#2117) (@github-actions[bot])

    Others:

    • 968bc49d577e6c3c5bbb9e6587542c9ddfe66dad: chore(deps): bump the all-dependencies group across 1 directory with 2 updates (#2118) (@dependabot[bot])
  2. v1.3.52026-09-27 · 2026-09-27 14:33 UTC
    查看更新说明

    Changelog

    Bug Fix 🛠

    • 4ca4fdd262d266e446484522a117033765d54f43: fix: always create the compdef before r-w-o zshrc (#2084) (@kemingy)
    • f576c92c1e6dcb9b00b60995534aeb2a83b0b407: fix: restrict install.python_packages paths to the build context (#2112) (@kemingy)

    Documentation 🖊️

    • 376d0713fdc27abe63e23af59f047169fb51ecc6: docs: add AGENTS.md with repo layout and development guide (#2115) (@kemingy)
    • e8254329e9f338c221cc0d1c54b2a3032349c05e: docs: updated CHANGELOG.md (#2077) (@github-actions[bot])

    Others:

    • b952b3aa886651298ac6edefa512e48de5ffa892: chore(deps): bump dependencies with a cooldown policy (#2113) (@kemingy)
    • 6471107ea252b13a5a6a3d8aa3c41ce6427ebdd3: chore(deps): bump github.com/cloudflare/circl from 1.6.1 to 1.6.3 (#2085) (@dependabot[bot])
    • a49a77a5f8620ed0aa85f54b6974ac0c511e865f: chore(deps): bump github.com/containerd/containerd/v2 from 2.3.4 to 2.3.6 (#2114) (@dependabot[bot])
    • fe0d820e1d0a5c1fbe0ca2cb600636daa2ca0e7f: chore(deps): bump go.opentelemetry.io/otel from 1.40.0 to 1.41.0 (#2098) (@dependabot[bot])
    • 0b8622574c79186146f845cc9f8baa570e48777e: chore(deps): bump go.opentelemetry.io/otel/sdk from 1.38.0 to 1.40.0 (#2087) (@dependabot[bot])
    • c5e6fd54eb111453ced50fe6fac1c16a506d7d62: chore(deps): bump go.opentelemetry.io/otel/sdk from 1.40.0 to 1.43.0 (#2096) (@dependabot[bot])
    • e4110d278bdf02c2fd924b7f9de3df84db7afe9b: chore(deps): bump google.golang.org/grpc from 1.76.0 to 1.79.3 (#2089) (@dependabot[bot])
    • 46aaab1ec8082f578c4725bb78f986f21bd7a623: chore(deps): bump the all-actions group across 1 directory with 6 updates (#2091) (@dependabot[bot])
    • 9e2d2cd34173a150c642138630087d18132b2311: chore: pin actions (#2116) (@kemingy)
  3. v1.3.42026-02-07 · 2026-02-07 01:43 UTC
    查看更新说明

    Changelog

    Exciting New Features 🎉

    • c49ed2cb7fdeaa5d966ca36181b7ce27bc6fdf6a: feat: add the build.envd file to this repo (#2082) (@kemingy)
    • 3cac99fd121961eae2ce0bb634a026891b8e77df: feat: get the latest github release tag for codex (#2081) (@kemingy)
    • d7379df920a3305191f834e1539f3b4bfd9f084f: feat: support --cap for envd up (#2078) (@kemingy)

    Others:

    • 38015c99198dc8490301c9662c1bdce7d650e4df: chore(deps): bump pypa/cibuildwheel from 3.3.0 to 3.3.1 in the all-actions group (#2079) (@dependabot[bot])
  4. v1.3.32026-01-07 · 2026-01-07 11:20 UTC
    查看更新说明

    Changelog

    Bug Fix 🛠

    • 4719fa2998d4ea8a57c8c12b8d1abeaf8eca0cad: docs: fix links, merge lychee config file, tidy mods (#2072) (@kemingy)

    Documentation 🖊️

    • 5338ee68876e5134c2143ac4a48b8cfddd6ba42b: docs: updated CHANGELOG.md (#2068) (@github-actions[bot])

    Others:

    • 7ef03695e60c9af46f636d13c0e6a56b5eef59cc: chore(deps): bump golang.org/x/crypto from 0.43.0 to 0.45.0 (#2069) (@dependabot[bot])
    • eb76188c9362f02f5c03e4377cbc2a46801a1578: chore(deps): bump the all-actions group with 3 updates (#2071) (@dependabot[bot])
    • 0127bb44fde96bd1bf37801fa51db4a835fb6b78: chore(deps): bump the all-actions group with 4 updates (#2073) (@dependabot[bot])
    • 2498aca2d0e1bb6da8d2987c54ba749a61387683: chore: bump tool version to latest (#2076) (@kemingy)
  5. v1.3.22025-11-11 · 2025-11-11 14:49 UTC
    查看更新说明

    Changelog

    Bug Fix 🛠

    • b9d438501e01c857ac2c8688b82221f292b262e1: fix: get envd-sshd from ghcr (#2067) (@kemingy)
    • 9b3031b121e4d1da46839f9edc895e3f173c6a88: fix: update the default python image cache (#2065) (@kemingy)

    Documentation 🖊️

    • 305a8d3f4445d2c649ace6c755c5e1a408604721: docs: make the ssh agent forward err msg clear (#2066) (@kemingy)
    • 2d2f07cd6695ba1c47fa79d31cc01fedfe6de80a: docs: updated CHANGELOG.md (#2064) (@github-actions[bot])

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    What is envd?

    envd (ɪnˈvdɪ) is a command-line tool that helps you create the container-based development environment for AI/ML.

    Creating development environments is not easy, especially with today's complex systems and dependencies. With everything from Python to CUDA, BASH scripts, and Dockerfiles constantly breaking, it can feel like a nightmare - until now!

    Instantly get your environment running exactly as you need with a simple declaration of the packages you seek in build.envd and just one command: envd up!

    Why use envd?

    Environments built with envd provide the following features out-of-the-box:

    Simple CLI and language

    envd enables you to quickly and seamlessly integrate powerful CLI tools into your existing Python workflow to provision your programming environment without learning a new language or DSL.

    def build():
        base(dev=True)
        install.conda()
        install.python()
        install.python_packages(name = [
            "numpy",
        ])
        shell("fish")
        config.jupyter()
    

    Isolation, compatible with OCI image

    With envd, users can create an isolated space to train, fine-tune, or serve. By utilizing sophisticated virtualization technology as well as other features like buildkit, it's an ideal solution for environment setup.

    envd environment image is compatible with OCI image specification. By leveraging the power of an OCI image, you can make your environment available to anyone and everyone! Make it happen with a container registry like Harbor or Docker Hub.

    Local, and cloud

    envd can now be used on a hybrid platform, ranging from local machines to clusters hosted by Kubernetes. Any of these options offers an efficient and versatile way for developers to create their projects!

    $ envd context use local
    # Run envd environments locally
    $ envd up
    ...
    $ envd context use cluster
    # Run envd environments in the cluster with the same experience
    $ envd up
    

    Check out the doc for more details.

    Build anywhere, faster

    envd offers a wealth of advantages, such as remote build and software caching capabilities like pip index caches or apt cache, with the help of buildkit - all designed to make your life easier without ever having to step foot in the code itself!

    Reusing previously downloaded packages from the PyPI/APT cache saves time and energy, making builds more efficient. No need to redownload what was already acquired before – a single download is enough for repeat usage!

    With Dockerfile v1, users are unable to take advantage of PyPI caching for faster installation speeds - but envd offers this support and more!

    Besides, envd also supports remote build, which means you can build your environment on a remote machine, such as a cloud server, and then push it to the registry. This is especially useful when you are working on a machine with limited resources, or when you expect a build machine with higher performance.

    Knowledge reuse in your team

    Forget copy-pasting Dockerfile instructions - use envd to easily build functions and reuse them by importing any Git repositories with the include function! Craft powerful custom solutions quickly.

    envdlib = include("https://github.com/tensorchord/envdlib")
    
    def build():
        base(dev=True)
        install.conda()
        install.python()
        envdlib.tensorboard(host_port=8888)
    
    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`
    
        Args:
            envd_port (Optional[int]): port used by envd container
            envd_dir (Optional[str]): log storage mount path in the envd container
            host_port (Optional[int]): port used by the host, if not specified or equals to 0,
                envd will randomly choose a free port
            host_dir (Optional[str]): log storage mount path in the host
        """
        install.python_packages(["tensorboard"])
        runtime.mount(host_path=host_dir, envd_path=envd_dir)
        runtime.daemon(
            commands=[
                [
                    "tensorboard",
                    "--logdir",
                    envd_dir,
                    "--port",
                    str(envd_port),
                    "--host",
                    "0.0.0.0",
                ],
            ]
        )
        runtime.expose(envd_port=envd_port, host_port=host_port, service="tensorboard")
    

    Getting Started 🚀

    Requirements

    • Docker (20.10.0 or above)

    Install and bootstrap envd

    envd can be installed with pip, or you can download the binary release directly. After the installation, please run envd bootstrap to bootstrap.

    pip install --upgrade envd
    

    After the installation, please run envd bootstrap to bootstrap:

    envd bootstrap
    

    Read the documentation for more alternative installation methods.

    You can add --dockerhub-mirror or -m flag when running envd bootstrap, to configure the mirror for docker.io registry:

    envd bootstrap --dockerhub-mirror https://docker.mirrors.sjtug.sjtu.edu.cn
    

    Create an envd environment

    Please clone the envd-quick-start:

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

    The build manifest build.envd looks like:

    def build():
        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 = [
            "numpy",
        ])
        shell("fish")
    

    Note that we use Python here as an example but please check out examples for other languages such as R and Julia here.

    Then please run the command below to set up a new environment:

    cd envd-quick-start && envd up
    
    $ cd envd-quick-start && envd up
    [+] ⌚ 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!
    

    Set up Jupyter notebook

    Please edit the build.envd to enable jupyter notebook:

    def build():
        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 = [
            "numpy",
        ])
        shell("fish")
        config.jupyter()
    

    You can get the endpoint of the running Jupyter notebook via envd envs ls.

    $ envd up --detach
    $ envd envs ls
    NAME                    JUPYTER                 SSH TARGET              CONTEXT                                 IMAGE                   GPU     CUDA    CUDNN   STATUS          CONTAINER ID
    envd-quick-start        http://localhost:42779   envd-quick-start.envd   /home/gaocegege/code/envd-quick-start   envd-quick-start:dev    false   <none>  <none>  Up 54 seconds   bd3f6a729e94
    

    Difference between v0 and v1 syntax

    [!NOTE] Start from envd v1.0, v1 syntax is the default syntax for build.envd file, and moby-worker is the default builder.

    Featuresv0v1
    is default for envd<v1.0✅❌
    support dev✅✅
    support CUDA✅✅
    support serving⚠️✅
    support custom base image⚠️✅
    support installing multiple languages⚠️✅
    support moby builder❌✅

    [!IMPORTANT] For more details, check the upgrade to v1 doc.

    More on documentation 📝

    See envd documentation.

    Roadmap 🗂️

    Please checkout ROADMAP.

    Contribute 😊

    We welcome all kinds of contributions from the open-source community, individuals, and partners.

    Open in Gitpod

    Contributors ✨

    Thanks goes to these wonderful people (emoji key):

    This project follows the all-contributors specification. Contributions of any kind welcome!

    License 📋

    Apache 2.0