From 6563b558136f6641d0085fff3d8d1547e4cfcd4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20Capot=C4=83?= Date: Thu, 19 Apr 2018 16:27:10 -0400 Subject: [PATCH] dev: Fix TensorFlow workaround for our Jenkins server PR #357 did not fix the problem. This time I verified by applying this commit on the branch in PR #341. --- .conda/bin/jenkins-server-customization | 5 +++++ pr-check.sh | 28 ++++++++++++------------- run-tests.sh | 6 +++--- 3 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 .conda/bin/jenkins-server-customization diff --git a/.conda/bin/jenkins-server-customization b/.conda/bin/jenkins-server-customization new file mode 100644 index 000000000..d3e3cb223 --- /dev/null +++ b/.conda/bin/jenkins-server-customization @@ -0,0 +1,5 @@ +# This Bash script must be sourced, not executed +# Customizations required for the server that currently runs Jenkins + +conda install --yes mpi4py tensorflow +module unload gcc diff --git a/pr-check.sh b/pr-check.sh index 6c2e61b25..790b03b6a 100755 --- a/pr-check.sh +++ b/pr-check.sh @@ -116,27 +116,25 @@ python3 -m pip install -U "pip<10" || \ python3 -m pip install $ignore_installed -U -e . || \ exit_with_error_and_venv "Failed to install BrainIAK." -# Allow installation on OSes we do not formally support by installing packages -# with unmet non-PyPI dependencies with Conda. This option is not supported and -# should not be documented in user docs. In particular we use it on our CentOS -# 6 Jenkins server for Tensorflow, which requires glibc >= 2.17. -conda_override=$1 -if [ ${conda_override:-default} = "--conda-override" ] +# install developer dependencies +python3 -m pip install $ignore_installed -U -r requirements-dev.txt || \ + exit_with_error_and_venv "Failed to install development requirements." + +# Source a user-specified Bash script to customize the installation. +# This option is not supported and should not be documented in user docs. +# In particular we use it on our CentOS 6 Jenkins server with .conda/bin/ +customization_script_flag=$1 +if [ ${customization_script_flag:-default} = "--customization-script" ] then - conda_override_packages=$2 - if [ ${conda_override_packages:-default} = "default" ] + customization_script=$2 + if [ ${customization_script:-default} = "default" ] then - exit_with_error_and_venv "Missing Conda override package list" + exit_with_error_and_venv "Must specify customization script" else - echo $conda_override_packages | tr , " " | xargs conda install --yes + source $customization_script fi fi - -# install developer dependencies -python3 -m pip install $ignore_installed -U -r requirements-dev.txt || \ - exit_with_error_and_venv "Failed to install development requirements." - # static analysis ./run-checks.sh || \ exit_with_error_and_venv "run-checks failed" diff --git a/run-tests.sh b/run-tests.sh index 00baa0a40..181cc84a7 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -32,10 +32,10 @@ python3 -m pip freeze | grep -qi /brainiak \ # If removing, also remove from .conda/* export MKL_THREADING_LAYER=GNU -mpi_command=mpiexec -if [ ! -z $SLURM_NODELIST ] +mpi_command=$BRAINIAKDEV_MPI_COMMAND +if [ -z $mpi_command ] then - mpi_command=srun + mpi_command=mpiexec fi $mpi_command -n 2 coverage run -m pytest