You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

.Jenkinsfile 5.2 kB

2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. pipeline {
  2. agent any
  3. options {
  4. timeout(time:30, unit: 'MINUTES')
  5. }
  6. environment {
  7. PJ_NAME = 'fastNLP'
  8. POST_URL = 'https://open.feishu.cn/open-apis/bot/v2/hook/2f7122e3-3459-43d2-a9e4-ddd77bfc4282'
  9. }
  10. stages {
  11. stage('Parallel Stages') {
  12. parallel {
  13. stage('Test Other'){
  14. agent {
  15. docker {
  16. image 'fnlp:other'
  17. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci'
  18. }
  19. }
  20. steps {
  21. sh 'pytest ./tests --durations=0 --html=other.html --self-contained-html -m "not (torch or paddle or paddledist or jittor or oneflow or deepspeed or oneflowdist or torchpaddle or torchjittor or torchoneflow)"'
  22. }
  23. post {
  24. always {
  25. sh 'html_path=/ci/${PJ_NAME}/report-${BUILD_NUMBER}-${GIT_BRANCH#*/}-${GIT_COMMIT} && mkdir -p ${html_path} && mv other.html ${html_path}'
  26. }
  27. }
  28. }
  29. stage('Test Torch-1.11') {
  30. agent {
  31. docker {
  32. image 'fnlp:torch-1.11'
  33. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all --shm-size 1G'
  34. }
  35. }
  36. steps {
  37. sh 'pytest ./tests/ --durations=0 --html=torch-1.11.html --self-contained-html -m torch'
  38. }
  39. post {
  40. always {
  41. sh 'html_path=/ci/${PJ_NAME}/report-${BUILD_NUMBER}-${GIT_BRANCH#*/}-${GIT_COMMIT} && mkdir -p ${html_path} && mv torch-1.11.html ${html_path}'
  42. }
  43. }
  44. }
  45. stage('Test Torch-1.6') {
  46. agent {
  47. docker {
  48. image 'fnlp:torch-1.6'
  49. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all --shm-size 1G'
  50. }
  51. }
  52. steps {
  53. sh 'pytest ./tests/ --durations=0 --html=torch-1.6.html --self-contained-html -m torch'
  54. }
  55. post {
  56. always {
  57. sh 'html_path=/ci/${PJ_NAME}/report-${BUILD_NUMBER}-${GIT_BRANCH#*/}-${GIT_COMMIT} && mkdir -p ${html_path} && mv torch-1.6.html ${html_path}'
  58. }
  59. }
  60. }
  61. stage('Test Paddle') {
  62. agent {
  63. docker {
  64. image 'fnlp:paddle'
  65. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all --shm-size 1G'
  66. }
  67. }
  68. steps {
  69. sh 'pytest ./tests --durations=0 --html=paddle.html --self-contained-html -m paddle --co'
  70. sh 'FASTNLP_BACKEND=paddle pytest ./tests --durations=0 --html=paddle_with_backend.html --self-contained-html -m paddle --co'
  71. sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/drivers/paddle_driver/test_dist_utils.py --durations=0 --html=paddle_dist_utils.html --self-contained-html --co'
  72. sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/drivers/paddle_driver/test_fleet.py --durations=0 --html=paddle_fleet.html --self-contained-html --co'
  73. sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/controllers/test_trainer_paddle.py --durations=0 --html=paddle_trainer.html --self-contained-html --co'
  74. }
  75. post {
  76. always {
  77. sh 'html_path=/ci/${PJ_NAME}/report-${BUILD_NUMBER}-${GIT_BRANCH#*/}-${GIT_COMMIT} && mkdir -p ${html_path} && mv paddle*.html ${html_path}'
  78. }
  79. }
  80. }
  81. // stage('Test Jittor') {
  82. // agent {
  83. // docker {
  84. // image 'fnlp:jittor'
  85. // args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all --shm-size 1G'
  86. // }
  87. // }
  88. // steps {
  89. // // sh 'pip install fitlog'
  90. // // sh 'pytest ./tests --html=test_results.html --self-contained-html'
  91. // sh 'pytest ./tests --durations=0 --html=jittor.html --self-contained-html -m jittor --co'
  92. // }
  93. // }
  94. }
  95. }
  96. }
  97. post {
  98. failure {
  99. sh 'post 1'
  100. }
  101. success {
  102. sh 'post 0'
  103. // sh 'post github'
  104. }
  105. }
  106. }