Git Product home page Git Product logo

envd's Introduction

envd cat wink envd cat wink

Development environment for AI/ML

discord invitation link trackgit-views Python Version all-contributors envd package donwloads continuous integration Coverage Status

explain

explain

What is envd?

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

Development environments are full of python and system dependencies, CUDA, BASH scripts, Dockerfiles, SSH configurations, Kubernetes YAMLs, and many other clunky things that are always breaking. envd is to solve the problem:

  1. Declare the list of dependencies (CUDA, python packages, your favorite IDE, and so on) in build.envd
  2. Simply run envd up.
  3. Develop in the isolated environment.

Why use envd?

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

โค๏ธ Knowledge reuse in your team

envd build functions can be reused. Use include function to import any git repositories. No more copy/paste Dockerfile instructions, let's reuse them.

envdlib = include("https://github.com/tensorchord/envdlib")

def build():
    base(os="ubuntu20.04", language="python")
    envdlib.tensorboard(host_port=8888)
envdlib.tensorboard is defined in github.com/tensorchord/envdlib
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")

โฑ๏ธ Builtkit native, build up to 6x faster

Buildkit supports parallel builds and software cache (e.g. pip index cache and apt cache). You can enjoy the benefits without knowledge of it.

For example, the PyPI cache is shared across builds and thus the package will be cached if it has been downloaded before.

๐Ÿ One configuration to rule them all

Development environments are full of Dockerfiles, bash scripts, Kubernetes YAML manifests, and many other clunky files that are always breaking. You just need one configuration file build.envd1, it works both for local Docker and Kubernetes clusters in the cloud.

envd

โœ๏ธ Don't sacrifice your developer experience

SSH is configured for the created environment. You can use vscode-remote, jupyter, pycharm or other IDEs that you love. Besides this, declare the IDE extensions you want, let envd take care of them.

def build():
    install.vscode_extensions([
        "ms-python.python",
    ])

โ˜๏ธ No polluted environment

Are you working on multiple projects, all of which need different versions of CUDA? envd helps you create isolated and clean environments.

Who should use envd?

We're focused on helping data scientists and teams that develop AI/ML models. And they may suffer from:

  • building the development environments with Python/R/Julia, CUDA, Docker, SSH, and so on. Do you have a complicated Dockerfile or build script that sets up all your dev environments, but is always breaking?
  • Updating the environment. Do you always need to ask infrastructure engineers how to add a new Python/R/Julia package in the Dockerfile?
  • Managing environments and machines. Do you always forget which machines are used for the specific project, because you handle multiple projects concurrently?

Talk with us

๐Ÿ’ฌ Interested in talking with us about your experience building or managing AI/ML applications?

Set up a time to chat!

Getting Started ๐Ÿš€

Requirements

  • Docker (20.10.0 or above)

Install and bootstrap envd

envd can be installed with pip (only support Python3). After the installation, please run envd bootstrap to bootstrap.

pip3 install --pre --upgrade envd
envd bootstrap

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(os="ubuntu20.04", language="python3")
    # Configure the pip index if needed.
    # config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
    install.python_packages(name = [
        "numpy",
    ])
    shell("zsh")

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 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
โฌข [envd]โฏ # You are in the container-based environment!

Set up Jupyter notebook

Please edit the build.envd to enable jupyter notebook:

def build():
    base(os="ubuntu20.04", language="python3")
    # Configure the pip index if needed.
    # config.pip_index(url = "https://pypi.tuna.tsinghua.edu.cn/simple")
    install.python_packages(name = [
        "numpy",
    ])
    shell("zsh")
    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

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):

 Friends A.
Friends A.

๐Ÿ“– ๐ŸŽจ
Aaron Sun
Aaron Sun

๐Ÿ““ ๐Ÿ’ป
Aka.Fido
Aka.Fido

๐Ÿ“ฆ ๐Ÿ“– ๐Ÿ’ป
Alex Xi
Alex Xi

๐Ÿ’ป
Bingyi Sun
Bingyi Sun

๐Ÿ’ป
Ce Gao
Ce Gao

๐Ÿ’ป ๐Ÿ“– ๐ŸŽจ ๐Ÿ“†
Guangyang Li
Guangyang Li

๐Ÿ’ป
Gui-Yue
Gui-Yue

๐Ÿ’ป
Haiker Sun
Haiker Sun

๐Ÿ’ป
Ikko Ashimine
Ikko Ashimine

๐Ÿ’ป
Isaac
Isaac

๐Ÿ’ป
JasonZhu
JasonZhu

๐Ÿ’ป
Jian Zeng
Jian Zeng

๐ŸŽจ ๐Ÿค” ๐Ÿ”ฌ
Jinjing Zhou
Jinjing Zhou

๐Ÿ› ๐Ÿ’ป ๐ŸŽจ ๐Ÿ“–
Jun
Jun

๐Ÿ“ฆ ๐Ÿ’ป
Keming
Keming

๐Ÿ’ป ๐Ÿ“– ๐Ÿค” ๐Ÿš‡
Kevin Su
Kevin Su

๐Ÿ’ป
Ling Jin
Ling Jin

๐Ÿ› ๐Ÿš‡
Manjusaka
Manjusaka

๐Ÿ’ป
Nino
Nino

๐ŸŽจ ๐Ÿ’ป
Pengyu Wang
Pengyu Wang

๐Ÿ“–
Sepush
Sepush

๐Ÿ“–
Siyuan Wang
Siyuan Wang

๐Ÿ’ป ๐Ÿš‡ ๐Ÿšง
Suyan
Suyan

๐Ÿ“–
To My
To My

๐Ÿ“–
Tumushimire Yves
Tumushimire Yves

๐Ÿ’ป
Wei Zhang
Wei Zhang

๐Ÿ’ป
Weizhen Wang
Weizhen Wang

๐Ÿ’ป
XRW
XRW

๐Ÿ’ป
Xu Jin
Xu Jin

๐Ÿ’ป
Xuanwo
Xuanwo

๐Ÿ’ฌ ๐ŸŽจ ๐Ÿค” ๐Ÿ‘€
Yijiang Liu
Yijiang Liu

๐Ÿ’ป
Yilong Li
Yilong Li

๐Ÿ“– ๐Ÿ› ๐Ÿ’ป
Yuan Tang
Yuan Tang

๐Ÿ’ป ๐ŸŽจ ๐Ÿ“– ๐Ÿค”
Yuchen Cheng
Yuchen Cheng

๐Ÿ› ๐Ÿš‡ ๐Ÿšง ๐Ÿ”ง
Yuedong Wu
Yuedong Wu

๐Ÿ’ป
Yunchuan Zheng
Yunchuan Zheng

๐Ÿ’ป
Zheming Li
Zheming Li

๐Ÿ’ป
Zhenguo.Li
Zhenguo.Li

๐Ÿ’ป ๐Ÿ“–
Zhenzhen Zhao
Zhenzhen Zhao

๐Ÿš‡ ๐Ÿ““ ๐Ÿ’ป
Zhizhen He
Zhizhen He

๐Ÿ’ป ๐Ÿ“–
cutecutecat
cutecutecat

๐Ÿ’ป
dqhl76
dqhl76

๐Ÿ“– ๐Ÿ’ป
jimoosciuc
jimoosciuc

๐Ÿ““
kenwoodjw
kenwoodjw

๐Ÿ’ป
nullday
nullday

๐Ÿค” ๐Ÿ’ป
wangxiaolei
wangxiaolei

๐Ÿ’ป
wyq
wyq

๐Ÿ› ๐ŸŽจ ๐Ÿ’ป
xiangtianyu
xiangtianyu

๐Ÿ“–
xieydd
xieydd

๐Ÿ’ป
xing0821
xing0821

๐Ÿค” ๐Ÿ““ ๐Ÿ’ป
zhyon404
zhyon404

๐Ÿ’ป
ๆจๆˆ้”ด
ๆจๆˆ้”ด

๐Ÿ’ป

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

Star History

Star History Chart

License ๐Ÿ“‹

Apache 2.0

trackgit-views

Footnotes

  1. The build language is starlark, which is a dialect of Python. โ†ฉ

envd's People

Contributors

gaocegege avatar kemingy avatar dependabot[bot] avatar github-actions[bot] avatar allcontributors[bot] avatar vovallen avatar terrytangyuan avatar aseaday avatar rudeigerc avatar zwpaper avatar triple-z avatar hezhizhen avatar dragonly avatar xiaoaier-z-l avatar yvestumushimire avatar kenwoodjw avatar aaronzs avatar popfido avatar shaonianche avatar gui-yue avatar lilylee1874 avatar thrimbda avatar alexxi19 avatar sunby avatar gyli avatar haiker2011 avatar eltociear avatar nasnoisaac avatar belyenochi avatar knight42 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.