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

Disable cache on the CI #2083

Merged
merged 20 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Disable the cache entirely
  • Loading branch information
ZanSara committed Jan 28, 2022
commit 359309f05922d20f5ad3fbb2426ee75abbdba269
59 changes: 33 additions & 26 deletions .github/workflows/linux_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,29 @@ jobs:
pip install mypy==0.910 types-Markdown types-requests types-PyYAML pydantic
mypy haystack

build-cache:
needs: type-check
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Cache
id: cache-python-env
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: linux-${{ hashFiles('**/*.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
if: steps.cache-python-env.outputs.cache-hit != 'true'
run: |
pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -e .[test]
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cpu.html
# build-cache:
# needs: type-check
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: 3.7
# - name: Cache
# id: cache-python-env
# uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: linux-${{ hashFiles('**/*.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}
# - name: Install dependencies
# if: steps.cache-python-env.outputs.cache-hit != 'true'
# run: |
# pip install --upgrade pip
# pip install --upgrade --upgrade-strategy eager -e .[test]
# pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cpu.html

prepare-build:
needs: build-cache
needs: type-check
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -51,6 +51,7 @@ jobs:
echo "::set-output name=matrix::$(find $(find . -type d -name test -not -path "./*env*/*") -type f -name test_*.py | jq -SR . | jq -cs .)"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

build:
needs: prepare-build
runs-on: ubuntu-20.04
Expand All @@ -64,11 +65,11 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: linux-${{ hashFiles('**/*.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}
# - name: Cache
# uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: linux-${{ hashFiles('**/*.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}
- name: Run Elasticsearch
run: docker run -d -p 9200:9200 -e "discovery.type=single-node" -e "ES_JAVA_OPTS=-Xms128m -Xmx128m" elasticsearch:7.9.2

Expand Down Expand Up @@ -96,5 +97,11 @@ jobs:
- name: Install tesseract
run: sudo apt-get install tesseract-ocr libtesseract-dev poppler-utils

- name: Install dependencies
run: |
pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -e .[test]
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cpu.html

- name: Run tests
run: pytest -s ${{ matrix.test-path }}
66 changes: 38 additions & 28 deletions .github/workflows/windows_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@ jobs:
pip install mypy==0.910 types-Markdown types-requests types-PyYAML pydantic
mypy haystack

build-cache:
needs: type-check
runs-on: windows-latest
# build-cache:
# needs: type-check
# runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Cache
id: cache-python-env
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: windows-${{ hashFiles('**/*.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}
- name: Install Pytorch on windows
run: |
pip install torch==1.8.1+cpu -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
- name: Install dependencies
if: steps.cache-python-env.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -e .[test]
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cpu.html
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-python@v2
# with:
# python-version: 3.7
# - name: Cache
# id: cache-python-env
# uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: windows-${{ hashFiles('**/*.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}
# - name: Install Pytorch on windows
# run: |
# pip install torch==1.8.1+cpu -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
# - name: Install dependencies
# if: steps.cache-python-env.outputs.cache-hit != 'true'
# run: |
# python -m pip install --upgrade pip
# pip install --upgrade --upgrade-strategy eager -e .[test]
# pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cpu.html

prepare-build:
needs: build-cache
Expand All @@ -70,11 +70,11 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Cache
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: windows-${{ hashFiles('**/*.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}
# - name: Cache
# uses: actions/cache@v2
# with:
# path: ${{ env.pythonLocation }}
# key: windows-${{ hashFiles('**/*.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}

# Windows runner can't run Linux containers. Refer https://github.com/actions/virtual-environments/issues/1143
- name: Set up Windows test env
Expand All @@ -87,6 +87,16 @@ jobs:
refreshenv
Get-Service elasticsearch-service-x64 | Start-Service

- name: Install Pytorch on windows
run: |
pip install torch==1.8.1+cpu -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -e .[test]
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.10.0+cpu.html

# We have to remove files if not test going to run from it
# As on windows we are going to disable quite a few tests these, hence these files will throw error refer https://github.com/pytest-dev/pytest/issues/812
# Removing test_ray, test_utils, test_preprocessor, test_knowledge_graph and test_connector
Expand Down