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

3
dgl_linux_libs = 'build/libdgl.so, build/runUnitTests, python/dgl/_ffi/_cy3/core.cpython-*-x86_64-linux-gnu.so, build/tensoradapter/pytorch/*.so'
Minjie Wang's avatar
Minjie Wang committed
4
// Currently DGL on Windows is not working with Cython yet
5
dgl_win64_libs = "build\\dgl.dll, build\\runUnitTests.exe, build\\tensoradapter\\pytorch\\*.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
68
69
70
71
72
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}"
  }
}

73
def unit_test_win64(backend, dev) {
Minjie Wang's avatar
Minjie Wang committed
74
  init_git_win64()
Minjie Wang's avatar
Minjie Wang committed
75
  unpack_lib("dgl-${dev}-win64", dgl_win64_libs)
76
  timeout(time: 30, unit: 'MINUTES') {
77
    bat "CALL tests\\scripts\\task_unit_test.bat ${backend}"
Minjie Wang's avatar
Minjie Wang committed
78
  }
Da Zheng's avatar
Da Zheng committed
79
80
}

Minjie Wang's avatar
Minjie Wang committed
81
def example_test_linux(backend, dev) {
Minjie Wang's avatar
Minjie Wang committed
82
  init_git()
Minjie Wang's avatar
Minjie Wang committed
83
  unpack_lib("dgl-${dev}-linux", dgl_linux_libs)
Minjie Wang's avatar
Minjie Wang committed
84
85
  timeout(time: 20, unit: 'MINUTES') {
    sh "bash tests/scripts/task_example_test.sh ${dev}"
Minjie Wang's avatar
Minjie Wang committed
86
87
88
  }
}

89
def example_test_win64(backend, dev) {
Minjie Wang's avatar
Minjie Wang committed
90
  init_git_win64()
Minjie Wang's avatar
Minjie Wang committed
91
  unpack_lib("dgl-${dev}-win64", dgl_win64_libs)
Minjie Wang's avatar
Minjie Wang committed
92
93
  timeout(time: 20, unit: 'MINUTES') {
    bat "CALL tests\\scripts\\task_example_test.bat ${dev}"
94
95
96
  }
}

Minjie Wang's avatar
Minjie Wang committed
97
def tutorial_test_linux(backend) {
Minjie Wang's avatar
Minjie Wang committed
98
  init_git()
99
  unpack_lib('dgl-cpu-linux', dgl_linux_libs)
Minjie Wang's avatar
Minjie Wang committed
100
101
  timeout(time: 20, unit: 'MINUTES') {
    sh "bash tests/scripts/task_${backend}_tutorial_test.sh"
Minjie Wang's avatar
Minjie Wang committed
102
  }
Lingfan Yu's avatar
Lingfan Yu committed
103
104
}

Mufei Li's avatar
Mufei Li committed
105
106
107
def go_test_linux() {
  init_git()
  unpack_lib('dgl-cpu-linux', dgl_linux_libs)
Minjie Wang's avatar
Minjie Wang committed
108
  timeout(time: 20, unit: 'MINUTES') {
Mufei Li's avatar
Mufei Li committed
109
110
111
112
    sh "bash tests/scripts/task_go_test.sh"
  }
}

113
def is_authorized(name) {
114
  def authorized_user = ['VoVAllen', 'BarclayII', 'jermainewang', 'zheng-da', 'mufeili', 'Rhett-Ying', 'isratnisa']
115
116
  return (name in authorized_user)
}
VoVAllen's avatar
VoVAllen committed
117

Minjie Wang's avatar
Minjie Wang committed
118
pipeline {
Jinjing Zhou's avatar
Jinjing Zhou committed
119
  agent any
120
121
122
  triggers {
        issueCommentTrigger('@dgl-bot .*')
  }
Minjie Wang's avatar
Minjie Wang committed
123
  stages {
124
125
    stage('Regression Test Trigger') {
      agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
126
127
128
129
        docker {
            label 'linux-benchmark-node'
            image 'dgllib/dgl-ci-lint'
            alwaysPull true
Jinjing Zhou's avatar
Jinjing Zhou committed
130
        }
VoVAllen's avatar
VoVAllen committed
131
      }
132
      when { triggeredBy 'IssueCommentCause' }
Minjie Wang's avatar
Minjie Wang committed
133
      steps {
Jinjing Zhou's avatar
Jinjing Zhou committed
134
135
136
        // container('dgl-ci-lint') {
          checkout scm
          script {
137
138
              def comment = env.GITHUB_COMMENT
              def author = env.GITHUB_COMMENT_AUTHOR
139
140
              echo("${env.GIT_URL}")
              echo("${env}")
141
              if (!is_authorized(author)) {
142
                error('Not authorized to launch regression tests')
143
144
              }
              dir('benchmark_scripts_repo') {
Jinjing Zhou's avatar
Jinjing Zhou committed
145
146
                checkout([$class: 'GitSCM', branches: [[name: '*/master']],
                        userRemoteConfigs: [[credentialsId: 'github', url: 'https://github.com/dglai/DGL_scripts.git']]])
147
148
149
150
151
              }
              sh('cp benchmark_scripts_repo/benchmark/* benchmarks/scripts/')
              def command_lists = comment.split(' ')
              def instance_type = command_lists[2].replace('.', '')
              if (command_lists.size() != 5) {
Jinjing Zhou's avatar
Jinjing Zhou committed
152
153
              pullRequest.comment('Cannot run the regression test due to unknown command')
              error('Unknown command')
154
              } else {
Jinjing Zhou's avatar
Jinjing Zhou committed
155
              pullRequest.comment("Start the Regression test. View at ${RUN_DISPLAY_URL}")
156
              }
157
              def prNumber = env.BRANCH_NAME.replace('PR-', '')
158
159
              dir('benchmarks/scripts') {
                sh('python3 -m pip install boto3')
160
                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}'")
161
162
163
164
              }
              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'
              return
Jinjing Zhou's avatar
Jinjing Zhou committed
165
166
          }
        // }
167
      }
Minjie Wang's avatar
Minjie Wang committed
168
    }
169
170
    stage('Bot Instruction') {
      agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
171
172
173
174
        docker {
            label 'linux-benchmark-node'
            image 'dgllib/dgl-ci-lint'
            alwaysPull true
Minjie Wang's avatar
Minjie Wang committed
175
        }
176
177
178
179
180
181
182
      }
      steps {
        script {
          def prOpenTriggerCause = currentBuild.getBuildCauses('jenkins.branch.BranchEventCause')
          if (prOpenTriggerCause) {
            if (env.BUILD_ID == '1') {
              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`')
183
184
            }
          }
185
          echo('Not the first build')
186
        }
Minjie Wang's avatar
Minjie Wang committed
187
188
      }
    }
Jinjing Zhou's avatar
Jinjing Zhou committed
189
190
191
    stage('CI') {
      when { not { triggeredBy 'IssueCommentCause' } }
      stages {
192
193
        stage('Lint Check') {
          agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
194
195
            docker {
              label "linux-cpu-node"
Mufei Li's avatar
Mufei Li committed
196
              image "dgllib/dgl-ci-lint"
Jinjing Zhou's avatar
Jinjing Zhou committed
197
              alwaysPull true
VoVAllen's avatar
VoVAllen committed
198
199
            }
          }
Minjie Wang's avatar
Minjie Wang committed
200
          steps {
201
202
            init_git()
            sh 'bash tests/scripts/task_lint.sh'
VoVAllen's avatar
VoVAllen committed
203
          }
204
205
206
207
208
          post {
            always {
              cleanWs disableDeferredWipeout: true, deleteDirs: true
            }
          }
VoVAllen's avatar
VoVAllen committed
209
        }
Mufei Li's avatar
Mufei Li committed
210

211
212
213
214
        stage('Build') {
          parallel {
            stage('CPU Build') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
215
216
                docker {
                  label "linux-cpu-node"
217
                  image "dgllib/dgl-ci-cpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
218
219
                  args "-u root"
                  alwaysPull true
220
                }
Jinjing Zhou's avatar
Jinjing Zhou committed
221
222
              }
              steps {
223
                build_dgl_linux('cpu')
Jinjing Zhou's avatar
Jinjing Zhou committed
224
              }
225
226
227
228
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
229
              }
Lingfan Yu's avatar
Lingfan Yu committed
230
            }
231
232
            stage('GPU Build') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
233
234
                docker {
                  label "linux-cpu-node"
235
                  image "dgllib/dgl-ci-gpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
236
237
                  args "-u root"
                  alwaysPull true
238
                }
Minjie Wang's avatar
Minjie Wang committed
239
240
              }
              steps {
241
242
                // sh "nvidia-smi"
                build_dgl_linux('gpu')
Minjie Wang's avatar
Minjie Wang committed
243
              }
244
245
246
247
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
248
              }
249
            }
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
            stage('PyTorch Cugraph GPU Build') {
              agent {
                docker {
                  label "linux-cpu-node"
                  image "nvcr.io/nvidia/pytorch:22.04-py3"
                  args "-u root"
                  alwaysPull false
                }
              }
              steps {
                build_dgl_linux('cugraph')
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
268
269
270
271
            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
272
              steps {
273
274
275
276
277
278
                build_dgl_win64('cpu')
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
279
              }
Lingfan Yu's avatar
Lingfan Yu committed
280
            }
281
          // Currently we don't have Windows GPU build machines
282
          }
Lingfan Yu's avatar
Lingfan Yu committed
283
        }
284
285
286
287
        stage('Test') {
          parallel {
            stage('C++ CPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
288
289
                docker {
                  label "linux-cpu-node"
290
                  image "dgllib/dgl-ci-cpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
291
                  alwaysPull true
292
293
                }
              }
Minjie Wang's avatar
Minjie Wang committed
294
              steps {
295
296
297
298
299
300
301
302
303
304
                cpp_unit_test_linux('cpu')
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
            stage('C++ GPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
305
306
                docker {
                  label "linux-gpu-node"
307
                  image "dgllib/dgl-ci-gpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
308
309
                  args "--runtime nvidia"
                  alwaysPull true
310
311
312
313
                }
              }
              steps {
                cpp_unit_test_linux('gpu')
314
315
316
317
318
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
319
320
              }
            }
321
322
            stage('C++ CPU (Win64)') {
              agent { label 'windows' }
Minjie Wang's avatar
Minjie Wang committed
323
              steps {
324
325
326
327
328
329
                cpp_unit_test_win64()
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
Minjie Wang's avatar
Minjie Wang committed
330
              }
Minjie Wang's avatar
Minjie Wang committed
331
            }
332
333
            stage('Tensorflow CPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
334
335
                docker {
                  label "linux-cpu-node"
336
                  image "dgllib/dgl-ci-cpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
337
                  alwaysPull true
338
339
340
                }
              }
              stages {
341
                stage('Tensorflow CPU Unit test') {
342
343
344
345
346
347
348
349
350
351
                  steps {
                    unit_test_linux('tensorflow', 'cpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
352
            }
353
354
            stage('Tensorflow GPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
355
356
                docker {
                  label "linux-gpu-node"
357
                  image "dgllib/dgl-ci-gpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
358
359
                  args "--runtime nvidia"
                  alwaysPull true
360
361
362
                }
              }
              stages {
363
                stage('Tensorflow GPU Unit test') {
364
365
366
367
368
369
370
371
372
373
                  steps {
                    unit_test_linux('tensorflow', 'gpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
VoVAllen's avatar
VoVAllen committed
374
            }
375
376
            stage('Torch CPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
377
378
                docker {
                  label "linux-cpu-node"
379
                  image "dgllib/dgl-ci-cpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
380
381
                  args "--shm-size=4gb"
                  alwaysPull true
382
383
384
                }
              }
              stages {
385
                stage('Torch CPU Unit test') {
386
387
388
389
                  steps {
                    unit_test_linux('pytorch', 'cpu')
                  }
                }
390
                stage('Torch CPU Example test') {
391
392
393
394
                  steps {
                    example_test_linux('pytorch', 'cpu')
                  }
                }
395
                stage('Torch CPU Tutorial test') {
396
397
398
399
400
401
402
403
404
                  steps {
                    tutorial_test_linux('pytorch')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
VoVAllen's avatar
VoVAllen committed
405
              }
Da Zheng's avatar
Da Zheng committed
406
            }
407
408
409
            stage('Torch CPU (Win64)') {
              agent { label 'windows' }
              stages {
410
                stage('Torch CPU (Win64) Unit test') {
411
412
413
414
                  steps {
                    unit_test_win64('pytorch', 'cpu')
                  }
                }
415
                stage('Torch CPU (Win64) Example test') {
416
417
418
419
420
421
422
423
424
425
                  steps {
                    example_test_win64('pytorch', 'cpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
426
            }
427
428
            stage('Torch GPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
429
430
                docker {
                  label "linux-gpu-node"
431
                  image "dgllib/dgl-ci-gpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
432
433
                  args "--runtime nvidia --shm-size=8gb"
                  alwaysPull true
434
435
436
                }
              }
              stages {
437
                stage('Torch GPU Unit test') {
438
439
440
441
442
                  steps {
                    sh 'nvidia-smi'
                    unit_test_linux('pytorch', 'gpu')
                  }
                }
443
                stage('Torch GPU Example test') {
444
445
446
447
448
449
450
451
452
453
                  steps {
                    example_test_linux('pytorch', 'gpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
454
            }
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
            stage('PyTorch Cugraph GPU') {
              agent {
                docker {
                  label "linux-gpu-node"
                  image "nvcr.io/nvidia/pytorch:22.04-py3"
                  args "--runtime nvidia --shm-size=8gb"
                  alwaysPull false
                }
              }
              stages {
                stage('PyTorch Cugraph GPU Unit test') {
                  steps {
                    sh 'nvidia-smi'
                    unit_test_cugraph('pytorch', 'cugraph')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
478
479
            stage('MXNet CPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
480
481
                docker {
                  label "linux-cpu-node"
482
                  image "dgllib/dgl-ci-cpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
483
                  alwaysPull true
484
485
486
                }
              }
              stages {
487
                stage('MXNet CPU Unit test') {
488
489
490
491
492
493
494
495
496
                  steps {
                    unit_test_linux('mxnet', 'cpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
497
498
              }
            }
499
500
            stage('MXNet GPU') {
              agent {
Jinjing Zhou's avatar
Jinjing Zhou committed
501
502
                docker {
                  label "linux-gpu-node"
503
                  image "dgllib/dgl-ci-gpu:cu101_v220629"
Jinjing Zhou's avatar
Jinjing Zhou committed
504
505
                  args "--runtime nvidia"
                  alwaysPull true
506
507
508
                }
              }
              stages {
509
                stage('MXNet GPU Unit test') {
510
511
512
513
514
515
516
517
518
519
520
                  steps {
                    sh 'nvidia-smi'
                    unit_test_linux('mxnet', 'gpu')
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
521
            }
Minjie Wang's avatar
Minjie Wang committed
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
            stage('DGL-Go') {
              agent {
                docker {
                  label "linux-cpu-node"
                  image "dgllib/dgl-ci-cpu:cu101_v220629"
                  alwaysPull true
                }
              }
              stages {
                stage('DGL-Go CPU test') {
                  steps {
                    go_test_linux()
                  }
                }
              }
              post {
                always {
                  cleanWs disableDeferredWipeout: true, deleteDirs: true
                }
              }
            }
543
544
          }
        }
Minjie Wang's avatar
Minjie Wang committed
545
      }
Minjie Wang's avatar
Minjie Wang committed
546
    }
Minjie Wang's avatar
Minjie Wang committed
547
  }
548
549
  post {
    always {
550
      script {
551
        node("dglci-post-linux") {
552
553
554
555
          docker.image('dgllib/dgl-ci-awscli:v220418').inside("--pull always --entrypoint=''") {
            sh("rm -rf ci_tmp")
            dir('ci_tmp') {
              sh("curl -o cireport.log ${BUILD_URL}consoleText")
Rhett Ying's avatar
Rhett Ying committed
556
557
              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")
558
559
560
561
562
563
564
565
              sh("curl -L ${BUILD_URL}wfapi")
              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")

              def comment = sh(returnStdout: true, script: "python3 status.py").trim()
              echo(comment)
566
567
568
              if ((env.BRANCH_NAME).startsWith('PR-')) {
                pullRequest.comment(comment)
              }
569
570
571
572
573
574
            }
          }
        }
        node('windows') {
            bat(script: "rmvirtualenv ${BUILD_TAG}", returnStatus: true)
        }
575
576
577
      }
    }
  }
Minjie Wang's avatar
Minjie Wang committed
578
}