__init__
Global functions
TIP
Note that the documentation is automatically generated from envd/api folder in tensorchord/envd repo. Please update the python file there instead of directly editing file inside envd-docs repo.
base
python
def base(os: str, language: str, image: Optional[str])Set base image
Arguments:
osstr - The operating system (i.e.ubuntu20.04)languagestr - The programing language dependency (i.e.python3.8)imageOptional[str] - Custom image (i.e.python:3.9-slim)
shell
python
def shell(name: str)Interactive shell
Arguments:
namestr - shell name (i.e.zsh,bash)
run
python
def run(commands: str, mount_host: bool = False)Execute command
Arguments:
commandsstr - command to run during the building processmount_hostbool - mount the host directory. Default is False. Enabling this will disable the build cache for this operation.
Example:
run(commands=["conda install -y -c conda-forge exa"])git_config
python
def git_config(name: Optional[str] = None,
email: Optional[str] = None,
editor: Optional[str] = None)Setup git config
Arguments:
nameoptional, str - User nameemailoptional, str - User emaileditoroptional, str - Editor for git operationsExample usage:
git_config(name="My Name", email="my@email.com", editor="vim")include
python
def include(git: str)Import from another git repo
This will pull the git repo and execute all the envd files. The return value will be a module contains all the variables/functions defined (expect those has _ prefix).
Arguments:
gitstr - git URLExample usage:
envd = include("https://github.com/tensorchord/envdlib")
def build():
base(os="ubuntu20.04", language="python")
envd.tensorboard(8000)