Skip to content

Commit

Permalink
Cache linter S3 dependencies (pytorch#94745)
Browse files Browse the repository at this point in the history
Fixes pytorch#94716
Pull Request resolved: pytorch#94745
Approved by: https://github.com/seemethere
  • Loading branch information
huydhn authored and pytorchmergebot committed Feb 13, 2023
1 parent 36dfbb0 commit bdf9963
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .ci/docker/common/install_linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ pushd pytorch
# Install all linter dependencies
pip_install -r requirements.txt
conda_run lintrunner init

# Cache .lintbin directory as part of the Docker image
cp -r .lintbin /tmp
popd

# Node dependencies required by toc linter job
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,16 @@ jobs:
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
conda activate "${CONDA_ENV}"
CACHE_DIRECTORY="/tmp/.lintbin"
# Try to recover the cached binaries
if [[ -d "${CACHE_DIRECTORY}" ]]; then
# It's ok to fail this as lintrunner init would download these binaries
# again if they do not exist
cp -r "${CACHE_DIRECTORY}" . || true
fi
# This has already been cached in the docker image
lintrunner init
lintrunner init 2> /dev/null
# Do build steps necessary for linters
python3 -m tools.linter.clang_tidy.generate_build_files
Expand Down

0 comments on commit bdf9963

Please sign in to comment.