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

Feature request: linux-musl support #44

Open
jdrydn opened this issue Jun 8, 2023 · 5 comments
Open

Feature request: linux-musl support #44

jdrydn opened this issue Jun 8, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@jdrydn
Copy link

jdrydn commented Jun 8, 2023

Hi guys! We're running Zen with NodeJS in our project (fab library & visual editor btw 👏👏👏), working locally (node:16.19.1 running on Apple Silicon) but fails when deploying to cloud (node:16.19-alpine3.14 container) with the error:

/app/node_modules/@gorules/zen-engine/index.js:244
    throw loadError
    ^

Error: Cannot find module '@gorules/zen-engine-linux-arm64-musl'
Require stack:
- /app/node_modules/@gorules/zen-engine/index.js
- /app/dist/app.js
- /app/dist/server.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/app/node_modules/@gorules/zen-engine/index.js:200:31)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/app/node_modules/@gorules/zen-engine/index.js',
    '/app/dist/app.js',
    '/app/dist/server.js'
  ]
}

After reviewing the Zen Engine README, there's this lovely lil' line at the end:

zen/README.md

Line 177 in ccca4df

We do not support linux-musl for now as we are relying on the GoogleV8 engine to run function blocks as isolates.

So quick-fix for us for now is to drop Alpine from our package:

- FROM node:16.19-alpine3.14
+ #FROM node:16.19-alpine3.14
+ FROM node:16.19

But this may not be an acceptable solution in all use-cases!

Will there ever be support for linux-musl (perhaps by installing additional libs with apk)?

@stefan-gorules
Copy link
Contributor

Hi @jdrydn thank you for the amazing feedback and detailed report.

The constraint exists due to rusty_v8 crate which is being used for function nodes. We are exploring other alternatives and debating if we should switch to another v8 crate, move to JSC (JavaScript Core) or start building our own from the source.

For the time being it is indeed not possible, I will leave this issue open so we can track it in future.

@stefan-gorules stefan-gorules added the enhancement New feature or request label Jun 8, 2023
@stefan-gorules stefan-gorules self-assigned this Jun 8, 2023
@stefan-gorules
Copy link
Contributor

Just to provide an update here, we are exploring BoaJS as a replacement for V8, nothing is set in stone (as it's still somewhat experimental, and lacks some functionalities that we need for high-performance circumstances), but it would allow us to build for other architectures as well.

@mercs600
Copy link

mercs600 commented Mar 5, 2024

hi, any update here? it would be useful to use alpine version instead of an full image

@stefan-gorules
Copy link
Contributor

@mercs600 Hi, we've recently moved from using V8 to QuickJS which will likely be able to compile to MUSL. We'll have a look into it soon.

However, I'd like to note that in most cases MUSL architecture leads to degraded performance in exchange for smaller Docker sizes, which may or may not be what you want.

@kyle-mwnz
Copy link

Hi there, what is required to move this feature along?

Appreciate the note above about musl architecture however the Debian based Node.js images have critical dependency problems, which is why we are using Alpine based Node.js variants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants