8000 Chore separate benchmark in ci/cd by vermakhushboo · Pull Request #9664 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Chore separate benchmark in ci/cd #9664

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

Merged
merged 6 commits into from
Apr 22, 2025
Merged

Conversation

vermakhushboo
Copy link
Member
@vermakhushboo vermakhushboo commented Apr 17, 2025

What does this PR do?

Separated benchmark in CI/CD from tests so that they can run in parallel and tests can be restarted without waiting for benchmarking to complete.

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Screenshots may also be helpful.)

Related PRs and Issues

  • (Related PR or issue)

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores
    • Introduced a dedicated workflow for benchmarking pull requests, providing automated performance comparisons between the current branch and the latest official version.
    • Removed benchmarking steps from the main test workflow, consolidating all benchmarking activities into the new workflow for improved clarity and separation of concerns.

Copy link
coderabbitai bot commented Apr 17, 2025

Walkthrough

A new GitHub Actions workflow, benchmark.yml, has been introduced to handle benchmarking tasks on pull requests. This workflow includes jobs for setting up the environment, building a Docker image, running benchmarks against both the pull request and the latest official version, and posting a comparison as a pull request comment. Concurrently, the benchmarking job has been removed from the existing tests.yml workflow, effectively migrating all benchmarking responsibilities to the new dedicated workflow file.

Changes

File(s) Change Summary
.github/workflows/benchmark.yml Added a new workflow to automate benchmarking on pull requests, including setup, benchmarking, and PR commenting.
.github/workflows/tests.yml Removed the benchmarking job and all associated steps, transferring this functionality to the new workflow.

Poem

In the garden of code, a new path appears,
Benchmarks now run where the rabbit steers.
From tests they have hopped, to a workflow anew,
Comparing the old and the fresh PR view.
With numbers and charts, the results are in sight—
The rabbit ensures that performance is right!
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 00f1723 and 21f3221.

📒 Files selected for processing (1)
  • .github/workflows/benchmark.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/benchmark.yml
⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: E2E Service Test (Realtime)
  • GitHub Check: E2E Service Test (Migrations)
  • GitHub Check: E2E Service Test (Users)
  • GitHub Check: E2E Service Test (Webhooks)
  • GitHub Check: E2E Service Test (Messaging)
  • GitHub Check: E2E Service Test (Teams)
  • GitHub Check: E2E Service Test (Storage)
  • GitHub Check: E2E Service Test (Projects)
  • GitHub Check: E2E Service Test (Locale)
  • GitHub Check: E2E Service Test (Health)
  • GitHub Check: E2E Service Test (GraphQL)
  • GitHub Check: E2E Service Test (Databases)
  • GitHub Check: E2E Service Test (Console)
  • GitHub Check: E2E Service Test (Account)
  • GitHub Check: E2E Service Test (Avatars)
  • GitHub Check: E2E General Test
  • GitHub Check: Unit Test
  • GitHub Check: E2E Service Test (Dev Keys)
  • GitHub Check: Benchmark
  • GitHub Check: scan

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
github-actions bot commented Apr 17, 2025

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
binutils 2.42-r0 CVE-2025-0840 HIGH
libexpat 2.6.4-r0 CVE-2024-8176 HIGH
libxml2 2.12.7-r0 CVE-2024-56171 HIGH
libxml2 2.12.7-r0 CVE-2025-24928 HIGH
libxml2 2.12.7-r0 CVE-2025-27113 HIGH
xz 5.6.2-r0 CVE-2025-31115 HIGH
xz-libs 5.6.2-r0 CVE-2025-31115 HIGH
golang.org/x/crypto v0.31.0 CVE-2025-22869 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

8000

Copy link
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (4)
.github/workflows/tests.yml (1)

279-279: Remove trailing spaces.

There's a trailing whitespace at line 279 causing a linting error. Please remove it to adhere to YAML formatting standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 279-279: trailing spaces

(trailing-spaces)

.github/workflows/benchmark.yml (3)

64-65: Remove trailing spaces in run commands.

YAML lint reports trailing spaces on these lines. Removing them will satisfy the linter:

-          sed -i 's/traefik/localhost/g' .env 
-          docker load --input /tmp/${{ env.IMAGE }}.tar          
+          sed -i 's/traefik/localhost/g' .env
+          docker load --input /tmp/${{ env.IMAGE }}.tar
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 64-64: trailing spaces

(trailing-spaces)


[error] 65-65: trailing spaces

(trailing-spaces)


127-127: Add newline at end of file.

A newline is required at EOF to conform with POSIX and YAML standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 127-127: no new line character at the end of file

(new-line-at-end-of-file)


79-87: (Optional) Pin Docker Compose installation for reproducibility.

Downloading the latest compose manifest without version locking could lead to unexpected changes. Consider fetching a specific version or commit:

-          curl https://appwrite.io/install/compose -o docker-compose.yml
+          curl https://appwrite.io/install/compose?version=1.2.3 -o docker-compose.yml
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61868a9 and deac241.

📒 Files selected for processing (2)
  • .github/workflows/benchmark.yml (1 hunks)
  • .github/workflows/tests.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/tests.yml

[error] 279-279: trailing spaces

(trailing-spaces)

.github/workflows/benchmark.yml

[error] 64-64: trailing spaces

(trailing-spaces)


[error] 65-65: trailing spaces

(trailing-spaces)


[error] 127-127: no new line character at the end of file

(new-line-at-end-of-file)

🪛 actionlint (1.7.4)
.github/workflows/benchmark.yml

19-19: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


24-24: the runner of "docker/setup-buildx-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


27-27: the runner of "docker/build-push-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


42-42: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: Setup & Build Appwrite Image
  • GitHub Check: scan

@vermakhushboo vermakhushboo requested a review from Meldiron April 17, 2025 15:03
@vermakhushboo vermakhushboo changed the title [WIP] Chore separate benchmark in cicd Chore separate benchmark in cicd Apr 17, 2025
@vermakhushboo vermakhushboo changed the title Chore separate benchmark in cicd Chore separate benchmark in ci/cd Apr 17, 2025
Copy link
@coderabbitai coderabbitai bot left a comment

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 (6)
.github/workflows/benchmark.yml (6)

3-5: Use a stable concurrency group key.
The current concurrency group ${{ github.workflow }}-${{ github.ref }} includes the full ref (which changes per commit), preventing cancellation of previous runs on the same PR. Consider switching to ${{ github.workflow }}-pr-${{ github.event.pull_request.number }} or ${{ github.workflow }}-${{ github.head_ref }} to reliably cancel in-progress runs for the same PR.


7-10: Optimize cache key for cross-commit reuse.
Basing CACHE_KEY on github.event.pull_request.head.sha makes it unique per commit, so your cache is never reused across commits on the same PR. If you want to benefit from caching during iterative runs, consider using the PR number or branch name in the key instead.


63-68: Remove trailing whitespace and improve readiness check.
Lines 64 and 65 have trailing spaces (lint error). Also, instead of a fixed sleep 10, consider waiting for the service health endpoint to be ready (e.g., polling /v1/health/version) to avoid flakiness.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 64-64: trailing spaces

(trailing-spaces)


[error] 65-65: trailing spaces

(trailing-spaces)


69-73: Add non-interactive install flags for apt.
sudo apt install oha may hang waiting for confirmation. Use sudo apt install -y oha (or DEBIAN_FRONTEND=noninteractive).


89-104: Consider refactoring comment preparation.
The series of echo and jq commands work but are verbose and repetitive. You might extract common jq expressions into variables or a small helper script to improve readability and maintainability.


127-127: Add newline at end of file.
Static analysis flagged “no new line character at the end of file.” Please append a newline to satisfy POSIX conventions.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 127-127: no new line character at the end of file

(new-line-at-end-of-file)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between deac241 and 816c3a1.

📒 Files selected for processing (1)
  • .github/workflows/benchmark.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/benchmark.yml 8000

[error] 64-64: trailing spaces

(trailing-spaces)


[error] 65-65: trailing spaces

(trailing-spaces)


[error] 127-127: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms (20)
  • GitHub Check: E2E Service Test (Migrations)
  • GitHub Check: E2E Service Test (VCS)
  • GitHub Check: E2E Service Test (Locale)
  • GitHub Check: E2E Service Test (Users)
  • GitHub Check: E2E Service Test (Functions)
  • GitHub Check: E2E Service Test (Teams)
  • GitHub Check: E2E Service Test (Projects)
  • GitHub Check: E2E Service Test (Proxy)
  • GitHub Check: E2E Service Test (Sites)
  • GitHub Check: E2E Service Test (Storage)
  • GitHub Check: E2E Service Test (Health)
  • GitHub Check: E2E Service Test (FunctionsSchedule)
  • GitHub Check: E2E Service Test (GraphQL)
  • GitHub Check: E2E Service Test (Avatars)
  • GitHub Check: E2E Service Test (Account)
  • GitHub Check: E2E Service Test (Databases)
  • GitHub Check: E2E Service Test (Console)
  • GitHub Check: E2E General Test
  • GitHub Check: Unit Test
  • GitHub Check: Benchmark
🔇 Additional comments (11)
.github/workflows/benchmark.yml (11)

11-11: Trigger only on pull_request events is appropriate.
Since this workflow is dedicated to benchmarking PR changes, restricting it to on: pull_request is correct. No changes needed.


18-22: ✅ Updated checkout action to v4.
The actions/checkout@v4 with submodules: recursive is correct and addresses the previous recommendation to bump from v3 to v4.


23-24: ✅ Bumped docker/setup-buildx-action to v3.
This aligns with the latest workflow standards and satisfies the earlier actionlint suggestion.


26-35: Verify outputs parameter in docker/build-push-action.
The with: block uses outputs: type=docker,dest=/tmp/${{ env.IMAGE }}.tar, but the documented flag in buildx build is --output (singular). Please confirm against docker/build-push-action@v6 docs whether this key should be output instead of outputs.


41-46: ✅ Cache Appwrite image tarball with actions/cache@v4.
Using actions/cache@v4 to save and restore /tmp/${{ env.IMAGE }}.tar is correct and consistent with other CI workflows.


74-75: ✅ Benchmark PR with Oha.
The command to run a 180‑second, JSON‑format benchmark against the health endpoint is correct.


76-86: ✅ Tear down and install latest version.
Cleaning up the PR environment and then fetching and starting the latest official Appwrite version is implemented correctly.


87-88: ✅ Benchmark latest release.
Running the same Oha benchmark against the latest version completes the comparison cycle as intended.


105-111: ✅ Upload benchmark artifact.
Using actions/upload-artifact@v4 with a 7‑day retention is appropriate for storing raw JSON results.


112-119: ✅ Locate existing bot comment.
peter-evans/find-comment@v3 is configured correctly to detect a previous “Benchmark results” comment.


120-127: ✅ Create or update PR comment.
peter-evans/create-or-update-comment@v4 in replace mode will cleanly maintain a single up‑to‑date benchmark summary.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 127-127: no new line character at the end of file

(new-line-at-end-of-file)

Copy link
github-actions bot commented Apr 17, 2025

✨ Benchmark results

  • Requests per second: 992
  • Requests with 200 status code: 178,657
  • P99 latency: 0.188941918

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 992 1,411
200 178,657 254,027
P99 0.188941918 0.130738478

@Meldiron Meldiron merged commit 7773939 into 1.7.x Apr 22, 2025
63 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
< 3BCE /option>
Development

Successfully merging this pull request may close these issues.

2 participants
0