Created
January 12, 2023 11:07
-
-
Save dacbd/e84a7f78bc817ecc9821194309144261 to your computer and use it in GitHub Desktop.
leo example
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
pipelines: | |
default: | |
- step: | |
name: deploy-runner | |
image: iterativeai/cml:0-dvc2-base1 | |
script: | |
- | | |
leo_id=$(leo create \ | |
--cloud="aws" \ | |
--region="us-east-1" \ | |
--image="nvidia" \ | |
--machine="p2.xlarge" \ | |
--disk-size=64 \ | |
--workdir="." \ | |
--output="." \ | |
--environment AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \ | |
--environment AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \ | |
--environment AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN" \ | |
--script="$(cat ./run.sh)" | |
) | |
leo read \ | |
--cloud="aws" \ | |
--region="us-east-1" \ | |
--follow "$leo_id" | |
sleep 45 | |
leo delete \ | |
--cloud="aws" \ | |
--region="us-east-1" \ | |
--workdir="." \ | |
--output="." \ | |
"$leo_id" | |
- cml ci | |
- git show origin/main:image.png > image-main.png | |
- | | |
cat <<EOF > report.md | |
# Style transfer | |
## Workspace vs. Main | |
![](./image.png "Workspace") ![](./image-main.png "Main") | |
## Training metrics | |
$(dvc params diff main --show-md) | |
## GPU info | |
$(cat gpu_info.txt) | |
EOF | |
- cml comment create report.md |
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
#!/bin/bash | |
# system requirments | |
apt-get update | |
apt-get install python3.9 -y | |
nvidia-smi | |
# project requirments | |
pip3 install -r requirements.txt | |
dvc pull transfer | |
# run training | |
dvc repro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment