-
Notifications
You must be signed in to change notification settings - Fork 107
Support Speedscope format to profiling pipeline #1405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8921542
Update ci_consumption_workflow.yml
YunchuWang 3e46fbb
add read_all to all pipelines
YunchuWang 59d0c1e
Update perf-testing-setup.yml
YunchuWang ad769c7
Update perf-testing-setup.yml
YunchuWang 62a19f6
Update perf-testing-setup.yml
YunchuWang 51fe9d9
Update perf-testing-setup.yml
YunchuWang d45679d
Update perf-testing-setup.yml
YunchuWang 1e3bc70
Update perf-testing-setup.yml
YunchuWang 2d4779c
Update perf-testing-setup.yml
YunchuWang 96a654b
Update perf-testing-setup.yml
YunchuWang 511b613
Update perf-testing-setup.yml
YunchuWang 47927c5
Update perf-testing-setup.yml
YunchuWang 901147a
Update perf-testing-setup.yml
YunchuWang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,13 @@ on: | |
description: 'List of perf tests to run' | ||
required: false | ||
default: SyncHelloWorld | ||
report_format: | ||
description: 'Format of profiling report' | ||
type: choice | ||
required: true | ||
options: | ||
- speedscope | ||
- flamegraph | ||
issue_comment: | ||
types: [created] | ||
env: | ||
|
@@ -21,8 +28,9 @@ env: | |
|
||
jobs: | ||
build: | ||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.issue.pull_request && contains(github.event.comment.body, '/profile') }} | ||
if: ${{ github.event_name == 'workflow_dispatch' || github.event.issue.pull_request != null && contains(github.event.comment.body, '/profile') }} | ||
runs-on: ubuntu-latest | ||
permissions: read-all | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -74,9 +82,16 @@ jobs: | |
docker exec $container_id sh -c "pip install py-spy" | ||
docker exec $container_id sh -c "mkdir /home/profiling_reports" | ||
profiling_sampling_rate=${{ github.event.inputs.profiling_sampling_rate }} | ||
# report_name="${GITHUB_REF#refs/heads/}_${{ github.run_id }}.svg" | ||
report_name="${{ github.run_id }}.svg" | ||
docker exec -d $container_id sh -c "RUST_BACKTRACE=1 py-spy record -p $worker_pid -o /home/profiling_reports/$report_name -f flamegraph --idle --nonblocking --rate $profiling_sampling_rate > /home/site/wwwroot/py-spy.log 2>&1 &" | ||
report_format=${{ github.event.inputs.report_format }} | ||
if [ "$report_format" == "flamegraph" ]; then | ||
report_name="${{ github.run_id }}.svg" | ||
elif [ "$report_format" == "speedscope" ]; then | ||
report_name="${{ github.run_id }}.speedscope.json" | ||
else | ||
echo "Unsupported report format: $report_format" | ||
exit 1 | ||
fi | ||
docker exec -d $container_id sh -c "RUST_BACKTRACE=1 py-spy record -p $worker_pid -o /home/profiling_reports/$report_name -f $report_format --idle --nonblocking --rate $profiling_sampling_rate > /home/site/wwwroot/py-spy.log 2>&1 &" | ||
sleep 2 # Give it a moment to start | ||
py_spy_id=$(docker exec $container_id sh -c "ps aux | grep '[p]y-spy record'" | awk '{print $2}') | ||
|
||
|
@@ -94,11 +109,9 @@ jobs: | |
docker exec $container_id cat /home/site/wwwroot/py-spy.log | ||
docker exec $container_id sh -c "kill -2 $py_spy_id" | ||
sleep 2 | ||
|
||
mkdir profiling_reports | ||
chmod 777 profiling_reports | ||
docker cp $container_id:/home/profiling_reports/$report_name profiling_reports | ||
|
||
- name: Upload SVG to Azure Blob Storage | ||
uses: bacongobbler/[email protected] | ||
with: | ||
|
@@ -111,7 +124,7 @@ jobs: | |
run: | | ||
blob_url="https://${{ env.PYTHON_FUNCTION_PROFILING_STORAGE_ACCT }}.blob.core.windows.net/profiling/${{ env.report_name }}" | ||
echo "You can view the Blob at: $blob_url" | ||
|
||
- name: Upload profiling result to artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.