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.

WARNING

Enable v1 by adding # syntax=v1 to the 1st line of your envd file.

v1 is experimental and may change in the future. Make sure to freeze the envd version for online CI/CD.

apt_source

python
def apt_source(source: Optional[str])

Configure apt sources

Example usage:

python
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 = "", trust: bool = False)

Configure pypi index mirror

Arguments:

conda_channel

python
def conda_channel(channel: str)

Configure conda channel mirror

Example usage:

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

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

python
config.gpu(count=2)

Arguments:

  • count int - number of GPUs

shm_size

python
def shm_size(size: int)

Configure the shared memory size (megabyte) of docker containers

Example usage:

python
config.shm_size(size=1024)

Arguments:

  • size int - the shared memory size (megabyte) of docker containers

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

owner

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

  • uid int - UID
  • gid int - GID

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