Skip to content

Instantly share code, notes, and snippets.

@dacbd
Created January 12, 2023 11:07
Show Gist options
  • Save dacbd/e84a7f78bc817ecc9821194309144261 to your computer and use it in GitHub Desktop.
Save dacbd/e84a7f78bc817ecc9821194309144261 to your computer and use it in GitHub Desktop.
leo example
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
#!/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