Skip to content

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

python
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

python
def jupyter(token: str, port: int)

Configure jupyter notebook configuration

Arguments:

  • token str - Token for access authentication
  • port int - Port to serve jupyter notebook

pip_index

python
def pip_index(url: str, extra_url: str)

Configure pypi index mirror

Arguments:

conda_channel

python
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

python
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

python
def gpu(count: int)

Configure the number of GPUs required

Example usage:

config.gpu(count=2)

Arguments:

  • count int - number of GPUs

cran_mirror

python
def cran_mirror(url: str)

Configure the mirror URL, default is https://cran.rstudio.com

Arguments:

  • url str - mirror URL

julia_pkg_server

python
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

python
def rstudio_server()

Enable the RStudio Server (only work for base(os="ubuntu20.04", language="r"))

repo

python
def repo(url: str, description: str)

Setup repo related information. Will save to the image labels.

Arguments:

  • url str - repo URL
  • description str - repo description

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