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

Fix bun runtime by downgrading to 1.1.24 #1409

Merged
merged 3 commits into from
Oct 14, 2024
Merged

Fix bun runtime by downgrading to 1.1.24 #1409

merged 3 commits into from
Oct 14, 2024

Conversation

nicktrn
Copy link
Collaborator

@nicktrn nicktrn commented Oct 14, 2024

There's currently a bug in Bun IPC oven-sh/bun#13799 that affects versions > 1.1.24. This will only fix deploy, not dev. For successful dev runs, you will have to downgrade your local Bun version: curl -fsSL https://bun.sh/install | bash -s -- bun-v1.1.24

Summary by CodeRabbit

  • Bug Fixes

    • Resolved an IPC bug when using the Bun runtime by pinning to a stable Bun version (1.1.24 or lower).
    • Updated documentation to guide users on the specific Bun version requirement and installation commands.
  • Documentation

    • Enhanced the "Bun guide" with setup instructions and known issues regarding OpenTelemetry instrumentation compatibility with Bun.
  • Improvements

    • Updated the base image for the Dockerfile to a specific version for better stability.
    • Added error handling and logging improvements during the image build process.

Copy link

changeset-bot bot commented Oct 14, 2024

🦋 Changeset detected

Latest commit: 39cb7d7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
trigger.dev Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@internal/redis-worker Patch
@internal/zod-worker Patch
@internal/testcontainers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

coderabbitai bot commented Oct 14, 2024

Walkthrough

This pull request addresses an Inter-Process Communication (IPC) bug in the Bun runtime by pinning the Bun version to 1.1.24 or lower and updating the associated documentation. The changes include modifications to the buildImage.ts file, specifically the generateContainerfile function, which now uses a more specific Bun base image. Additionally, environment variables and error handling improvements are introduced in the Dockerfile build process to enhance clarity and functionality.

Changes

File Path Change Summary
.changeset/wicked-paws-accept.md Added a patch to fix an IPC bug by pinning Bun to version 1.1.24 or lower and updated the Bun guide.
packages/cli-v3/src/deploy/buildImage.ts Updated generateContainerfile, generateBunContainerfile, and generateNodeContainerfile methods; changed base image in Dockerfile; added TRIGGER_LOG_LEVEL environment variable; improved error handling and logging.

Possibly related PRs

  • README updates #1408: The README updates may indirectly relate to the main PR by providing clearer instructions on using the CLI, which could include the updated commands for running tasks in a Bun environment, but there are no direct code-level connections.

Poem

🐇 In the world of Bun, a patch we bring,
To fix the IPC, let the code sing!
With Docker refined and guides made clear,
Our CLI now dances, no need for fear.
So hop along, dear friends, let's play,
For coding adventures brighten our day! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@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: 0

🧹 Outside diff range and nitpick comments (1)
docs/guides/frameworks/bun.mdx (1)

Line range hint 89-91: Consider updating the "Known issues" section.

While the warning about the Bun version requirement is well-placed at the beginning of the document, it would be beneficial to also mention this issue in the "Known issues" section at the end. This ensures that users who skip to this section are aware of the version constraint and the IPC bug.

Consider adding the following point to the "Known issues" section:

- There is a known IPC bug in Bun versions higher than 1.1.24 that affects the `dev` command. Users should use Bun version 1.1.24 or lower as mentioned in the warning at the top of this guide.
🧰 Tools
🪛 LanguageTool

[grammar] ~14-~14: The word “setup” is a noun. The verb is spelled with a space.
Context: ...r Bun. This guide will show you have to setup Trigger.dev in your existing Bun projec...

(NOUN_VERB_CONFUSION)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a6de3f0 and 39cb7d7.

📒 Files selected for processing (3)
  • .changeset/wicked-paws-accept.md (1 hunks)
  • docs/guides/frameworks/bun.mdx (1 hunks)
  • packages/cli-v3/src/deploy/buildImage.ts (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/wicked-paws-accept.md
🧰 Additional context used
🔇 Additional comments (2)
docs/guides/frameworks/bun.mdx (1)

12-13: Excellent addition of the version requirement warning.

The warning message is clear, informative, and well-placed at the beginning of the document. It provides users with crucial information about the Bun version requirement, explains the reason (IPC bug), and offers a solution with the installation command.

packages/cli-v3/src/deploy/buildImage.ts (1)

467-467: Pinning Bun to version 1.1.24 in Dockerfile

The change to use imbios/bun-node:1.1.24-22-slim@sha256:9cfb7cd87529261c482fe17d8894c0986263f3a5ccf84ad65c00ec0e1ed539c6 as the base image effectively downgrades Bun to version 1.1.24, addressing the IPC bug in later versions.

Copy link

pkg-pr-new bot commented Oct 14, 2024

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/build@1409
pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/sdk@1409
pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev@1409
pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/core@1409

commit: 39cb7d7

@nicktrn nicktrn merged commit feb4fcd into main Oct 14, 2024
11 checks passed
@nicktrn nicktrn deleted the fix/bun-runtime branch October 14, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant