Skip to content

Commit

Permalink
Update perf-testing-setup.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
YunchuWang authored Jan 6, 2024
1 parent 88f8422 commit 78d1a8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/perf-testing-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
fi

echo "Running Docker container..."
container_id=$(docker run -d --shm-size="2g" --env FUNCTIONS_WORKER_RUNTIME_VERSION=${{ env.PYTHON_VERSION }} -p ${PORT}:80 -v $GITHUB_WORKSPACE/azure_functions_worker:/azure-functions-host/workers/python/${{ env.PYTHON_VERSION }}/LINUX/X64/azure_functions_worker perfimage:latest)
container_id=$(docker run -d --privileged --shm-size="2g" --env FUNCTIONS_WORKER_RUNTIME_VERSION=${{ env.PYTHON_VERSION }} -p ${PORT}:80 -v $GITHUB_WORKSPACE/azure_functions_worker:/azure-functions-host/workers/python/${{ env.PYTHON_VERSION }}/LINUX/X64/azure_functions_worker perfimage:latest)
sleep 10 # host needs some time to start.
echo "Container ID is $container_id"
echo "Fetching Docker container logs..."
Expand All @@ -83,7 +83,7 @@ jobs:
echo "Starting py-spy in background..."
echo "Container id is $container_id"
docker exec $container_id sh -c "pip install py-spy"
spy_pid=$(docker exec $container_id sh -c "py-spy record -p $worker_pid -o helloperf.svg -f flamegraph --idle --nonblocking --rate 1500")
spy_pid=$(docker exec $container_id sh -c "py-spy record -p $worker_pid -o helloperf.svg -f flamegraph --idle --nonblocking --rate 1500 & echo $!")
echo "Py-spy process id is $spy_pid"
echo "spy_pid=$spy_pid" >> $GITHUB_ENV
Expand Down

0 comments on commit 78d1a8c

Please sign in to comment.