chore(deps): Update ubi-minimal base image (main) #150
Workflow file for this run
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
| # Copyright The Conforma Contributors | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); | |
| # you may not use this file except in compliance with the License. | |
| # You may obtain a copy of the License at | |
| # | |
| # http://www.apache.org/licenses/LICENSE-2.0 | |
| # | |
| # Unless required by applicable law or agreed to in writing, software | |
| # distributed under the License is distributed on an "AS IS" BASIS, | |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| # See the License for the specific language governing permissions and | |
| # limitations under the License. | |
| # | |
| # SPDX-License-Identifier: Apache-2.0 | |
| --- | |
| name: Stress Benchmark | |
| "on": | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| stress: | |
| name: Stress Benchmark | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| continue-on-error: true | |
| env: | |
| # Tuned for 4 vCPU / 16 GB CI runners to complete within 5 minutes. | |
| # Code defaults are 10 components / 35 workers. | |
| EC_STRESS_COMPONENTS: "10" | |
| EC_STRESS_WORKERS: "10" | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@b09bb98e06d4d774595224525879c09bc6e98c40 # v2.20.1 | |
| with: | |
| egress-policy: audit | |
| disable-telemetry: true | |
| - name: Checkout repository | |
| uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | |
| - name: Restore Cache | |
| uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0 | |
| with: | |
| key: main | |
| path: '**' | |
| - name: Setup Go environment | |
| uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: false | |
| - name: Setup ORAS | |
| uses: oras-project/setup-oras@1d808f7d7f6995cc68b7bf507bfe5c5446e1dc9d # v2.0.1 | |
| - name: Prepare benchmark data | |
| run: | | |
| cd benchmark/stress | |
| ./prepare_data.sh | |
| - name: Build stress benchmark | |
| run: go build -o benchmark/stress/stress ./benchmark/stress | |
| - name: Run stress benchmark | |
| id: bench | |
| run: | | |
| set -o pipefail | |
| cd benchmark/stress | |
| ./stress 2>benchmark-stderr.txt | tee benchmark-output.txt | |
| - name: Write job summary | |
| if: always() | |
| run: | | |
| if [[ "${{ steps.bench.outcome }}" == "failure" && -s benchmark/stress/benchmark-stderr.txt ]]; then | |
| { | |
| echo "### Stderr" | |
| echo '```' | |
| tail -50 benchmark/stress/benchmark-stderr.txt | |
| echo '```' | |
| } >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| if [[ ! -f benchmark/stress/benchmark-output.txt ]]; then | |
| echo "## Stress Benchmark" >> "$GITHUB_STEP_SUMMARY" | |
| echo "Benchmark did not produce output." >> "$GITHUB_STEP_SUMMARY" | |
| exit 0 | |
| fi | |
| line=$(grep '^BenchmarkStress' benchmark/stress/benchmark-output.txt || true) | |
| if [[ -z "$line" ]]; then | |
| echo "## Stress Benchmark" >> "$GITHUB_STEP_SUMMARY" | |
| echo "No benchmark results found in output." >> "$GITHUB_STEP_SUMMARY" | |
| exit 0 | |
| fi | |
| ns_op=$(echo "$line" | grep -oP '[\d.]+ ns/op' | awk '{print $1}') | |
| peak_rss=$(echo "$line" | grep -oP '[\d.]+ peak-RSS-bytes' | awk '{print $1}') | |
| alloc=$(echo "$line" | grep -oP '[\d.]+ allocated-bytes/op' | awk '{print $1}') | |
| heap=$(echo "$line" | grep -oP '[\d.]+ heap-bytes-from-system' | awk '{print $1}') | |
| secs=$(awk -v val="${ns_op:-0}" 'BEGIN {printf "%.1f", val / 1000000000}') | |
| rss_mb=$(awk -v val="${peak_rss:-0}" 'BEGIN {printf "%.0f", val / 1048576}') | |
| alloc_mb=$(awk -v val="${alloc:-0}" 'BEGIN {printf "%.0f", val / 1048576}') | |
| heap_mb=$(awk -v val="${heap:-0}" 'BEGIN {printf "%.0f", val / 1048576}') | |
| { | |
| echo "## Stress Benchmark" | |
| echo "" | |
| echo "| Metric | Value | Description |" | |
| echo "|--------|-------|-------------|" | |
| echo "| Components | ${EC_STRESS_COMPONENTS} | Snapshot components validated |" | |
| echo "| Workers | ${EC_STRESS_WORKERS} | Parallel validation workers |" | |
| echo "| Execution time | ${secs}s | Wall-clock time per iteration |" | |
| echo "| Peak RSS | ${rss_mb} MB | Max physical memory used |" | |
| echo "| Allocated memory | ${alloc_mb} MB | Total Go heap allocations |" | |
| echo "| Heap from system | ${heap_mb} MB | Heap memory requested from OS |" | |
| } >> "$GITHUB_STEP_SUMMARY" |