-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: add include, refine others (#817)
* doc: add include, refine others Signed-off-by: Keming <[email protected]> * update Signed-off-by: Keming <[email protected]> Signed-off-by: Keming <[email protected]>
- Loading branch information
Showing
2 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,15 +37,20 @@ def shell(name: str): | |
"""Interactive shell | ||
Args: | ||
name (str): shell name(i.e. `zsh`) | ||
name (str): shell name(i.e. `zsh`, `bash`) | ||
""" | ||
|
||
|
||
def run(commands: str): | ||
"""Execute command | ||
Args: | ||
commands (str): command to run | ||
commands (str): command to run during the building process | ||
Example: | ||
``` | ||
run(commands=["conda install -y -c conda-forge exa"]) | ||
``` | ||
""" | ||
|
||
|
||
|
@@ -60,4 +65,29 @@ def git_config( | |
name (optional, str): User name | ||
email (optional, str): User email | ||
editor (optional, str): Editor for git operations | ||
Example usage: | ||
``` | ||
git_config(name="My Name", email="[email protected]", editor="vim") | ||
``` | ||
""" | ||
|
||
|
||
def include(git: str): | ||
"""Import from another git repo | ||
This will pull the git repo and execute all the `envd` files. The return value will be a module | ||
contains all the variables/functions defined (expect those has `_` prefix). | ||
Args: | ||
git (str): git URL | ||
Example usage: | ||
``` | ||
envd = include("https://github.com/tensorchord/envdlib") | ||
def build(): | ||
base(os="ubuntu20.04", language="python") | ||
envd.tensorboard(8000) | ||
``` | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,10 +25,20 @@ | |
|
||
|
||
def command(commands: Dict[str, str]): | ||
"""Execute commands | ||
"""Execute commands during runtime | ||
Args: | ||
commands (Dict[str, str]): map name to command, similar to Makefile | ||
Example usage: | ||
``` | ||
runtime.command(commands={ | ||
"train": "python train.py --epoch 20 --notify [email protected]", | ||
"run": "python server.py --batch 1 --host 0.0.0.0 --port 8000", | ||
}) | ||
``` | ||
You can run `envd run --command train` to train the model. | ||
""" | ||
|
||
|
||
|