From e85793567a539bf25836d21dd005905b1e38fdbb Mon Sep 17 00:00:00 2001 From: x54-729 <17307130121@fudan.edu.cn> Date: Tue, 17 May 2022 16:28:26 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Jenkinsfile=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E8=87=AA=E5=8A=A8=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..68812e18 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,83 @@ +pipeline { + agent none + environment { + PJ_NAME = 'fastNLP' + POST_URL = 'https://open.feishu.cn/open-apis/bot/v2/hook/14719364-818d-4f88-9057-7c9f0eaaf6ae' + } + stages { + stage('Parallel Stages') { + parallel { + stage('Test Other'){ + agent { + docker { + image 'fnlp:other' + args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci' + } + } + steps { + sh 'pytest ./tests --durations=0 -m "not torch and not paddle and not jittor and not torchpaddle and not torchjittor"' + } + } + stage('Test Torch-1.11') { + agent { + docker { + image 'fnlp:torch-1.11' + args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all' + } + } + steps { + sh 'pytest ./tests/core/drivers/torch_driver --durations=0 -m torch' + } + } + stage('Test Torch-1.6') { + agent { + docker { + image 'fnlp:torch-1.6' + args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all' + } + } + steps { + sh 'pytest ./tests/core/drivers/torch_driver --durations=0 -m torch' + } + } + stage('Test Paddle') { + agent { + docker { + image 'fnlp:paddle' + args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all' + } + } + steps { + sh 'pytest ./tests --durations=0 -m paddle' + sh 'FASTNLP_BACKEND=paddle pytest ./tests --durations=0 -m paddle' + sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/drivers/paddle_driver/test_dist_utils.py --durations=0' + sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/drivers/paddle_driver/test_fleet.py" --durations=0' + sh 'FASTNLP_BACKEND=paddle pytest ./tests/core/core/controllers/test_trainer_paddle.py --durations=0' + } + } + stage('Test Jittor') { + agent { + docker { + image 'fnlp:jittor' + args '-u root:root -v ${JENKINS_HOME}/html/docs:/docs -v ${JENKINS_HOME}/html/_ci:/ci --gpus all' + } + } + steps { + // sh 'pip install fitlog' + // sh 'pytest ./tests --html=test_results.html --self-contained-html' + sh 'pytest ./tests --durations=0 -m jittor' + } + } + } + } + } + post { + failure { + sh 'post 1' + } + success { + sh 'post 0' + sh 'post github' + } + } +} \ No newline at end of file