|
38 | 38 | # environment variable is also now needed, as of july 2024.
|
39 | 39 | # ref: https://github.com/actions/runner/issues/2906#issuecomment-2208546951
|
40 | 40 | ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: 'true'
|
| 41 | + |
| 42 | + # APT package list for caching |
| 43 | + APT_CACHE_RESTORE_KEYS: | |
| 44 | + apt-cache-${{ runner.os }}-${{ github.job }} |
41 | 45 |
|
42 | 46 | concurrency:
|
43 | 47 | group: ${{ github.head_ref || github.run_id }}
|
@@ -190,19 +194,51 @@ jobs:
|
190 | 194 | sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 10
|
191 | 195 | fi
|
192 | 196 |
|
| 197 | + - name: Setup APT Cache for Distcheck |
| 198 | + id: apt-cache-distcheck |
| 199 | + uses: actions/cache@v3 |
| 200 | + with: |
| 201 | + path: /var/cache/apt/archives |
| 202 | + key: apt-cache-${{ runner.os }}-distcheck-${{ hashFiles('**/workflows/distcheck.yaml') }} |
| 203 | + restore-keys: ${{ env.APT_CACHE_RESTORE_KEYS }} |
| 204 | + |
193 | 205 | - name: Install Base Dependencies
|
194 | 206 | run: |
|
195 |
| - sudo apt-get update -y |
| 207 | + # Download packages without installing if they're not in cache |
| 208 | + sudo apt-get update -y || (sleep 10 && sudo apt-get update -y) || (sleep 30 && sudo apt-get update -y) |
| 209 | + sudo apt-get install -y --download-only ${{ env.APT_PACKAGES }} || true |
| 210 | + # Install from cache |
196 | 211 | sudo apt-get install -y ${{ env.APT_PACKAGES }}
|
197 | 212 |
|
| 213 | + - name: Setup CUDA APT Cache |
| 214 | + id: cuda-apt-cache-distcheck |
| 215 | + if: matrix.sdk == 'cuda' |
| 216 | + uses: actions/cache@v3 |
| 217 | + with: |
| 218 | + path: /var/cache/apt/archives |
| 219 | + key: cuda-apt-cache-distcheck-${{ runner.os }}-${{ hashFiles('**/workflows/distcheck.yaml') }} |
| 220 | + restore-keys: | |
| 221 | + cuda-apt-cache-${{ runner.os }}- |
| 222 | + |
198 | 223 | - name: Install CUDA SDK
|
199 | 224 | if: matrix.sdk == 'cuda'
|
200 | 225 | run: |
|
201 |
| - sudo apt-get update -y && sudo apt-get install -y wget lsb-release |
| 226 | + # Install with retry logic |
| 227 | + sudo apt-get update -y || (sleep 10 && sudo apt-get update -y) || (sleep 30 && sudo apt-get update -y) |
| 228 | + sudo apt-get install -y wget lsb-release || (sleep 10 && sudo apt-get install -y wget lsb-release) |
202 | 229 | repo="ubuntu$(lsb_release -r | cut -d':' -f2 | xargs | sed 's/[.]//g')"
|
203 |
| - wget https://developer.download.nvidia.com/compute/cuda/repos/${repo}/$(uname -m)/cuda-keyring_1.1-1_all.deb |
| 230 | + for i in {1..3}; do |
| 231 | + if wget https://developer.download.nvidia.com/compute/cuda/repos/${repo}/$(uname -m)/cuda-keyring_1.1-1_all.deb; then |
| 232 | + break |
| 233 | + fi |
| 234 | + echo "Retrying wget in 10 seconds..." |
| 235 | + sleep 10 |
| 236 | + done |
204 | 237 | sudo dpkg -i cuda-keyring_1.1-1_all.deb
|
205 |
| - sudo apt-get update -y |
| 238 | + sudo apt-get update -y || (sleep 10 && sudo apt-get update -y) || (sleep 30 && sudo apt-get update -y) |
| 239 | + # Download packages without installing if not in cache |
| 240 | + sudo apt-get install -y --download-only cuda-cudart-dev-12-6 cuda-crt-12-6 || true |
| 241 | + # Install from cache |
206 | 242 | sudo apt-get install -y cuda-cudart-dev-12-6 cuda-crt-12-6
|
207 | 243 |
|
208 | 244 | - name: Install lttng
|
@@ -281,24 +317,58 @@ jobs:
|
281 | 317 | - uses: actions/setup-python@v5
|
282 | 318 | with:
|
283 | 319 | python-version: '3.9'
|
| 320 | + |
| 321 | + - name: Setup APT Cache for CodeChecker |
| 322 | + id: apt-cache-codechecker |
| 323 | + uses: actions/cache@v3 |
| 324 | + with: |
| 325 | + path: /var/cache/apt/archives |
| 326 | + key: apt-cache-${{ runner.os }}-codechecker-${{ hashFiles('**/workflows/distcheck.yaml') }} |
| 327 | + restore-keys: ${{ env.APT_CACHE_RESTORE_KEYS }} |
284 | 328 |
|
285 | 329 | - name: Install Base Dependencies
|
286 | 330 | run: |
|
287 |
| - sudo apt-get update -y |
| 331 | + # Download packages without installing if they're not in cache |
| 332 | + sudo apt-get update -y || (sleep 10 && sudo apt-get update -y) || (sleep 30 && sudo apt-get update -y) |
| 333 | + sudo apt-get install -y --download-only ${{ env.APT_PACKAGES }} || true |
| 334 | + # Install from cache |
288 | 335 | sudo apt-get install -y ${{ env.APT_PACKAGES }}
|
289 | 336 |
|
| 337 | + - name: Setup CUDA APT Cache |
| 338 | + id: cuda-apt-cache-codechecker |
| 339 | + if: matrix.sdk == 'cuda' |
| 340 | + uses: actions/cache@v3 |
| 341 | + with: |
| 342 | + path: /var/cache/apt/archives |
| 343 | + key: cuda-apt-cache-codechecker-${{ runner.os }}-${{ hashFiles('**/workflows/distcheck.yaml') }} |
| 344 | + restore-keys: | |
| 345 | + cuda-apt-cache-${{ runner.os }}- |
| 346 | + |
290 | 347 | - name: Install CUDA SDK
|
291 | 348 | if: matrix.sdk == 'cuda'
|
292 | 349 | run: |
|
293 |
| - sudo apt-get update -y && sudo apt-get install -y wget lsb-release |
| 350 | + # Install with retry logic |
| 351 | + sudo apt-get update -y || (sleep 10 && sudo apt-get update -y) || (sleep 30 && sudo apt-get update -y) |
| 352 | + sudo apt-get install -y wget lsb-release || (sleep 10 && sudo apt-get install -y wget lsb-release) |
294 | 353 | repo="ubuntu$(lsb_release -r | cut -d':' -f2 | xargs | sed 's/[.]//g')"
|
295 |
| - wget https://developer.download.nvidia.com/compute/cuda/repos/${repo}/$(uname -m)/cuda-keyring_1.1-1_all.deb |
| 354 | + for i in {1..3}; do |
| 355 | + if wget https://developer.download.nvidia.com/compute/cuda/repos/${repo}/$(uname -m)/cuda-keyring_1.1-1_all.deb; then |
| 356 | + break |
| 357 | + fi |
| 358 | + echo "Retrying wget in 10 seconds..." |
| 359 | + sleep 10 |
| 360 | + done |
296 | 361 | sudo dpkg -i cuda-keyring_1.1-1_all.deb
|
297 |
| - sudo apt-get update -y |
| 362 | + sudo apt-get update -y || (sleep 10 && sudo apt-get update -y) || (sleep 30 && sudo apt-get update -y) |
| 363 | + # Download packages without installing if not in cache |
| 364 | + sudo apt-get install -y --download-only cuda-cudart-dev-12-6 cuda-crt-12-6 || true |
| 365 | + # Install from cache |
298 | 366 | sudo apt-get install -y cuda-cudart-dev-12-6 cuda-crt-12-6
|
299 | 367 |
|
300 | 368 | - name: Install cppcheck
|
301 | 369 | run: |
|
| 370 | + sudo apt-get update -y || (sleep 10 && sudo apt-get update -y) || (sleep 30 && sudo apt-get update -y) |
| 371 | + sudo apt-get install -y --download-only cppcheck || true |
302 | 372 | sudo apt-get install -y cppcheck
|
303 | 373 |
|
304 | 374 | - name: Fetch and Install EFA Installer Dependencies
|
|
0 commit comments