Skip to content

Commit b781bd9

Browse files
FindHaofacebook-github-bot
authored andcommitted
Remove APT package caching from GitHub Actions workflow (#30)
Summary: Eliminated the caching step for APT packages in the CI workflow to streamline the process. This change simplifies the workflow by focusing on essential steps, improving maintainability and reducing potential cache-related issues. No other modifications were made to the workflow. Pull Request resolved: #30 Reviewed By: Sibylau Differential Revision: D78166625 Pulled By: FindHao fbshipit-source-id: b0389629c15322186de6e76a30684d6df1ed326e
1 parent 64937b0 commit b781bd9

File tree

2 files changed

+4
-39
lines changed

2 files changed

+4
-39
lines changed

.ci/setup.sh

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,6 @@ echo "CUDA_VERSION: $CUDA_VERSION"
1818
# Install system dependencies
1919
echo "Installing system dependencies..."
2020

21-
# Check if we have cached APT lists (indicates cache hit)
22-
HAS_APT_CACHE=false
23-
if [ -f "/var/lib/apt/lists/lock" ] || [ "$(ls -A /var/lib/apt/lists/ 2>/dev/null | wc -l)" -gt 5 ]; then
24-
echo "✅ Detected cached APT package lists"
25-
HAS_APT_CACHE=true
26-
else
27-
echo "📦 No APT cache found"
28-
HAS_APT_CACHE=false
29-
fi
30-
3121
# Set up LLVM 17 APT source with modern GPG key handling
3222
echo "Setting up LLVM 17 APT source..."
3323
NEED_SOURCE_UPDATE=false
@@ -53,20 +43,13 @@ else
5343
echo "✅ LLVM APT source already configured"
5444
fi
5545

56-
# Smart APT update strategy
57-
APT_UPDATED=false
58-
if [ "$HAS_APT_CACHE" = "true" ] && [ "$NEED_SOURCE_UPDATE" = "false" ]; then
59-
echo "🚀 Using cached package lists, skipping initial update"
60-
APT_UPDATED=false
61-
elif [ "$NEED_SOURCE_UPDATE" = "true" ]; then
46+
# Update package lists
47+
if [ "$NEED_SOURCE_UPDATE" = "true" ]; then
6248
echo "🔄 Updating package lists (new source added)..."
63-
sudo apt-get update
64-
APT_UPDATED=true
6549
else
66-
echo "🔄 Updating package lists (no cache available)..."
67-
sudo apt-get update
68-
APT_UPDATED=true
50+
echo "🔄 Updating package lists..."
6951
fi
52+
sudo apt-get update
7053

7154
# Install clang and clangd first
7255
echo "Installing clang and clangd..."
@@ -109,13 +92,6 @@ if [ "$HAS_CORRECT_CUDA" = "true" ]; then
10992
# Install other dev libraries but skip CUDA toolkit
11093
sudo apt-get install -y libstdc++6 libstdc++-12-dev libffi-dev libncurses-dev zlib1g-dev libxml2-dev git build-essential
11194
else
112-
# Need to install CUDA - ensure package lists are updated
113-
if [ "$APT_UPDATED" = "false" ]; then
114-
echo "🔄 Updating package lists before CUDA installation..."
115-
sudo apt-get update
116-
APT_UPDATED=true
117-
fi
118-
11995
echo "📦 Installing CUDA $CUDA_VERSION_REQUIRED and development libraries..."
12096
# Install all packages including CUDA toolkit (this is the big download)
12197
sudo apt-get install -y cuda-toolkit-12.8 libstdc++6 libstdc++-12-dev libffi-dev libncurses-dev zlib1g-dev libxml2-dev git build-essential

.github/workflows/test.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,6 @@ jobs:
6868
restore-keys: |
6969
${{ runner.os }}-pip-3.11-
7070
71-
- name: Cache APT packages
72-
uses: actions/cache@v3
73-
with:
74-
path: |
75-
/var/cache/apt/archives
76-
/var/lib/apt/lists
77-
key: ${{ runner.os }}-apt-${{ hashFiles('.ci/setup.sh') }}-${{ steps.weekly-cache.outputs.week }}
78-
restore-keys: |
79-
${{ runner.os }}-apt-${{ hashFiles('.ci/setup.sh') }}-
80-
${{ runner.os }}-apt-
81-
8271
- name: Get Triton latest commit
8372
id: triton-commit
8473
run: |

0 commit comments

Comments
 (0)