Skip to content

Commit 846dbc6

Browse files
committed
Azure CI: Cache
Try to use caching for as much as possible on Azure. This might help to reuse AMReX objects between our weekly updates. It might also be just way too large and get evicted quickly.
1 parent 9ea3876 commit 846dbc6

File tree

1 file changed

+49
-10
lines changed

1 file changed

+49
-10
lines changed

.azure-pipelines.yml

Lines changed: 49 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ pr:
1010
jobs:
1111
- job:
1212
variables:
13-
WARPX_CI_NUM_MAKE_JOBS: 2
13+
BLASPP_HOME: '/usr/local'
14+
CEI_SUDO: 'sudo'
15+
CEI_TMP: '/tmp/cei'
16+
FFTW_HOME: '/usr'
17+
LAPACKPP_HOME: '/usr/local'
18+
OMP_NUM_THREADS: 1
1419
WARPX_CI_CCACHE: 'TRUE'
20+
WARPX_CI_NUM_MAKE_JOBS: 2
1521
WARPX_CI_OPENPMD: 'TRUE'
16-
FFTW_HOME: '/usr/'
17-
BLASPP_HOME: '/usr/local/'
18-
LAPACKPP_HOME: '/usr/local/'
19-
OMP_NUM_THREADS: 1
22+
WARPX_CI_TMP: '/tmp/ci'
2023

2124
strategy:
2225
matrix:
@@ -42,12 +45,39 @@ jobs:
4245
timeoutInMinutes: 90
4346

4447
steps:
45-
- script: |
48+
# set up caches:
49+
# - once stored under a key, they become immutable (even if cache content changes)
50+
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
51+
- task: Cache@2
52+
inputs:
53+
key: 'Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh'
54+
restoreKeys: |
55+
Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake | run_test.sh
56+
Ccache | "$(System.JobName)" | cmake/dependencies/AMReX.cmake
57+
Ccache | "$(System.JobName)"
58+
Ccache
59+
path: /home/vsts/.ccache
60+
cacheHitVar: CCACHE_CACHE_RESTORED
61+
displayName: Cache Ccache Objects
62+
63+
- task: Cache@2
64+
inputs:
65+
key: 'Python3 | "$(System.JobName)" | run_test.sh'
66+
restoreKeys: |
67+
Python3 | "$(System.JobName)" | run_test.sh
68+
Python3 | "$(System.JobName)"
69+
Python3
70+
path: /home/vsts/.local/lib/python3.8
71+
cacheHitVar: PYTHON38_CACHE_RESTORED
72+
displayName: Cache Python Libraries
73+
74+
- bash: |
4675
cat /proc/cpuinfo | grep "model name" | sort -u
47-
sudo apt update
76+
df -h
4877
sudo apt install -y ccache gcc gfortran g++ openmpi-bin libopenmpi-dev \
4978
libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev pkg-config make \
5079
python3 python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev
80+
ccache --set-config=max_size=10.0G
5181
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2
5282
sudo update-alternatives --set python /usr/bin/python3
5383
python -m pip install --upgrade pip
@@ -57,22 +87,31 @@ jobs:
5787
python -m pipx ensurepath
5888
export PATH="$HOME/.local/bin:$PATH"
5989
python -m pip install --upgrade matplotlib mpi4py numpy scipy yt
60-
export CEI_SUDO="sudo"
6190
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://git.io/JvLxY
6291
sudo chmod a+x /usr/local/bin/cmake-easyinstall
6392
if [ "${WARPX_CI_OPENPMD:-FALSE}" == "TRUE" ]; then
64-
cmake-easyinstall --prefix=/usr/local git+https://github.com/openPMD/[email protected] \
93+
cmake-easyinstall --prefix=/usr/local \
94+
git+https://github.com/openPMD/[email protected] \
95+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
96+
-DCMAKE_VERBOSE_MAKEFILE=ON \
6597
-DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
6698
python -m pip install --upgrade openpmd-api
6799
fi
68100
if [[ "${WARPX_CI_RZ_OR_NOMPI:-FALSE}" == "TRUE" || "${WARPX_CI_PYTHON_MAIN:-FALSE}" == "TRUE" ]]; then
69101
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/blaspp.git \
102+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
70103
-Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
71104
cmake-easyinstall --prefix=/usr/local git+https://bitbucket.org/icl/lapackpp.git \
105+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
72106
-Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
73107
fi
108+
rm -rf ${CEI_TMP}
109+
df -h
74110
displayName: 'Install dependencies'
75111
76-
- script: |
112+
- bash: |
113+
df -h
77114
./run_test.sh
115+
rm -rf ${WARPX_CI_TMP}
116+
df -h
78117
displayName: 'Build & test'

0 commit comments

Comments
 (0)