-
Notifications
You must be signed in to change notification settings - Fork 13
74 lines (74 loc) · 2.32 KB
/
example-get-started-experiments-deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: example-get-started-experiments deploy
on:
push:
paths:
- example-get-started-experiments/**
branches:
- master
workflow_dispatch:
permissions: write-all
jobs:
deploy-runner:
environment: aws
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: iterative/setup-cml@v2
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-region: us-east-2
role-to-assume: ${{ vars.AWS_SANDBOX_ROLE }}
role-duration-seconds: 43200
- name: Create Runner
env:
REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
cml runner launch --single \
--labels=cml \
--cloud=aws \
--cloud-region=us-east \
--cloud-hdd-size=40 \
--cloud-type=g5.2xlarge \
--idle-timeout=3600 \
test:
needs: deploy-runner
runs-on: [ self-hosted, cml ]
environment: aws
container:
image: iterativeai/cml:0-dvc2-base1-gpu
options: --gpus all --ipc host
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: us-east-2
role-to-assume: ${{ vars.AWS_SANDBOX_ROLE }}
role-duration-seconds: 43200
- name: Generate repo
env:
REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
pip install virtualenv
cd example-get-started-experiments
./generate.sh
- name: Deploy repo
env:
GH_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
run: |
cd example-get-started-experiments/build/example-get-started-experiments
. .venv/bin/activate
# add remote
git remote add origin https://${{ secrets.PERSONAL_ACCESS_TOKEN }}@github.com/iterative/example-get-started-experiments.git
# drop existing refs
git ls-remote origin | awk '{print $2}' | xargs -n 1 git push --delete origin || true
# push updated refs
git push --force origin main
dvc exp push origin -A
# we push git tags one by one for Studio to receive webhooks:
git tag --sort=creatordate | xargs -n 1 git push --force origin