Skip to main content

A development environment management tool for data scientists.

Project description

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

⏱️ BuildKit-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.

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.

pip3 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(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

💻 📖 🎨 📆
Frost Ming
Frost Ming

💻 📖
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

🤔 💻
rrain7
rrain7

💻
tison
tison

💻
wangxiaolei
wangxiaolei

💻
wyq
wyq

🐛 🎨 💻
x0oo0x
x0oo0x

💻
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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envd-0.3.1.tar.gz (9.4 MB view details)

Uploaded Source

Built Distributions

envd-0.3.1-py2.py3-none-musllinux_1_1_x86_64.whl (9.2 MB view details)

Uploaded Python 2 Python 3 musllinux: musl 1.1+ x86-64

envd-0.3.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (9.2 MB view details)

Uploaded Python 2 Python 3 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

envd-0.3.1-py2.py3-none-macosx_11_0_arm64.whl (18.8 MB view details)

Uploaded Python 2 Python 3 macOS 11.0+ ARM64

envd-0.3.1-py2.py3-none-macosx_10_9_x86_64.whl (18.8 MB view details)

Uploaded Python 2 Python 3 macOS 10.9+ x86-64

File details

Details for the file envd-0.3.1.tar.gz.

File metadata

  • Download URL: envd-0.3.1.tar.gz
  • Upload date:
  • Size: 9.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for envd-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3400ebbe9a165104071b1d9e2ebea8ad67a12982b438dfdc6e14f9bd00188962
MD5 cdb8617053c154be560180cdbc295fb9
BLAKE2b-256 2195de9b573e6c94fe5b9a844faed07198e2661869e0a60864354ab1c8254951

See more details on using hashes here.

Provenance

File details

Details for the file envd-0.3.1-py2.py3-none-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for envd-0.3.1-py2.py3-none-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 a8c4ad3cf3d61a2da55b9afcde9c999b053587f55c308b929362426d9d3d2094
MD5 a42e358c6cf6ac8dd0d924fa4cf68538
BLAKE2b-256 32c3b41866691be45f28eb535bfede378d76437d5b1e61423c7b1bf747136729

See more details on using hashes here.

Provenance

File details

Details for the file envd-0.3.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for envd-0.3.1-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1dc5018e4bce074d77a50e4e1d374e466c85f1aaa4379fa4082264fefc425795
MD5 63b5f8b9cfab8c7d638890c29d6d8742
BLAKE2b-256 02ff0446f38328f246a2c45e15a2670f481794da68635d0124c82eac2105551d

See more details on using hashes here.

Provenance

File details

Details for the file envd-0.3.1-py2.py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: envd-0.3.1-py2.py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 18.8 MB
  • Tags: Python 2, Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

File hashes

Hashes for envd-0.3.1-py2.py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9960b12d2d0ac810be504006647a41672a86b0fdaee5aad958dd29cbd9d76921
MD5 5d8b85b79d30a8f32f22ba09841b8fe2
BLAKE2b-256 dc625ad3c57f53e8d1430c3ba06d88219e2340d45ecbb68d099ca2ee87445f12

See more details on using hashes here.

Provenance

File details

Details for the file envd-0.3.1-py2.py3-none-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: envd-0.3.1-py2.py3-none-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 18.8 MB
  • Tags: Python 2, Python 3, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.8.3 requests/2.27.1 setuptools/41.2.0 requests-toolbelt/0.10.1 tqdm/4.64.1 CPython/2.7.18

File hashes

Hashes for envd-0.3.1-py2.py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 86fb20fb2b4ea3069beff6d5a6000a86b51d2d354566de1983d65368a0c726cc
MD5 e70bcb2ee7a84439601f835fb0d4ae69
BLAKE2b-256 5458fa8b358b607f4ed3132ae9e7a8b195f665c4b9757452148fd6a1ebeb84f3

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page