Skip to content

Commit aee7dfe

Browse files
committed
fancier caching
Signed-off-by: Raghu Raja <raghunch@amazon.com>
1 parent 52ed0bc commit aee7dfe

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/tunercheck.yaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,26 @@ jobs:
2020
runs-on: ubuntu-22.04
2121

2222
steps:
23-
# Cache APT packages
23+
# Create directory for APT cache
24+
- name: Create APT cache directory
25+
run: |
26+
sudo mkdir -p /tmp/apt-cache
27+
sudo chmod 777 /tmp/apt-cache
28+
29+
# Cache APT packages in a user-accessible location
2430
- name: Cache APT packages
2531
id: cache-apt
2632
uses: actions/cache@v3
2733
with:
28-
path: |
29-
/var/cache/apt/archives
30-
/var/lib/apt/lists
34+
path: /tmp/apt-cache
3135
key: apt-${{ runner.os }}-${{ hashFiles('**/workflow.yml') }}
3236

37+
# Restore APT cache if it exists
38+
- name: Restore APT cache
39+
if: steps.cache-apt.outputs.cache-hit == 'true'
40+
run: |
41+
sudo cp -R /tmp/apt-cache/* /var/cache/apt/archives/
42+
3343
# Cache CUDA installation
3444
- name: Cache CUDA
3545
id: cache-cuda
@@ -65,15 +75,9 @@ jobs:
6575
6676
- name: Install System Dependencies
6777
run: |
68-
# Only download without installing if we have cache
69-
if [ "${{ steps.cache-apt.outputs.cache-hit }}" = "true" ]; then
70-
sudo apt-get install -y --download-only cuda-toolkit libhwloc-dev
71-
else
72-
sudo apt-get install -y cuda-toolkit libhwloc-dev
73-
fi
74-
75-
# Install from cache if available
7678
sudo apt-get install -y cuda-toolkit libhwloc-dev
79+
# Save the package cache for future runs
80+
sudo cp -R /var/cache/apt/archives/*.deb /tmp/apt-cache/ || true
7781
7882
- name: Install Python Dependencies
7983
run: |

0 commit comments

Comments
 (0)