A development environment management tool for data scientists.
Project description
Development environment for AI/ML
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():
install.python_packages(name = [
"numpy",
])
shell("zsh")
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(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")
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 runningenvd 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.
- Join our discord community!
- To build from the source, please read our contributing documentation and development tutorial.
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
License 📋
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file envd-0.3.21.tar.gz
.
File metadata
- Download URL: envd-0.3.21.tar.gz
- Upload date:
- Size: 13.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b87717b3636490e935966f4e70a8cc098eb0acc1e1eb1cc83818be5a17203cd0 |
|
MD5 | 75588d6bec7afd6226da5bd84f5c2307 |
|
BLAKE2b-256 | e529eb9215683fa19f81167af6a4363b00324465302bad74eee0330a1025010f |
File details
Details for the file envd-0.3.21-py2.py3-none-musllinux_1_1_x86_64.whl
.
File metadata
- Download URL: envd-0.3.21-py2.py3-none-musllinux_1_1_x86_64.whl
- Upload date:
- Size: 13.4 MB
- Tags: Python 2, Python 3, musllinux: musl 1.1+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab8c997bd5007256f40c4f1f490fc0ff4f180c7fdb7aabd82a4afc14dc175007 |
|
MD5 | 2fc92fea4832216d446033707313f7be |
|
BLAKE2b-256 | b764e3cbf2221ba7876aafa12cbc0f1feaffa8d88cabca1794364fc6f91cee1d |
File details
Details for the file envd-0.3.21-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: envd-0.3.21-py2.py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 13.4 MB
- Tags: Python 2, Python 3, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f830bc147bf715255826566126bc4a8178ea8241711958a5885d57ea3834a16 |
|
MD5 | 9744e5bc1c76ac4d0b537ab595d74517 |
|
BLAKE2b-256 | c4b6ad1473789e405f19f37e9c42d95a37944ca6b26df6c0c2441d9b6effe2d6 |
File details
Details for the file envd-0.3.21-py2.py3-none-macosx_11_0_arm64.whl
.
File metadata
- Download URL: envd-0.3.21-py2.py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 27.1 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/1.0.0 tqdm/4.64.1 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cce1e6ce3281b778ca193621e2cb634ea75763497b668ae507503b572df2262d |
|
MD5 | 39d83d3d294ac0ee2dc2b3431e8ec115 |
|
BLAKE2b-256 | 8cd218787757a6bc2e8f4eba9d8fc4a72eb8f9aad8fbbff2757dafb0853147f0 |
File details
Details for the file envd-0.3.21-py2.py3-none-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: envd-0.3.21-py2.py3-none-macosx_10_9_x86_64.whl
- Upload date:
- Size: 27.1 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/1.0.0 tqdm/4.64.1 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7672315cb29cccc35362eb01e94707106b0997407194c1bbe7cd5da42fd057a9 |
|
MD5 | 98b8b73cf9bf1d2403d6c16376a953d5 |
|
BLAKE2b-256 | a71a0fe14d24be9636995b5a4434caf212b4666511f3c9ceba6e98fdd0fab25e |