Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into shimin/fix_data_scrub
Browse files Browse the repository at this point in the history
  • Loading branch information
Min Shi committed Oct 25, 2023
2 parents 1e4bd57 + aeebd8e commit 32db654
Show file tree
Hide file tree
Showing 169 changed files with 40,098 additions and 608 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
"pkill",
"pgrep",
"Hwfoxydrg",
"llms"
"llms",
"vcrpy"
],
"allowCompoundWords": true
}
11 changes: 11 additions & 0 deletions .github/actions/step_merge_main/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: step_merge_main
runs:
using: composite
steps:
- name: Merge main to current branch
working-directory: ${{ github.workspace }}
shell: pwsh
run: |
git config --global user.name 'prompt flow fundamental'
git config --global user.email '[email protected]'
git pull --no-ff origin main
2 changes: 1 addition & 1 deletion .github/actions/step_sdk_setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ runs:
pip list
python ./setup.py bdist_wheel
$package = Get-ChildItem ./dist | ? { $_.Name.Contains('.whl')}
pip install $($package.FullName + "[azure]")
pip install $($package.FullName + "[azure,executable]")
echo "########### pip freeze (After) ###########"
pip freeze
working-directory: ${{ inputs.scriptPath }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/step_sdk_setup_win/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
pip list
python ./setup.py bdist_wheel
$package = Get-ChildItem ./dist | ? { $_.Name.Contains('.whl')}
pip install $($package.FullName + "[azure]")
pip install $($package.FullName + "[azure,executable]")
echo "########### pip freeze (After) ###########"
pip freeze
working-directory: ${{ inputs.scriptPath }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/promptflow-executor-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: merge main to current branch
uses: "./.github/actions/step_merge_main"
- name: Display and Set Environment Variables
run: |
if [ "ubuntu-latest" == "${{ matrix.os }}" ]; then
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/promptflow-executor-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: merge main to current branch
uses: "./.github/actions/step_merge_main"
- name: Display and Set Environment Variables
run: |
if [ "ubuntu-latest" == "${{ matrix.os }}" ]; then
Expand Down Expand Up @@ -112,4 +115,4 @@ jobs:
pythonVersion: 3.9
coverageThreshold: 50
token: ${{ secrets.GITHUB_TOKEN }}
context: test/executor_unit
context: test/executor_unit
5 changes: 4 additions & 1 deletion .github/workflows/promptflow-global-config-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: merge main to current branch
uses: "./.github/actions/step_merge_main"
- name: Display and Set Environment Variables
run: |
if [ "ubuntu-latest" == "${{ matrix.os }}" ]; then
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/promptflow-release-testing-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ jobs:
gci env:* | sort-object name
az account show
pip install langchain
pip install numexpr
python scripts/building/run_coverage_tests.py `
-p ${{ github.workspace }}/src/promptflow/promptflow `
-t ${{ github.workspace }}/src/promptflow/tests/executor/e2etests ${{ github.workspace }}/src/promptflow/tests/executor/unittests `
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/promptflow-sdk-cli-azure-e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: promptflow-sdk-cli-azure-e2e-test

on:
pull_request:
paths:
- src/promptflow/**
- scripts/**
- '**promptflow-sdk-cli-azure-e2e-test.yml'
workflow_dispatch:

env:
packageSetupType: promptflow_with_extra
testWorkingDirectory: ${{ github.workspace }}/src/promptflow
PYTHONPATH: ${{ github.workspace }}/src/promptflow
IS_IN_CI_PIPELINE: "true"
PROMPT_FLOW_TEST_RUN_LIVE: "false"
PROMPT_FLOW_SKIP_LIVE_RECORDING: "false"

jobs:
sdk_cli_azure_e2e_test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v4

- name: Display and Set Environment Variables
run: |
if [ "ubuntu-latest" == "${{ matrix.os }}" ]; then
export pyVersion="3.9";
elif [ "macos-latest" == "${{ matrix.os }}" ]; then
export pyVersion="3.10";
else
echo "Unsupported OS: ${{ matrix.os }}";
exit 1;
fi
env | sort >> $GITHUB_OUTPUT
id: display_env
shell: bash -el {0}

- name: Python Setup - ${{ matrix.os }} - Python Version ${{ steps.display_env.outputs.pyVersion }}
uses: "./.github/actions/step_create_python_environment"
with:
pythonVersion: ${{ steps.display_env.outputs.pyVersion }}

- name: Build wheel
uses: "./.github/actions/step_sdk_setup"
with:
setupType: ${{ env.packageSetupType }}
scriptPath: ${{ env.testWorkingDirectory }}

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Run Test
shell: pwsh
working-directory: ${{ env.testWorkingDirectory }}
run: |
gci env:* | sort-object name
python "../../scripts/building/run_coverage_tests.py" `
-p promptflow `
-t ${{ github.workspace }}/src/promptflow/tests/sdk_cli_azure_test/e2etests `
-l eastus `
-m "e2etest" `
-n ${{ steps.cpu-cores.outputs.count }} `
--coverage-config ${{ github.workspace }}/src/promptflow/tests/sdk_cli_test/.coveragerc
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: Test Results (Python ${{ steps.display_env.outputs.pyVersion }}) (OS ${{ matrix.os }})
path: |
${{ env.testWorkingDirectory }}/*.xml
${{ env.testWorkingDirectory }}/htmlcov/
publish-test-results:
name: "Publish Tests Results"
needs: sdk_cli_azure_e2e_test
runs-on: ubuntu-latest
permissions: write-all
if: always()

steps:
- name: checkout
uses: actions/checkout@v3
- name: Publish Test Results
uses: "./.github/actions/step_publish_test_results"
with:
testActionFileName: promptflow-sdk-cli-azure-e2e-test.yml
testResultTitle: promptflow SDK CLI Azure E2E Test Result
osVersion: ubuntu-latest
pythonVersion: 3.9
coverageThreshold: 40
token: ${{ secrets.GITHUB_TOKEN }}
context: test/sdk_cli
7 changes: 5 additions & 2 deletions .github/workflows/promptflow-sdk-cli-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: merge main to current branch
uses: "./.github/actions/step_merge_main"
- name: Display and Set Environment Variables
run: |
if [ "ubuntu-latest" == "${{ matrix.os }}" ]; then
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/promptflow-sdk-pfs-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
fetch-depth: 0
- name: merge main to current branch
uses: "./.github/actions/step_merge_main"
- name: Display and Set Environment Variables
run: |
if [ "ubuntu-latest" == "${{ matrix.os }}" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# 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_standard_flow_with_enabled_by_value
on:
schedule:
- cron: "27 22 * * *" # Every day starting at 6:27 BJT
pull_request:
branches: [ main ]
paths: [ examples/flows/standard/flow-with-enabled-by-value/**, examples/*requirements.txt, .github/workflows/samples_flows_standard_flow_with_enabled_by_value.yml ]
workflow_dispatch:

jobs:
samples_readme_ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python 3.9 environment
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Generate config.json
run: echo '${{ secrets.TEST_WORKSPACE_CONFIG_JSON_CANARY }}' > ${{ github.workspace }}/examples/config.json
- 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/standard/flow-with-enabled-by-value
run: |
AOAI_API_KEY=${{ secrets.AOAI_API_KEY_TEST }}
AOAI_API_ENDPOINT=${{ secrets.AOAI_API_ENDPOINT_TEST }}
AOAI_API_ENDPOINT=$(echo ${AOAI_API_ENDPOINT//\//\\/})
if [[ -e .env.example ]]; then
echo "env replacement"
sed -i -e "s/<your_AOAI_key>/$AOAI_API_KEY/g" -e "s/<your_AOAI_endpoint>/$AOAI_API_ENDPOINT/g" .env.example
mv .env.example .env
fi
- name: Create run.yml
working-directory: examples/flows/standard/flow-with-enabled-by-value
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: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Extract Steps examples/flows/standard/flow-with-enabled-by-value/README.md
working-directory: ${{ github.workspace }}
run: |
python scripts/readme/extract_steps_from_readme.py -f examples/flows/standard/flow-with-enabled-by-value/README.md -o examples/flows/standard/flow-with-enabled-by-value
- name: Cat script
working-directory: examples/flows/standard/flow-with-enabled-by-value
run: |
cat bash_script.sh
- name: Run scripts
working-directory: examples/flows/standard/flow-with-enabled-by-value
run: |
export aoai_api_key=${{secrets.AOAI_API_KEY_TEST }}
export aoai_api_endpoint=${{ secrets.AOAI_API_ENDPOINT_TEST }}
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: Pip List for Debug
if : ${{ always() }}
working-directory: examples/flows/standard/flow-with-enabled-by-value
run: |
pip list
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: artifact
path: examples/flows/standard/flow-with-enabled-by-value/bash_script.sh
47 changes: 47 additions & 0 deletions .github/workflows/samples_runmanagement_runmanagement.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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_runmanagement_runmanagement
on:
schedule:
- cron: "51 20 * * *" # Every day starting at 4:51 BJT
pull_request:
branches: [ main ]
paths: [ examples/**, .github/workflows/samples_runmanagement_runmanagement.yml ]
workflow_dispatch:

jobs:
samples_notebook_ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Generate config.json
run: echo '${{ secrets.TEST_WORKSPACE_CONFIG_JSON_CANARY }}' > ${{ github.workspace }}/examples/config.json
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Setup Python 3.9 environment
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Prepare requirements
run: |
python -m pip install --upgrade pip
pip install -r ${{ github.workspace }}/examples/requirements.txt
pip install -r ${{ github.workspace }}/examples/dev_requirements.txt
- name: Create Aoai Connection
run: pf connection create -f ${{ github.workspace }}/examples/connections/azure_openai.yml --set api_key="${{ secrets.AOAI_API_KEY_TEST }}" api_base="${{ secrets.AOAI_API_ENDPOINT_TEST }}"
- name: Test Notebook
working-directory: examples/tutorials/run-management
run: |
papermill -k python run-management.ipynb run-management.output.ipynb
- name: Upload artifact
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: artifact
path: examples/tutorials/run-management
Loading

0 comments on commit 32db654

Please sign in to comment.