config
Config 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.
apt_source
def apt_source(source: Optional[str])Configure apt sources
Example usage:
apt_source(source='''
deb https://mirror.sjtu.edu.cn/ubuntu jammy main restricted
deb https://mirror.sjtu.edu.cn/ubuntu jammy-updates main restricted
deb https://mirror.sjtu.edu.cn/ubuntu jammy universe
deb https://mirror.sjtu.edu.cn/ubuntu jammy-updates universe
deb https://mirror.sjtu.edu.cn/ubuntu jammy multiverse
deb https://mirror.sjtu.edu.cn/ubuntu jammy-updates multiverse
deb https://mirror.sjtu.edu.cn/ubuntu jammy-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu jammy partner
deb https://mirror.sjtu.edu.cn/ubuntu jammy-security main restricted universe multiverse
''')Arguments:
sourcestr, optional - The apt source configuration
jupyter
def jupyter(token: str, port: int)Configure jupyter notebook configuration
Arguments:
tokenstr - Token for access authenticationportint - Port to serve jupyter notebook
pip_index
def pip_index(url: str, extra_url: str = "", trust: bool = False)Configure pypi index mirror
Arguments:
urlstr - PyPI index URL (i.e. https://mirror.sjtu.edu.cn/pypi/web/simple)extra_urlstr - PyPI extra index URL.urlandextra_urlwill be treated equally, see https://github.com/pypa/pip/issues/8606trustbool - trust the provided index
conda_channel
def conda_channel(channel: str)Configure conda channel mirror
Example usage:
config.conda_channel(channel='''
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
''')Arguments:
channelstr - Basically the same with file content of an usual .condarc
entrypoint
def entrypoint(args: List[str])Configure entrypoint for custom base image
Example usage:
config.entrypoint(["date", "-u"])Arguments:
argsList[str] - list of arguments to run
gpu
def gpu(count: int)Configure the number of GPUs required
Example usage:
config.gpu(count=2)Arguments:
countint - number of GPUs
shm_size
def shm_size(size: int)Configure the shared memory size (megabyte) of docker containers
Example usage:
config.shm_size(size=1024)Arguments:
sizeint - the shared memory size (megabyte) of docker containers
cran_mirror
def cran_mirror(url: str)Configure the mirror URL, default is https://cran.rstudio.com
Arguments:
urlstr - mirror URL
julia_pkg_server
def julia_pkg_server(url: str)Configure the package server for Julia. Since Julia 1.5, https://pkg.julialang.org is the default pkg server.
Arguments:
urlstr - Julia pkg server URL
rstudio_server
def rstudio_server()Enable the RStudio Server (only work for base(os="ubuntu22.04", language="r"))
repo
def repo(url: str, description: str)Setup repo related information. Will save to the image labels.
Arguments:
urlstr - repo URLdescriptionstr - repo description
owner
def owner(uid: int, gid: int)Configure uid:gid as the environment owner. This can also be achieved by using flag envd --owner uid:gid build or environment variable ENVD_BUILD_OWNER=uid:gid envd build
Arguments:
uidint - UIDgidint - GID