Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] [GHA] Setup pip cache directory per Python on Windows; do not use cache for setup-python action #28015

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/actions/setup_python/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ inputs:
runs:
using: 'composite'
steps:

- name: Check if Python is already installed (Linux)
if: ${{ runner.os == 'Linux' }}
shell: bash
Expand Down Expand Up @@ -54,13 +53,11 @@ runs:
with:
python-version: ${{ inputs.version }}

- if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64' && steps.check_python.outputs.installed == 'false' ) }}
- if: ${{ runner.os == 'macOS' || runner.os == 'Windows' || (runner.os == 'Linux' && runner.arch != 'ARM64' && steps.check_python.outputs.installed == 'false') }}
name: Setup Python ${{ inputs.version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ inputs.version }}
env:
PIP_CACHE_DIR: ${{ inputs.self-hosted-runner == 'true' && inputs.pip-cache-path || '' }}
Comment on lines -62 to -63
Copy link
Contributor Author

@akashchi akashchi Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we do not know the pip version the action will install, we should not just pass the inputs.pip-cache-path because it can corrupt the cache in there as they are not separated per the pip version.


- if: ${{ inputs.should-setup-pip-paths == 'true' && runner.os != 'Windows' }}
name: Setup pip variables (cache and install path)
Expand Down
4 changes: 4 additions & 0 deletions .github/scripts/workflow_rerun/errors_to_look_for.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,9 @@
{
"error_text": "Upload progress stalled",
"ticket": 152933
},
{
"error_text": "because the GET request got Content-Type",
"ticket": 158400
}
]
6 changes: 5 additions & 1 deletion .github/workflows/job_build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,11 @@ jobs:

$pythonCommand = "py -$pyVersion -c `"import sys; print(f'{sys.executable}')`""
$pythonExecutablePath = & cmd /c $pythonCommand


$pipVersion = & $pythonExecutablePath -c "import pip; print(pip.__version__)"
Write-Host "Using pip version: $pipVersion for $pyVersion"
$env:PIP_CACHE_DIR="${{ env.PIP_CACHE_PATH }}/$pipVersion"

& $pythonExecutablePath -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt

cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir"
Expand Down
Loading