Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

ARM support #130

Closed
Vinno97 opened this issue Feb 8, 2019 · 7 comments
Closed

ARM support #130

Vinno97 opened this issue Feb 8, 2019 · 7 comments

Comments

@Vinno97
Copy link

Vinno97 commented Feb 8, 2019

Hi,

I noticed there are currently no ARM images available for Theia, but I see no technical reason for it being so. Many Dockerfiles should already be ARM-compatible, and can be adjusted with just minor changes.
For example:

RUN curl -sS https://storage.googleapis.com/golang/go$GO_VERSION.linux-amd64.tar.gz | tar -C /usr/local -xzf -

can be changed to something like:

RUN curl -sS https://storage.googleapis.com/golang/go$GO_VERSION.linux-$ARCH.tar.gz | tar -C /usr/local -xzf -

I propose following https://blog.hypriot.com/post/setup-simple-ci-pipeline-for-arm-images/ to include the ARM builds in the CI pipeline.


P.S. I have tried building the images by myself on my Raspberry Pi, but all that I have tried kept getting stuck at the same place. I do not expect this to be related to it being ARM, but rather some other factor.

[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error /home/theia/node_modules/vscode-ripgrep: Command failed.
Exit code: 1
Command: node ./lib/postinstall.js
Arguments: 
Directory: /home/theia/node_modules/vscode-ripgrep
Output:
Downloading ripgrep failed: Error: Request failed with code 401



The command '/bin/sh -c yarn --pure-lockfile &&     NODE_OPTIONS="--max_old_space_size=4096" yarn theia build &&     yarn --production &&     yarn autoclean --init &&     echo *.ts >> .yarnclean &&     echo *.ts.map >> .yarnclean &&     echo *.spec.* >> .yarnclean &&     yarn autoclean --force &&     rm -rf ./node_modules/electron &&     yarn cache clean' returned a non-zero code: 1

@marcdumais-work
Copy link
Member

marcdumais-work commented Feb 11, 2019

Hi @Vinno97

Yes, an ARM version of one or more of our docker images would be nice to have. If it could be parametrized so that we can use the same sources to build it/them, even better (e.g. like we do for "latest" vs "next" versions of the images).

Downloading ripgrep failed: Error: Request failed with code 401

I think this error happens when the vscode-ripgrep npm package, during post-install, attempts to download its platform-specific executable from their releases on GitHub. It's very possible that they do not have any such executable available for ARM (Linux, MacOS and Windows are covered).

Yep, looks-like only the major "desktop" plarforms are supported. (Update: to be confirmed - this is not conclusive by itself I think):
https://github.com/roblourens/vscode-ripgrep/blob/master/lib/postinstall.js#L29-L38

As a temporary work-around, you could remove @theia/file-search from package.json (and make sure it's not included it indirectly through a dependency from another Theia extension), then vscode-ripgrep should not be needed and this issue will go away.

@Vinno97
Copy link
Author

Vinno97 commented Feb 12, 2019

Hi Marc,

Thank you, I think I will try that if I cannot get it to work otherwise.

In response to the parameterization of the image: I am currently already exploring the possibilities of using multiarch/ubuntu-core as the base image and building it with the (still experimental) --platform flag.

If successful, it might enable us to (easily) provide images for multiple arches.


Regarding vscode-ripgrep not supporting ARM: it seems like it should actually work. I have not ran the code myself, but it will attempt to download ripgrep-0.10.0-pcre-arm, which is a valid asset on https://github.com/roblourens/ripgrep/releases. I suspect the error is actually caused by me supplying an incorrect GITHUB_TOKEN. Will post an update when I have more info.

P.S. I double-checked if os.arch() actually does return a string that matches the ripgrep releases, but it does.

> const os = require('os')
undefined
> os.arch()
'arm'

@Vinno97
Copy link
Author

Vinno97 commented Feb 16, 2019

I have been tinkering with it for a couple hours and I believe the installation of all OS dependencies in the theia-full-docker now succeeds. The the building of theia itself, however, keeps failing on the following command:

RUN NODE_OPTIONS="--max_old_space_size=4096" yarn theia build
[3/4] Linking dependencies...
warning "@theia/extension-manager > @theia/application-manager > [email protected]" has unmet peer dependency "font-awesome@>=4.3.0".
warning "theia-yang-extension > yang-sprotty > sprotty > [email protected]" has incorrect peer dependency "snabbdom@~0.6.6".
[4/4] Building fresh packages...
success Saved lockfile.
Done in 739.16s.
Removing intermediate container 3a68f4d309b4
 ---> f6d15ad6f7d8
Step 19/22 : RUN NODE_OPTIONS="--max_old_space_size=4096" yarn theia build
 ---> Running in 1dc44c408a45
Segmentation fault (core dumped)
The command '/bin/sh -c NODE_OPTIONS="--max_old_space_size=4096" yarn theia build' returned a non-zero code: 139

I am not familiar with how Theia is set up and this error does not give me enough information to easily see what it is caused by. Is there some way to enable more verbose logging to indicate what causes the segmentation fault?

I do not expect to be able to work on it for the next few days, but here is my W.I.P.:
https://gist.github.com/Vinno97/5f58a7cb0721b4faec0341f5b4e2c182

@marcdumais-work
Copy link
Member

hi @Vinno97

I suspect the error is actually caused by me supplying an incorrect GITHUB_TOKEN

ah yes, the GH API rate limit is a recurring problem when GITHUB_TOKEN is not correctly set.

I am currently already exploring the possibilities of using multiarch/ubuntu-core as the base image and building it with the (still experimental) --platform flag.

+1 sounds like a good thing to try.

@marcdumais-work
Copy link
Member

The command '/bin/sh -c NODE_OPTIONS="--max_old_space_size=4096" yarn theia build' returned a non-zero code: 139

The "--max_old_space_size=4096" switch was added to work-around a heap exhaustion issue during build/CI, affecting the full image relatively consistently. Removing some of the Theia extensions from *.package.json might help.

I wonder: what device are you building-on? Does it have 4+GB of RAM? If that much memory cannot be allocated for the JS heap, it might fail quickly. Maybe try a lower value? I think default is 1.8GB.

@Vinno97
Copy link
Author

Vinno97 commented Feb 28, 2019

I was building on a laptop with 16GB RAM using qemu. I do not think that the available RAM was the issue, but I also cannot rule it out. I am still busy for the next few days, but I hope to be able to continue working on it in the last half of next week.

@stale
Copy link

stale bot commented Jul 16, 2019

This contribution has been automatically marked as stale due to inactivity, and it will be closed if no further activity occurs. Thank you for contributing to Theia!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants