-
Notifications
You must be signed in to change notification settings - Fork 344
/
Copy path.gitlab-ci.yml
54 lines (50 loc) · 1.26 KB
/
.gitlab-ci.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
deploy-runner:
only:
refs: [master]
image: iterativeai/cml:0-dvc2-base1
script:
- pip install awscli
- >
CREDENTIALS=($(aws sts assume-role-with-web-identity --region=us-west-1
--role-arn=arn:aws:iam::342840881361:role/SandboxUser
--role-session-name=GitLab --duration-seconds=3600
--web-identity-token="$CI_JOB_JWT_V2"
--query="Credentials.[AccessKeyId,SecretAccessKey,SessionToken]"
--output=text))
- export AWS_ACCESS_KEY_ID="${CREDENTIALS[0]}"
- export AWS_SECRET_ACCESS_KEY="${CREDENTIALS[1]}"
- export AWS_SESSION_TOKEN="${CREDENTIALS[2]}"
- |
cml runner \
--cloud=aws \
--cloud-region=us-west \
--cloud-type=g4dn.xlarge \
--cloud-spot \
--labels=cml-runner-gpu
test-runner:
needs: [deploy-runner]
only:
refs: [master]
tags:
- cml-runner-gpu
script:
- pip install tensorboard
- npm ci
- npm run lint
- npm run test
- nvidia-smi
test-container:
needs: [deploy-runner]
only:
refs: [master]
tags:
- cml-runner-gpu
image: iterativeai/cml:0-dvc2-base1-gpu
script:
- dvc --version
- cml --version
- pip install tensorboard
- npm ci
- npm run lint
- npm run test
- nvidia-smi