e768098d0e
Flake8 Lint / flake8 (push) Waiting to run
Spell check CI / Spell_Check (push) Waiting to run
tools_continuous_delivery / Private PyPI non-main branch release (push) Has been skipped
tools_continuous_delivery / Private PyPI main branch release (push) Failing after 2m42s
Publish Promptflow Doc / Build (push) Has been cancelled
Publish Promptflow Doc / Deploy (push) Has been cancelled
121 lines
4.8 KiB
YAML
121 lines
4.8 KiB
YAML
# This code is autogenerated.
|
|
# Code is generated by running custom script: python3 readme.py
|
|
# Any manual changes to this file may cause incorrect behavior.
|
|
# Any manual changes will be overwritten if the code is regenerated.
|
|
|
|
name: samples_flows_chat_chat_with_image
|
|
on:
|
|
schedule:
|
|
- cron: "16 19 * * *" # Every day starting at 3:16 BJT
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths: [ examples/flows/chat/chat-with-image/**, examples/*requirements.txt, .github/workflows/samples_flows_chat_chat_with_image.yml ]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
IS_IN_CI_PIPELINE: "true"
|
|
|
|
permissions:
|
|
id-token: write
|
|
contents: read
|
|
|
|
jobs:
|
|
samples_flows_chat_chat_with_image:
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
internal
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
- name: Setup Python 3.9 environment
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.9"
|
|
- name: Prepare requirements
|
|
working-directory: examples
|
|
run: |
|
|
if [[ -e requirements.txt ]]; then
|
|
python -m pip install --upgrade pip
|
|
pip install -r requirements.txt
|
|
fi
|
|
- name: Prepare dev requirements
|
|
working-directory: examples
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install -r dev_requirements.txt
|
|
- name: Refine .env file
|
|
working-directory: examples/flows/chat/chat-with-image
|
|
run: |
|
|
AOAI_API_KEY=${{ secrets.AOAI_GPT_4V_KEY }}
|
|
AOAI_API_ENDPOINT=${{ secrets.AOAI_GPT_4V_ENDPOINT }}
|
|
AOAI_API_ENDPOINT=$(echo ${AOAI_API_ENDPOINT//\//\\/})
|
|
cp ../../../connections/azure_openai.yml ./azure_openai.yml
|
|
sed -i -e "s/<user-input>/$AOAI_API_KEY/g" -e "s/aoai-api-endpoint/$AOAI_API_ENDPOINT/g" azure_openai.yml
|
|
- name: Create AOAI Connection from ENV file
|
|
working-directory: examples/flows/chat/chat-with-image
|
|
run: |
|
|
if [[ -e .env ]]; then
|
|
pf connection create --file .env --name aoai_gpt4v_connection
|
|
fi
|
|
if [[ -e azure_openai.yml ]]; then
|
|
pf connection create --file azure_openai.yml --name aoai_gpt4v_connection
|
|
fi
|
|
pf connection list
|
|
- name: Create run.yml
|
|
working-directory: examples/flows/chat/chat-with-image
|
|
run: |
|
|
gpt_base=${{ secrets.AOAI_API_ENDPOINT_TEST }}
|
|
gpt_base=$(echo ${gpt_base//\//\\/})
|
|
if [[ -e run.yml ]]; then
|
|
sed -i -e "s/\${azure_open_ai_connection.api_key}/${{ secrets.AOAI_API_KEY_TEST }}/g" -e "s/\${azure_open_ai_connection.api_base}/$gpt_base/g" run.yml
|
|
fi
|
|
- name: Random Wait
|
|
uses: AliSajid/random-wait-action@main
|
|
with:
|
|
minimum: 0
|
|
maximum: 99
|
|
- name: Azure Login
|
|
uses: azure/login@v1
|
|
with:
|
|
subscription-id: ${{secrets.AZURE_SUBSCRIPTION_ID}}
|
|
tenant-id: ${{secrets.AZURE_TENANT_ID}}
|
|
client-id: ${{secrets.AZURE_CLIENT_ID}}
|
|
- name: Extract Steps examples/flows/chat/chat-with-image/README.md
|
|
working-directory: ${{ github.workspace }}
|
|
run: |
|
|
python scripts/readme/extract_steps_from_readme.py -f examples/flows/chat/chat-with-image/README.md -o examples/flows/chat/chat-with-image
|
|
- name: Cat script
|
|
working-directory: examples/flows/chat/chat-with-image
|
|
run: |
|
|
cat bash_script.sh
|
|
- name: Run scripts against canary workspace (scheduled runs only)
|
|
if: github.event_name == 'schedule'
|
|
working-directory: examples/flows/chat/chat-with-image
|
|
run: |
|
|
export aoai_api_key=${{secrets.AOAI_GPT_4V_KEY }}
|
|
export aoai_api_endpoint=${{ secrets.AOAI_GPT_4V_ENDPOINT }}
|
|
export test_workspace_sub_id=${{ secrets.TEST_WORKSPACE_SUB_ID }}
|
|
export test_workspace_rg=${{ secrets.TEST_WORKSPACE_RG }}
|
|
export test_workspace_name=${{ secrets.TEST_WORKSPACE_NAME_CANARY }}
|
|
bash bash_script.sh
|
|
- name: Run scripts against production workspace
|
|
if: github.event_name != 'schedule'
|
|
working-directory: examples/flows/chat/chat-with-image
|
|
run: |
|
|
export aoai_api_key=${{secrets.AOAI_GPT_4V_KEY }}
|
|
export aoai_api_endpoint=${{ secrets.AOAI_GPT_4V_ENDPOINT }}
|
|
export test_workspace_sub_id=${{ secrets.TEST_WORKSPACE_SUB_ID }}
|
|
export test_workspace_rg=${{ secrets.TEST_WORKSPACE_RG }}
|
|
export test_workspace_name=${{ secrets.TEST_WORKSPACE_NAME_PROD }}
|
|
bash bash_script.sh
|
|
- name: Pip List for Debug
|
|
if : ${{ always() }}
|
|
working-directory: examples/flows/chat/chat-with-image
|
|
run: |
|
|
pip list
|
|
- name: Upload artifact
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: artifact
|
|
path: examples/flows/chat/chat-with-image/bash_script.sh |