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 3.5 kB

3 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. pipeline {
  2. agent none
  3. environment {
  4. PJ_NAME = 'fastNLP'
  5. POST_URL = 'https://open.feishu.cn/open-apis/bot/v2/hook/14719364-818d-4f88-9057-7c9f0eaaf6ae'
  6. }
  7. stages {
  8. stage('Parallel Stages') {
  9. parallel {
  10. stage('Test Other'){
  11. agent {
  12. docker {
  13. image 'fnlp:other'
  14. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci'
  15. }
  16. }
  17. steps {
  18. sh 'pytest ./tests --durations=0 -m "not torch and not paddle and not paddledist and not jittor and not torchpaddle and not torchjittor"'
  19. }
  20. }
  21. stage('Test Torch-1.11') {
  22. agent {
  23. docker {
  24. image 'fnlp:torch-1.11'
  25. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all'
  26. }
  27. }
  28. steps {
  29. sh 'pytest ./tests/ --durations=0 -m torch'
  30. }
  31. }
  32. stage('Test Torch-1.6') {
  33. agent {
  34. docker {
  35. image 'fnlp:torch-1.6'
  36. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all'
  37. }
  38. }
  39. steps {
  40. sh 'pytest ./tests/ --durations=0 -m torch'
  41. }
  42. }
  43. stage('Test Paddle') {
  44. agent {
  45. docker {
  46. image 'fnlp:paddle'
  47. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all'
  48. }
  49. }
  50. steps {
  51. sh 'pytest ./tests --durations=0 -m paddle --co'
  52. sh 'FASTNLP_BACKEND=paddle pytest ./tests --durations=0 -m paddle --co'
  53. sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/drivers/paddle_driver/test_dist_utils.py --durations=0 --co'
  54. sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/drivers/paddle_driver/test_fleet.py --durations=0 --co'
  55. sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/controllers/test_trainer_paddle.py --durations=0 --co'
  56. }
  57. }
  58. stage('Test Jittor') {
  59. agent {
  60. docker {
  61. image 'fnlp:jittor'
  62. args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all'
  63. }
  64. }
  65. steps {
  66. // sh 'pip install fitlog'
  67. // sh 'pytest ./tests --html=test_results.html --self-contained-html'
  68. sh 'pytest ./tests --durations=0 -m jittor --co'
  69. }
  70. }
  71. }
  72. }
  73. }
  74. post {
  75. failure {
  76. sh 'post 1'
  77. }
  78. success {
  79. sh 'post 0'
  80. sh 'post github'
  81. }
  82. }
  83. }