Jenkinsfile 19.9 KB
Newer Older
Lingfan Yu's avatar
Lingfan Yu committed
1
2
#!/usr/bin/env groovy

peizhou001's avatar
peizhou001 committed
3
dgl_linux_libs = 'build/libdgl.so, build/runUnitTests, python/dgl/_ffi/_cy3/core.cpython-*-x86_64-linux-gnu.so, build/tensoradapter/pytorch/*.so, build/dgl_sparse/*.so, build/graphbolt/*.so'
Minjie Wang's avatar
Minjie Wang committed
4
// Currently DGL on Windows is not working with Cython yet
peizhou001's avatar
peizhou001 committed
5
dgl_win64_libs = "build\\dgl.dll, build\\runUnitTests.exe, build\\tensoradapter\\pytorch\\*.dll, build\\dgl_sparse\\*.dll, build\\graphbolt\\*.dll"
Minjie Wang's avatar
Minjie Wang committed
6
7

def init_git() {
8
  sh 'rm -rf *'
Minjie Wang's avatar
Minjie Wang committed
9
  checkout scm
10
  sh 'git submodule update --recursive --init'
Lingfan Yu's avatar
Lingfan Yu committed
11
12
}

Minjie Wang's avatar
Minjie Wang committed
13
14
def init_git_win64() {
  checkout scm
15
  bat 'git submodule update --recursive --init'
Lingfan Yu's avatar
Lingfan Yu committed
16
17
}

Minjie Wang's avatar
Minjie Wang committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// pack libraries for later use
def pack_lib(name, libs) {
  echo "Packing ${libs} into ${name}"
  stash includes: libs, name: name
}

// unpack libraries saved before
def unpack_lib(name, libs) {
  unstash name
  echo "Unpacked ${libs} from ${name}"
}

def build_dgl_linux(dev) {
  init_git()
32
  sh "bash tests/scripts/build_dgl.sh ${dev}"
33
  sh 'ls -lh /usr/lib/x86_64-linux-gnu/'
Minjie Wang's avatar
Minjie Wang committed
34
  pack_lib("dgl-${dev}-linux", dgl_linux_libs)
Lingfan Yu's avatar
Lingfan Yu committed
35
36
}

Minjie Wang's avatar
Minjie Wang committed
37
def build_dgl_win64(dev) {
38
39
  /* Assuming that Windows slaves are already configured with MSBuild VS2017,
   * CMake and Python/pip/setuptools etc. */
Minjie Wang's avatar
Minjie Wang committed
40
  init_git_win64()
41
  bat "CALL tests\\scripts\\build_dgl.bat"
Minjie Wang's avatar
Minjie Wang committed
42
  pack_lib("dgl-${dev}-win64", dgl_win64_libs)
43
44
}

45
def cpp_unit_test_linux(dev) {
Minjie Wang's avatar
Minjie Wang committed
46
  init_git()
47
  unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
48
  sh 'bash tests/scripts/task_cpp_unit_test.sh'
VoVAllen's avatar
VoVAllen committed
49
50
}

Minjie Wang's avatar
Minjie Wang committed
51
52
def cpp_unit_test_win64() {
  init_git_win64()
53
  unpack_lib('dgl-cpu-win64', dgl_win64_libs)
VoVAllen's avatar
VoVAllen committed
54
55
56
  bat "CALL tests\\scripts\\task_cpp_unit_test.bat"
}

Minjie Wang's avatar
Minjie Wang committed
57
def unit_test_linux(backend, dev) {
Minjie Wang's avatar
Minjie Wang committed
58
  init_git()
Minjie Wang's avatar
Minjie Wang committed
59
  unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
60
  timeout(time: 30, unit: 'MINUTES') {
61
    sh "bash tests/scripts/task_unit_test.sh ${backend} ${dev}"
Minjie Wang's avatar
Minjie Wang committed
62
  }
Lingfan Yu's avatar
Lingfan Yu committed
63
64
}

65
66
67
def unit_distributed_linux(backend, dev) {
  init_git()
  unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
68
  timeout(time: 40, unit: 'MINUTES') {
69
70
71
72
    sh "bash tests/scripts/task_distributed_test.sh ${backend} ${dev}"
  }
}

73
74
75
76
77
78
79
80
def unit_test_cugraph(backend, dev) {
  init_git()
  unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
  timeout(time: 15, unit: 'MINUTES') {
    sh "bash tests/scripts/cugraph_unit_test.sh ${backend}"
  }
}

81
def unit_test_win64(backend, dev) {
Minjie Wang's avatar
Minjie Wang committed
82
  init_git_win64()
Minjie Wang's avatar
Minjie Wang committed
83
  unpack_lib("dgl-${dev}-win64", dgl_win64_libs)
84
  timeout(time: 50, unit: 'MINUTES') {
85
    bat "CALL tests\\scripts\\task_unit_test.bat ${backend}"
Minjie Wang's avatar
Minjie Wang committed
86
  }
Da Zheng's avatar
Da Zheng committed
87
88
}

Minjie Wang's avatar
Minjie Wang committed
89
def example_test_linux(backend, dev) {
Minjie Wang's avatar
Minjie Wang committed
90
  init_git()
Minjie Wang's avatar
Minjie Wang committed
91
  unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
Minjie Wang's avatar
Minjie Wang committed
92
93
  timeout(time: 20, unit: 'MINUTES') {
    sh "bash tests/scripts/task_example_test.sh ${dev}"
Minjie Wang's avatar
Minjie Wang committed
94
95
96
  }
}

97
def example_test_win64(backend, dev) {
Minjie Wang's avatar
Minjie Wang committed
98
  init_git_win64()
Minjie Wang's avatar
Minjie Wang committed
99
  unpack_lib("dgl-${dev}-win64", dgl_win64_libs)
Minjie Wang's avatar
Minjie Wang committed
100
101
  timeout(time: 20, unit: 'MINUTES') {
    bat "CALL tests\\scripts\\task_example_test.bat ${dev}"
102
103
104
  }
}

Minjie Wang's avatar
Minjie Wang committed
105
def tutorial_test_linux(backend) {
Minjie Wang's avatar
Minjie Wang committed
106
  init_git()
107
  unpack_lib('dgl-cpu-linux', dgl_linux_libs)
Minjie Wang's avatar
Minjie Wang committed
108
109
  timeout(time: 20, unit: 'MINUTES') {
    sh "bash tests/scripts/task_${backend}_tutorial_test.sh"
Minjie Wang's avatar
Minjie Wang committed
110
  }
Lingfan Yu's avatar
Lingfan Yu committed
111
112
}

Mufei Li's avatar
Mufei Li committed
113
114
115
def go_test_linux() {
  init_git()
  unpack_lib('dgl-cpu-linux', dgl_linux_libs)
Minjie Wang's avatar
Minjie Wang committed
116
  timeout(time: 20, unit: 'MINUTES') {
Mufei Li's avatar
Mufei Li committed
117
118
119
120
    sh "bash tests/scripts/task_go_test.sh"
  }
}

121
def is_authorized(name) {
122
123
124
125
126
127
128
129
  def devs = [
    // System:
    'dgl-bot', 'noreply',
    // Core:
    'Rhett-Ying', 'BarclayII', 'jermainewang', 'mufeili', 'isratnisa',
    'rudongyu', 'classicsong', 'HuXiangkun', 'hetong007', 'kylasa',
    'frozenbugs', 'peizhou001', 'zheng-da', 'czkkkkkk', 'thvasilo',
    // Intern:
xiangyuzhi's avatar
xiangyuzhi committed
130
    'keli-wen', 'caojy1998', 'RamonZhou', 'xiangyuzhi',
131
132
133
    // Friends:
    'nv-dlasalle', 'yaox12', 'chang-l', 'Kh4L', 'VibhuJawa', 'kkranen',
    'bgawrych', 'itaraban', 'daniil-sizov', 'anko-intel', 'Kacper-Pietkun',
134
    'hankaj', 'agrabows', 'DominikaJedynak', 'RafLit', 'mfbalin',
135
136
137
    // Emeritus:
    'VoVAllen',
  ]
138
139
140
141
142
143
  return (name in devs)
}

def is_admin(name) {
  def admins = ['dgl-bot', 'Rhett-Ying', 'BarclayII', 'jermainewang']
  return (name in admins)
144
}
VoVAllen's avatar
VoVAllen committed
145

146
147
def regression_test_done = false

Minjie Wang's avatar
Minjie Wang committed
148
pipeline {
Jinjing Zhou's avatar
Jinjing Zhou committed
149
  agent any
150
  triggers {
Rhett Ying's avatar
Rhett Ying committed
151
        issueCommentTrigger('@dgl-bot.*')
152
  }
Minjie Wang's avatar
Minjie Wang committed
153
  stages {
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
    // Below 2 stages are to authenticate the change/comment author.
    // Only core developers are allowed to trigger CI.
    // Such authentication protects CI from malicious code which may bring CI instances down.
    stage('Authentication') {
      agent {
        docker {
            label 'linux-benchmark-node'
            image 'dgllib/dgl-ci-lint'
            alwaysPull true
        }
      }
      when { not { triggeredBy 'IssueCommentCause' } }
      steps {
        script {
          def author = env.CHANGE_AUTHOR
          def prOpenTriggerCause = currentBuild.getBuildCauses('jenkins.branch.BranchEventCause')
          def first_run = prOpenTriggerCause && env.BUILD_ID == '1'
          if (author && !is_authorized(author)) {
Rhett Ying's avatar
Rhett Ying committed
172
            pullRequest.comment("Not authorized to trigger CI. Please ask core developer to help trigger via issuing comment: \n - `@dgl-bot`")
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
            error("Authentication failed.")
          }
          if (first_run) {
            pullRequest.comment('To trigger regression tests: \n - `@dgl-bot run [instance-type] [which tests] [compare-with-branch]`; \n For example: `@dgl-bot run g4dn.4xlarge all dmlc/master` or `@dgl-bot run c5.9xlarge kernel,api dmlc/master`')
          }
        }
      }
    }
    stage('AuthenticationComment') {
      agent {
        docker {
            label 'linux-benchmark-node'
            image 'dgllib/dgl-ci-lint'
            alwaysPull true
        }
      }
      when { triggeredBy 'IssueCommentCause' }
      steps {
        script {
          def author = env.GITHUB_COMMENT_AUTHOR
          if (!is_authorized(author)) {
            pullRequest.comment("Not authorized to trigger CI via issuing comment.")
            error("Authentication failed.")
          }
        }
      }
    }
    stage('Regression Test') {
201
      agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
202
203
204
205
        docker {
            label 'linux-benchmark-node'
            image 'dgllib/dgl-ci-lint'
            alwaysPull true
Jinjing Zhou's avatar
Jinjing Zhou committed
206
        }
VoVAllen's avatar
VoVAllen committed
207
      }
208
      when { triggeredBy 'IssueCommentCause' }
Minjie Wang's avatar
Minjie Wang committed
209
      steps {
Jinjing Zhou's avatar
Jinjing Zhou committed
210
211
          checkout scm
          script {
212
              def comment = env.GITHUB_COMMENT
Rhett Ying's avatar
Rhett Ying committed
213
214
215
216
217
218
219
220
221
              def command_lists = comment.split(' ')
              if (command_lists.size() == 1) {
                // CI command, not for regression
                return
              }
              if (command_lists.size() != 5) {
                pullRequest.comment('Cannot run the regression test due to unknown command')
                error('Unknown command')
              }
222
              def author = env.GITHUB_COMMENT_AUTHOR
223
224
              echo("${env.GIT_URL}")
              echo("${env}")
225
              if (!is_admin(author)) {
226
                error('Not authorized to launch regression tests')
227
228
              }
              dir('benchmark_scripts_repo') {
Jinjing Zhou's avatar
Jinjing Zhou committed
229
230
                checkout([$class: 'GitSCM', branches: [[name: '*/master']],
                        userRemoteConfigs: [[credentialsId: 'github', url: 'https://github.com/dglai/DGL_scripts.git']]])
231
232
233
              }
              sh('cp benchmark_scripts_repo/benchmark/* benchmarks/scripts/')
              def instance_type = command_lists[2].replace('.', '')
Jinjing Zhou's avatar
Jinjing Zhou committed
234
              pullRequest.comment("Start the Regression test. View at ${RUN_DISPLAY_URL}")
235
              def prNumber = env.BRANCH_NAME.replace('PR-', '')
236
237
              dir('benchmarks/scripts') {
                sh('python3 -m pip install boto3')
238
                sh("PYTHONUNBUFFERED=1 GIT_PR_ID=${prNumber} GIT_URL=${env.GIT_URL} GIT_BRANCH=${env.CHANGE_BRANCH} python3 run_reg_test.py --data-folder ${env.GIT_COMMIT}_${instance_type} --run-cmd '${comment}'")
239
240
241
              }
              pullRequest.comment("Finished the Regression test. Result table is at https://dgl-asv-data.s3-us-west-2.amazonaws.com/${env.GIT_COMMIT}_${instance_type}/results/result.csv. Jenkins job link is ${RUN_DISPLAY_URL}. ")
              currentBuild.result = 'SUCCESS'
242
              regression_test_done = true
Jinjing Zhou's avatar
Jinjing Zhou committed
243
          }
244
      }
Minjie Wang's avatar
Minjie Wang committed
245
    }
Jinjing Zhou's avatar
Jinjing Zhou committed
246
    stage('CI') {
247
      when { expression { !regression_test_done } }
Jinjing Zhou's avatar
Jinjing Zhou committed
248
      stages {
249
250
251
        stage('Abort Previous CI') {
          steps {
            script {
252
253
254
255
256
257
258
259
              if (env.BRANCH_NAME != "master") {
                // Jenkins will abort an older build if a newer build already
                // passed a higher milestone.
                // https://www.jenkins.io/doc/pipeline/steps/pipeline-milestone-step/
                def buildNumber = env.BUILD_NUMBER as int
                for (int i = 1; i <= buildNumber; i++) {
                  milestone(i)
                }
260
261
262
263
264
              }
            }
          }
        }

265
266
        stage('Lint Check') {
          agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
267
            docker {
268
              label "linux-benchmark-node"
Mufei Li's avatar
Mufei Li committed
269
              image "dgllib/dgl-ci-lint"
Jinjing Zhou's avatar
Jinjing Zhou committed
270
              alwaysPull true
VoVAllen's avatar
VoVAllen committed
271
272
            }
          }
Minjie Wang's avatar
Minjie Wang committed
273
          steps {
274
275
            init_git()
            sh 'bash tests/scripts/task_lint.sh'
VoVAllen's avatar
VoVAllen committed
276
          }
277
278
279
280
281
          post {
            always {
              cleanWs disableDeferredWipeout: true, deleteDirs: true
            }
          }
VoVAllen's avatar
VoVAllen committed
282
        }
Mufei Li's avatar
Mufei Li committed
283

284
285
286
287
        stage('Build') {
          parallel {
            stage('CPU Build') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
288
289
                docker {
                  label "linux-cpu-node"
290
                  image "dgllib/dgl-ci-cpu:v230711"
Jinjing Zhou's avatar
Jinjing Zhou committed
291
292
                  args "-u root"
                  alwaysPull true
293
                }
Jinjing Zhou's avatar
Jinjing Zhou committed
294
295
              }
              steps {
296
                build_dgl_linux('cpu')
Jinjing Zhou's avatar
Jinjing Zhou committed
297
              }
298
299
300
301
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
302
              }
Lingfan Yu's avatar
Lingfan Yu committed
303
            }
304
305
            stage('GPU Build') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
306
307
                docker {
                  label "linux-cpu-node"
308
                  image "dgllib/dgl-ci-gpu:cu116_v230711"
Jinjing Zhou's avatar
Jinjing Zhou committed
309
310
                  args "-u root"
                  alwaysPull true
311
                }
Minjie Wang's avatar
Minjie Wang committed
312
313
              }
              steps {
314
315
                // sh "nvidia-smi"
                build_dgl_linux('gpu')
Minjie Wang's avatar
Minjie Wang committed
316
              }
317
318
319
320
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
321
              }
322
            }
323
324
325
326
            stage('PyTorch Cugraph GPU Build') {
              agent {
                docker {
                  label "linux-cpu-node"
327
                  image "rapidsai/cugraph_stable_torch-cuda:11.8-base-ubuntu20.04-py3.10-pytorch2.0.0-rapids23.04"
328
                  args "-u root"
329
                  alwaysPull true
330
331
332
333
334
335
336
337
338
339
340
                }
              }
              steps {
                build_dgl_linux('cugraph')
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
341
342
343
344
            stage('CPU Build (Win64)') {
              // Windows build machines are manually added to Jenkins master with
              // "windows" label as permanent agents.
              agent { label 'windows' }
Minjie Wang's avatar
Minjie Wang committed
345
              steps {
346
347
348
349
350
351
                build_dgl_win64('cpu')
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
352
              }
Lingfan Yu's avatar
Lingfan Yu committed
353
            }
354
          // Currently we don't have Windows GPU build machines
355
          }
Lingfan Yu's avatar
Lingfan Yu committed
356
        }
357
358
359
360
        stage('Test') {
          parallel {
            stage('C++ CPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
361
362
                docker {
                  label "linux-cpu-node"
363
                  image "dgllib/dgl-ci-cpu:v230711"
Jinjing Zhou's avatar
Jinjing Zhou committed
364
                  alwaysPull true
365
366
                }
              }
Minjie Wang's avatar
Minjie Wang committed
367
              steps {
368
369
370
371
372
373
374
375
376
377
                cpp_unit_test_linux('cpu')
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
            stage('C++ GPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
378
379
                docker {
                  label "linux-gpu-node"
380
                  image "dgllib/dgl-ci-gpu:cu116_v230711"
Jinjing Zhou's avatar
Jinjing Zhou committed
381
382
                  args "--runtime nvidia"
                  alwaysPull true
383
384
385
386
                }
              }
              steps {
                cpp_unit_test_linux('gpu')
387
388
389
390
391
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
392
393
              }
            }
394
395
            stage('C++ CPU (Win64)') {
              agent { label 'windows' }
Minjie Wang's avatar
Minjie Wang committed
396
              steps {
397
398
399
400
401
402
                cpp_unit_test_win64()
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
403
              }
Minjie Wang's avatar
Minjie Wang committed
404
            }
405
406
            stage('Tensorflow CPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
407
408
                docker {
                  label "linux-cpu-node"
409
                  image "dgllib/dgl-ci-cpu:v230711"
Jinjing Zhou's avatar
Jinjing Zhou committed
410
                  alwaysPull true
411
412
413
                }
              }
              stages {
414
                stage('Tensorflow CPU Unit test') {
415
416
417
418
419
420
421
422
423
424
                  steps {
                    unit_test_linux('tensorflow', 'cpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
425
            }
426
427
            stage('Tensorflow GPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
428
429
                docker {
                  label "linux-gpu-node"
430
                  image "dgllib/dgl-ci-gpu:cu116_v230711"
Jinjing Zhou's avatar
Jinjing Zhou committed
431
432
                  args "--runtime nvidia"
                  alwaysPull true
433
434
435
                }
              }
              stages {
436
                stage('Tensorflow GPU Unit test') {
437
438
439
                  steps {
                    unit_test_linux('tensorflow', 'gpu')
                  }
440
441
                  // Tensorflow does not support cuda 11.6 yet.
                  when { expression { false } }
442
443
444
445
446
447
448
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
VoVAllen's avatar
VoVAllen committed
449
            }
450
451
            stage('Torch CPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
452
453
                docker {
                  label "linux-cpu-node"
454
                  image "dgllib/dgl-ci-cpu:v230711"
Jinjing Zhou's avatar
Jinjing Zhou committed
455
456
                  args "--shm-size=4gb"
                  alwaysPull true
457
458
459
                }
              }
              stages {
460
                stage('Torch CPU Unit test') {
461
462
463
464
                  steps {
                    unit_test_linux('pytorch', 'cpu')
                  }
                }
465
                stage('Torch CPU Example test') {
466
467
468
469
                  steps {
                    example_test_linux('pytorch', 'cpu')
                  }
                }
470
                stage('Torch CPU Tutorial test') {
471
472
473
474
475
476
477
478
479
                  steps {
                    tutorial_test_linux('pytorch')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
VoVAllen's avatar
VoVAllen committed
480
              }
Da Zheng's avatar
Da Zheng committed
481
            }
482
483
484
            stage('Torch CPU (Win64)') {
              agent { label 'windows' }
              stages {
485
                stage('Torch CPU (Win64) Unit test') {
486
487
488
489
                  steps {
                    unit_test_win64('pytorch', 'cpu')
                  }
                }
490
                stage('Torch CPU (Win64) Example test') {
491
492
493
494
495
496
497
498
499
500
                  steps {
                    example_test_win64('pytorch', 'cpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
501
            }
502
503
            stage('Torch GPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
504
505
                docker {
                  label "linux-gpu-node"
506
                  image "dgllib/dgl-ci-gpu:cu116_v230711"
Jinjing Zhou's avatar
Jinjing Zhou committed
507
508
                  args "--runtime nvidia --shm-size=8gb"
                  alwaysPull true
509
510
511
                }
              }
              stages {
512
                stage('Torch GPU Unit test') {
513
514
515
516
517
                  steps {
                    sh 'nvidia-smi'
                    unit_test_linux('pytorch', 'gpu')
                  }
                }
518
                stage('Torch GPU Example test') {
519
520
521
522
523
524
525
526
527
528
                  steps {
                    example_test_linux('pytorch', 'gpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
529
            }
530
531
532
533
            stage('Distributed') {
              agent {
                docker {
                  label "linux-cpu-node"
534
                  image "dgllib/dgl-ci-cpu:v230711"
535
536
537
538
539
540
541
542
543
                  args "--shm-size=4gb"
                  alwaysPull true
                }
              }
              stages {
                stage('Distributed Torch CPU Unit test') {
                  steps {
                    unit_distributed_linux('pytorch', 'cpu')
                  }
544
                  when { expression { false } }
545
546
547
548
549
550
551
552
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
553
554
555
556
            stage('PyTorch Cugraph GPU') {
              agent {
                docker {
                  label "linux-gpu-node"
557
                  image "rapidsai/cugraph_stable_torch-cuda:11.8-base-ubuntu20.04-py3.10-pytorch2.0.0-rapids23.04"
558
                  args "--runtime nvidia --shm-size=8gb"
559
                  alwaysPull true
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
                }
              }
              stages {
                stage('PyTorch Cugraph GPU Unit test') {
                  steps {
                    sh 'nvidia-smi'
                    unit_test_cugraph('pytorch', 'cugraph')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
Minjie Wang's avatar
Minjie Wang committed
576
577
578
579
            stage('DGL-Go') {
              agent {
                docker {
                  label "linux-cpu-node"
580
                  image "dgllib/dgl-ci-cpu:v230711"
Minjie Wang's avatar
Minjie Wang committed
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
                  alwaysPull true
                }
              }
              stages {
                stage('DGL-Go CPU test') {
                  steps {
                    go_test_linux()
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
597
598
          }
        }
Minjie Wang's avatar
Minjie Wang committed
599
      }
Minjie Wang's avatar
Minjie Wang committed
600
    }
Minjie Wang's avatar
Minjie Wang committed
601
  }
602
603
  post {
    always {
604
      script {
605
        node("dglci-post-linux") {
606
607
608
          docker.image('dgllib/dgl-ci-awscli:v220418').inside("--pull always --entrypoint=''") {
            sh("rm -rf ci_tmp")
            dir('ci_tmp') {
609
              sh("curl -k -o cireport.log ${BUILD_URL}consoleText")
Rhett Ying's avatar
Rhett Ying committed
610
611
              sh("curl -o report.py https://raw.githubusercontent.com/dmlc/dgl/master/tests/scripts/ci_report/report.py")
              sh("curl -o status.py https://raw.githubusercontent.com/dmlc/dgl/master/tests/scripts/ci_report/status.py")
612
              sh("curl -k -L ${BUILD_URL}wfapi")
613
614
615
616
617
              sh("cat status.py")
              sh("pytest --html=report.html --self-contained-html report.py || true")
              sh("aws s3 sync ./ s3://dgl-ci-result/${JOB_NAME}/${BUILD_NUMBER}/${BUILD_ID}/logs/  --exclude '*' --include '*.log' --acl public-read --content-type text/plain")
              sh("aws s3 sync ./ s3://dgl-ci-result/${JOB_NAME}/${BUILD_NUMBER}/${BUILD_ID}/logs/  --exclude '*.log' --acl public-read")

618
              def comment = sh(returnStdout: true, script: "python3 status.py --result ${currentBuild.currentResult}").trim()
619
              echo(comment)
620
621
622
              if ((env.BRANCH_NAME).startsWith('PR-')) {
                pullRequest.comment(comment)
              }
623
624
625
626
627
628
            }
          }
        }
        node('windows') {
            bat(script: "rmvirtualenv ${BUILD_TAG}", returnStatus: true)
        }
629
630
631
      }
    }
  }
Minjie Wang's avatar
Minjie Wang committed
632
}