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

ARM64 support #45

Open
Utopiah opened this issue Feb 24, 2024 · 8 comments
Open

ARM64 support #45

Utopiah opened this issue Feb 24, 2024 · 8 comments

Comments

@Utopiah
Copy link

Utopiah commented Feb 24, 2024

Getting exec format error on

  • hubs-compose-spoke
  • hubs-compose-hubs-storybook
  • hubs-compose-hubs-admin
  • hubs-compose-hubs-client

while

  • hubs-compose-reticulum
  • hubs-compose-dialog
  • hubs-compose-postgrest
  • postgres

do run fine.

@Utopiah
Copy link
Author

Utopiah commented Feb 24, 2024

BTW this is on a RPi with Debian 12.4

I have the same problem trying to run HubsCE with kubernetes and kind or k3s so I imagine it's the way some of those images are built that aren't properly cross-platform.

@Utopiah
Copy link
Author

Utopiah commented Feb 24, 2024

The docker-compose and dockerfiles seems to explicitly target amd64.

@Utopiah
Copy link
Author

Utopiah commented Feb 24, 2024

FWIW bin/init failed due to

npm ERR! npm ERR! command sh -c node install.js
npm ERR! npm ERR! PhantomJS not found on PATH
npm ERR! npm ERR! Unexpected platform or architecture: linux/arm64

I believe for hubs-compose-hubs-client.

Briefly trying bin/up anyway despite this error shows other errors so maybe the ARM64 build process should be investigated if Raspberry Pis are consider popular targets.

@Utopiah
Copy link
Author

Utopiah commented Feb 25, 2024

FWIW on AMD64 on my desktop had no problem, whole setup took 10min and worked right away.

I did so as I'm not familiar with mutagen and wanted to insure I did the setup right.

So yes I believe some of the images should be buildable on ARM64.

@Utopiah
Copy link
Author

Utopiah commented Feb 25, 2024

Note that this Hubs-Foundation/reticulum#711 might be problematic.

@Utopiah
Copy link
Author

Utopiah commented Mar 10, 2024

Note that bin/init then bin/up (surprisingly enough) worked well (after few retries but not modifying files iirc) on an M1 Max which is also arm64.

@Utopiah
Copy link
Author

Utopiah commented Mar 10, 2024

So in hubs-client getting

npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! command /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/root/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm WARN deprecated [email protected]: this library is no longer supported
npm ERR! npm WARN deprecated [email protected]: Removed event-stream from gulp-header
npm ERR! npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! npm WARN deprecated [email protected]: No longer maintained. We recomment migrating to ESLint with eslint-config-wikimedia.
npm ERR! npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm ERR! npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm ERR! npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm ERR! npm WARN deprecated [email protected]: Please use the native JSON object instead of JSON 3
npm ERR! npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! npm WARN deprecated [email protected]: this package is now deprecated
npm ERR! npm WARN deprecated [email protected]: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm ERR! npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! npm WARN deprecated [email protected]: JSCS has merged with ESLint! See - https://medium.com/@markelog/jscs-end-of-the-line-bc9bf0b3fdb2
npm ERR! npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm ERR! npm notice 
npm ERR! npm notice New major version of npm available! 8.11.0 -> 10.5.0
npm ERR! npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.5.0>
npm ERR! npm notice Run `npm install -g [email protected]` to update!
npm ERR! npm notice 
npm ERR! npm ERR! code 1
npm ERR! npm ERR! path /root/.npm/_cacache/tmp/git-cloneebXk1R/node_modules/phantomjs-prebuilt
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c node install.js
npm ERR! npm ERR! PhantomJS not found on PATH
npm ERR! npm ERR! Unexpected platform or architecture: linux/arm64
npm ERR! npm ERR! It seems there is no binary available for your platform/architecture
npm ERR! npm ERR! Try to install PhantomJS globally
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /root/.npm/_logs/2024-03-10T13_28_04_325Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-03-10T13_27_32_406Z-debug-0.log

so wondering due to

npm ERR! npm ERR! Unexpected platform or architecture: linux/arm64
npm ERR! npm ERR! It seems there is no binary available for your platform/architecture
npm ERR! npm ERR! Try to install PhantomJS globally

so maybe modifying the Dockerfile to install according to https://github.com/fg2it/phantomjs-on-raspberry could help.

For example hubs-compose/dockerfiles/hubs.Dockerfile modified to

# syntax=docker/dockerfile:1
ARG NODE_VERSION=16.16

FROM --platform=linux/arm64 node:${NODE_VERSION}
RUN wget https://github.com/fg2it/phantomjs-on-raspberry/releases/download/v2.1.1-jessie-stretch-arm64/phantomjs -O /usr/local/bin/phantomjs
RUN chmod +x /usr/local/bin/phantomjs
COPY files/conditional-npm-ci /usr/local/bin/conditional-npm-ci

seems to work.

@Utopiah
Copy link
Author

Utopiah commented Mar 10, 2024

Now for Spoke getting

[9/10] ⠄ puppeteer
error /code/node_modules/puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /code/node_modules/puppeteer
Output:
The chromium binary is not available for arm64: 
If you are on Ubuntu, you can install with: 

 apt-get install chromium-browser

which seems to be addressed at puppeteer/puppeteer#7740 which leads to a built image via hubs-compose/dockerfiles/spoke.Dockerfile using e.g

# syntax=docker/dockerfile:1
ARG NODE_VERSION=16.13

FROM --platform=linux/arm64 node:${NODE_VERSION}

RUN apt-get update && apt-get install wget unzip -y

WORKDIR /
RUN wget https://playwright.azureedge.net/builds/chromium/1088/chromium-linux-arm64.zip
RUN unzip chromium-linux-arm64.zip && rm -f ./chromium-linux-arm64.zip

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV CHROME_PATH=/chrome-linux/chrome
ENV PUPPETEER_EXECUTABLE_PATH=/chrome-linux/chrome

HEALTHCHECK CMD curl -fk https://localhost:9090 || exit 1
WORKDIR /code
CMD ["./scripts/run-local-reticulum.sh"]

Note that this hasn't been tested in Spoke itself and might have version problems as mentioned in the issue. Unfortunately even though it does seem to build the image, it does not seem to work once launching via mutagen.

Seems that according to

error /code/node_modules/puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments: 
Directory: /code/node_modules/puppeteer

the puppeteer module of node doesn't seems to find chromium.

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

No branches or pull requests

1 participant