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

indexer-native: Install uses precompiled binaries hosted on GitHub releases #414

Merged
merged 2 commits into from
Apr 28, 2022

Conversation

fordN
Copy link
Contributor

@fordN fordN commented Apr 26, 2022

Description

We use neon to package rust binaries with node-bindings (as Node add-on modules), so they can be called by our indexer component packages. The system works well, but has a few shortcomings the most commonly reported point of friction has been in compiling the binaries on our users machines (see Related Issues below). In order to compile there are a few requirements to be installed on the machine: Rust, python, node-gyp, and in some cases nan. This PR aims to avoid these requirements/issues by precompiling the binaries on various machines and for various versions of the Node ABI and publishing these binaries to the GitHub releases page and making the defaulting the install process download the relevant precompiled binary instead of compiling it on the users machine. Another benefit of this update is that hosting the binaries separately allows us to reduce the size of the NPM package significantly, and will provide us more control of the compilation process (optimizing the Rust compilation configs).

Related issues

Updates

  • Update install process to download precompiled binary, if that fails fallback to the current behavior and compile directly on user's machine
  • Add GitHub Actions workflow for pre-compiling the Node add-on module on various machines and binaries and pushing to the GitHub releases page

@fordN fordN self-assigned this Apr 26, 2022
@fordN fordN force-pushed the ford/precompile-indexer-native branch 5 times, most recently from ffc3ff4 to 896b2ad Compare April 26, 2022 19:58
Copy link
Contributor

@That3Percent That3Percent left a comment

Choose a reason for hiding this comment

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

Thanks for doing this! It's been a common complaint and nobody has the bandwidth to try and remove node.

I have absolutely no idea what any of this code is doing, so I'll abstain from reviewing. If other reviewers are okay with it so am I.

Copy link

@promaty promaty left a comment

Choose a reason for hiding this comment

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

automate all the things!

.github/workflows/publish-native-binaries.yml Outdated Show resolved Hide resolved
.github/workflows/publish-native-binaries.yml Outdated Show resolved Hide resolved
.github/workflows/publish-native-binaries.yml Outdated Show resolved Hide resolved
@fordN fordN force-pushed the ford/precompile-indexer-native branch from 896b2ad to 63d6955 Compare April 27, 2022 21:10
- Update install process to download precompiled binary,if that fails
fallback to the current behavior and compile directly on user's machine
- Add GitHub Actions workflow for pre-compiling the Node add-on module
on various machines and binaries and pushing to the GitHub releases
page
@fordN fordN force-pushed the ford/precompile-indexer-native branch from 63d6955 to ff39606 Compare April 28, 2022 01:32
@fordN fordN merged commit 1ba2e2c into main Apr 28, 2022
@fordN fordN deleted the ford/precompile-indexer-native branch April 28, 2022 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🚗 Merged
3 participants