Skip to content

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

  • os str - The operating system (i.e. ubuntu20.04)
  • language str - The programming language dependency (i.e. python3.8)
  • image Optional[str] - Custom image (i.e. python:3.9-slim)

shell

python
def shell(name: str)

Interactive shell

Arguments:

  • name str - shell name (i.e. zsh, bash)

run

python
def run(commands: List[str], mount_host: bool = False)

Execute command

Arguments:

  • commands List[str] - command to run during the building process
  • mount_host bool - mount the host directory. Default is False. Enabling this will disable the build cache for this operation.

Example:

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

  • name optional, str - User name

  • email optional, str - User email

  • editor optional, str - Editor for git operations

    Example usage:

python
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 (except the ones with _ prefix).

Arguments:

  • git str - git URL

    Example usage:

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

def build():
    base(os="ubuntu20.04", language="python")
    envd.tensorboard(8000)

Released under the Apache-2.0 License. Built with VitePress.