ci: make pip skip cached packages while installing dependencies (#1570)

We want each build to be reproducible regardless of prior builds and
prior package installations, but pip, by default, uses cached packages
from previous invocations of `pip install`.  As a result, the incorrect
dependencies downloaded in the RollPyTorch workflow in the main
repository cannot be reproduced in private forks of the repository.  To
resolve this problem, this patch adds a `--no-cache-dir` flag to pip, so
that it fetches and inspects each requested package independent or prior
installations.
pull/1587/head snapshot-20221112.655
Ashay Rane 2022-11-11 20:31:38 -06:00 committed by GitHub
parent a558034c1a
commit eec9a7e022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -279,8 +279,8 @@ function setup_venv() {
source /main_checkout/torch-mlir/docker_venv/bin/activate
echo ":::: pip installing dependencies"
python3 -m pip install --upgrade -r /main_checkout/torch-mlir/externals/llvm-project/mlir/python/requirements.txt
python3 -m pip install --upgrade -r /main_checkout/torch-mlir/requirements.txt
python3 -m pip install --no-cache-dir -r /main_checkout/torch-mlir/externals/llvm-project/mlir/python/requirements.txt
python3 -m pip install --no-cache-dir -r /main_checkout/torch-mlir/requirements.txt
}
@ -347,7 +347,7 @@ function clean_build() {
}
function build_torch_mlir() {
python -m pip install --upgrade -r /main_checkout/torch-mlir/requirements.txt \
python -m pip install --no-cache-dir -r /main_checkout/torch-mlir/requirements.txt \
--extra-index-url https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
CMAKE_GENERATOR=Ninja \
TORCH_MLIR_PYTHON_PACKAGE_VERSION=${TORCH_MLIR_PYTHON_PACKAGE_VERSION} \