Skip to content
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

chore(ci): Handle external libraries in compilation timing report #6750

Merged
merged 138 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from 132 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
3338487
update compilation_report script and job to handle external libraries
vezenovm Dec 9, 2024
a1104a0
bring back accidental deleteion
vezenovm Dec 9, 2024
d127872
missing job
vezenovm Dec 9, 2024
aa82e83
remove job
vezenovm Dec 9, 2024
491bf47
Merge branch 'master' into mv/compilation-report-external
vezenovm Dec 9, 2024
4eba04b
write perms
vezenovm Dec 9, 2024
bc4f40f
Merge remote-tracking branch 'origin/mv/compilation-report-external' …
vezenovm Dec 9, 2024
4a4ea20
tests report w/o matrix
vezenovm Dec 9, 2024
c8e8444
remove dep on old job
vezenovm Dec 9, 2024
27d4d61
test if reports runs
vezenovm Dec 9, 2024
ce3f652
test w override
vezenovm Dec 9, 2024
647f60e
bring back upload_compilation_report
vezenovm Dec 9, 2024
2fcfc9a
just upload report
vezenovm Dec 9, 2024
ed0c12f
comment out upload
vezenovm Dec 9, 2024
288c8d1
bring back upload artifact
vezenovm Dec 9, 2024
e678221
add debug
vezenovm Dec 9, 2024
4ca7986
remove artifact upload
vezenovm Dec 9, 2024
537e2c7
try bringing back again
vezenovm Dec 9, 2024
b6f2179
do not specify working directory
vezenovm Dec 9, 2024
290d81c
bring back upload report
vezenovm Dec 9, 2024
0f1cc54
change path
vezenovm Dec 9, 2024
6aefe80
specify dir path not file name
vezenovm Dec 9, 2024
dee5f14
do not specify path
vezenovm Dec 9, 2024
308a2ef
nit with brackets
vezenovm Dec 9, 2024
81910d2
try to trigger report
vezenovm Dec 9, 2024
804f231
test next job
vezenovm Dec 10, 2024
69cb0c9
update name
vezenovm Dec 10, 2024
4e01594
remove the download
vezenovm Dec 10, 2024
e778e86
use checout and download without path
vezenovm Dec 10, 2024
25d39f8
remove the download
vezenovm Dec 10, 2024
350f2d8
delete name
vezenovm Dec 10, 2024
c156bb9
bring back download
vezenovm Dec 10, 2024
3e43fbe
correct indents
vezenovm Dec 10, 2024
b36429a
no download
vezenovm Dec 10, 2024
3e8dffc
bring back parsing the report
vezenovm Dec 10, 2024
6cde9c4
download report
vezenovm Dec 10, 2024
15a5fa3
bring back external repos
vezenovm Dec 10, 2024
10c88b0
simplify external_repo_compilation_report for debugging
vezenovm Dec 10, 2024
7ecc8fe
only checkout matrix
vezenovm Dec 10, 2024
ac1a2b6
debugging
vezenovm Dec 10, 2024
a1690cd
do not use include
vezenovm Dec 10, 2024
581450a
one project
vezenovm Dec 10, 2024
1b59d22
put project in an array
vezenovm Dec 10, 2024
739b8e9
go back to include
vezenovm Dec 10, 2024
bafb26b
remove matrix
vezenovm Dec 10, 2024
46db5a6
fix dep in upload_compilation_report
vezenovm Dec 10, 2024
4c24ff2
test matrix
vezenovm Dec 10, 2024
a8faea6
only have have matrix
vezenovm Dec 10, 2024
e2e7e5e
only depend on generate_compilation_report
vezenovm Dec 10, 2024
d82a52e
fix indents
vezenovm Dec 10, 2024
efb0bc6
one more indent
vezenovm Dec 10, 2024
0a05826
bring back report logic
vezenovm Dec 10, 2024
b812d85
bring back action external repo reports
vezenovm Dec 10, 2024
14a4733
upload report
vezenovm Dec 10, 2024
778dc21
upload script
vezenovm Dec 10, 2024
056b6c9
compilation_report.sh correct path
vezenovm Dec 10, 2024
d19c101
change perms on compilation_report.sh
vezenovm Dec 10, 2024
585ce2d
delete test_dirs
vezenovm Dec 10, 2024
e7fcdb3
switch how we upoad report
vezenovm Dec 10, 2024
68a097e
switch order of paths
vezenovm Dec 10, 2024
ccbdaff
fix bad path
vezenovm Dec 10, 2024
c93c7ae
split out move
vezenovm Dec 10, 2024
d9ea61e
fetch the name from nargo toml rather than the specified dir
vezenovm Dec 10, 2024
982635a
wrap in parens cmd
vezenovm Dec 10, 2024
5794b17
debug
vezenovm Dec 10, 2024
f1756ef
one more
vezenovm Dec 10, 2024
82f0a75
type in path
vezenovm Dec 10, 2024
a3b4987
remove echo
vezenovm Dec 10, 2024
0c2f8bd
use extended reg ex
vezenovm Dec 10, 2024
4ef49da
correct name
vezenovm Dec 10, 2024
ad8fe13
print compilation reports as we are failing on json deserialization
vezenovm Dec 10, 2024
e68a32c
try to extract name, it is successful locally but not in CI
vezenovm Dec 10, 2024
d28637f
more debugging stuff
vezenovm Dec 10, 2024
7592273
try again
vezenovm Dec 10, 2024
167f2e7
discern on workspaces
vezenovm Dec 10, 2024
98b5666
update the actual report
vezenovm Dec 10, 2024
8074a85
just avoid using grep on the nargo toml
vezenovm Dec 10, 2024
7eb4dc0
account for new lines
vezenovm Dec 10, 2024
c267d91
generate fresh reports and combine them using jq
vezenovm Dec 10, 2024
b8cf732
fixup if statement
vezenovm Dec 10, 2024
37db26b
debug res of compilationgit status
vezenovm Dec 10, 2024
9ae0b3c
rename step
vezenovm Dec 10, 2024
585d65f
report id
vezenovm Dec 10, 2024
ef31693
specify outputs correctly
vezenovm Dec 10, 2024
544455d
extract basename
vezenovm Dec 10, 2024
7389da5
wrap in parens
vezenovm Dec 10, 2024
acda6ca
try and cat the contents'
vezenovm Dec 10, 2024
c9710b0
switch to same id
vezenovm Dec 10, 2024
ba59409
split path into var
vezenovm Dec 10, 2024
8a8bd28
attach old reports
vezenovm Dec 10, 2024
39c648e
do not overrwite PATH
vezenovm Dec 10, 2024
d7a7475
try to download multiple artifacts of similar name
vezenovm Dec 10, 2024
5e95f8b
pattern not name
vezenovm Dec 10, 2024
7499faf
fix upload
vezenovm Dec 10, 2024
063a390
no need for basename anymore
vezenovm Dec 10, 2024
4d2db0f
use outputs for the name
vezenovm Dec 10, 2024
eb38d18
rename bad var
vezenovm Dec 10, 2024
3c27057
loop over reports from artifacts
vezenovm Dec 10, 2024
6d419f3
remove the extra path segment
vezenovm Dec 10, 2024
b0bce58
fix bad compilation times for native noir repo tests
vezenovm Dec 10, 2024
fd3aff2
test inner dir
vezenovm Dec 10, 2024
981e7cf
add extension
vezenovm Dec 10, 2024
428a76c
use correct report name
vezenovm Dec 10, 2024
a631401
parens around REPORT_NAME
vezenovm Dec 10, 2024
4ab1738
checkout do not upload compilation script
vezenovm Dec 10, 2024
97a6a44
cleanup reports yml
vezenovm Dec 10, 2024
bc9e317
specify path in checkout
vezenovm Dec 10, 2024
6c583b9
specify cone mode false
vezenovm Dec 10, 2024
9b08f0b
move in separate job
vezenovm Dec 10, 2024
4873320
Update .github/workflows/reports.yml
TomAFrench Dec 10, 2024
416654a
try ./test_programs/ prefix
vezenovm Dec 10, 2024
b9d7479
merge conflicts w/ origin
vezenovm Dec 10, 2024
210bf28
remove test_programs prefix
vezenovm Dec 10, 2024
3fc95d8
try checkout again
vezenovm Dec 10, 2024
c77a117
cd into test_programs
vezenovm Dec 10, 2024
0224ffd
this should work now
vezenovm Dec 10, 2024
e46d7a8
Update .github/workflows/reports.yml
vezenovm Dec 10, 2024
f8c5e3e
Update .github/workflows/reports.yml
vezenovm Dec 10, 2024
ab8b904
fix indent
vezenovm Dec 10, 2024
cd857e2
Update reports.yml
TomAFrench Dec 10, 2024
3d9113e
try and specify path
vezenovm Dec 10, 2024
147e979
specify more exact
vezenovm Dec 10, 2024
61fa3b5
checkout test-repo after script checkout
vezenovm Dec 10, 2024
aee423a
Update .github/workflows/reports.yml
vezenovm Dec 10, 2024
2768257
Update .github/workflows/reports.yml
vezenovm Dec 10, 2024
c1cbfef
try different path for script
vezenovm Dec 10, 2024
8700ef0
update runner path
vezenovm Dec 10, 2024
049499d
Update .github/workflows/reports.yml
vezenovm Dec 10, 2024
f56ff40
different name
vezenovm Dec 10, 2024
1e59ead
add to path
vezenovm Dec 10, 2024
b5810f4
one more
vezenovm Dec 10, 2024
4546bc5
use scripts in path
vezenovm Dec 10, 2024
da6e410
add path to name
vezenovm Dec 10, 2024
3068fd4
relax external_repo_compilation_report dep
vezenovm Dec 10, 2024
6822222
silence warnings
vezenovm Dec 10, 2024
6632fa0
comment out rollup circuits for now
vezenovm Dec 10, 2024
5fe58e0
Update .github/workflows/reports.yml
TomAFrench Dec 11, 2024
5ccf5e5
Update .github/workflows/reports.yml
TomAFrench Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 135 additions & 1 deletion .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ jobs:
path: ./dist/*
retention-days: 3


compare_gates_reports:
name: Circuit sizes
needs: [build-nargo]
Expand Down Expand Up @@ -262,8 +261,143 @@ jobs:
working-directory: ./test_programs
run: |
./compilation_report.sh
cat compilation_report.json
mv compilation_report.json ../compilation_report.json

- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
name: in_progress_compilation_report
path: compilation_report.json
retention-days: 3
overwrite: true

external_repo_compilation_report:
needs: [generate_compilation_report]
vezenovm marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- project: { repo: AztecProtocol/aztec-packages, path: ./noir-projects/noir-contracts }
- project: { repo: AztecProtocol/aztec-packages, path: ./noir-projects/noir-protocol-circuits/crates/parity-root }
- project: { repo: AztecProtocol/aztec-packages, path: ./noir-projects/noir-protocol-circuits/crates/private-kernel-inner }
- project: { repo: AztecProtocol/aztec-packages, path: ./noir-projects/noir-protocol-circuits/crates/private-kernel-reset }
- project: { repo: AztecProtocol/aztec-packages, path: ./noir-projects/noir-protocol-circuits/crates/rollup-base-private }
- project: { repo: AztecProtocol/aztec-packages, path: ./noir-projects/noir-protocol-circuits/crates/rollup-base-public }

name: External repo compilation report - ${{ matrix.project.repo }}
vezenovm marked this conversation as resolved.
Show resolved Hide resolved
steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# repository: ${{ matrix.project.repo }}
# path: test-repo
# ref: ${{ matrix.project.ref }}

- name: Download nargo binary
uses: actions/download-artifact@v4
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V

- uses: actions/checkout@v4
with:
path: scripts
sparse-checkout: |
test_programs/compilation_report.sh
sparse-checkout-cone-mode: false

- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ matrix.project.repo }}
path: test-repo
ref: ${{ matrix.project.ref }}

- name: Generate compilation report
working-directory: ./test-repo/${{ matrix.project.path }}
run: |
ls .
echo " "
ls /home/runner/work/noir/noir
ls /home/runner/work/noir/noir/scripts/
ls /home/runner/work/noir/noir/scripts/test_programs
mv /home/runner/work/noir/noir/scripts/test_programs/compilation_report.sh ./compilation_report.sh
# mv ./test_programs/compilation_report.sh ./compilation_report.sh
chmod +x ./compilation_report.sh
./compilation_report.sh 1

- name: Move compilation report
id: report
shell: bash
run: |
PACKAGE_NAME=${{ matrix.project.path }}
PACKAGE_NAME=$(basename $PACKAGE_NAME)
mv ./test-repo/${{ matrix.project.path }}/compilation_report.json ./compilation_report_$PACKAGE_NAME.json
echo "compilation_report_name=$PACKAGE_NAME" >> $GITHUB_OUTPUT

- name: Upload compilation report
uses: actions/upload-artifact@v4
with:
name: compilation_report_${{ steps.report.outputs.compilation_report_name }}
path: compilation_report_${{ steps.report.outputs.compilation_report_name }}.json
retention-days: 3
overwrite: true

upload_compilation_report:
name: Upload compilation report
needs: [external_repo_compilation_report]
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Download initial compilation report
uses: actions/download-artifact@v4
with:
name: in_progress_compilation_report

- name: Download matrix compilation reports
uses: actions/download-artifact@v4
with:
pattern: compilation_report_*
path: ./reports

- name: Merge compilation reports using jq
run: |
echo "Merging reports"

combined_reports="[]"

# Iterate over each report and merge them
for report in ./reports/*; do
# The report is saved under ./compilation_report_{ matrix_report }/compilation_report_{ matrix_report }.json
REPORT_NAME=$(echo $(ls $report))
# Extract the 'compilation_reports' array from each report and merge it
combined_reports=$(jq '[.compilation_reports[]] + '"$combined_reports" <<< "$(cat "$report/$REPORT_NAME")")
done

combined_reports=$(jq '[.compilation_reports[]] + '"$combined_reports" <<< "$(cat ./compilation_report.json)")

# Wrap the merged compilation reports into a new object as to keep the 'compilation_reports' key
final_report="{\"compilation_reports\": $combined_reports}"

echo "$final_report" > compilation_report.json

cat compilation_report.json

- name: Parse compilation report
id: compilation_report
uses: noir-lang/noir-bench-report@0d7464a8c39170523932d7846b6e6b458a294aea
Expand Down
18 changes: 14 additions & 4 deletions test_programs/compilation_report.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ set -e

current_dir=$(pwd)
base_path="$current_dir/execution_success"
test_dirs=$(ls $base_path)

# Tests to be profiled for compilation report
tests_to_profile=("sha256_regression" "regression_4709" "ram_blowup_regression")

echo "{\"compilation_reports\": [ " > $current_dir/compilation_report.json

# If there is an argument that means we want to generate a report for only the current directory
if [ "$#" -ne 0 ]; then
base_path="$current_dir"
tests_to_profile=(".")
fi

ITER="1"
NUM_ARTIFACTS=${#tests_to_profile[@]}

Expand All @@ -23,9 +29,14 @@ for dir in ${tests_to_profile[@]}; do

cd $base_path/$dir

COMPILE_TIME=$((time nargo compile --force) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s')
echo -e " {\n \"artifact_name\":\"$dir\",\n \"time\":\"$COMPILE_TIME\"\n" >> $current_dir/compilation_report.json
PACKAGE_NAME=$dir
if [ "$#" -ne 0 ]; then
PACKAGE_NAME=$(basename $current_dir)
fi

COMPILE_TIME=$((time nargo compile --force) 2>&1 | grep real | grep -oE '[0-9]+m[0-9]+.[0-9]+s')
echo -e " {\n \"artifact_name\":\"$PACKAGE_NAME\",\n \"time\":\"$COMPILE_TIME\"" >> $current_dir/compilation_report.json

if (($ITER == $NUM_ARTIFACTS)); then
echo "}" >> $current_dir/compilation_report.json
else
Expand All @@ -36,4 +47,3 @@ for dir in ${tests_to_profile[@]}; do
done

echo "]}" >> $current_dir/compilation_report.json

Loading