forked from NVIDIA/Megatron-LM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jet-tests.yml
97 lines (90 loc) · 3.13 KB
/
jet-tests.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.jet_common:
stage: jet
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_APPROVED
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /READY FOR REVIEW/'
- if: $JET_CUSTOM_FILTER != "" && $CI_PIPELINE_SOURCE != 'merge_request_event'
- when: never
include:
- project: dl/jet/gitlab-templates
ref: main
file: downstreams.yml
jet-setup:
extends: [ .jet_common ]
tags:
- os/linux
script:
- set -x
- |
if [[ $CI_PIPELINE_SOURCE == "merge_request_event" ]] && [[ $CI_MERGE_REQUEST_APPROVED || $CI_MERGE_REQUEST_LABELS =~ "READY FOR REVIEW" ]]; then
JET_FILTER="type == 'build' or 'merge-request' in spec.scope"
elif [[ -n $JET_CUSTOM_FILTER && $CI_PIPELINE_SOURCE != 'merge_request_event' ]]; then
JET_FILTER=$JET_CUSTOM_FILTER
else
JET_FILTER="False"
fi
echo "_JET_FILTER=$JET_FILTER" | tee -a config.env
artifacts:
reports:
dotenv: config.env
jet-configure:
image: alpine
extends: [.jet_common, .jet-configure]
tags:
- os/linux
script:
- wget https://github.com/mikefarah/yq/releases/download/v4.35.2/yq_linux_amd64.tar.gz -O - | tar xz && mv yq_linux_amd64 /usr/local/bin/yq
- cd tests/functional_tests/jet_recipes
- |
if [[ $CI_PIPELINE_SOURCE == "merge_request_event" ]]; then
yq e ".spec.source.ref = \"merge-requests/${CI_MERGE_REQUEST_IID}/head\"" -i build-pyt.yaml
else
yq e ".spec.source.ref = \"${CI_COMMIT_REF_NAME}\"" -i build-pyt.yaml
fi
artifacts:
paths:
- tests/functional_tests/jet_recipes
jet-trigger:
stage: jet
extends: [.jet_common, .jet-trigger]
needs: [ jet-configure, jet-setup ]
trigger:
project: dl/jet/ci
branch: $JET_CLUSTER_BRANCH
strategy: depend
inherit:
variables:
- JET_CUSTOM_FILTER
- JET_CLUSTER_BRANCH
variables:
JET_WORKLOADS_FILTER: "$_JET_FILTER"
jet-functional-results:
stage: jet
image: gitlab-master.nvidia.com:5005/dl/jet/api:latest
tags:
- os/linux
needs: [ jet-trigger ]
before_script:
- jet secrets jwt-login jwt/nvidia/gitlab-master adlr-megatron-lm-ci $CI_JOB_JWT
script:
- python -m pip install -U --no-cache-dir prettytable
- python tests/functional_tests/python_test_utils/jet_test_pipeline.py ${CI_PIPELINE_ID} --test exit
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_APPROVED
when: always
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_LABELS =~ /READY FOR REVIEW/'
when: always
- if: $JET_CUSTOM_FILTER != "" && $CI_PIPELINE_SOURCE != 'merge_request_event'
when: always
- when: never
jet-compare-metrics:
extends: .jet_common
image: gitlab-master.nvidia.com:5005/dl/jet/api:latest
tags:
- os/linux
needs: [ jet-functional-results ]
before_script:
- jet secrets jwt-login jwt/nvidia/gitlab-master adlr-megatron-lm-ci $CI_JOB_JWT
script:
- python -m pip install -U --no-cache-dir pytest tensorboard
- python tests/functional_tests/python_test_utils/jet_test_pipeline.py ${CI_PIPELINE_ID} --test metrics