feat(gateway): support Rust QP builtin in Docker image#2005
Conversation
4d5442d to
498678a
Compare
Summary of ChangesHello @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
Changelog
Ignored Files
Activity
Using Gemini Code AssistThe 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
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 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
|
🚀 Snapshot Release (
|
| 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 ↗︎ |
There was a problem hiding this comment.
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.
packages/gateway/rollup.config.js
Outdated
| 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), | ||
| ); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
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.
…tion or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
cb95284 to
5e79762
Compare
…tion or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
🚀 Snapshot Release (Bun Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared |
🚀 Snapshot Release (Node Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared |
Related graphql-hive/console#7722
*.nodefiles of query planner to the bundlerequire-in-the-middleused by OpenTelementry instrumentation to support*.nodeimportNode Docker w/ Rust QP