Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/microsoft/promptflow into l…
Browse files Browse the repository at this point in the history
…iucheng/20240424_doc
  • Loading branch information
liucheng-ms committed Apr 29, 2024
2 parents 52ce48a + 43a3363 commit 6902503
Show file tree
Hide file tree
Showing 382 changed files with 17,253 additions and 10,266 deletions.
6 changes: 5 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@
"autogen",
"spawnve",
"addrs",
"pycache",
"pywin",
"STARTF",
"mltable",
Expand All @@ -215,7 +216,10 @@
"mpnet",
"wargs",
"dcid",
"cmpop"
"piezo",
"Piezo",
"cmpop",
"omap"
],
"flagWords": [
"Prompt Flow"
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/create_promptflow_release_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ jobs:
echo "replaced src/promptflow/promptflow/_version.py:"
cat src/promptflow/promptflow/_version.py
git add src/promptflow/promptflow/_version.py
git config --global user.name 'promptflow release'
git config --global user.email '[email protected]'
git commit -m "update version in _version.py for promptflow"
git push --set-upstream origin $branch_name
if [[ $(git diff --name-only) == *"src/promptflow/promptflow/_version.py"* ]]; then
git add src/promptflow/promptflow/_version.py
git config --global user.name 'promptflow release'
git config --global user.email '[email protected]'
git commit -m "update version in _version.py for promptflow"
git push --set-upstream origin $branch_name
fi
git tag promptflow_$release_version
git push origin --tags
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/promptflow-core-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,24 @@ jobs:
- name: generate end-to-end test config from secret
run: echo '${{ secrets.PF_TRACING_E2E_TEST_CONFIG }}' >> connections.json
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: set test mode
run: |
echo "PROMPT_FLOW_TEST_MODE=$(if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo replay; else echo live; fi)" >> $GITHUB_ENV
- name: Azure login (non pull_request workflow)
if: github.event_name != 'pull_request'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: generate live test resources (non pull_request workflow)
if: github.event_name != 'pull_request'
uses: "./.github/actions/step_generate_configs"
with:
targetFolder: ${{ env.PROMPTFLOW_DIRECTORY }}
- name: generate live test resources (pull_request workflow)
if: github.event_name == 'pull_request'
working-directory: ${{ env.PROMPTFLOW_DIRECTORY }}
run: |
cp ${{ github.workspace }}/src/promptflow/dev-connections.json.example ${{ github.workspace }}/src/promptflow/connections.json
- name: run core tests
run: poetry run pytest ./tests/core --cov=promptflow --cov-config=pyproject.toml --cov-report=term --cov-report=html --cov-report=xml
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down Expand Up @@ -77,6 +95,24 @@ jobs:
poetry run pip show promptflow-tracing
poetry run pip show promptflow-core
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: set test mode
run: |
echo "PROMPT_FLOW_TEST_MODE=$(if [[ "${{ github.event_name }}" == "pull_request" ]]; then echo replay; else echo live; fi)" >> $GITHUB_ENV
- name: Azure login (non pull_request workflow)
if: github.event_name != 'pull_request'
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: generate live test resources (non pull_request workflow)
if: github.event_name != 'pull_request'
uses: "./.github/actions/step_generate_configs"
with:
targetFolder: ${{ env.PROMPTFLOW_DIRECTORY }}
- name: generate live test resources (pull_request workflow)
if: github.event_name == 'pull_request'
working-directory: ${{ env.PROMPTFLOW_DIRECTORY }}
run: |
cp ${{ github.workspace }}/src/promptflow/dev-connections.json.example ${{ github.workspace }}/src/promptflow/connections.json
- name: run azureml-serving tests
run: poetry run pytest ./tests/azureml-serving --cov=promptflow --cov-config=pyproject.toml --cov-report=term --cov-report=html --cov-report=xml
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promptflow-evals-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
# snok/install-poetry need this to support Windows
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promptflow-evals-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
# snok/install-poetry need this to support Windows
Expand Down
39 changes: 24 additions & 15 deletions .github/workflows/promptflow-import-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,16 @@ jobs:
- uses: snok/install-poetry@v1
- name: Install all packages
run: |
cd ${{ env.WORKING_DIRECTORY }}/src/promptflow-tracing
touch promptflow/__init__.py
poetry install --with dev
cd ${{ env.WORKING_DIRECTORY }}/src/promptflow-core
touch promptflow/__init__.py
poetry install --with dev
cd ${{ env.WORKING_DIRECTORY }}/src/promptflow-devkit
touch promptflow/__init__.py
poetry install --with dev
cd ${{ env.WORKING_DIRECTORY }}/src/promptflow-azure
touch promptflow/__init__.py
poetry install --with dev
cd ${{ env.WORKING_DIRECTORY }}/src/promptflow-evals
touch promptflow/__init__.py
poetry install --with dev
touch src/promptflow-tracing/promptflow/__init__.py
poetry install --with dev -C ${{ env.WORKING_DIRECTORY }}/src/promptflow-tracing
touch src/promptflow-core/promptflow/__init__.py
poetry install --with dev -C ${{ env.WORKING_DIRECTORY }}/src/promptflow-core
touch src/promptflow-devkit/promptflow/__init__.py
poetry install --with dev -C ${{ env.WORKING_DIRECTORY }}/src/promptflow-devkit
touch src/promptflow-azure/promptflow/__init__.py
poetry install --with dev -C ${{ env.WORKING_DIRECTORY }}/src/promptflow-azure
touch src/promptflow-evals/promptflow/__init__.py
poetry install --with dev -C ${{ env.WORKING_DIRECTORY }}/src/promptflow-evals
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: import lint
run: |
Expand All @@ -59,4 +54,18 @@ jobs:
cd ${{ env.WORKING_DIRECTORY }}/src/promptflow-evals
poetry run lint-imports
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: import lint testing private imports from global
working-directory: ${{ env.WORKING_DIRECTORY }}/src/promptflow-azure
run: |
set -xe
rm ${{ env.WORKING_DIRECTORY }}/src/promptflow-tracing/promptflow/__init__.py
rm ${{ env.WORKING_DIRECTORY }}/src/promptflow-core/promptflow/__init__.py
rm ${{ env.WORKING_DIRECTORY }}/src/promptflow-devkit/promptflow/__init__.py
rm ${{ env.WORKING_DIRECTORY }}/src/promptflow-azure/promptflow/__init__.py
rm ${{ env.WORKING_DIRECTORY }}/src/promptflow-evals/promptflow/__init__.py
echo "=== Add more import linter when facing more import errors ==="
echo "=== promptflow-azure full lints ==="
poetry run pip install langchain
poetry run python ${{ github.workspace }}/scripts/import_linter/import_linter.py
41 changes: 23 additions & 18 deletions .github/workflows/promptflow-release-testing-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
pythonVersion: ['3.8', '3.9', '3.10', '3.11']
defaults:
run:
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
pythonVersion: ['3.8', '3.9', '3.10', '3.11']
# snok/install-poetry need this to support Windows
defaults:
Expand Down Expand Up @@ -160,13 +160,11 @@ jobs:
run: |
poetry run pip install $(python -c "import glob; print(glob.glob('**/promptflow_tracing-*.whl', recursive=True)[0])")
poetry run pip install $(python -c "import glob; print(glob.glob('**/promptflow_core-*.whl', recursive=True)[0])")
poetry run pip install -e ../promptflow-recording
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install test dependency group
run: poetry install --only test
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install recording
run: poetry install
working-directory: ${{ env.RECORD_DIRECTORY }}
- name: run core tests
run: poetry run pytest ./tests/core
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand All @@ -186,7 +184,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
pythonVersion: ['3.8', '3.9', '3.10', '3.11']
# snok/install-poetry need this to support Windows
defaults:
Expand All @@ -209,13 +207,11 @@ jobs:
run: |
poetry run pip install $(python -c "import glob; print(glob.glob('**/promptflow_tracing-*.whl', recursive=True)[0])")
poetry run pip install $(python -c "import glob; print(glob.glob('**/promptflow_core-*.whl', recursive=True)[0]+'[azureml-serving]')")
poetry run pip install -e ../promptflow-recording
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install test dependency group
run: poetry install --only test
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install recording
run: poetry install
working-directory: ${{ env.RECORD_DIRECTORY }}
- name: run azureml-serving tests
run: poetry run pytest ./tests/azureml-serving
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand All @@ -236,7 +232,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
pythonVersion: ['3.8', '3.9', '3.10', '3.11']
# snok/install-poetry need this to support Windows
defaults:
Expand Down Expand Up @@ -274,9 +270,6 @@ jobs:
- name: install test dependency group
run: poetry install --only test
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install recording
run: poetry install
working-directory: ${{ env.RECORD_DIRECTORY }}
- name: run devkit tests
run: poetry run pytest ./tests/sdk_cli_test ./tests/sdk_pfs_test -n auto -m "unittest or e2etest"
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand All @@ -293,7 +286,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
pythonVersion: ['3.8', '3.9', '3.10', '3.11']
env:
PROMPT_FLOW_TEST_MODE: "live"
Expand Down Expand Up @@ -356,7 +349,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
pythonVersion: ['3.8', '3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -401,18 +394,30 @@ jobs:
gci ./promptflow -Recurse | % {if ($_.Name.Contains('.whl')) {python -m pip install "$($_.FullName)[azure,executor-service]"}}
gci ./promptflow-tools -Recurse | % {if ($_.Name.Contains('.whl')) {python -m pip install "$($_.FullName)"}}
pip freeze
- name: Run Executor Test
- name: Run Executor Unit Test
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
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/unittests `
-l eastus `
-m "all" `
-o "${{ github.workspace }}/test-results-executor-unit.xml"
- name: Run Executor E2E Test
shell: pwsh
working-directory: ${{ github.workspace }}
run: |
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 `
-t ${{ github.workspace }}/src/promptflow/tests/executor/e2etests `
-l eastus `
-m "all" `
-o "${{ github.workspace }}/test-results-executor.xml"
-o "${{ github.workspace }}/test-results-executor-e2e.xml"
- name: Upload pytest test results (Python ${{ matrix.pythonVersion }}) (OS ${{ matrix.os }})
if: ${{ always() }}
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promptflow-tracing-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
# snok/install-poetry need this to support Windows
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/promptflow-tracing-unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
needs: build
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: false
# snok/install-poetry need this to support Windows
Expand Down
Loading

0 comments on commit 6902503

Please sign in to comment.