envd

module
v0.2.0-alpha.19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2022 License: Apache-2.0

README ΒΆ

Development environment for machine learning

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

⚠️ envd is still under heavy development, and subject to change. it is not feature-complete or production-ready.

envd (ΙͺnˈvdΙͺ) provides an alternative to Docker for AI/ML applications.

🐍 Escape Dockerfile Hell - Develop with Python, save time on writing Dockerfiles, bash scripts, and Kubernetes YAML manifests

⏱️ Save you plenty of time - Build the environment up to 6x faster.

☁️ Local & cloud - envd images are OCI compatible, integrate with Docker and Kubernetes seamlessly.

πŸ” Repeatable builds & reproducible results - You can reproduce the same environment on your laptop, public cloud VMs, or Docker containers, without any changes in setup.

Why use envd?

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

🐍 Life is short, use Python[^1]

Development environments are full of Dockerfiles, bash scripts, Kubernetes YAML manifests, and many other clunky files that are always breaking. envd builds are isolated and clean. You can develop with Python, save time on writing Bash / Makefile / Dockerfile / ...

envd

[^1]: The build language is starlark, which is a dialect of Python.

⏱️ 6x faster build

envd adopts a multi-level cache mechanism to accelerate the building process. For example, the PyPI cache is shared across builds and thus the package will be cached if it has been downloaded before. It saves plenty of time, especially when you update the environment by trial and error.[^2]

[^2]: Docker without buildkit

☁️ Local & cloud native

Local development simplifies the debugging, but... Setup local & cloud native environment with envd

❌ Complex to setup. When they break, you often need to run the whole setup.

❌ Resource intensive because of the constraints to your CPU, moemory and local GPU.

❌ Not reproducible. Because not everyone has an identical setup.

βœ… AI infrastructure as code, reproduce the environment painlessly.

βœ… Separate your environment to avoid impacting your local configuration.

βœ… Use larger or more specialized hardware.

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.

πŸ“– 🎨

Aaron Sun

πŸ““ πŸ’»

Aka.Fido

πŸ“¦ πŸ“– πŸ’»

Bingyi Sun

πŸ’»

Ce Gao

πŸ’» πŸ“– 🎨 πŸ“†

Guangyang Li

πŸ’»

Gui-Yue

πŸ’»

Haiker Sun

πŸ’»

Ikko Ashimine

πŸ’»

Jian Zeng

🎨 πŸ€” πŸ”¬

Jinjing Zhou

πŸ› πŸ’» 🎨 πŸ“–

Jun

πŸ“¦ πŸ’»

Keming

πŸ’» πŸ“– πŸ€” πŸš‡

Kevin Su

πŸ’»

Ling Jin

πŸ› πŸš‡

Manjusaka

πŸ’»

Nino

🎨

Pengyu Wang

πŸ“–

Sepush

πŸ“–

Siyuan Wang

πŸ’» πŸš‡ 🚧

Wei Zhang

πŸ’»

Xu Jin

πŸ’»

Xuanwo

πŸ’¬ 🎨 πŸ€” πŸ‘€

Yuan Tang

πŸ’» 🎨 πŸ“– πŸ€”

Yuchen Cheng

πŸ› πŸš‡ 🚧 πŸ”§

Yunchuan Zheng

πŸ’»

Zheming Li

πŸ’»

Zhenguo.Li

πŸ’» πŸ“–

Zhenzhen Zhao

πŸš‡ πŸ““ πŸ’»

Zhizhen He

πŸ’» πŸ“–

jimoosciuc

πŸ““

kenwoodjw

πŸ’»

nullday

πŸ€” πŸ’»

wyq

πŸ› 🎨 πŸ’»

xiangtianyu

πŸ“–

xing0821

πŸ€” πŸ““ πŸ’»

zhyon404

πŸ’»

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

License πŸ“‹

Apache 2.0

trackgit-views

Directories ΒΆ

Path Synopsis
cmd
envd command
envd-ssh command
ssh is the CLI running in the container as the sshd.
ssh is the CLI running in the container as the sshd.
pkg
app
buildkitd/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
docker
The following code is from https://github.com/fsouza/go-dockerclient/ Copyright (c) 2013-2021, go-dockerclient authors
The following code is from https://github.com/fsouza/go-dockerclient/ Copyright (c) 2013-2021, go-dockerclient authors
lang/frontend/starlark/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
progress/compileui/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
ssh

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL