Skip to content

Commit cecfcce

Browse files
ax3llgiacome
authored andcommitted
run_test.sh: Own virtual env (BLAST-WarpX#2653)
Isolate builds locally, so we don't overwrite a developer's setup anymore. This also avoids a couple of nifty problems that can occur by mixing those envs. Originally part of BLAST-WarpX#2556
1 parent b396d67 commit cecfcce

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

.azure-pipelines.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,16 @@ jobs:
7474
- bash: |
7575
cat /proc/cpuinfo | grep "model name" | sort -u
7676
df -h
77-
sudo apt install -y ccache gcc gfortran g++ openmpi-bin libopenmpi-dev \
77+
sudo apt install -y ccache curl gcc gfortran git g++ openmpi-bin libopenmpi-dev \
7878
libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev pkg-config make \
7979
python3 python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev
8080
ccache --set-config=max_size=10.0G
81-
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
82-
sudo update-alternatives --set python /usr/bin/python3
83-
python -m pip install --upgrade pip
84-
python -m pip install --upgrade wheel
85-
python -m pip install --upgrade pipx
86-
python -m pipx install cmake
87-
python -m pipx ensurepath
81+
python3 -m pip install --upgrade pip
82+
python3 -m pip install --upgrade wheel
83+
python3 -m pip install --upgrade pipx
84+
python3 -m pipx install cmake
85+
python3 -m pipx ensurepath
8886
export PATH="$HOME/.local/bin:$PATH"
89-
python -m pip install --upgrade matplotlib mpi4py numpy scipy yt
9087
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://git.io/JvLxY
9188
sudo chmod a+x /usr/local/bin/cmake-easyinstall
9289
if [ "${WARPX_CI_OPENPMD:-FALSE}" == "TRUE" ]; then
@@ -95,7 +92,7 @@ jobs:
9592
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
9693
-DCMAKE_VERBOSE_MAKEFILE=ON \
9794
-DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
98-
python -m pip install --upgrade openpmd-api
95+
python3 -m pip install --upgrade openpmd-api
9996
fi
10097
if [[ "${WARPX_CI_RZ_OR_NOMPI:-FALSE}" == "TRUE" || "${WARPX_CI_PYTHON_MAIN:-FALSE}" == "TRUE" ]]; then
10198
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/blaspp.git \

run_test.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ ln -s ${tmp_dir} test_dir
5757
cd test_dir
5858
echo "cd $PWD"
5959

60+
# Prepare a virtual environment
61+
rm -rf py-venv
62+
python3 -m venv py-venv
63+
source py-venv/bin/activate
64+
python3 -m pip install --upgrade -r warpx/Regression/requirements.txt
65+
6066
# Clone PICSAR, AMReX and warpx-data
6167
git clone https://github.com/AMReX-Codes/amrex.git
6268
cd amrex && git checkout --detach 60fe729fe2ba65ebffc88c0af18743c254d3992c && cd -
@@ -73,7 +79,7 @@ git clone https://github.com/ECP-WarpX/regression_testing.git
7379
mkdir -p rt-WarpX/WarpX-benchmarks
7480
cd warpx/Regression
7581
echo "cd $PWD"
76-
python prepare_file_ci.py
82+
python3 prepare_file_ci.py
7783
cp ci-tests.ini ../../rt-WarpX
7884
cp -r Checksum ../../regression_testing/
7985

@@ -82,8 +88,13 @@ cd ../../regression_testing/
8288
echo "cd $PWD"
8389
# run only tests specified in variable tests_arg (single test or multiple tests)
8490
if [[ ! -z "${tests_arg}" ]]; then
85-
python regtest.py ../rt-WarpX/ci-tests.ini --no_update all "${tests_run}"
91+
python3 regtest.py ../rt-WarpX/ci-tests.ini --no_update all "${tests_run}"
8692
# run all tests (variables tests_arg and tests_run are empty)
8793
else
88-
python regtest.py ../rt-WarpX/ci-tests.ini --no_update all
94+
python3 regtest.py ../rt-WarpX/ci-tests.ini --no_update all
8995
fi
96+
97+
# clean up python virtual environment
98+
cd ../
99+
echo "cd $PWD"
100+
deactivate

0 commit comments

Comments
 (0)