Skip to content

Commit

Permalink
Upload native build statistics
Browse files Browse the repository at this point in the history
Since Quarkus CI already runs the native tests quite often with a fixed
Mandrel version, we can gather these data and increase our insight
regarding Quarkus changes that affects image build time statistics.
  • Loading branch information
zakkak committed Apr 22, 2024
1 parent 824234e commit 70ddd16
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci-actions-incremental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,70 @@ jobs:
path: |
build-reports.zip
retention-days: 7
- name: Collect build JSON stats
shell: bash
run: find . -name '*runner*.json' | tar czvf build-stats.tgz -T -
- name: Upload build JSON stats
uses: actions/upload-artifact@v4
with:
name: build-stats-${{matrix.category}}
path: 'build-stats.tgz'
retention-days: 7

native-tests-stats-upload:
name: Upload build stats to collector
if: ${{ always() && github.repository == 'quarkusio/quarkus' && endsWith(github.ref, '/main') && github.event_name != 'pull_request' && needs.native-tests.result != 'skipped' && needs.native-tests.result != 'cancelled' }}
needs:
- native-tests
- calculate-test-jobs
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.calculate-test-jobs.outputs.native_matrix) }}
runs-on: ${{matrix.os-name}}
steps:
- uses: actions/checkout@v4
with:
repository: graalvm/mandrel
fetch-depth: 1
path: workflow-quarkus
- uses: actions/download-artifact@v4
with:
name: build-stats-${{matrix.category}}
path: .
- name: Extract and import build stats
env:
UPLOAD_TOKEN: ${{ secrets.UPLOAD_COLLECTOR_TOKEN }}
COLLECTOR_URL: https://stage-collector.foci.life/api/v1/image-stats
TAG: quarkus-main-ci
shell: bash
run: |
tar -xf build-stats.tgz
echo "Tag for stat upload is going to be: '${BUILD_STATS_TAG}'"
for bs in $(find ./quarkus/ -name \*build-output-stats.json); do
f=$(echo "$bs" | sed 's/\(.*\)-build-output-stats\.json/\1/g')
d=$(dirname $bs)
# import the stat
stat_id=$(curl -s -w '\n' -H "Content-Type: application/json" \
-H "token: $UPLOAD_TOKEN" --post302 --data "@$(pwd)/$bs" "$URL/import?t=$TAG" | jq .id)
# Create runner info json
cat > ./runner-info.json <<EOF
{
"testVersion": "$GITHUB_REF_NAME",
"mandrelVersion": null,
"quarkusVersion": "@GITHUB_SHA",
"jdkVersion": "$(java -version)",
"operatingSystem": "$RUNNER_OS",
"architecture": "$RUNNER_ARCH",
"memorySizeBytes": "$(free -b | awk '/Mem:/{print $2}')",
"memorySizeAvailableBytes": "$(free -b | awk '/Mem:/{print $4}')",
"description": "Quarkus CI github runner on $GITHUB_REF_NAME branch/tag",
}
EOF
jq . runner-info.json
# Add runner info
curl -s -w '\n' -H "Content-Type: application/json" -H "token: $TOKEN" \
-X PUT --data "@./runner-info.json" "$COLLECTOR_URL/update-runner-info/$stat_id" > /dev/null
done
build-report:
runs-on: ubuntu-latest
name: Build report
Expand Down

0 comments on commit 70ddd16

Please sign in to comment.