haystack/.github/workflows/tutorials.yml
Sara Zan 5d8476eb58
Restart containers in tutorials.sh (#2858)
* restart tutorials in the loop

* remove container steps in tutorials.yml

* forgotten quotes

* unmatched bracket

* give names to containers

* try to limit the log size

* make the containers restart on the scripts as well

* feedback

* Raise integration tests timeout

* raising limit again
2022-07-25 17:35:36 +02:00

66 lines
2.2 KiB
YAML

name: Tutorials
on:
workflow_dispatch: # Activate this workflow manually
pull_request:
paths:
- 'tutorials/*.*'
env:
# Tutorials that require a GPU to run, so can't be run on CI without self-hosted runners
DONT_RUN: Tutorial2_ Tutorial9_ Tutorial13_ Tutorial18_
jobs:
run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: ./.github/actions/python_cache/
- name: Install pdftotext
run: wget --no-check-certificate https://dl.xpdfreader.com/xpdf-tools-linux-4.04.tar.gz && tar -xvf xpdf-tools-linux-4.04.tar.gz && sudo cp xpdf-tools-linux-4.04/bin64/pdftotext /usr/local/bin
# Some tutorials require these libraries to run
# - Tutorial 17 for the audio libs
# - Tutorial 11, 14, 15, 16 for pygraphviz
- name: Install graphviz and audio libs
run: sudo apt install libgraphviz-dev graphviz libsndfile1 ffmpeg
# Some tutorials require these libraries to run
# - Tutorial 15
- name: Install torch-scatter
run: pip install torch-scatter -f https://data.pyg.org/whl/torch-1.12.0+cpu.html
# Haystack needs to be reinstalled at this stage to make sure the current commit's version is the one getting tested.
# The cache can last way longer than a specific action's run, so older Haystack version could be carried over.
- name: Reinstall Haystack
run: |
pip install --upgrade pip
pip install .[all]
pip install pygraphviz
pip install ipython nbformat
- name: Cache mini GoT dataset
run: |
mkdir -p data/tutorials
cd data/tutorials
wget https://s3.eu-central-1.amazonaws.com/deepset.ai-farm-qa/datasets/documents/wiki_gameofthrones_txt1_mini.zip -q &> /dev/null
unzip wiki_gameofthrones_txt1_mini.zip
rm wiki_gameofthrones_txt1_mini.zip
- uses: jitterbit/get-changed-files@v1
id: diff
continue-on-error: true
with:
format: space-delimited
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run tutorials
run: ./.github/utils/tutorials.sh ${{ env.pythonLocation }} "${{ steps.diff.outputs.added_modified }}" "${{ env.DONT_RUN }}" "EDITABLE" "RESTART"