Skip to content

Commit

Permalink
add api doc (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
VoVAllen committed Jun 10, 2022
1 parent 723b32f commit 45e4562
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
61 changes: 61 additions & 0 deletions envd/api/config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Copyright 2022 The envd Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Optional


def apt_source(mode: Optional[str], source: Optional[str]):
r"""Config 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
'''
)
```
Args:
mode (str, optional): This argument is not supported currently
source (str, optional): The apt source configuration
"""
pass


def jupyter(password: str, port: int):
"""
Config jupyter notebook configuration
Args:
password (str): Password for access authenticatioin
port (int): Port to serve jupyter notebook
"""
pass

def pip_index(url):
"""
Config pypi index mirror
Args:
url (str): Pypi index url (i.e. https://mirror.sjtu.edu.cn/pypi/web/simple)
"""
pass
46 changes: 46 additions & 0 deletions envd/api/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2022 The envd Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import List, Optional


def system_packages(name: List[str]):
"""Install package by system-level package manager(apt on Ubuntu)
"""
pass


def python_packages(name: List[str]):
"""Install python package by pip
"""
pass


def r_packages(name: List[str]):
"""Install R packages by R package manager
"""
pass

def cuda(version: str, cudnn: Optional[str] = None):
"""Install CUDA dependency
Args:
version (str): CUDA version, such as '11.6'
cudnn (optional, str): CUDNN version, such as '6'
"""

def vscode_extensions(name: List[str]):
"""Install VS Code extensions
Args:
name (list of str): extension names, such as ['ms-python.python']
"""

0 comments on commit 45e4562

Please sign in to comment.