Skip to content

feat(gateway): support Rust QP builtin in Docker image#2005

Merged
ardatan merged 27 commits intomainfrom
docker-rust-qp
Feb 25, 2026
Merged

feat(gateway): support Rust QP builtin in Docker image#2005
ardatan merged 27 commits intomainfrom
docker-rust-qp

Conversation

@ardatan
Copy link
Member

@ardatan ardatan commented Feb 23, 2026

Related graphql-hive/console#7722

  • Adds *.node files of query planner to the bundle
  • Patch require-in-the-middle used by OpenTelementry instrumentation to support *.node import
  • Add a scenario to E2E tests - Node Docker w/ Rust QP

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ardatan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the deployment of the gateway by integrating the Rust Query Planner directly into its Docker image. By modifying the build process to bundle the Rust QP and its runtime dependencies, the change eliminates the need for separate installation steps, simplifying the Docker setup and ensuring the QP is readily available for use.

Highlights

  • Rust Query Planner Integration: Enabled the Rust Query Planner (QP) to be bundled directly into the gateway's Docker image, making it a built-in component rather than an external dependency.
  • Build Process Enhancement: Introduced rollup-plugin-natives to the build configuration to correctly handle and bundle native modules like the Rust QP, ensuring it's available for dynamic imports within the Docker environment.
  • Dependency Management: Updated package.json and yarn.lock to include the new rollup-plugin-natives dependency and its transitive dependencies.
Changelog
  • .changeset/twenty-news-compete.md
    • Added a new changeset entry documenting the support for Rust QP as a built-in component in the Docker image.
  • packages/gateway/package.json
    • Added rollup-plugin-natives to development dependencies.
  • packages/gateway/rollup.config.js
    • Imported nativePlugin and join for path manipulation.
    • Added module mappings for @graphql-hive/router-runtime and @graphql-hive/router-query-planner to ensure they are bundled.
    • Removed @graphql-hive/router-query-planner from the external dependencies list.
    • Integrated nativePlugin to copy the Rust Query Planner to the bundle's node_modules directory.
  • yarn.lock
    • Updated the lockfile to include rollup-plugin-natives and its new dependencies such as fs-extra, jsonfile, and universalify.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/test.yml
Activity
  • The pull request was created by ardatan.
  • A new feature is being introduced to support the Rust Query Planner in the Docker image.
  • A new changeset file was added, indicating a minor version bump for @graphql-hive/gateway.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 23, 2026

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/gateway 2.5.0-alpha-b36eb4f10d8937485204951f41452c795f99156b npm ↗︎ unpkg ↗︎
@graphql-hive/nestjs 2.0.41-alpha-b36eb4f10d8937485204951f41452c795f99156b npm ↗︎ unpkg ↗︎
@graphql-hive/router-runtime 1.1.12-alpha-b36eb4f10d8937485204951f41452c795f99156b npm ↗︎ unpkg ↗︎

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for the Rust Query Planner (QP) as a built-in component within the Docker image. This is achieved by updating the Rollup configuration to bundle the @graphql-hive/router-query-planner and @graphql-hive/router-runtime packages into the node_modules directory of the bundle. Additionally, rollup-plugin-natives has been integrated to handle the native binary components of the Rust Query Planner, ensuring they are correctly copied and referenced within the bundled output. These changes facilitate the use of the high-performance Rust-based query planner in containerized environments without requiring manual installation of additional packages.

Comment on lines 183 to 206
const currentDirectory = fileURLToPath(new URL('.', import.meta.url));

// Copy *.node files to the bundle
const routerQueryPlannerPath = path.join(
currentDirectory,
'../../node_modules/@graphql-hive/router-query-planner',
);
const destDir = path.join(
currentDirectory,
'bundle',
'node_modules',
'@graphql-hive',
'router-query-planner',
);
fsExtra.ensureDirSync(destDir);
for (const file of readdirSync(routerQueryPlannerPath)) {
if (file.endsWith('.node')) {
copyFileSync(
path.join(routerQueryPlannerPath, file),
path.join(destDir, file),
);
}
}

Copy link
Member

Choose a reason for hiding this comment

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

Please avoid inline actions and use a rollup plugin instead. There is a plugin that does exactly this: https://github.com/vladshcherbin/rollup-plugin-copy.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

@ardatan ardatan requested a review from enisdenjo February 25, 2026 11:45
ardatan and others added 2 commits February 25, 2026 14:47
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 25, 2026

🚀 Snapshot Release (Binary for Linux-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 25, 2026

🚀 Snapshot Release (Binary for Linux-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 25, 2026

🚀 Snapshot Release (Binary for macOS-ARM64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 25, 2026

🚀 Snapshot Release (Binary for macOS-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 25, 2026

🚀 Snapshot Release (Bun Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:2.5.0-alpha-b36eb4f10d8937485204951f41452c795f99156b-bun

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 25, 2026

🚀 Snapshot Release (Binary for Windows-X64)

The latest changes of this PR are available for download (based on the declared changesets).

Download

@theguild-bot
Copy link
Collaborator

theguild-bot commented Feb 25, 2026

🚀 Snapshot Release (Node Docker Image)

The latest changes of this PR are available as image on GitHub Container Registry (based on the declared changesets):

ghcr.io/graphql-hive/gateway:2.5.0-alpha-b36eb4f10d8937485204951f41452c795f99156b

@ardatan ardatan merged commit 3866e36 into main Feb 25, 2026
108 of 110 checks passed
@ardatan ardatan deleted the docker-rust-qp branch February 25, 2026 14:16
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.

3 participants