diff --git a/.jenkins/Jenkinsfile b/.jenkins/Jenkinsfile deleted file mode 100644 index 033182681..000000000 --- a/.jenkins/Jenkinsfile +++ /dev/null @@ -1,258 +0,0 @@ -#!/usr/bin/env groovy - -// Continuous Integration script for clinicadl -// Author: mauricio.diaz@inria.fr - -pipeline { - options { - timeout(time: 1, unit: 'HOURS') - disableConcurrentBuilds(abortPrevious: true) - } - agent none - stages { - stage('Functional tests') { - failFast false - parallel { - stage('No GPU') { - agent { - label 'cpu' - } - environment { - CONDA_HOME = "$HOME/miniconda" - CONDA_ENV = "$WORKSPACE/env" - PATH = "$HOME/.local/bin:$PATH" - TMP_DIR = "$HOME/tmp" - INPUT_DATA_DIR = '/mnt/data/clinicadl_data_ci/data_ci' - } - stages { - stage('Build Env') { - steps { - echo 'Installing clinicadl sources in Linux...' - echo "My branch name is ${BRANCH_NAME}" - sh "echo 'My branch name is ${BRANCH_NAME}'" - sh 'printenv' - sh "echo 'Agent name: ${NODE_NAME}'" - sh ''' - set +x - source "${CONDA_HOME}/etc/profile.d/conda.sh" - make env.conda - conda activate "${CONDA_ENV}" - conda info - echo "Install clinicadl using poetry..." - cd $WORKSPACE - make env - # Show clinicadl help message - echo "Display clinicadl help message" - clinicadl --help - conda deactivate - ''' - } - } - stage('CLI tests Linux') { - steps { - catchError(buildResult: 'FAILURE', stageResult: 'UNSTABLE') { - echo 'Testing pipeline instantiation...' - sh 'echo "Agent name: ${NODE_NAME}"' - sh ''' - set +x - echo $WORKSPACE - source "${CONDA_HOME}/etc/profile.d/conda.sh" - conda activate "${CONDA_ENV}" - conda list - cd $WORKSPACE/tests - poetry run pytest \ - --junitxml=./test-reports/test_cli_report.xml \ - --verbose \ - --disable-warnings \ - test_cli.py - conda deactivate - ''' - } - } - } - stage('tsvtools tests Linux') { - steps { - catchError(buildResult: 'FAILURE', stageResult: 'UNSTABLE') { - echo 'Testing tsvtool tasks...' - sh "echo 'Agent name: ${NODE_NAME}'" - sh ''' - source "${CONDA_HOME}/etc/profile.d/conda.sh" - conda activate "${CONDA_ENV}" - cd $WORKSPACE/tests - poetry run pytest \ - --junitxml=./test-reports/test_tsvtool_report.xml \ - --verbose \ - --disable-warnings \ - --basetemp=$TMP_DIR \ - --input_data_directory=$INPUT_DATA_DIR \ - test_tsvtools.py - conda deactivate - ''' - } - } - post { - always { - junit 'tests/test-reports/test_tsvtool_report.xml' - } - success { - sh 'rm -rf ${TMP_DIR}/*' - } - } - } - stage('Quality check tests Linux') { - steps { - catchError(buildResult: 'FAILURE', stageResult: 'UNSTABLE') { - echo 'Testing quality check tasks...' - sh "echo 'Agent name: ${NODE_NAME}'" - sh ''' - source "${CONDA_HOME}/etc/profile.d/conda.sh" - conda activate "${CONDA_ENV}" - cd $WORKSPACE/tests - poetry run pytest \ - --junitxml=./test-reports/test_quality_check_report.xml \ - --verbose \ - --disable-warnings \ - --basetemp=$TMP_DIR \ - --input_data_directory=$INPUT_DATA_DIR \ - test_qc.py - conda deactivate - ''' - } - } - post { - always { - junit 'tests/test-reports/test_quality_check_report.xml' - } - success { - sh 'rm -rf ${TMP_DIR}/*' - } - } - } - stage('Generate tests Linux') { - steps { - catchError(buildResult: 'FAILURE', stageResult: 'UNSTABLE') { - echo 'Testing generate task...' - sh "echo 'Agent name: ${NODE_NAME}'" - sh ''' - source "${CONDA_HOME}/etc/profile.d/conda.sh" - conda activate "${CONDA_ENV}" - cd $WORKSPACE/tests - poetry run pytest \ - --junitxml=./test-reports/test_generate_report.xml \ - --verbose \ - --disable-warnings \ - --basetemp=$TMP_DIR \ - --input_data_directory=$INPUT_DATA_DIR \ - test_generate.py - conda deactivate - ''' - } - } - post { - always { - junit 'tests/test-reports/test_generate_report.xml' - } - success { - sh 'rm -rf ${TMP_DIR}/*' - } - } - } - stage('Prepare data tests Linux') { - steps { - catchError(buildResult: 'FAILURE', stageResult: 'UNSTABLE') { - echo 'Testing prepare_data task...' - sh "echo 'Agent name: ${NODE_NAME}'" - sh ''' - source "${CONDA_HOME}/etc/profile.d/conda.sh" - conda activate "${CONDA_ENV}" - cd $WORKSPACE/tests - poetry run pytest \ - --junitxml=./test-reports/test_prepare_data_report.xml \ - --verbose \ - --disable-warnings \ - --basetemp=$TMP_DIR \ - --input_data_directory=$INPUT_DATA_DIR \ - test_prepare_data.py - conda deactivate - ''' - } - } - post { - always { - junit 'tests/test-reports/test_prepare_data_report.xml' - } - success { - sh 'rm -rf ${TMP_DIR}/*' - } - } - } - stage('Predict tests Linux') { - steps { - catchError(buildResult: 'FAILURE', stageResult: 'UNSTABLE') { - echo 'Testing predict...' - sh "echo 'Agent name: ${NODE_NAME}'" - sh ''' - source "${CONDA_HOME}/etc/profile.d/conda.sh" - conda activate "${CONDA_ENV}" - cd $WORKSPACE/tests - poetry run pytest \ - --junitxml=./test-reports/test_predict_report.xml \ - --verbose \ - --disable-warnings \ - --basetemp=$TMP_DIR \ - --input_data_directory=$INPUT_DATA_DIR \ - test_predict.py - conda deactivate - ''' - } - } - post { - always { - junit 'tests/test-reports/test_predict_report.xml' - } - success { - sh 'rm -rf ${TMP_DIR}/*' - } - } - } - // stage('Meta-maps analysis') { - // environment { - // PATH = "$HOME/miniconda3/bin:$HOME/miniconda/bin:$PATH" - // } - // steps { - // echo 'Testing maps-analysis task...' - // sh 'echo "Agent name: ${NODE_NAME}"' - // sh '''#!/usr/bin/env bash - // set +x - // eval "$(conda shell.bash hook)" - // conda activate "${WORKSPACE}/env" - // cd $WORKSPACE/tests - // pytest \ - // --junitxml=./test-reports/test_meta-analysis_report.xml \ - // --verbose \ - // --disable-warnings \ - // test_meta_maps.py - // conda deactivate - // ''' - // } - // post { - // always { - // junit 'tests/test-reports/test_meta-analysis_report.xml' - // sh 'rm -rf $WORKSPACE/tests/data/dataset' - // } - // } - // } - } - post { - // Clean after build - cleanup { - cleanWs(deleteDirs: true, - notFailBuild: true, - patterns: [[pattern: 'env', type: 'INCLUDE']]) - } - } - } - } - } - } -} diff --git a/.jenkins/scripts/find_env.sh b/.jenkins/scripts/find_env.sh deleted file mode 100755 index a68fff821..000000000 --- a/.jenkins/scripts/find_env.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# A shell script to launch clinica in CI machines - -# Name of the Conda environment according to the branch -CLINICA_ENV_BRANCH="clinicadl_test" - -set -e -set +x - -ENV_EXISTS=0 -# Verify that the conda environment corresponding to the branch exists, otherwise -# create it. -ENVS=$(conda env list | awk '{print $1}' ) -echo $ENVS - -for ENV in $ENVS -do - if [[ "$ENV " == *"$CLINICA_ENV_BRANCH "* ]] - then - echo "Find Conda environment named $ENV, continue." - conda activate $CLINICA_ENV_BRANCH - cd $WORKSPACE/ - poetry install - conda deactivate - ENV_EXISTS=1 - break - fi; -done -if [ "$ENV_EXISTS" = 0 ]; then - echo "Conda env $CLINICA_ENV_BRANCH not found... Creating" - conda create -y -f environment.yml - echo "Conda env $CLINICA_ENV_BRANCH was created." - conda activate $CLINICA_ENV_BRANCH - cd $WORKSPACE/ - poetry install - echo "ClinicaDL has been installed in $CLINICA_ENV_BRANCH." - conda deactivate - cd $WORKSPACE -fi diff --git a/.jenkins/scripts/generate_wheels.sh b/.jenkins/scripts/generate_wheels.sh deleted file mode 100755 index 326d55074..000000000 --- a/.jenkins/scripts/generate_wheels.sh +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/sh - -#--------------------------------------# -# ClinicaDL package creations ( wheel) -#--------------------------------------# -# -# WARNING: Activate a conda environment with the right pip version. -# Use at your own risk. - - -CURRENT_DIR=$(pwd) -echo $CURRENT_DIR - -# ensure we are in the right dir -SCRIPT_DIR=`(dirname $0)` -cd "$SCRIPT_DIR" -echo "Entering ${SCRIPT_DIR}/../../" -cd "${SCRIPT_DIR}/../../" -ls - -# clean pycache stuff -rm -rf dist build clinicadl.egg-info/ -find -name "*__pycache__*" -exec rm {} \-rf \; -find -name "*.pyc*" -exec rm {} \-rf \; - -set -o errexit -set -e -# generate wheel -poetry build -# come back to directory of -cd $CURRENT_DIR