From 8dd2fb42336039dac6a052a5efa8e0d1de0fa3e3 Mon Sep 17 00:00:00 2001 From: Anand <115868723+zodwick@users.noreply.github.com> Date: Sat, 5 Oct 2024 23:47:47 +0530 Subject: [PATCH 01/13] Create doc_gen.yml --- .github/workflows/doc_gen.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/doc_gen.yml diff --git a/.github/workflows/doc_gen.yml b/.github/workflows/doc_gen.yml new file mode 100644 index 000000000..f8c5089b4 --- /dev/null +++ b/.github/workflows/doc_gen.yml @@ -0,0 +1,30 @@ +name: Run gen_ref_pages + +on: + push: + branches: + - main + + +jobs: + run_script: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.11' # Specify your Python version + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -e ".[docs]" + pip install -e ".[env]" + + - name: Run gen_ref_pages.py + run: | + python scripts/gen_ref_pages.py From 37b327d9953f3b532504298ce32f66bc48a2d292 Mon Sep 17 00:00:00 2001 From: Anand <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 00:20:44 +0530 Subject: [PATCH 02/13] Update index.md --- docs/howtos/index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/howtos/index.md b/docs/howtos/index.md index 5dcb20373..3cac81521 100644 --- a/docs/howtos/index.md +++ b/docs/howtos/index.md @@ -27,5 +27,4 @@ Each guide in this section provides a focused solution to real-world problems th How to integrate Ragas with other frameworks and observability tools. Use Ragas with frameworks like [Langchain](integrations/langchain.md), [LlamaIndex](integrations/llamaindex.md), and [observability tools](). - From 18f660d0f723488d2c651422b159bdf638e220dd Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 20:33:57 +0530 Subject: [PATCH 03/13] added deploy ? --- .github/workflows/mike-deploy.yml | 90 +++++++++++++++++++++++++++++++ VERSION | 1 + 2 files changed, 91 insertions(+) create mode 100644 .github/workflows/mike-deploy.yml create mode 100644 VERSION diff --git a/.github/workflows/mike-deploy.yml b/.github/workflows/mike-deploy.yml new file mode 100644 index 000000000..52bd902f8 --- /dev/null +++ b/.github/workflows/mike-deploy.yml @@ -0,0 +1,90 @@ +# Workflow inspiration and adaptation came from Andruino-Cli +# https://github.com/arduino/arduino-cli/blob/master/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml + +name: Deploy Documents 5.5 + +env: + PYTHON_VERSION: "3.9" + +on: + push: + branches: + # Branch to base "dev" website on. Set in siteversion.py also. + - master + # Release branches have names like 0.8.x, 0.9.x, ... + - "[0-9]+.[0-9]+.x" + create: + +jobs: + pre-publish: + runs-on: ubuntu-latest + outputs: + result: ${{ steps.determination.outputs.result }} + steps: + - name: Determine if documentation should be published on this workflow run + id: determination + run: | + RELEASE_BRANCH_REGEX="refs/heads/[0-9]+.[0-9]+.x" + if [[ "${{ github.event_name }}" == "push" || ( "${{ github.event_name }}" == "create" && "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX ) ]]; then + RESULT="true" + else + RESULT="false" + fi + + echo "result=$RESULT" >> $GITHUB_OUTPUT + echo "Deploy documents: $RESULT" + + publish: + runs-on: ubuntu-latest + needs: pre-publish + if: needs.pre-publish.outputs.result == 'true' + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Install Requirements + run: | + python -m pip install --upgrade pip + python -m pip install -e ".[docs]" + python -m pip install -e ".[env]" + + - name: Run script to generate references + run: python scripts/gen_ref_pages.py + + - name: Determine versioning parameters + id: determine-versioning + run: | + # Read the first line from the VERSION file + LINE=$(head -n 1 ./VERSION) + + # Extract version and alias using parameter expansion + VERSION="${LINE%%|*}" + ALIAS="${LINE#*|}" + + # Print the extracted values for verification + echo "Version: $VERSION" + echo "Alias: $ALIAS" + + echo "Ragas_DOCS_VERSION=$VERSION" >> $GITHUB_ENV + echo "Ragas_DOCS_ALIAS=$ALIAS" >> $GITHUB_ENV + + - name: Deploy + if: ${{ env.Ragas_DOCS_VERSION }} != null + run: | + # Publishing implies creating a git commit on the production branch, + # We will need to create a user for this at some point + git config user.name + git config user.email + git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production + mike deploy \ + --update-aliases \ + --branch production \ + --push \ + ${{ env.Ragas_DOCS_VERSION }} \ + ${{ env.Ragas_DOCS_ALIAS }} diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..643d9ca56 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0|dev \ No newline at end of file From e17c7bd0381d24c6856f653832198a55de61bfc3 Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:21:49 +0530 Subject: [PATCH 04/13] test1 --- scripts/gen_ref_pages.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/gen_ref_pages.py b/scripts/gen_ref_pages.py index 2806bf116..382fa69aa 100644 --- a/scripts/gen_ref_pages.py +++ b/scripts/gen_ref_pages.py @@ -11,6 +11,7 @@ root = Path(__file__).parent.parent src = root / "src" src_ragas = root / "src" / "ragas" +#ok lets test this logger.info("Generating code reference pages for %s with root %s", src, root) for path in sorted(src.rglob("*.py")): From 070a79e365b2d5785130b0b8a62a3cd1286ad4df Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:28:02 +0530 Subject: [PATCH 05/13] new script called mike deploy ?? --- .github/workflows/doc_gen.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 .github/workflows/doc_gen.yml diff --git a/.github/workflows/doc_gen.yml b/.github/workflows/doc_gen.yml deleted file mode 100644 index f8c5089b4..000000000 --- a/.github/workflows/doc_gen.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Run gen_ref_pages - -on: - push: - branches: - - main - - -jobs: - run_script: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.11' # Specify your Python version - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e ".[docs]" - pip install -e ".[env]" - - - name: Run gen_ref_pages.py - run: | - python scripts/gen_ref_pages.py From b4499d75eff80c0e0a5e46d315864f9498ecb9a3 Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:30:15 +0530 Subject: [PATCH 06/13] soup test --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 72216ace3..01fbe4d31 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # ✨ Introduction -Ragas is a library that provides tools to supercharge the evaluation of Large Language Model (LLM) applications. It is designed to help you evaluate your LLM applications with ease and confidence. +soup is a library that provides tools to supercharge the evaluation of Large Language Model (LLM) applications. It is designed to help you evaluate your LLM applications with ease and confidence. From 015005e00da22b22e30923403a104205e2ad9023 Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:31:40 +0530 Subject: [PATCH 07/13] duh --- .github/workflows/mike-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mike-deploy.yml b/.github/workflows/mike-deploy.yml index 52bd902f8..35326bad2 100644 --- a/.github/workflows/mike-deploy.yml +++ b/.github/workflows/mike-deploy.yml @@ -10,7 +10,7 @@ on: push: branches: # Branch to base "dev" website on. Set in siteversion.py also. - - master + - main # Release branches have names like 0.8.x, 0.9.x, ... - "[0-9]+.[0-9]+.x" create: From 2dd98a04d5e9c0ed7f246025096e610f0ca23319 Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:46:28 +0530 Subject: [PATCH 08/13] update git cred ? --- .github/workflows/mike-deploy.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mike-deploy.yml b/.github/workflows/mike-deploy.yml index 35326bad2..bc74036de 100644 --- a/.github/workflows/mike-deploy.yml +++ b/.github/workflows/mike-deploy.yml @@ -9,7 +9,7 @@ env: on: push: branches: - # Branch to base "dev" website on. Set in siteversion.py also. + # Branch to base "dev" website on. - main # Release branches have names like 0.8.x, 0.9.x, ... - "[0-9]+.[0-9]+.x" @@ -52,7 +52,8 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -e ".[docs]" - python -m pip install -e ".[env]" + python -m pip install -e ".[env]" + - name: Run script to generate references run: python scripts/gen_ref_pages.py @@ -79,8 +80,8 @@ jobs: run: | # Publishing implies creating a git commit on the production branch, # We will need to create a user for this at some point - git config user.name - git config user.email + git config user.name "github-actions[bot]" + git config user.email "{user.id}+{user.login}@users.noreply.github.com" git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production mike deploy \ --update-aliases \ From d36027c7f2ff91caac09cc45e1e336469fab6c0e Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:50:18 +0530 Subject: [PATCH 09/13] fix branch to gh-pages --- .github/workflows/mike-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mike-deploy.yml b/.github/workflows/mike-deploy.yml index bc74036de..0cace92b3 100644 --- a/.github/workflows/mike-deploy.yml +++ b/.github/workflows/mike-deploy.yml @@ -82,7 +82,7 @@ jobs: # We will need to create a user for this at some point git config user.name "github-actions[bot]" git config user.email "{user.id}+{user.login}@users.noreply.github.com" - git fetch --no-tags --prune --depth=1 origin +refs/heads/production:refs/remotes/origin/production + git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages mike deploy \ --update-aliases \ --branch production \ From 3a875aa2ffd459fb0043816efa19e74ce135d72a Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:52:17 +0530 Subject: [PATCH 10/13] Add "mike" package to the project dependencies --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index bf8093a7b..5a6cee78a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ docs = [ "mkdocs-section-index", "mkdocs-git-committers-plugin-2", "mkdocs-git-revision-date-localized-plugin", + "mike", ] [tool.setuptools] package-dir = {"" = "src"} From 162f214b63e269757231e2bd5ace7d033370afa4 Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:01:50 +0530 Subject: [PATCH 11/13] ragas dev test ? --- .github/workflows/mike-deploy.yml | 5 ++--- docs/index.md | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mike-deploy.yml b/.github/workflows/mike-deploy.yml index 0cace92b3..9a413c252 100644 --- a/.github/workflows/mike-deploy.yml +++ b/.github/workflows/mike-deploy.yml @@ -52,8 +52,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install -e ".[docs]" - python -m pip install -e ".[env]" - + python -m pip install -e ".[env]" - name: Run script to generate references run: python scripts/gen_ref_pages.py @@ -85,7 +84,7 @@ jobs: git fetch --no-tags --prune --depth=1 origin +refs/heads/gh-pages:refs/remotes/origin/gh-pages mike deploy \ --update-aliases \ - --branch production \ --push \ + --remote origin \ ${{ env.Ragas_DOCS_VERSION }} \ ${{ env.Ragas_DOCS_ALIAS }} diff --git a/docs/index.md b/docs/index.md index 01fbe4d31..f5de42b5f 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # ✨ Introduction -soup is a library that provides tools to supercharge the evaluation of Large Language Model (LLM) applications. It is designed to help you evaluate your LLM applications with ease and confidence. +Ragas dev is a library that provides tools to supercharge the evaluation of Large Language Model (LLM) applications. It is designed to help you evaluate your LLM applications with ease and confidence. From f8409e29b8e7d3d195ea4ce6c198afb15d12d180 Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:04:37 +0530 Subject: [PATCH 12/13] feat(ci): mike-based pipeline for auto doc gen and deployment --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index f5de42b5f..72216ace3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ # ✨ Introduction -Ragas dev is a library that provides tools to supercharge the evaluation of Large Language Model (LLM) applications. It is designed to help you evaluate your LLM applications with ease and confidence. +Ragas is a library that provides tools to supercharge the evaluation of Large Language Model (LLM) applications. It is designed to help you evaluate your LLM applications with ease and confidence. From bae3ef41dc11b1cf9df5097bf856939cc6aed901 Mon Sep 17 00:00:00 2001 From: zodwick <115868723+zodwick@users.noreply.github.com> Date: Mon, 7 Oct 2024 10:07:30 +0530 Subject: [PATCH 13/13] remove unwanted comment --- scripts/gen_ref_pages.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/gen_ref_pages.py b/scripts/gen_ref_pages.py index 382fa69aa..2806bf116 100644 --- a/scripts/gen_ref_pages.py +++ b/scripts/gen_ref_pages.py @@ -11,7 +11,6 @@ root = Path(__file__).parent.parent src = root / "src" src_ragas = root / "src" / "ragas" -#ok lets test this logger.info("Generating code reference pages for %s with root %s", src, root) for path in sorted(src.rglob("*.py")):