forked from NVIDIA/NeMo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.groovy
86 lines (78 loc) · 2.98 KB
/
ci.groovy
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
@Library('blossom-github-lib@master')
import ipp.blossom.*
podTemplate(cloud:'sc-ipp-blossom-prod', yaml : """
apiVersion: v1
kind: Pod
metadata:
labels:
some-label: some-label-value
spec:
volumes:
- name: scratch
nfs:
server: ipp1-cdot01-col01
path: /vol/scratch1/scratch.okuchaiev_blossom
containers:
- name: cuda
image: nvcr.io/nvidia/pytorch:22.05-py3
command:
- cat
volumeMounts:
- name: scratch
mountPath: /testdata
resources:
requests:
nvidia.com/gpu: 1
limits:
nvidia.com/gpu: 1
restartPolicy: Never
backoffLimit: 4
tty: true
nodeSelector:
kubernetes.io/os: linux
nvidia.com/gpu_type: "A100_PCIE_40GB"
"""
) {
node(POD_LABEL) {
def githubHelper
stage('Get Token') {
withCredentials([usernamePassword(credentialsId: 'GHAtoken', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
// create new instance of helper object
githubHelper = GithubHelper.getInstance("${GIT_PASSWORD}", githubData)
}
}
def stageName = ''
try {
currentBuild.description = githubHelper.getBuildDescription()
container('cuda') {
stageName = 'Code checkout'
stage(stageName) {
// update status on github
githubHelper.updateCommitStatus("$BUILD_URL", "$stageName Running", GitHubCommitState.PENDING)
checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: "pr/"+githubHelper.getPRNumber()]],
doGenerateSubmoduleConfigurations: false,
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'github-token', url: githubHelper.getCloneUrl(), refspec: '+refs/pull/*/head:refs/remotes/origin/pr/*']]]
}
stageName = "Code Style"
stage(stageName) {
sh "apt-get update && \
apt-get install -y bc && \
pip install -r requirements/requirements_test.txt && \
python setup.py style && ls -l /testdata"
}
stageName = 'Installation & GPU unit tests'
stage(stageName) {
sh "nvidia-smi && ./reinstall.sh release && \
NEMO_NUMBA_MINVER=0.53 pytest -m 'not pleasefixme and not torch_tts'"
}
}
githubHelper.updateCommitStatus("$BUILD_URL", "Complete", GitHubCommitState.SUCCESS)
}
catch (Exception ex){
currentBuild.result = 'FAILURE'
println ex
githubHelper.updateCommitStatus("$BUILD_URL", "$stageName Failed", GitHubCommitState.FAILURE)
}
}
}