Skip to content

Commit

Permalink
moved cache to a fixed location for all runners
Browse files Browse the repository at this point in the history
  • Loading branch information
aviadingo committed Jan 6, 2025
1 parent 398eb79 commit 2951fa0
Showing 1 changed file with 40 additions and 35 deletions.
75 changes: 40 additions & 35 deletions .github/workflows/cpp-golang-rust-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,38 +125,38 @@ jobs:
fi
fi
echo "INSTALL_PATH=$INSTALL_PATH" >> $GITHUB_OUTPUT
mkdir -p /tmp/ci/cache
- name: Get OS version
id: os-version
run: |
echo "OS_VERSION=$(lsb_release -d | awk -F'\t' '{print $2}' | tr -d '[:space:]')" >> $GITHUB_OUTPUT
# - name: Download ICICLE lib artifacts
# uses: actions/download-artifact@v4
# continue-on-error: true
# # if: steps.exists-flag.outputs.EXIST_FLAG =='false'
# with:
# name: icicle-builds-curve-${{ matrix.curve.name }}-${{ steps.extract-cuda-sha.outputs.cuda-backend-sha }}-${{ steps.os-version.outputs.OS_VERSION }}
# path: ${{steps.exists-flag.outputs.INSTALL_PATH}}
# merge-multiple: true
- name: Restore cached ICICLE backend
id: cache-icicle-restore
uses: actions/cache/restore@v4
with:
path: /tmp/ci_cache
path: /tmp/ci/cache
key: icicle-builds-curve-${{ matrix.curve.name }}-${{ steps.extract-cuda-sha.outputs.cuda-backend-sha }}-${{ steps.os-version.outputs.OS_VERSION }}


- name: Set CUDA backend flag
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.rust == 'true' || needs.check-changed-files.outputs.cpp == 'true'
id: cuda-flag
run: |
CUDA_BACKEND_SHA=${{ steps.extract-cuda-sha.outputs.cuda-backend-sha }}
CURVE=${{ matrix.curve.name }}
COMMIT_FILE="gh_commit_sha_${CURVE}_${CUDA_BACKEND_SHA}"
if [ "${{ needs.extract-cuda-backend-branch.outputs.cuda-backend-branch }}" == "main" ]; then
INSTALL_PATH=$(realpath ${{ github.workspace }}/../../main_lib/curve/$CURVE)
COMMIT_FILE_PATH=${INSTALL_PATH}/lib/${COMMIT_FILE}
if [ "${{ steps.exists-flag.outputs.EXIST_FLAG }}" == "false" ]; then
if [ "${{ steps.cache-icicle-restore.outputs.cache-hit }}" == "true" ]; then
cp -r /tmp/ci/cache $INSTALL_PATH
fi
fi
if [ -f "$COMMIT_FILE_PATH" ]; then
echo "${COMMIT_FILE} exists in ${INSTALL_PATH}/lib. Setting CUDA_FLAG="
Expand All @@ -169,6 +169,13 @@ jobs:
else
INSTALL_PATH=$(realpath ${{ github.workspace }}/../../temp_lib/curve/$CURVE)
COMMIT_FILE_PATH=${INSTALL_PATH}/lib/${COMMIT_FILE}
if [ "${{ steps.exists-flag.outputs.EXIST_FLAG }}" == "false" ]; then
if [ "${{ steps.cache-icicle-restore.outputs.cache-hit }}" == "true" ]; then
cp -r /tmp/ci/cache $INSTALL_PATH
fi
fi
if [ -f "$COMMIT_FILE_PATH" ]; then
echo "${COMMIT_FILE} exists in ${INSTALL_PATH}/lib. Setting CUDA_FLAG="
echo "CUDA_FLAG=" >> $GITHUB_OUTPUT
Expand All @@ -182,12 +189,7 @@ jobs:
echo "ICICLE_BACKEND_INSTALL_DIR=${INSTALL_PATH}/lib" >> $GITHUB_OUTPUT
echo "INSTALL_PATH=$INSTALL_PATH" >> $GITHUB_OUTPUT
echo "COMMIT_FILE_PATH=$COMMIT_FILE_PATH" >> $GITHUB_OUTPUT
- name: Setup go
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true'
timeout-minutes: 15
uses: actions/setup-go@v5
with:
go-version: '1.22.0'
- name: Build curve
working-directory: ./icicle
Expand All @@ -198,35 +200,18 @@ jobs:
cmake --build build --target install -j
rm -rf ${{ steps.cuda-flag.outputs.INSTALL_PATH }}/lib/gh_commit_sha_${{ matrix.curve.name }}*
touch ${{ steps.cuda-flag.outputs.COMMIT_FILE_PATH }}
cp -r ${{ steps.cuda-flag.outputs.INSTALL_PATH }} /tmp/ci/cache
# - name: Upload ICICLE lib artifacts
# uses: actions/upload-artifact@v4
# # if: steps.cuda-flag.outputs.CUDA_FLAG == '-DCUDA_BACKEND=local'
# with:
# name: icicle-builds-curve-${{ matrix.curve.name }}-${{ steps.extract-cuda-sha.outputs.cuda-backend-sha }}-${{ steps.os-version.outputs.OS_VERSION }}
# path: |
# ${{ steps.cuda-flag.outputs.INSTALL_PATH }}/*
# retention-days: 5
# overwrite: true

- name: Cache ICICLE backend
id: cache-icicle-save
uses: actions/cache/save@v4
# if: steps.cuda-flag.outputs.CUDA_FLAG == '-DCUDA_BACKEND=local'
with:
path: /tmp/ci_cache
key: icicle-builds-curve-${{ matrix.curve.name }}-${{ steps.extract-cuda-sha.outputs.cuda-backend-sha }}-${{ steps.os-version.outputs.OS_VERSION }}

- name: Run RUST Curve Tests
working-directory: ./wrappers/rust/icicle-curves
if: needs.check-changed-files.outputs.rust == 'true' || needs.check-changed-files.outputs.cpp == 'true'
run: |
CURVE=${{ matrix.curve.name }}
CURVE_DIR=icicle-${CURVE//_/-}
export ICICLE_BACKEND_INSTALL_DIR=${{ steps.cuda-flag.outputs.INSTALL_PATH }}
cd ./$CURVE_DIR
cargo test --release --verbose -- --skip phase
cargo test phase2 --release
cargo test phase3 --release

- name: Run C++ Curve Tests
working-directory: ./icicle/build/tests
if: needs.check-changed-files.outputs.cpp == 'true'
Expand All @@ -247,6 +232,26 @@ jobs:
cd -
fi
done
- name: Run RUST Curve Tests
working-directory: ./wrappers/rust/icicle-curves
if: needs.check-changed-files.outputs.rust == 'true' || needs.check-changed-files.outputs.cpp == 'true'
run: |
CURVE=${{ matrix.curve.name }}
CURVE_DIR=icicle-${CURVE//_/-}
export ICICLE_BACKEND_INSTALL_DIR=${{ steps.cuda-flag.outputs.INSTALL_PATH }}
cd ./$CURVE_DIR
cargo test --release --verbose -- --skip phase
cargo test phase2 --release
cargo test phase3 --release
- name: Setup go
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true'
timeout-minutes: 15
uses: actions/setup-go@v5
with:
go-version: '1.22.0'

- name: Run Golang curve Tests
working-directory: ./wrappers/golang/curves
if: needs.check-changed-files.outputs.golang == 'true' || needs.check-changed-files.outputs.cpp == 'true'
Expand Down

0 comments on commit 2951fa0

Please sign in to comment.