diff --git a/.github/workflows/azure-dev.yml b/.github/workflows/azure-dev.yml index 401ec162..7f3d35cb 100644 --- a/.github/workflows/azure-dev.yml +++ b/.github/workflows/azure-dev.yml @@ -27,15 +27,15 @@ jobs: AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }} AZURE_LOCATION: ${{ vars.AZURE_LOCATION }} - # project specific - AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} - AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }} - AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME }} - AZURE_OPENAI_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_DEPLOYMENT_NAME }} - AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME: ${{secrets.AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME }} - AZURE_SEARCH_ENDPOINT: ${{ secrets.AZURE_SEARCH_ENDPOINT }} - AZURE_SEARCH_INDEX_NAME: ${{ secrets.AZURE_SEARCH_INDEX_NAME }} - BING_SEARCH_ENDPOINT: ${{ secrets.BING_SEARCH_ENDPOINT }} + # project specific + AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }} + AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }} + AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME }} + AZURE_OPENAI_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }} + AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME }} + AZURE_SEARCH_ENDPOINT: ${{ vars.AZURE_SEARCH_ENDPOINT }} + AZURE_SEARCH_INDEX_NAME: ${{ vars.AZURE_SEARCH_INDEX_NAME }} + BING_SEARCH_ENDPOINT: ${{ vars.BING_SEARCH_ENDPOINT }} BING_SEARCH_KEY: ${{ secrets.BING_SEARCH_KEY }} steps: diff --git a/.github/workflows/evaluate.yml b/.github/workflows/evaluate.yml index bbf05248..36b8a51b 100644 --- a/.github/workflows/evaluate.yml +++ b/.github/workflows/evaluate.yml @@ -1,4 +1,4 @@ -name: Evaluate +name: Build And Evaluate on: workflow_dispatch: @@ -15,23 +15,13 @@ permissions: contents: read jobs: - evaluate: + build: runs-on: ubuntu-latest env: AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }} AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }} AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }} AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} - AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} - AZURE_OPENAI_API_VERSION: ${{ secrets.AZURE_OPENAI_API_VERSION }} - AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME }} - AZURE_OPENAI_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_DEPLOYMENT_NAME }} - AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME }} - AZURE_SEARCH_ENDPOINT: ${{ secrets.AZURE_SEARCH_ENDPOINT }} - AZURE_SEARCH_INDEX_NAME: ${{ secrets.AZURE_SEARCH_INDEX_NAME }} - BING_SEARCH_ENDPOINT: ${{ secrets.BING_SEARCH_ENDPOINT }} - BING_SEARCH_KEY: ${{ secrets.BING_SEARCH_KEY }} - steps: - name: checkout repo content uses: actions/checkout@v4 # checkout the repository content @@ -59,23 +49,45 @@ jobs: inlineScript: | az account set --subscription ${{env.AZURE_SUBSCRIPTION_ID}} - - name: evaluate orchestrator - working-directory: ./src/api - run: | - python -m api.evaluate.evaluate - - - name: Upload eval results as build artifact - uses: actions/upload-artifact@v4 - with: - name: eval_result - path: ./src/api/api/evaluate/eval_results.jsonl + - name: Provision Infrastructure + run: azd provision --no-prompt + env: + AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }} + AZURE_SERVER_APP_SECRET: ${{ secrets.AZURE_SERVER_APP_SECRET }} + AZURE_CLIENT_APP_SECRET: ${{ secrets.AZURE_CLIENT_APP_SECRET }} - - name: GitHub Summary Step - if: ${{ success() }} - working-directory: ./src/api - run: | - echo "" >> $GITHUB_STEP_SUMMARY + - name: Deploy Application + run: azd deploy --no-prompt + evaluate: + runs-on: ubuntu-latest + env: + AZURE_OPENAI_ENDPOINT: ${{ vars.AZURE_OPENAI_ENDPOINT }} + AZURE_OPENAI_API_VERSION: ${{ vars.AZURE_OPENAI_API_VERSION }} + AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_4_EVAL_DEPLOYMENT_NAME }} + AZURE_OPENAI_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_DEPLOYMENT_NAME }} + AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME: ${{ vars.AZURE_OPENAI_35_TURBO_DEPLOYMENT_NAME }} + AZURE_SEARCH_ENDPOINT: ${{ vars.AZURE_SEARCH_ENDPOINT }} + AZURE_SEARCH_INDEX_NAME: ${{ vars.AZURE_SEARCH_INDEX_NAME }} + BING_SEARCH_ENDPOINT: ${{ vars.BING_SEARCH_ENDPOINT }} + BING_SEARCH_KEY: ${{ secrets.BING_SEARCH_KEY }} + steps: + - name: evaluate orchestrator + working-directory: ./src/api + run: | + python -m api.evaluate.evaluate + + - name: Upload eval results as build artifact + uses: actions/upload-artifact@v4 + with: + name: eval_result + path: ./src/api/api/evaluate/eval_results.jsonl + + - name: GitHub Summary Step + if: ${{ success() }} + working-directory: ./src/api + run: | + echo "" >> $GITHUB_STEP_SUMMARY - echo "📊 Promptflow Evaluation Results" >> $GITHUB_STEP_SUMMARY - cat api/evaluate/eval_results.md >> $GITHUB_STEP_SUMMARY + echo "📊 Promptflow Evaluation Results" >> $GITHUB_STEP_SUMMARY + cat api/evaluate/eval_results.md >> $GITHUB_STEP_SUMMARY \ No newline at end of file