From 430895d5adf6cebc4d81a90837483a9b57062a34 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 8 Jun 2021 12:49:55 +0100 Subject: [PATCH 1/8] does not run unit tests in all combinations --- scripts/jenkins-build.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/jenkins-build.sh b/scripts/jenkins-build.sh index 239cabd..178fe20 100644 --- a/scripts/jenkins-build.sh +++ b/scripts/jenkins-build.sh @@ -120,7 +120,13 @@ fi # need to call first build if [[ -d ${RECIPE_PATH} ]]; then - eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" + ##if >0 commit (some _ in version) then marking as dev build + if [[ ! ${ncommits} == "0" ]]; then + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" + else + eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=3.7 --numpy=1.18 + fi # call with --output generates the files being created #export REG_FILES=$REG_FILES`eval conda build Wrappers/Python/conda-recipe "$CCPI_BUILD_ARGS" --output`$'\n' #--output bug work around @@ -128,7 +134,13 @@ if [[ -d ${RECIPE_PATH} ]]; then fi if [[ -d recipe ]]; then - eval conda build recipe "$CCPI_BUILD_ARGS" "$@" + ##if >0 commit (some _ in version) then marking as dev build + if [[ ! ${ncommits} == "0" ]]; then + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" + else + eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=3.7 --numpy=1.18 + fi # call with --output generates the files being created #--output bug work around #export REG_FILES=$REG_FILES`eval conda build recipe "$CCPI_BUILD_ARGS" --output`$'\n' From c3c97a4825456459fe63fc0faa85b7b6ec3c483f Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 8 Jun 2021 12:56:53 +0100 Subject: [PATCH 2/8] add variables to set the version of Python and NumPy with default --- scripts/jenkins-build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/jenkins-build.sh b/scripts/jenkins-build.sh index 178fe20..bf87900 100644 --- a/scripts/jenkins-build.sh +++ b/scripts/jenkins-build.sh @@ -37,6 +37,14 @@ if [[ ! -n ${NO_GPU} ]] || [ ${NO_GPU} = false ]; then nvidia-smi fi +# set test Python and NumPy version +if [[ ! -n ${TEST_PY} ]] ; then + export TEST_PY='3.6' +fi +if [[ ! -n ${TEST_NP} ]] ; then + export TEST_NP='1.15' +fi + if [[ ! -n ${RECIPE_PATH} ]] ; then export RECIPE_PATH=Wrappers/Python/conda-recipe fi @@ -125,7 +133,7 @@ if [[ -d ${RECIPE_PATH} ]]; then eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" else eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" - eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=3.7 --numpy=1.18 + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=${TEST_PY} --numpy=${TEST_NP} fi # call with --output generates the files being created #export REG_FILES=$REG_FILES`eval conda build Wrappers/Python/conda-recipe "$CCPI_BUILD_ARGS" --output`$'\n' @@ -139,7 +147,7 @@ if [[ -d recipe ]]; then eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" else eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" - eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=3.7 --numpy=1.18 + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=${TEST_PY} --numpy=${TEST_NP} fi # call with --output generates the files being created #--output bug work around From da3e2735fe58b3257f66b81fb263b0f6cd712669 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 8 Jun 2021 15:03:33 +0100 Subject: [PATCH 3/8] fix pointer to recipe dir --- scripts/jenkins-build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/jenkins-build.sh b/scripts/jenkins-build.sh index bf87900..9561906 100644 --- a/scripts/jenkins-build.sh +++ b/scripts/jenkins-build.sh @@ -144,10 +144,10 @@ fi if [[ -d recipe ]]; then ##if >0 commit (some _ in version) then marking as dev build if [[ ! ${ncommits} == "0" ]]; then - eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" + eval conda build recipe "$CCPI_BUILD_ARGS" "$@" else - eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" - eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=${TEST_PY} --numpy=${TEST_NP} + eval conda build --no-test recipe "$CCPI_BUILD_ARGS" "$@" + eval conda build recipe "$CCPI_BUILD_ARGS" "$@" --python=${TEST_PY} --numpy=${TEST_NP} fi # call with --output generates the files being created #--output bug work around From 3224423c55a02664f4ed4055c185eea802ca9623 Mon Sep 17 00:00:00 2001 From: Edoardo Pasca Date: Tue, 8 Jun 2021 15:22:16 +0100 Subject: [PATCH 4/8] fix logic on when to test --- scripts/jenkins-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/jenkins-build.sh b/scripts/jenkins-build.sh index 9561906..0cc9618 100644 --- a/scripts/jenkins-build.sh +++ b/scripts/jenkins-build.sh @@ -129,7 +129,7 @@ fi if [[ -d ${RECIPE_PATH} ]]; then ##if >0 commit (some _ in version) then marking as dev build - if [[ ! ${ncommits} == "0" ]]; then + if [[ ${ncommits} == "0" ]]; then eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" else eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" @@ -143,7 +143,7 @@ fi if [[ -d recipe ]]; then ##if >0 commit (some _ in version) then marking as dev build - if [[ ! ${ncommits} == "0" ]]; then + if [[ ${ncommits} == "0" ]]; then eval conda build recipe "$CCPI_BUILD_ARGS" "$@" else eval conda build --no-test recipe "$CCPI_BUILD_ARGS" "$@" From 4b467b7e00e342df2dde95597ba585d4b955faa1 Mon Sep 17 00:00:00 2001 From: gfardell Date: Tue, 14 Mar 2023 13:05:27 +0000 Subject: [PATCH 5/8] test list on nightly --- scripts/jenkins-build.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/jenkins-build.sh b/scripts/jenkins-build.sh index 0cc9618..a384e42 100644 --- a/scripts/jenkins-build.sh +++ b/scripts/jenkins-build.sh @@ -39,10 +39,10 @@ fi # set test Python and NumPy version if [[ ! -n ${TEST_PY} ]] ; then - export TEST_PY='3.6' + export TEST_PY=(3.8 3.8 3.10 3.10) fi if [[ ! -n ${TEST_NP} ]] ; then - export TEST_NP='1.15' + export TEST_NP=(1.21 1.23 1.21 1.23) fi if [[ ! -n ${RECIPE_PATH} ]] ; then @@ -128,12 +128,22 @@ fi # need to call first build if [[ -d ${RECIPE_PATH} ]]; then - ##if >0 commit (some _ in version) then marking as dev build if [[ ${ncommits} == "0" ]]; then + # one release build and test all eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" else + # first build all eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" - eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=${TEST_PY} --numpy=${TEST_NP} + + #then build some with tests + for i in ${!TEST_PY[@]}; + do + py_ver=${TEST_PY[$i]} + np_ver=${TEST_NP[$i]} + + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=${py_ver} --numpy=${np_ver} + done + fi # call with --output generates the files being created #export REG_FILES=$REG_FILES`eval conda build Wrappers/Python/conda-recipe "$CCPI_BUILD_ARGS" --output`$'\n' From 5b4c43306d0a77ae543d81ca02abbce54b0f212d Mon Sep 17 00:00:00 2001 From: gfardell Date: Thu, 16 Mar 2023 09:15:55 +0000 Subject: [PATCH 6/8] add loop in both code blocks --- scripts/jenkins-build.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/jenkins-build.sh b/scripts/jenkins-build.sh index a384e42..07620f5 100644 --- a/scripts/jenkins-build.sh +++ b/scripts/jenkins-build.sh @@ -154,10 +154,20 @@ fi if [[ -d recipe ]]; then ##if >0 commit (some _ in version) then marking as dev build if [[ ${ncommits} == "0" ]]; then + # one release build and test all eval conda build recipe "$CCPI_BUILD_ARGS" "$@" else + # first build all eval conda build --no-test recipe "$CCPI_BUILD_ARGS" "$@" - eval conda build recipe "$CCPI_BUILD_ARGS" "$@" --python=${TEST_PY} --numpy=${TEST_NP} + + #then rebuild some with tests + for i in ${!TEST_PY[@]}; + do + py_ver=${TEST_PY[$i]} + np_ver=${TEST_NP[$i]} + + eval conda build recipe "$CCPI_BUILD_ARGS" "$@" --python=${py_ver} --numpy=${np_ver} + done fi # call with --output generates the files being created #--output bug work around From 1476a804a21822b56ee698311a271e3c95fd0f0f Mon Sep 17 00:00:00 2001 From: gfardell Date: Mon, 27 Mar 2023 13:06:35 +0000 Subject: [PATCH 7/8] update default behaviour --- scripts/jenkins-build.sh | 86 ++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 51 deletions(-) diff --git a/scripts/jenkins-build.sh b/scripts/jenkins-build.sh index 90f6bd9..9f3c016 100644 --- a/scripts/jenkins-build.sh +++ b/scripts/jenkins-build.sh @@ -27,6 +27,9 @@ # - it detects the branch under which the CCPi is build, master is uploaded to anaconda channel, non-master branch isn't # NO_GPU - if set to true, GPU driver information is not printed # RECIPE_PATH - if set, uses this as the path to the conda recipe instead of Wrappers/Python/conda-recipe +# TEST_PY - Can be set to a bash array of versions to test if not tag i.e (3.8 3.8 3.10 3.10) +# TEST_NP - Can be set to a bash array of versions to test if not tag i.e (1.21 1.23 1.21 1.23) + echo CCPi build echo called with arguments: $@ echo CCPI_BUILD_ARGS: $CCPI_BUILD_ARGS @@ -36,13 +39,6 @@ if [[ -z ${NO_GPU} ]] || [ ${NO_GPU} = false ]; then nvidia-smi fi -# set test Python and NumPy version -if [[ ! -n ${TEST_PY} ]] ; then - export TEST_PY=(3.8 3.8 3.10 3.10) -fi -if [[ ! -n ${TEST_NP} ]] ; then - export TEST_NP=(1.21 1.23 1.21 1.23) -fi if [[ ! -n ${RECIPE_PATH} ]] ; then export RECIPE_PATH=Wrappers/Python/conda-recipe @@ -91,6 +87,18 @@ cat .git/HEAD conda install -y conda-build + +# set test Python and NumPy version +export TEST_ALL=true + +if [[ ${ncommits} != "0" ]] + + if [[ -n ${TEST_PY} && -n ${TEST_NP} ]]; then + TEST_ALL=false + fi + +fi + #This may be removed in future if [[ -n ${CCPI_PRE_BUILD} ]]; then eval conda build "${CCPI_PRE_BUILD}" @@ -100,55 +108,31 @@ else fi # need to call first build -if [[ -d ${RECIPE_PATH} ]]; then - - if [[ ${ncommits} == "0" ]]; then - # one release build and test all - eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" - else - # first build all - eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" - - #then build some with tests - for i in ${!TEST_PY[@]}; - do - py_ver=${TEST_PY[$i]} - np_ver=${TEST_NP[$i]} - - eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=${py_ver} --numpy=${np_ver} - done - fi - # call with --output generates the files being created - #export REG_FILES=$REG_FILES`eval conda build Wrappers/Python/conda-recipe "$CCPI_BUILD_ARGS" --output`$'\n' - #--output bug work around - export REG_FILES=`ls /home/jenkins/conda-bld/linux-64/*${CIL_VERSION}*${ncommits}.tar.bz2` +# set path to recipe if recipe exists +if [[ -d recipe ]]; then + RECIPE_PATH=recipe fi -if [[ -d recipe ]]; then - ##if >0 commit (some _ in version) then marking as dev build - if [[ ${ncommits} == "0" ]]; then - # one release build and test all - eval conda build recipe "$CCPI_BUILD_ARGS" "$@" - else - # first build all - eval conda build --no-test recipe "$CCPI_BUILD_ARGS" "$@" - - #then rebuild some with tests - for i in ${!TEST_PY[@]}; - do - py_ver=${TEST_PY[$i]} - np_ver=${TEST_NP[$i]} - - eval conda build recipe "$CCPI_BUILD_ARGS" "$@" --python=${py_ver} --numpy=${np_ver} - done - fi - # call with --output generates the files being created - #--output bug work around - #export REG_FILES=$REG_FILES`eval conda build recipe "$CCPI_BUILD_ARGS" --output`$'\n' - export REG_FILES=`ls /home/jenkins/conda-bld/linux-64/*${CIL_VERSION}*${ncommits}.tar.bz2` +if [[ ${TEST_ALL} == true ]]; then + # build and test all + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" +else + # first build all + eval conda build --no-test ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" + #then build some with tests + for i in ${!TEST_PY[@]}; + do + py_ver=${TEST_PY[$i]} + np_ver=${TEST_NP[$i]} + eval conda build ${RECIPE_PATH} "$CCPI_BUILD_ARGS" "$@" --python=${py_ver} --numpy=${np_ver} + done fi +# get list of created files +export REG_FILES=`ls /home/jenkins/conda-bld/linux-64/*${CIL_VERSION}*${ncommits}.tar.bz2` + + if ls /home/jenkins/conda-bld/linux-64/*${CIL_TAG_PREV}*.tar.bz2 1> /dev/null 2>&1; then export REG_FILES=`ls /home/jenkins/conda-bld/linux-64/*${CIL_TAG_PREV}*.tar.bz2` elif ls /home/jenkins/conda-bld/noarch/*${CIL_TAG_PREV}*.tar.bz2 1> /dev/null 2>&1; then From cb6d72e3c7d8e371b90f30ed7aa586e3ee31a5ae Mon Sep 17 00:00:00 2001 From: Gemma Fardell <47746591+gfardell@users.noreply.github.com> Date: Tue, 28 Mar 2023 13:54:56 +0100 Subject: [PATCH 8/8] Update jenkins-build.sh --- scripts/jenkins-build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/jenkins-build.sh b/scripts/jenkins-build.sh index 9f3c016..a7c5644 100644 --- a/scripts/jenkins-build.sh +++ b/scripts/jenkins-build.sh @@ -89,9 +89,9 @@ conda install -y conda-build # set test Python and NumPy version -export TEST_ALL=true +TEST_ALL=true -if [[ ${ncommits} != "0" ]] +if [[ ${ncommits} != "0" ]]; then if [[ -n ${TEST_PY} && -n ${TEST_NP} ]]; then TEST_ALL=false