-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: support runtime init script #1085
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d60f535
stash
VoVAllen 8a8f691
add
VoVAllen 1e5153e
Merge remote-tracking branch 'tensorchord/main' into init_script
VoVAllen 1f54ee7
fix
VoVAllen 4456eae
add example
VoVAllen c58aae0
fix
VoVAllen ef6d4b4
fix
VoVAllen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is too flexible. Currently, we only need the
start-after
.Maybe we can switch to a TOML tool to generate it if it becomes more complex in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can refactor this once we need more controls here.