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 focal main restricted
deb https://mirror.sjtu.edu.cn/ubuntu focal-updates main restricted
deb https://mirror.sjtu.edu.cn/ubuntu focal universe
deb https://mirror.sjtu.edu.cn/ubuntu focal-updates universe
deb https://mirror.sjtu.edu.cn/ubuntu focal multiverse
deb https://mirror.sjtu.edu.cn/ubuntu focal-updates multiverse
deb https://mirror.sjtu.edu.cn/ubuntu focal-backports main restricted universe multiverse
deb http://archive.canonical.com/ubuntu focal partner
deb https://mirror.sjtu.edu.cn/ubuntu focal-security main restricted universe multiverse
''')
Arguments:
source
str, optional - The apt source configuration
jupyter
def jupyter(token: str, port: int)
Configure jupyter notebook configuration
Arguments:
token
str - Token for access authenticationport
int - Port to serve jupyter notebook
pip_index
def pip_index(url: str, extra_url: str)
Configure pypi index mirror
Arguments:
url
str - PyPI index URL (i.e. https://mirror.sjtu.edu.cn/pypi/web/simple)extra_url
str - PyPI extra index URL.url
andextra_url
will be treated equally, see https://github.com/pypa/pip/issues/8606
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:
channel
str - 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:
args
List[str] - list of arguments to run
gpu
def gpu(count: int)
Configure the number of GPUs required
Example usage:
config.gpu(count=2)
Arguments:
count
int - number of GPUs
cran_mirror
def cran_mirror(url: str)
Configure the mirror URL, default is https://cran.rstudio.com
Arguments:
url
str - 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:
url
str - Julia pkg server URL
rstudio_server
def rstudio_server()
Enable the RStudio Server (only work for base(os="ubuntu20.04", language="r")
)
repo
def repo(url: str, description: str)
Setup repo related information. Will save to the image labels.
Arguments:
url
str - repo URLdescription
str - repo description