-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: support runtime init script (#1085)
* stash Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai> * add Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai> * fix Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai> * add example Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai> * fix Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai> * fix Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai> Signed-off-by: Jinjing.Zhou <allenzhou@tensorchord.ai>
- Loading branch information
Showing
9 changed files
with
119 additions
and
21 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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
def install_kubectl_kind(env_name): | ||
run( | ||
[ | ||
'curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"', | ||
"sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl", | ||
] | ||
) | ||
run( | ||
[ | ||
"curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.16.0/kind-linux-amd64", | ||
"chmod +x ./kind", | ||
"sudo mv ./kind /usr/local/bin/kind", | ||
] | ||
) | ||
runtime.init( | ||
[ | ||
"sudo kind create cluster", | ||
"sudo docker network connect kind {}".format(env_name), | ||
'sudo kind get kubeconfig --name "kind" --internal | sed "s/kind-control-plane/$(sudo docker inspect "kind-control-plane" --format "{{ .NetworkSettings.Networks.kind.IPAddress }}")/g" | tee /home/envd/.kindkubeconfig', | ||
] | ||
) | ||
runtime.environ(env={"KUBECONFIG": "/home/envd/.kindkubeconfig"}) | ||
|
||
|
||
def build(): | ||
base(os="ubuntu20.04", language="python3.9") | ||
install.python_packages( | ||
name=[ | ||
"pydflow", | ||
] | ||
) | ||
shell("zsh") | ||
run( | ||
[ | ||
"pip install git+https://github.com/deepmodeling/dpgen2 -i https://pypi.tuna.tsinghua.edu.cn/simple" | ||
] | ||
) | ||
run(["curl -sSL https://get.daocloud.io/docker | sh"]) | ||
runtime.mount("/var/run/docker.sock", "/var/run/docker.sock") | ||
install_kubectl_kind("dpgen2") |
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
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
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
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
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
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
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