Skip to content

Added benchmarking for production docker image - #29794

Merged
acburdine merged 1 commit into
mainfrom
feat/docker-benchmarks
Aug 5, 2026
Merged

Added benchmarking for production docker image#29794
acburdine merged 1 commit into
mainfrom
feat/docker-benchmarks

Conversation

@acburdine

Copy link
Copy Markdown
Member

no ref

  • allow benchmarks of dev tree as well as docker image to benchmark docker-specific boot time improvements

split out from #29790 to make the benchmark measurements appear

@nx-cloud

nx-cloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 7bee325

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 6m 35s View ↗
nx run ghost:test:ci:integration ✅ Succeeded 4s View ↗
nx run ghost:test:integration ✅ Succeeded 2m 59s View ↗
nx run ghost:test:legacy ✅ Succeeded 3m View ↗
nx run ghost:test:e2e ✅ Succeeded 2m 29s View ↗
nx run @tryghost/koenig-lexical:test:acceptance ✅ Succeeded 2m 24s View ↗
nx run @tryghost/comments-ui:test:acceptance ✅ Succeeded 42s View ↗
nx run @tryghost/activitypub:test:acceptance ✅ Succeeded 38s View ↗
Additional runs (9) ✅ Succeeded ... View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-05 21:52:22 UTC

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 378490c8-374e-4d60-969d-bd96b4cfde6e

📥 Commits

Reviewing files that changed from the base of the PR and between e96e6c9 and af05f8e.

📒 Files selected for processing (4)
  • .github/actions/install-hyperfine/action.yml
  • .github/actions/report-boot-benchmark/action.yml
  • .github/actions/report-boot-benchmark/calibration.js
  • .github/workflows/ci.yml
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/actions/report-boot-benchmark/calibration.js
  • .github/actions/install-hyperfine/action.yml
  • .github/actions/report-boot-benchmark/action.yml
  • .github/workflows/ci.yml

Walkthrough

The PR adds composite actions for pinned Hyperfine installation and boot benchmark reporting. The reporting action measures host data, compilation calibration, and Hyperfine results. The CI workflow uses these actions for development-tree benchmarks and adds a production-image benchmark after loading the core image and starting MySQL and Ghost. The workflow exports core image tags from job_docker.

Possibly related PRs

  • TryGhost/Ghost#29356: Shares the Docker CI pipeline and image outputs used by the production-image benchmark.
  • TryGhost/Ghost#29769: Both PRs modify ci.yml to run and publish Hyperfine-based Ghost boot benchmarks.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary change: adding benchmarking for the production Docker image.
Description check ✅ Passed The description relates directly to benchmarking the development tree and production Docker image boot time.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/docker-benchmarks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
.github/workflows/ci.yml (2)

546-554: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider pinning the MySQL image for series comparability.

mysql:8.0 is a floating tag. A new 8.0.x push changes database behaviour under the measurement, so the production-image series can move with no Ghost commit behind it. That is the same failure mode the comment at lines 509-512 describes for base image bumps. Pin a digest or a full patch version, and treat a bump as a deliberate baseline break.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 546 - 554, Update the MySQL image
reference in the docker run command to use a fixed full patch version or
immutable digest instead of the floating mysql:8.0 tag. Preserve the existing
MySQL configuration and treat future image-reference changes as deliberate
baseline updates.

569-576: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Pass the image tag through env instead of inline ${{ }}.

${{ steps.load.outputs.image-tag }} expands directly into the shell command. The value is sanitized by docker/metadata-action and the job runs only on the registry path, so this is not exploitable today. Use env indirection to match the pattern already used at lines 1512-1517 and to clear the zizmor template-injection finding.

♻️ Proposed change
       - name: Start Ghost container
         # Kept alive with `sleep` so each measured run is a `docker exec`; timing
         # `docker run` would put container create/start inside the measurement.
+        env:
+          IMAGE_TAG: ${{ steps.load.outputs.image-tag }}
         run: |
           docker run -d --name ghost --network ghost-perf --entrypoint sleep \
             -e GHOST_CI_SHUTDOWN_AFTER_BOOT=1 \
             -e database__client=mysql \
             -e database__connection__host=mysql \
             -e database__connection__user=root \
             -e database__connection__password=root \
             -e database__connection__database=ghost \
-            "${{ steps.load.outputs.image-tag }}" infinity
+            "$IMAGE_TAG" infinity
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 569 - 576, Update the docker run step
to expose steps.load.outputs.image-tag through the step’s env configuration,
then reference that environment variable in the command instead of inline GitHub
expression interpolation. Preserve the existing image selection and container
arguments.

Source: Linters/SAST tools

.github/actions/install-hyperfine/action.yml (1)

21-24: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add download retries and quiet output.

A single wget call with no retry makes the step fail on a transient GitHub CDN error. Retries remove a known CI flake source at low cost.

♻️ Proposed change
         TARBALL="hyperfine-v${HYPERFINE_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
-        wget "https://github.com/sharkdp/hyperfine/releases/download/v${HYPERFINE_VERSION}/${TARBALL}"
+        wget --retry-connrefused --tries=3 --timeout=30 \
+          "https://github.com/sharkdp/hyperfine/releases/download/v${HYPERFINE_VERSION}/${TARBALL}"
         echo "${HYPERFINE_SHA256}  ${TARBALL}" | sha256sum --check --strict
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/actions/install-hyperfine/action.yml around lines 21 - 24, Update
the wget invocation in the hyperfine download step to use retry handling for
transient failures and quiet output, while preserving the existing URL and
tarball flow. Configure wget with a finite retry count appropriate for CI before
the existing checksum validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/actions/report-boot-benchmark/action.yml:
- Around line 87-97: Update the “Publish to benchmark series” step’s if
condition to require a non-empty github-token in addition to excluding
pull_request events. Preserve publishing for authenticated non-pull-request runs
while skipping the step when the optional token is empty.

---

Nitpick comments:
In @.github/actions/install-hyperfine/action.yml:
- Around line 21-24: Update the wget invocation in the hyperfine download step
to use retry handling for transient failures and quiet output, while preserving
the existing URL and tarball flow. Configure wget with a finite retry count
appropriate for CI before the existing checksum validation.

In @.github/workflows/ci.yml:
- Around line 546-554: Update the MySQL image reference in the docker run
command to use a fixed full patch version or immutable digest instead of the
floating mysql:8.0 tag. Preserve the existing MySQL configuration and treat
future image-reference changes as deliberate baseline updates.
- Around line 569-576: Update the docker run step to expose
steps.load.outputs.image-tag through the step’s env configuration, then
reference that environment variable in the command instead of inline GitHub
expression interpolation. Preserve the existing image selection and container
arguments.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 710ae366-44b4-4dd7-8fd8-d3339dba401b

📥 Commits

Reviewing files that changed from the base of the PR and between e96e6c9 and 4b8bc64.

📒 Files selected for processing (3)
  • .github/actions/install-hyperfine/action.yml
  • .github/actions/report-boot-benchmark/action.yml
  • .github/workflows/ci.yml

Comment thread .github/actions/report-boot-benchmark/action.yml
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.55%. Comparing base (e96e6c9) to head (af05f8e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #29794      +/-   ##
==========================================
- Coverage   75.59%   75.55%   -0.04%     
==========================================
  Files        1613     1613              
  Lines      142670   142670              
  Branches    17659    17647      -12     
==========================================
- Hits       107852   107800      -52     
- Misses      33766    33818      +52     
  Partials     1052     1052              
Flag Coverage Δ
e2e-tests 77.68% <ø> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@acburdine acburdine added the perf-tests Run performance tests with this PR. label Aug 5, 2026
@acburdine
acburdine force-pushed the feat/docker-benchmarks branch from 4b8bc64 to 34ccab4 Compare August 5, 2026 20:41
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@acburdine
acburdine force-pushed the feat/docker-benchmarks branch from 34ccab4 to 7bee325 Compare August 5, 2026 21:29
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

no ref
- allow benchmarks of dev tree as well as docker image to benchmark docker-specific boot time improvements
@acburdine
acburdine force-pushed the feat/docker-benchmarks branch from 7bee325 to af05f8e Compare August 5, 2026 21:43
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@acburdine
acburdine merged commit 5c48d0c into main Aug 5, 2026
56 checks passed
@acburdine
acburdine deleted the feat/docker-benchmarks branch August 5, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-tests Run performance tests with this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant