-
-
Notifications
You must be signed in to change notification settings - Fork 300
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
Publish compiled binaries with new releases #3633
Comments
Will any of these suffice @dapplion ? I think it's important to figure this out to help reduce the risks of NPM or building from source. https://github.com/nexe/nexe |
I appreciate the simplicity and approach of caxa. In the mean time, our docker image gives users something similar (guards against installation-time npm risks). |
@wemeetagain Would it be difficult for us to implement this as part of the releases that we do so we push binaries alongside the source code .zip/.tar.gz? I'm thinking something similar to what Prysm does for their releases. I agree, documentation update to recommend docker would be a key change to make. |
Error from Windows on CI build with caxa: C:\Users\Phil-ChainSafe\Downloads>lodestar-windows-next.exe SyntaxError: missing ) after argument list |
Where is this coming from? I don't see this in the codebase |
I think this is coming from caxa |
@wemeetagain , I spoke to @mpetrunic today and he has some experience using https://github.com/vercel/pkg for packaging up node applications if you wanted to give this one a try instead. |
has anyone been working on this? |
we have a branch that builds binaries for linux and macos, had issues with windows, and things stalled there. unstable...cayman/release-binary |
Adding some discussion points from Devconnect here after speaking to @nflaig and conversations with other node operations teams. It seems like this would be a preferred approach to helping adoption and enabling node operators to work with Lodestar in their setups if this issue is completed.
We previously tried Caxa, but ran into issues with Windows binaries. This might not be a huge issue anymore if Windows users are able to benefit from WSL. |
I have been in contact with Ethereum on ARM and they have already integrated Lodestar (fpm-package-builder/l1-clients/consensus-layer/lodestar) . Caxa does not seem to support cross-compiles but we might be able to just use a arm64 runner to built the binary for arm. I quickly looked at two other libraries similar to caxa Further testing is required, need to do some research on different approaches used to bundle the binary. Ideally we want to publish binaries on github with every release, support linux (amd64/arm64), macos, windows, and also publish a verifiable signature for each binary. |
ResearchI have researched and tested a few different tools but have not found an ideal solution yet pkg
nexe
boxednode
sea
caxa
package
Another summary comparing different tools can also be found here. ConclusionBased on the research I think the only long-term viable solution that does not break between node versions is caxa (or package) as those just provide as thin wrapper around the source code and dependencies (great video on how it works). All the other tools try to create "real" binaries but this causes too many issues especially due to the use of native modules and worker threads (and other low level APIs) in Lodestar. We also already know that caxa works on arm64 if build on an arm machine (generatebinary.sh). Issues
Possible solutions |
Caxa looks good, thank for researching these options! Why not support amd archs for now, and arm latter? |
We can definitely do that but the only known consumer of binaries right now is Ethereum on ARM and I am not sure if it makes sense to invest more time into this now (to get it production ready) if we can't even support them yet. I currently also have some doubts using caxa as the author just deprecated it (Nov 21, 2023) and package (the successor library) still has some issues and does not produce a single binary file which I don't like that much. I wanna make sure before we commit to using caxa that we could potentially maintain it ourselves, it does not look like there are many updates (if any) required to keep the library compatible with new node versions. |
I experimented with node single executable applications (see a guide). Some more details Final binary size is (node:28835) ExperimentalWarning: Single executable application is an experimental feature and might change at any time
(Use `server --trace-warnings ...` to show where the warning was created)
node:internal/url:775
this.#updateContext(bindingUrl.parse(input, base));
^
TypeError: Invalid URL
at new URL (node:internal/url:775:36)
at normalizeReferrerURL (node:internal/modules/helpers:298:10)
at importModuleDynamically (node:internal/modules/cjs/loader:1261:45)
at importModuleDynamicallyWrapper (node:internal/vm/module:431:21)
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:176:14)
at ./packages/cli/bin/lodestar.js:3:1
at embedderRunCjs (node:internal/util/embedding:37:10)
at node:internal/main/embedding:18:8 {
code: 'ERR_INVALID_URL',
input: './packages/cli/bin/lodestar.js'
} |
It's listed in #3633 (comment) (sea), last time I checked it didn't even support ES modules, and even if they fix this there will likely be issues with native modules, worker threads, and other low level APIs. Although stability got moved from experimental to active development, definitely something to follow and keep up to date. |
Gave another look at this after discussing with @nflaig. Sounds like the more reasonable approach to address this considering our constraints is to use caxa. Unfortunately
Later, we can update our doc website to have a comprehensible list of releases, similar to what geth is doing. |
Let's create follow up issues for remaining nice-to-have tasks. |
Closing this as our latest release (v1.19.0) includes binaries, thanks for pushing this to the finish line @jeluard ❤️ |
In order to help reduce or mitigate the risks which come from building Lodestar locally (example: NPM), this proposal is to add binary releases to our release process. This will simplify and reduce the risks of running Lodestar bare metal on Linux.
All the other 4 mainnet clients do this currently and we should add this as part of moving Lodestar to a production-ready client.
TO-DO:
The text was updated successfully, but these errors were encountered: