From fcaeb2a4079307fd04d6c9d008a0d01d6548697c Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 10:03:42 +0100 Subject: [PATCH 01/11] ci: send Slack notification on nightly failures + modernize workflow --- .github/workflows/nightly.yml | 42 ++++++++++++--------------- tutorials/27_First_RAG_Pipeline.ipynb | 9 ++++++ 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 22f2f496..ec70c80c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -4,15 +4,17 @@ on: workflow_dispatch: # Activate this workflow manually schedule: - cron: "0 0 * * *" + # TODO: REMOVE TRIGGER AFTER TESTING + pull_request: jobs: generate-matrix: - runs-on: ubuntu-latest + runs-on: ubuntu-slim outputs: - matrix_v2: ${{ steps.generator.outputs.matrix_v2 }} + matrix: ${{ steps.generator.outputs.matrix }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: "3.11" - id: generator @@ -23,7 +25,7 @@ jobs: VERSION=$(gh api /repos/deepset-ai/haystack/releases | \ jq -r '[.[].tag_name | select(test("^v2.[0-9]+.[0-9]+$"))] | first') NOTEBOOKS=$(python ./scripts/generate_matrix.py --haystack-version "$VERSION" --include-main) - echo "matrix_v2={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT" + echo "matrix={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT" run-tutorials: needs: generate-matrix @@ -33,7 +35,7 @@ jobs: strategy: max-parallel: 2 fail-fast: false - matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix_v2) }} + matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} env: HAYSTACK_TELEMETRY_ENABLED: "False" @@ -44,7 +46,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 + + - name: Setup Python and uv + uses: astral-sh/setup-uv@v7 + with: + python-version: "3.11" - name: Install common dependencies run: | @@ -54,12 +61,12 @@ jobs: libsndfile1 \ ffmpeg - pip install nbconvert ipython + uv pip install nbconvert ipython - name: Install tutorial dependencies if: toJSON(matrix.dependencies) != '[]' run: | - pip install "${{ join(matrix.dependencies, '" "')}}" + uv pip install "${{ join(matrix.dependencies, '" "')}}" - name: Convert notebook to Python run: | @@ -77,19 +84,8 @@ jobs: python "$NOTEBOOK" fi - - name: Send Failure to Datadog + - name: Notify Slack on nightly failure if: failure() - uses: masci/datadog@v1 + uses: deepset-ai/notify-slack-action@v1 with: - api-key: ${{ secrets.CORE_DATADOG_API_KEY }} - api-url: https://api.datadoghq.eu - events: | - - title: "Tutorial ${{ matrix.notebook }} failed" - text: "Branch ${{ github.ref_name }} tests failed" - alert_type: "error" - source_type_name: "Github" - host: ${{ github.repository_owner }} - tags: - - "project:${{ github.repository }}" - - "name:${{ matrix.notebook }}" - - "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} diff --git a/tutorials/27_First_RAG_Pipeline.ipynb b/tutorials/27_First_RAG_Pipeline.ipynb index f24153b2..cdcb02cb 100644 --- a/tutorials/27_First_RAG_Pipeline.ipynb +++ b/tutorials/27_First_RAG_Pipeline.ipynb @@ -76,6 +76,15 @@ "Initialize a DocumentStore to index your documents. A DocumentStore stores the Documents that the question answering system uses to find answers to your questions. In this tutorial, you'll be using the `InMemoryDocumentStore`." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "raise Exception(\"let's make this fail\")" + ] + }, { "cell_type": "code", "execution_count": 3, From c80939e4606c77741121c88bcdfab70f0e5b5770 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 10:08:43 +0100 Subject: [PATCH 02/11] fix --- .github/workflows/nightly.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ec70c80c..fcc55697 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -60,7 +60,8 @@ jobs: gcc \ libsndfile1 \ ffmpeg - + + uv venv uv pip install nbconvert ipython - name: Install tutorial dependencies @@ -89,3 +90,4 @@ jobs: uses: deepset-ai/notify-slack-action@v1 with: slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} + mention-here: false From d5e1ae3ac0bd6bd18adbc85a51b774ac9b6b4ed3 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 10:14:36 +0100 Subject: [PATCH 03/11] try --- .github/workflows/nightly.yml | 20 ++++++++++---------- .github/workflows/run_tutorials.yml | 28 +++++++++++++++++----------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index fcc55697..eae9e7e6 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -71,23 +71,23 @@ jobs: - name: Convert notebook to Python run: | - jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb + uv run jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - name: Run the converted notebook run: | NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | python "$NOTEBOOK" + yes y | uv run python "$NOTEBOOK" elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | python "$NOTEBOOK" + yes Q | uv run python "$NOTEBOOK" else - python "$NOTEBOOK" + uv run python "$NOTEBOOK" fi - - name: Notify Slack on nightly failure - if: failure() - uses: deepset-ai/notify-slack-action@v1 - with: - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} - mention-here: false + # - name: Notify Slack on nightly failure + # if: failure() + # uses: deepset-ai/notify-slack-action@v1 + # with: + # slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} + # mention-here: false diff --git a/.github/workflows/run_tutorials.yml b/.github/workflows/run_tutorials.yml index 7fc46d6c..fc885a77 100644 --- a/.github/workflows/run_tutorials.yml +++ b/.github/workflows/run_tutorials.yml @@ -7,13 +7,13 @@ on: jobs: generate-matrix: - runs-on: ubuntu-latest + runs-on: ubuntu-slim outputs: matrix: ${{ steps.filter.outputs.matrix }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v6 with: python-version: "3.11" @@ -29,7 +29,7 @@ jobs: - name: Get changed files id: files - uses: tj-actions/changed-files@v46 + uses: tj-actions/changed-files@v47 with: matrix: true files: tutorials/*.ipynb @@ -75,7 +75,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 + + - name: Setup Python and uv + uses: astral-sh/setup-uv@v7 + with: + python-version: "3.11" - name: Install common dependencies run: | @@ -85,25 +90,26 @@ jobs: libsndfile1 \ ffmpeg - pip install nbconvert ipython + uv venv + uv pip install nbconvert ipython - name: Install tutorial dependencies if: toJSON(matrix.dependencies) != '[]' run: | - pip install "${{ join(matrix.dependencies, '" "')}}" + uv pip install "${{ join(matrix.dependencies, '" "')}}" - name: Convert notebook to Python run: | - jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb + uv run jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - name: Run the converted notebook run: | NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | python "$NOTEBOOK" + yes y | uv run python "$NOTEBOOK" elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | python "$NOTEBOOK" + yes Q | uv run python "$NOTEBOOK" else - python "$NOTEBOOK" + uv run python "$NOTEBOOK" fi From 68f27aee93b635e496ec9c545686b9736f010cb2 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 10:25:39 +0100 Subject: [PATCH 04/11] activate env --- .github/workflows/nightly.yml | 10 ++++++---- .github/workflows/run_tutorials.yml | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index eae9e7e6..d8645118 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -71,18 +71,20 @@ jobs: - name: Convert notebook to Python run: | - uv run jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb + source .venv/bin/activate + jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - name: Run the converted notebook run: | + source .venv/bin/activate NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | uv run python "$NOTEBOOK" + yes y | python "$NOTEBOOK" elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | uv run python "$NOTEBOOK" + yes Q | python "$NOTEBOOK" else - uv run python "$NOTEBOOK" + python "$NOTEBOOK" fi # - name: Notify Slack on nightly failure diff --git a/.github/workflows/run_tutorials.yml b/.github/workflows/run_tutorials.yml index fc885a77..bdba586d 100644 --- a/.github/workflows/run_tutorials.yml +++ b/.github/workflows/run_tutorials.yml @@ -100,16 +100,18 @@ jobs: - name: Convert notebook to Python run: | - uv run jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb + source .venv/bin/activate + jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - name: Run the converted notebook run: | + source .venv/bin/activate NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | uv run python "$NOTEBOOK" + yes y | python "$NOTEBOOK" elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | uv run python "$NOTEBOOK" + yes Q | python "$NOTEBOOK" else - uv run python "$NOTEBOOK" + python "$NOTEBOOK" fi From cd94158fd741af69604494452843998bbf9d1455 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 10:29:13 +0100 Subject: [PATCH 05/11] no-project --- .github/workflows/nightly.yml | 10 ++++------ .github/workflows/run_tutorials.yml | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d8645118..b3107185 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -71,20 +71,18 @@ jobs: - name: Convert notebook to Python run: | - source .venv/bin/activate - jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb + uv run --no-project jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - name: Run the converted notebook run: | - source .venv/bin/activate NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | python "$NOTEBOOK" + yes y | uv run --no-project python "$NOTEBOOK" elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | python "$NOTEBOOK" + yes Q | uv run --no-project python "$NOTEBOOK" else - python "$NOTEBOOK" + uv run --no-project python "$NOTEBOOK" fi # - name: Notify Slack on nightly failure diff --git a/.github/workflows/run_tutorials.yml b/.github/workflows/run_tutorials.yml index bdba586d..73910895 100644 --- a/.github/workflows/run_tutorials.yml +++ b/.github/workflows/run_tutorials.yml @@ -100,18 +100,16 @@ jobs: - name: Convert notebook to Python run: | - source .venv/bin/activate - jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb + uv run --no-project jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - name: Run the converted notebook run: | - source .venv/bin/activate NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | python "$NOTEBOOK" + yes y | uv run --no-project python "$NOTEBOOK" elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | python "$NOTEBOOK" + yes Q | uv run --no-project python "$NOTEBOOK" else - python "$NOTEBOOK" + uv run --no-project python "$NOTEBOOK" fi From 48fd18a18fa839ae125ab5a3a4d59e2554ae0b79 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 10:35:00 +0100 Subject: [PATCH 06/11] activate --- .github/workflows/nightly.yml | 10 ++++++---- .github/workflows/run_tutorials.yml | 10 ++++++---- .github/workflows/verify_generation.yml | 16 ++++++++++------ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index b3107185..61a32d06 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -71,18 +71,20 @@ jobs: - name: Convert notebook to Python run: | - uv run --no-project jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb + . .venv/bin/activate + jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - name: Run the converted notebook run: | + . .venv/bin/activate NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | uv run --no-project python "$NOTEBOOK" + yes y | python "$NOTEBOOK" elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | uv run --no-project python "$NOTEBOOK" + yes Q | python "$NOTEBOOK" else - uv run --no-project python "$NOTEBOOK" + python "$NOTEBOOK" fi # - name: Notify Slack on nightly failure diff --git a/.github/workflows/run_tutorials.yml b/.github/workflows/run_tutorials.yml index 73910895..da9c3274 100644 --- a/.github/workflows/run_tutorials.yml +++ b/.github/workflows/run_tutorials.yml @@ -100,16 +100,18 @@ jobs: - name: Convert notebook to Python run: | - uv run --no-project jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb + . .venv/bin/activate + jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - name: Run the converted notebook run: | + . .venv/bin/activate NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | uv run --no-project python "$NOTEBOOK" + yes y | python "$NOTEBOOK" elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | uv run --no-project python "$NOTEBOOK" + yes Q | python "$NOTEBOOK" else - uv run --no-project python "$NOTEBOOK" + python "$NOTEBOOK" fi diff --git a/.github/workflows/verify_generation.yml b/.github/workflows/verify_generation.yml index c4a51c1e..a1ae337e 100644 --- a/.github/workflows/verify_generation.yml +++ b/.github/workflows/verify_generation.yml @@ -7,20 +7,24 @@ on: - "index.toml" jobs: - run-tutorials: - runs-on: ubuntu-latest + verify-markdown-generation: + runs-on: ubuntu-slim steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - - uses: actions/setup-python@v5 + - name: Setup Python and uv + uses: astral-sh/setup-uv@v7 with: - python-version: "3.10" + python-version: "3.11" - name: Install dependencies - run: pip install -r requirements.txt + run: | + uv venv + uv pip install -r requirements.txt - name: Generate all tutorials run: | + . .venv/bin/activate mkdir output python scripts/generate_markdowns.py --index index.toml --notebooks all --output ./output From 799756cb41f2f1f8b9f98b7b175b4d16028b26bd Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 10:45:27 +0100 Subject: [PATCH 07/11] no containers --- .github/workflows/nightly.yml | 13 ++++++------- .github/workflows/run_tutorials.yml | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 61a32d06..a9726b6b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -30,7 +30,6 @@ jobs: run-tutorials: needs: generate-matrix runs-on: ubuntu-latest - container: deepset/haystack:base-${{ matrix.haystack_version }} strategy: max-parallel: 2 @@ -55,13 +54,13 @@ jobs: - name: Install common dependencies run: | - apt-get update && apt-get install -y \ - build-essential \ - gcc \ - libsndfile1 \ - ffmpeg - uv venv + if [ "${{ matrix.haystack_version }}" = "main" ]; then + uv pip install "haystack-ai @ git+https://github.com/deepset-ai/haystack.git@main" + else + VERSION="${{ matrix.haystack_version }}" + uv pip install "haystack-ai==${VERSION#v}" + fi uv pip install nbconvert ipython - name: Install tutorial dependencies diff --git a/.github/workflows/run_tutorials.yml b/.github/workflows/run_tutorials.yml index da9c3274..3b0c7ead 100644 --- a/.github/workflows/run_tutorials.yml +++ b/.github/workflows/run_tutorials.yml @@ -60,7 +60,6 @@ jobs: run-tutorials: runs-on: ubuntu-latest needs: generate-matrix - container: deepset/haystack:base-${{ matrix.haystack_version }} strategy: fail-fast: false @@ -84,13 +83,13 @@ jobs: - name: Install common dependencies run: | - apt-get update && apt-get install -y \ - build-essential \ - gcc \ - libsndfile1 \ - ffmpeg - uv venv + if [ "${{ matrix.haystack_version }}" = "main" ]; then + uv pip install "haystack-ai @ git+https://github.com/deepset-ai/haystack.git@main" + else + VERSION="${{ matrix.haystack_version }}" + uv pip install "haystack-ai==${VERSION#v}" + fi uv pip install nbconvert ipython - name: Install tutorial dependencies From b48b72339d552f3401c1a37d516c913f180b96ef Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 11:10:47 +0100 Subject: [PATCH 08/11] fixes --- .github/workflows/nightly.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a9726b6b..0da7ec63 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -32,7 +32,6 @@ jobs: runs-on: ubuntu-latest strategy: - max-parallel: 2 fail-fast: false matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} @@ -86,9 +85,9 @@ jobs: python "$NOTEBOOK" fi - # - name: Notify Slack on nightly failure - # if: failure() - # uses: deepset-ai/notify-slack-action@v1 - # with: - # slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} - # mention-here: false + - name: Notify Slack on nightly failure + if: failure() + uses: deepset-ai/notify-slack-action@v1 + with: + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} + mention-here: false From 0d62999affe732f7e207ff27ebd334b8429dbd25 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 11:52:04 +0100 Subject: [PATCH 09/11] clean up --- .github/workflows/nightly.yml | 5 +---- tutorials/27_First_RAG_Pipeline.ipynb | 9 --------- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0da7ec63..61a40243 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -4,8 +4,6 @@ on: workflow_dispatch: # Activate this workflow manually schedule: - cron: "0 0 * * *" - # TODO: REMOVE TRIGGER AFTER TESTING - pull_request: jobs: generate-matrix: @@ -89,5 +87,4 @@ jobs: if: failure() uses: deepset-ai/notify-slack-action@v1 with: - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} - mention-here: false + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} \ No newline at end of file diff --git a/tutorials/27_First_RAG_Pipeline.ipynb b/tutorials/27_First_RAG_Pipeline.ipynb index cdcb02cb..f24153b2 100644 --- a/tutorials/27_First_RAG_Pipeline.ipynb +++ b/tutorials/27_First_RAG_Pipeline.ipynb @@ -76,15 +76,6 @@ "Initialize a DocumentStore to index your documents. A DocumentStore stores the Documents that the question answering system uses to find answers to your questions. In this tutorial, you'll be using the `InMemoryDocumentStore`." ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "raise Exception(\"let's make this fail\")" - ] - }, { "cell_type": "code", "execution_count": 3, From 0e46a3ad763806d3c6fc342b7e3fe9acc8f0b684 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 11:58:04 +0100 Subject: [PATCH 10/11] unify workflows --- .github/workflows/nightly.yml | 90 --------------------------- .github/workflows/run_tutorials.yml | 42 ++++++++----- tutorials/27_First_RAG_Pipeline.ipynb | 9 +++ 3 files changed, 36 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 61a40243..00000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: Run Tutorials Nightly - -on: - workflow_dispatch: # Activate this workflow manually - schedule: - - cron: "0 0 * * *" - -jobs: - generate-matrix: - runs-on: ubuntu-slim - outputs: - matrix: ${{ steps.generator.outputs.matrix }} - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 - with: - python-version: "3.11" - - id: generator - env: - GH_TOKEN: ${{ github.token }} - run: | - # Get tutorial notebooks - VERSION=$(gh api /repos/deepset-ai/haystack/releases | \ - jq -r '[.[].tag_name | select(test("^v2.[0-9]+.[0-9]+$"))] | first') - NOTEBOOKS=$(python ./scripts/generate_matrix.py --haystack-version "$VERSION" --include-main) - echo "matrix={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT" - - run-tutorials: - needs: generate-matrix - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} - - env: - HAYSTACK_TELEMETRY_ENABLED: "False" - HF_API_TOKEN: ${{ secrets.HF_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - SERPERDEV_API_KEY: ${{ secrets.SERPERDEV_API_KEY }} - NOTION_API_KEY: ${{ secrets.NOTION_API_KEY }} - - steps: - - name: Checkout - uses: actions/checkout@v6 - - - name: Setup Python and uv - uses: astral-sh/setup-uv@v7 - with: - python-version: "3.11" - - - name: Install common dependencies - run: | - uv venv - if [ "${{ matrix.haystack_version }}" = "main" ]; then - uv pip install "haystack-ai @ git+https://github.com/deepset-ai/haystack.git@main" - else - VERSION="${{ matrix.haystack_version }}" - uv pip install "haystack-ai==${VERSION#v}" - fi - uv pip install nbconvert ipython - - - name: Install tutorial dependencies - if: toJSON(matrix.dependencies) != '[]' - run: | - uv pip install "${{ join(matrix.dependencies, '" "')}}" - - - name: Convert notebook to Python - run: | - . .venv/bin/activate - jupyter nbconvert --to python --RegexRemovePreprocessor.patterns '%%bash' ./tutorials/${{ matrix.notebook }}.ipynb - - - name: Run the converted notebook - run: | - . .venv/bin/activate - NOTEBOOK="./tutorials/${{ matrix.notebook }}.py" - if [ "${{ matrix.notebook }}" = "47_Human_in_the_Loop_Agent" ]; then - # We add a prompt to confirm any user inputs in the HiTL notebook - yes y | python "$NOTEBOOK" - elif [ "${{ matrix.notebook }}" = "48_Conversational_RAG" ]; then - yes Q | python "$NOTEBOOK" - else - python "$NOTEBOOK" - fi - - - name: Notify Slack on nightly failure - if: failure() - uses: deepset-ai/notify-slack-action@v1 - with: - slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} \ No newline at end of file diff --git a/.github/workflows/run_tutorials.yml b/.github/workflows/run_tutorials.yml index 3b0c7ead..313b3c26 100644 --- a/.github/workflows/run_tutorials.yml +++ b/.github/workflows/run_tutorials.yml @@ -1,6 +1,9 @@ -name: Run Haystack Tutorials +name: Run Tutorials on: + workflow_dispatch: # Activate this workflow manually + schedule: + - cron: "0 0 * * *" pull_request: paths: - "tutorials/*.ipynb" @@ -9,7 +12,7 @@ jobs: generate-matrix: runs-on: ubuntu-slim outputs: - matrix: ${{ steps.filter.outputs.matrix }} + matrix: ${{ steps.matrix.outputs.matrix }} steps: - uses: actions/checkout@v6 @@ -28,16 +31,18 @@ jobs: echo "matrix={\"include\":$NOTEBOOKS}" >> "$GITHUB_OUTPUT" - name: Get changed files + if: github.event_name == 'pull_request' id: files uses: tj-actions/changed-files@v47 with: matrix: true files: tutorials/*.ipynb - - name: Filter non changed notebooks - id: filter + - name: Filter to changed notebooks (pull request only) + id: matrix shell: python env: + EVENT_NAME: ${{ github.event_name }} MATRIX: ${{ steps.generator.outputs.matrix }} CHANGED_FILES: ${{ steps.files.outputs.all_changed_files }} run: | @@ -45,21 +50,22 @@ jobs: import json matrix = json.loads(os.environ["MATRIX"]) - changed_files = json.loads(os.environ["CHANGED_FILES"]) - new_matrix = {"include": []} - for item in matrix["include"]: - notebook = item["notebook"] - if f"tutorials/{notebook}.ipynb" not in changed_files: - continue - new_matrix["include"].append(item) - - new_matrix = json.dumps(new_matrix) + + if os.environ["EVENT_NAME"] == "pull_request": + changed_files = json.loads(os.environ["CHANGED_FILES"]) + new_matrix = {"include": []} + for item in matrix["include"]: + notebook = item["notebook"] + if f"tutorials/{notebook}.ipynb" in changed_files: + new_matrix["include"].append(item) + matrix = new_matrix + with open(os.environ["GITHUB_OUTPUT"], "a") as f: - print(f"matrix={new_matrix}", file=f) + print(f"matrix={json.dumps(matrix)}", file=f) run-tutorials: - runs-on: ubuntu-latest needs: generate-matrix + runs-on: ubuntu-latest strategy: fail-fast: false @@ -114,3 +120,9 @@ jobs: else python "$NOTEBOOK" fi + + - name: Notify Slack on nightly failure + if: failure() && github.event_name != 'pull_request' + uses: deepset-ai/notify-slack-action@v1 + with: + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFICATIONS }} diff --git a/tutorials/27_First_RAG_Pipeline.ipynb b/tutorials/27_First_RAG_Pipeline.ipynb index f24153b2..8a3a9ea5 100644 --- a/tutorials/27_First_RAG_Pipeline.ipynb +++ b/tutorials/27_First_RAG_Pipeline.ipynb @@ -58,6 +58,15 @@ "pip install \"sentence-transformers>=4.1.0\"" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# let me try" + ] + }, { "cell_type": "markdown", "metadata": { From 477e802d87b07fbe5cfffc1eecf43d28adbaae71 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Fri, 6 Mar 2026 12:01:30 +0100 Subject: [PATCH 11/11] remove trigger --- tutorials/27_First_RAG_Pipeline.ipynb | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tutorials/27_First_RAG_Pipeline.ipynb b/tutorials/27_First_RAG_Pipeline.ipynb index 8a3a9ea5..f24153b2 100644 --- a/tutorials/27_First_RAG_Pipeline.ipynb +++ b/tutorials/27_First_RAG_Pipeline.ipynb @@ -58,15 +58,6 @@ "pip install \"sentence-transformers>=4.1.0\"" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# let me try" - ] - }, { "cell_type": "markdown", "metadata": {