Skip to content

Commit 488b027

Browse files
committed
Remove unnecessary logic to add/remove binary caches for GitHub workflows
1 parent 998824d commit 488b027

File tree

3 files changed

+21
-90
lines changed

3 files changed

+21
-90
lines changed

.github/workflows/ubuntu-ci-x86_64-gnu.yaml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@ jobs:
5050
5151
- name: create-buildcache
5252
run: |
53-
# Get day of week to decide whether to use build caches or not
54-
DOW=$(date +%u)
55-
# Monday is 1 ... Sunday is 7
56-
if [[ $DOW == 7 ]]; then
57-
export USE_BINARY_CACHE=false
58-
echo "Ignore existing binary cache for creating buildcache environment"
59-
else
60-
export USE_BINARY_CACHE=true
61-
echo "Use existing binary cache for creating buildcache environment"
62-
fi
63-
6453
# Set up spack-stack
6554
source ./setup.sh
6655
@@ -126,15 +115,13 @@ jobs:
126115
spack mirror add local-source file://${SOURCE_CACHE_PATH}/
127116
spack mirror create -a -d ${SOURCE_CACHE_PATH}/
128117
129-
# Add binary cache if requested
130-
if [ "$USE_BINARY_CACHE" = true ] ; then
131-
set +e
132-
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
133-
spack buildcache update-index local-binary
134-
set -e
135-
echo "Packages in spack binary cache:"
136-
spack buildcache list
137-
fi
118+
# Add binary cache
119+
set +e
120+
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
121+
spack buildcache update-index local-binary
122+
set -e
123+
echo "Packages in spack binary cache:"
124+
spack buildcache list
138125
139126
# Break installation up in pieces and create build caches in between
140127
# This allows us to "spin up" builds that altogether take longer than
@@ -169,11 +156,6 @@ jobs:
169156
spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.${ENVNAME}.all
170157
spack buildcache create -u local-binary
171158
172-
# Remove binary cache for next round of concretization
173-
if [ "$USE_BINARY_CACHE" = true ] ; then
174-
spack mirror rm local-binary
175-
fi
176-
177159
# Remove buildcache config settings
178160
spack config remove config:install_tree:padded_length
179161
@@ -201,11 +183,6 @@ jobs:
201183
${SPACK_STACK_DIR}/util/show_duplicate_packages.py -i fms -i crtm -i crtm-fix -i esmf -i mapl -i py-cython -i neptune-env -i fms -i ip
202184
spack stack check-preferred-compiler 2>&1 | tee log.check-preferred-compiler.${ENVNAME}
203185
204-
# Add binary cache back in
205-
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
206-
echo "Packages in combined spack build caches:"
207-
spack buildcache list
208-
209186
# Install from cache
210187
spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.${ENVNAME}.all
211188

.github/workflows/ubuntu-ci-x86_64-oneapi-ifx.yaml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@ jobs:
5050
5151
- name: create-buildcache
5252
run: |
53-
# Get day of week to decide whether to use build caches or not
54-
DOW=$(date +%u)
55-
# Monday is 1 ... Sunday is 7
56-
if [[ $DOW == 7 ]]; then
57-
export USE_BINARY_CACHE=false
58-
echo "Ignore existing binary cache for creating buildcache environment"
59-
else
60-
export USE_BINARY_CACHE=true
61-
echo "Use existing binary cache for creating buildcache environment"
62-
fi
63-
6453
# Set up spack-stack
6554
source ./setup.sh
6655
@@ -142,15 +131,13 @@ jobs:
142131
spack mirror add local-source file://${SOURCE_CACHE_PATH}/
143132
spack mirror create -a -d ${SOURCE_CACHE_PATH}/
144133
145-
# Add binary cache if requested
146-
if [ "$USE_BINARY_CACHE" = true ] ; then
147-
set +e
148-
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
149-
spack buildcache update-index local-binary
150-
set -e
151-
echo "Packages in spack binary cache:"
152-
spack buildcache list
153-
fi
134+
# Add binary cache
135+
set +e
136+
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
137+
spack buildcache update-index local-binary
138+
set -e
139+
echo "Packages in spack binary cache:"
140+
spack buildcache list
154141
155142
# Break installation up in pieces and create build caches in between
156143
# This allows us to "spin up" builds that altogether take longer than
@@ -188,11 +175,6 @@ jobs:
188175
# Check for libirc.so in shared libraries (returns 1=error if found)
189176
${SPACK_STACK_DIR}/util/check_libirc.sh
190177
191-
# Remove binary cache for next round of concretization
192-
if [ "$USE_BINARY_CACHE" = true ] ; then
193-
spack mirror rm local-binary
194-
fi
195-
196178
# Remove buildcache config settings
197179
spack config remove config:install_tree:padded_length
198180
@@ -220,11 +202,6 @@ jobs:
220202
${SPACK_STACK_DIR}/util/show_duplicate_packages.py -i fms -i crtm -i crtm-fix -i esmf -i mapl -i py-cython -i neptune-env -i fms -i ip
221203
spack stack check-preferred-compiler 2>&1 | tee log.check-preferred-compiler.${ENVNAME}
222204
223-
# Add binary cache back in
224-
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
225-
echo "Packages in combined spack build caches:"
226-
spack buildcache list
227-
228205
# Install from cache
229206
spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.${ENVNAME}.all
230207

.github/workflows/ubuntu-ci-x86_64-oneapi.yaml

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,6 @@ jobs:
5050
5151
- name: create-buildcache
5252
run: |
53-
# Get day of week to decide whether to use build caches or not
54-
DOW=$(date +%u)
55-
# Monday is 1 ... Sunday is 7
56-
if [[ $DOW == 7 ]]; then
57-
export USE_BINARY_CACHE=false
58-
echo "Ignore existing binary cache for creating buildcache environment"
59-
else
60-
export USE_BINARY_CACHE=true
61-
echo "Use existing binary cache for creating buildcache environment"
62-
fi
63-
6453
# Set up spack-stack
6554
source ./setup.sh
6655
@@ -142,15 +131,13 @@ jobs:
142131
spack mirror add local-source file://${SOURCE_CACHE_PATH}/
143132
spack mirror create -a -d ${SOURCE_CACHE_PATH}/
144133
145-
# Add binary cache if requested
146-
if [ "$USE_BINARY_CACHE" = true ] ; then
147-
set +e
148-
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
149-
spack buildcache update-index local-binary
150-
set -e
151-
echo "Packages in spack binary cache:"
152-
spack buildcache list
153-
fi
134+
# Add binary cache
135+
set +e
136+
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
137+
spack buildcache update-index local-binary
138+
set -e
139+
echo "Packages in spack binary cache:"
140+
spack buildcache list
154141
155142
# Break installation up in pieces and create build caches in between
156143
# This allows us to "spin up" builds that altogether take longer than
@@ -188,11 +175,6 @@ jobs:
188175
# Check for libirc.so in shared libraries (returns 1=error if found)
189176
${SPACK_STACK_DIR}/util/check_libirc.sh
190177
191-
# Remove binary cache for next round of concretization
192-
if [ "$USE_BINARY_CACHE" = true ] ; then
193-
spack mirror rm local-binary
194-
fi
195-
196178
# Remove buildcache config settings
197179
spack config remove config:install_tree:padded_length
198180
@@ -220,11 +202,6 @@ jobs:
220202
${SPACK_STACK_DIR}/util/show_duplicate_packages.py -i fms -i crtm -i crtm-fix -i esmf -i mapl -i py-cython -i neptune-env -i fms -i ip
221203
spack stack check-preferred-compiler 2>&1 | tee log.check-preferred-compiler.${ENVNAME}
222204
223-
# Add binary cache back in
224-
spack mirror add local-binary file://${BUILD_CACHE_PATH}/
225-
echo "Packages in combined spack build caches:"
226-
spack buildcache list
227-
228205
# Install from cache
229206
spack install --fail-fast --source --no-check-signature 2>&1 | tee log.install.${ENVNAME}.all
230207

0 commit comments

Comments
 (0)