-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (63 loc) · 1.64 KB
/
cml.yml
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
on: pull_request
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
TF_VAR_name: ${{ github.run_id }}
TF_VAR_parallelism: 4
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
terraform init
terraform apply --auto-approve
env:
CML_RUNNER_LABELS: cml-matrix-${{ github.run_id }}
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
- uses: actions/upload-artifact@v2
with:
name: state
path: terraform.tfstate
# debug:
# needs: deploy
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/download-artifact@v2
# with:
# name: state
# - run: |
# terraform init
# while sleep 8; do
# terraform refresh
# terraform show
# done
train:
needs: deploy
strategy:
matrix:
epochs: [3, 5, 7, 9]
runs-on: cml-matrix-${{ github.run_id }}
steps:
- uses: actions/checkout@v2
- uses: iterative/setup-cml@v1
- run: |
echo "$MATRIX_EPOCH" > epoch.txt
cml pr epoch.txt
env:
MATRIX_EPOCH: ${{ matrix.epoch }}
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
destroy:
if: always()
needs: train
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: state
- run: |
terraform init
terraform destroy --auto-approve