"vscode:/vscode.git/clone" did not exist on "6e01e8c1c8ea323d30e3f57050469b2df66b56c6"
Jenkinsfile 4.97 KB
Newer Older
Lingfan Yu's avatar
Lingfan Yu committed
1
2
#!/usr/bin/env groovy

Lingfan Yu's avatar
Lingfan Yu committed
3
def init_git_submodule() {
Lingfan Yu's avatar
Lingfan Yu committed
4
5
6
7
    sh 'git submodule init'
    sh 'git submodule update'
}

Lingfan Yu's avatar
Lingfan Yu committed
8
9
10
11
12
def setup() {
    sh 'easy_install nose'
    init_git_submodule()
}

Lingfan Yu's avatar
Lingfan Yu committed
13
14
15
16
17
18
19
def build_dgl() {
    sh 'if [ -d build ]; then rm -rf build; fi; mkdir build'
    dir('python') {
        sh 'python3 setup.py install'
    }
    dir ('build') {
        sh 'cmake ..'
20
        sh 'make -j4'
Lingfan Yu's avatar
Lingfan Yu committed
21
22
23
    }
}

Da Zheng's avatar
Da Zheng committed
24
def pytorch_unit_test() {
Lingfan Yu's avatar
Lingfan Yu committed
25
26
27
28
29
30
31
    withEnv(["DGL_LIBRARY_PATH=${env.WORKSPACE}/build"]) {
        sh 'nosetests tests -v --with-xunit'
        sh 'nosetests tests/pytorch -v --with-xunit'
        sh 'nosetests tests/graph_index -v --with-xunit'
    }
}

Da Zheng's avatar
Da Zheng committed
32
33
34
35
36
37
def mxnet_unit_test() {
    withEnv(["DGL_LIBRARY_PATH=${env.WORKSPACE}/build"]) {
        sh 'nosetests tests/mxnet -v --with-xunit'
    }
}

Lingfan Yu's avatar
Lingfan Yu committed
38
39
40
41
42
43
44
45
def example_test(dev) {
    dir ('tests/scripts') {
        withEnv(["DGL_LIBRARY_PATH=${env.WORKSPACE}/build"]) {
            sh "./test_examples.sh ${dev}"
        }
    }
}

Minjie Wang's avatar
Minjie Wang committed
46
pipeline {
Lingfan Yu's avatar
Lingfan Yu committed
47
    agent none
Minjie Wang's avatar
Minjie Wang committed
48
    stages {
Lingfan Yu's avatar
Lingfan Yu committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
        stage('Lint Check') {
            agent {
                docker {
                    image 'lingfanyu/dgl-lint'
                }
            }
            stages {
                stage('CHECK') {
                    steps {
                        init_git_submodule()
                        sh 'tests/scripts/task_lint.sh'
                    }
                }
            }
        }
Da Zheng's avatar
Da Zheng committed
64
        stage('Build and Test on Pytorch') {
Lingfan Yu's avatar
Lingfan Yu committed
65
66
67
68
69
70
71
72
73
74
            parallel {
                stage('CPU') {
                    agent {
                        docker {
                            image 'lingfanyu/dgl-cpu'
                        }
                    }
                    stages {
                        stage('SETUP') {
                            steps {
Lingfan Yu's avatar
Lingfan Yu committed
75
                                setup()
Lingfan Yu's avatar
Lingfan Yu committed
76
77
78
79
                            }
                        }
                        stage('BUILD') {
                            steps {
Lingfan Yu's avatar
Lingfan Yu committed
80
81
82
83
84
                                build_dgl()
                            }
                        }
                        stage('UNIT TEST') {
                            steps {
Da Zheng's avatar
Da Zheng committed
85
                                pytorch_unit_test()
Lingfan Yu's avatar
Lingfan Yu committed
86
87
                            }
                        }
Lingfan Yu's avatar
Lingfan Yu committed
88
                        stage('EXAMPLE TEST') {
Lingfan Yu's avatar
Lingfan Yu committed
89
                            steps {
Lingfan Yu's avatar
Lingfan Yu committed
90
                                example_test('CPU')
Lingfan Yu's avatar
Lingfan Yu committed
91
92
93
94
95
96
97
98
99
100
101
102
103
                            }
                        }
                    }
                    post {
                        always {
                            junit '*.xml'
                        }
                    }
                }
                stage('GPU') {
                    agent {
                        docker {
                            image 'lingfanyu/dgl-gpu'
Lingfan Yu's avatar
Lingfan Yu committed
104
                            args '--runtime nvidia'
Lingfan Yu's avatar
Lingfan Yu committed
105
106
107
108
109
                        }
                    }
                    stages {
                        stage('SETUP') {
                            steps {
Lingfan Yu's avatar
Lingfan Yu committed
110
                                setup()
Lingfan Yu's avatar
Lingfan Yu committed
111
112
113
114
                            }
                        }
                        stage('BUILD') {
                            steps {
Lingfan Yu's avatar
Lingfan Yu committed
115
116
117
118
119
                                build_dgl()
                            }
                        }
                        stage('UNIT TEST') {
                            steps {
Da Zheng's avatar
Da Zheng committed
120
                                pytorch_unit_test()
Lingfan Yu's avatar
Lingfan Yu committed
121
122
                            }
                        }
Lingfan Yu's avatar
Lingfan Yu committed
123
                        stage('EXAMPLE TEST') {
Lingfan Yu's avatar
Lingfan Yu committed
124
                            steps {
Lingfan Yu's avatar
Lingfan Yu committed
125
                                example_test('GPU')
Lingfan Yu's avatar
Lingfan Yu committed
126
127
128
129
130
131
132
133
                            }
                        }
                    }
                    post {
                        always {
                            junit '*.xml'
                        }
                    }
Minjie Wang's avatar
Minjie Wang committed
134
135
136
                }
            }
        }
Da Zheng's avatar
Da Zheng committed
137
138
139
140
141
        stage('Build and Test on MXNet') {
            parallel {
                stage('CPU') {
                    agent {
                        docker {
142
                            image 'zhengda1936/dgl-mxnet-cpu:v3'
Da Zheng's avatar
Da Zheng committed
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
                        }
                    }
                    stages {
                        stage('SETUP') {
                            steps {
                                setup()
                            }
                        }
                        stage('BUILD') {
                            steps {
                                build_dgl()
                            }
                        }
                        stage('UNIT TEST') {
                            steps {
                                mxnet_unit_test()
                            }
                        }
                        stage('EXAMPLE TEST') {
                            steps {
                                example_test('CPU')
                            }
                        }
                    }
                    post {
                        always {
                            junit '*.xml'
                        }
                    }
                }
            }
        }
Minjie Wang's avatar
Minjie Wang committed
175
176
    }
}