From 6b22e4eafe846bd0eee6aef4eef8c2a960ad237d Mon Sep 17 00:00:00 2001 From: Sanchari Date: Tue, 11 Jun 2024 11:00:39 +0200 Subject: [PATCH 1/3] Put train model and fetch model in same workflow for azure test run --- .github/workflows/run-e2e-tests-on-azure.yml | 129 ++++++------------- 1 file changed, 39 insertions(+), 90 deletions(-) diff --git a/.github/workflows/run-e2e-tests-on-azure.yml b/.github/workflows/run-e2e-tests-on-azure.yml index 8a60e03..bfc774d 100644 --- a/.github/workflows/run-e2e-tests-on-azure.yml +++ b/.github/workflows/run-e2e-tests-on-azure.yml @@ -1,4 +1,4 @@ -name: Continous Integration and Deployment +name: Run e2e tests on azure on: schedule: @@ -11,7 +11,7 @@ env: POETRY_VERSION: 1.8.2 jobs: - train-model: + train-model-and-run-tests: name: Train model runs-on: ubuntu-22.04 @@ -77,94 +77,43 @@ jobs: name: trained-model path: models/${{steps.upload_model.outputs.model}}.tar.gz - run_e2e_tests: - name: Run e2e Tests - runs-on: ubuntu-22.04 - needs: [train-model] - steps: - - name: Checkout git repository 🕝 - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c - with: - ref: test-azure-openai - - - name: Setup Python - uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b - with: - python-version: ${{ env.DEFAULT_PYTHON_VERSION }} - - - name: Install poetry 🦄 - uses: Gr1N/setup-poetry@15821dc8a61bc630db542ae4baf6a7c19a994844 - with: - poetry-version: ${{ env.POETRY_VERSION }} - - - name: Load Poetry Cached Libraries ⬇ - id: cache-poetry - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 - with: - path: .venv - key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ env.DEFAULT_PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} - restore-keys: ${{ runner.os }}-poetry-${{ env.DEFAULT_PYTHON_VERSION }} - - - name: Create virtual environment - if: steps.cache-poetry.outputs.cache-hit != 'true' - run: python -m venv create .venv - - - name: Set up virtual environment - run: poetry config virtualenvs.in-project true + - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a + with: + name: trained-model + path: models/ - # Authenticate with gcloud for release registry (where Rasa is published) - - id: "auth-release" - name: Authenticate with gcloud for release registry 🎫 - uses: "google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d" - with: - token_format: 'access_token' - credentials_json: "${{ secrets.RASA_RELEASES_READ }}" - - - name: Configure OAuth token for poetry - run: | - poetry config http-basic.rasa-plus oauth2accesstoken $(gcloud auth print-access-token) - - - name: Install Dependencies 📦 - run: | - make install - - - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a - with: - name: trained-model - path: models/ - - - name: Init LLM Cache - id: cache-llm - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 - with: - path: .rasa - key: rasa-llm-cache - - - name: Run action server - env: - OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}} - RASA_PRO_LICENSE: ${{secrets.RASA_PRO_LICENSE}} - RASA_DUCKLING_HTTP_URL: ${{secrets.DUCKLING_URL}} - RASA_PRO_BETA_INTENTLESS: true - run: | - make actions & - - - name: Run e2e happy_path tests - env: - OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}} - RASA_PRO_LICENSE: ${{secrets.RASA_PRO_LICENSE}} - RASA_DUCKLING_HTTP_URL: ${{secrets.DUCKLING_URL}} - RASA_PRO_BETA_INTENTLESS: true - run: | - poetry run rasa test e2e e2e_tests/passing/happy_path - - - name: Run e2e chitchat tests - env: - OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}} - RASA_PRO_LICENSE: ${{secrets.RASA_PRO_LICENSE}} - RASA_DUCKLING_HTTP_URL: ${{secrets.DUCKLING_URL}} - RASA_PRO_BETA_INTENTLESS: true - run: | - poetry run rasa test e2e e2e_tests/passing/chitchat + - name: Init LLM Cache + id: cache-llm + uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 + with: + path: .rasa + key: rasa-llm-cache + + - name: Run action server + env: + OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}} + RASA_PRO_LICENSE: ${{secrets.RASA_PRO_LICENSE}} + RASA_DUCKLING_HTTP_URL: ${{secrets.DUCKLING_URL}} + RASA_PRO_BETA_INTENTLESS: true + run: | + make actions & + + - name: Run e2e happy_path tests + env: + OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}} + RASA_PRO_LICENSE: ${{secrets.RASA_PRO_LICENSE}} + RASA_DUCKLING_HTTP_URL: ${{secrets.DUCKLING_URL}} + RASA_PRO_BETA_INTENTLESS: true + run: | + poetry run rasa test e2e e2e_tests/passing/happy_path + + - name: Run e2e chitchat tests + env: + OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}} + RASA_PRO_LICENSE: ${{secrets.RASA_PRO_LICENSE}} + RASA_DUCKLING_HTTP_URL: ${{secrets.DUCKLING_URL}} + RASA_PRO_BETA_INTENTLESS: true + run: | + poetry run rasa test e2e e2e_tests/passing/chitchat \ No newline at end of file From 6add837bbae29048c3faa975522901a800082ecb Mon Sep 17 00:00:00 2001 From: Sanchari Date: Mon, 1 Jul 2024 18:13:07 +0200 Subject: [PATCH 2/3] Test e2e tests with azure openai for version 3.9.0 --- .github/workflows/run-e2e-tests-on-azure.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run-e2e-tests-on-azure.yml b/.github/workflows/run-e2e-tests-on-azure.yml index bfc774d..be6e669 100644 --- a/.github/workflows/run-e2e-tests-on-azure.yml +++ b/.github/workflows/run-e2e-tests-on-azure.yml @@ -1,9 +1,13 @@ name: Run e2e tests on azure on: - schedule: - # Run cron job at 8AM Monday every week. - - cron: '0 8 * * 1' + push: + branches: + - 'fix-test-run-schedule' + +# schedule: +# # Run cron job at 8AM Monday every week. +# - cron: '0 8 * * 1' workflow_dispatch: env: @@ -19,7 +23,7 @@ jobs: - name: Checkout git repository 🕝 uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c with: - ref: test-azure-openai + ref: azure-openai-release-3.9 - name: Setup Python uses: actions/setup-python@57ded4d7d5e986d7296eab16560982c6dd7c923b @@ -77,12 +81,6 @@ jobs: name: trained-model path: models/${{steps.upload_model.outputs.model}}.tar.gz - - - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a - with: - name: trained-model - path: models/ - - name: Init LLM Cache id: cache-llm uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 From 1adda76b1ccd551e9477c512984224fb930f0a2c Mon Sep 17 00:00:00 2001 From: Sanchari Date: Mon, 1 Jul 2024 18:30:06 +0200 Subject: [PATCH 3/3] Add description to workflow --- .github/workflows/run-e2e-tests-on-azure.yml | 29 ++++++-------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/run-e2e-tests-on-azure.yml b/.github/workflows/run-e2e-tests-on-azure.yml index be6e669..afaa538 100644 --- a/.github/workflows/run-e2e-tests-on-azure.yml +++ b/.github/workflows/run-e2e-tests-on-azure.yml @@ -1,13 +1,13 @@ name: Run e2e tests on azure +# This workflow runs `e2e_tests/passing/happy_path` and `e2e_tests/passing/chitchat` tests +# using azure openai configurations +# the config files are located on the branch `azure-openai-release-3.9` +# the workflow checks out the `azure-openai-release-3.9` branch and runs the tests. on: - push: - branches: - - 'fix-test-run-schedule' - -# schedule: -# # Run cron job at 8AM Monday every week. -# - cron: '0 8 * * 1' + schedule: + # Run cron job at 8AM Monday every week. + - cron: '0 8 * * 1' workflow_dispatch: env: @@ -50,18 +50,6 @@ jobs: - name: Set up virtual environment run: poetry config virtualenvs.in-project true - # Authenticate with gcloud for release registry (where Rasa is published) - - id: "auth-release" - name: Authenticate with gcloud for release registry 🎫 - uses: "google-github-actions/auth@ef5d53e30bbcd8d0836f4288f5e50ff3e086997d" - with: - token_format: 'access_token' - credentials_json: "${{ secrets.RASA_RELEASES_READ }}" - - - name: Configure OAuth token for poetry - run: | - poetry config http-basic.rasa-plus oauth2accesstoken $(gcloud auth print-access-token) - - name: Install Dependencies 📦 run: | make install @@ -107,6 +95,7 @@ jobs: poetry run rasa test e2e e2e_tests/passing/happy_path - name: Run e2e chitchat tests + if: always() env: OPENAI_API_KEY: ${{secrets.AZURE_OPENAI_API_KEY}} RASA_PRO_LICENSE: ${{secrets.RASA_PRO_LICENSE}} @@ -114,4 +103,4 @@ jobs: RASA_PRO_BETA_INTENTLESS: true run: | poetry run rasa test e2e e2e_tests/passing/chitchat - \ No newline at end of file + \ No newline at end of file