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

Changes to theia-full-docker to run on arm64 #471

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dm4tze
Copy link

@dm4tze dm4tze commented Apr 3, 2021

Hello theia-ide team,

I've made some changes to your theia-full-docker Dockerfile to get it running on an arm64 machine (Raspberry PI4 #411 #130).
Since some of these changes will affect builds for other architectures I want to discuss my solution with you.
If we come to a conclusion I will adjust the Dockerfile to build on the other supported architectures too.
Following changes have been made:

  • Get Golang in the right architecture (I see no problems here)
  • Downgraded LLVM from Version 13 to version 11 and use the distribution package form ARM64 build. (http://apt.llvm.org/bionic/ is not providing arm package)
  • Get CMAKE in the right architecture (I see no problems here)
  • Do not install python 2 (There seems no support anymore)
  • Install .NET via tarball since there is no arm64 package (needs some work to support other architectures)
  • Install DART via zip since there is no arm64 package.

Which of these changes are problematic? Is there a way to test all these changes to see if everything is working as expected?

g++-multilib \
gdb && \
# depending on architecture install form public LLVM PPA (Verison 13) or distirbution (Version 11)
ARG LLVM=11
Copy link
Member

Choose a reason for hiding this comment

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

We would probably still not want to touch this value, and only set it in the arm64 architecture only.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, I have changed the default to 13 and only downgrade it if you build the image on arm64.

Copy link
Member

Choose a reason for hiding this comment

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

Awesome. If we go with one unified multi-arch image, I think we should proceed as per above when necessary. This way we maintain bleeding-edge features for the main arch, but permit other ones to evolve at their own pace and still work in the meantime, maybe with slightly reduced feature-set.

@marcdumais-work
Copy link
Member

@dm4tze have you considered starting with one of the more modest images, that would be easier to handle? Like theia-docker or theia-cpp-docker? The theia-full image is quite big (> 4GB) and seems at first look ill-suited for a rspb board, even the beefier v4 model.

@marcdumais-work
Copy link
Member

What I would love is to have an Electron-based Theia app package that works on a rspb4, like VSCodium has (they have a bunch).

@dm4tze dm4tze marked this pull request as ready for review April 15, 2021 19:31
@dm4tze
Copy link
Author

dm4tze commented Apr 20, 2021

@dm4tze have you considered starting with one of the more modest images, that would be easier to handle? Like theia-docker or theia-cpp-docker? The theia-full image is quite big (> 4GB) and seems at first look ill-suited for a rspb board, even the beefier v4 model.

The idea was, first porting the full image then it should be easy to adjust the other images. At my rpi4 as backend it works without any performance issue. But I have to say, that I use a SSD as storage.

What I would love is to have an Electron-based Theia app package that works on a rspb4, like VSCodium has (they have a bunch).

I don't have a rpi with installed GUI at the moment. That's why I'm using theia :)

@marcdumais-work
Copy link
Member

I don't have a rpi with installed GUI at the moment. That's why I'm using theia :)

There is something we're working-on that might be of interest to you. There is not that much info in the issue, but in short we're going to make available a browser app backend, in an easily packaged form. I hope the way we do it can work on raspberry pi and such, too. TL;DR the browser Theia app without Docker.

@stale
Copy link

stale bot commented Jun 29, 2021

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!

@stale stale bot added the stale label Jun 29, 2021
@stale stale bot removed the stale label Jun 30, 2021
@marcdumais-work
Copy link
Member

marcdumais-work commented Jun 30, 2021

@dm4tze Sorry - this PR fell between the cracks for a while. I'm interested in trying it on my own raspberry pi 4.

Can you give a bit of details about how one goes about setting-up the necessary environment (high-level steps)? I'm ok installing a new system from scratch on a new micro-sd card, if need be. I suggest adding the info in the PR description.

&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y dotnet-sdk-$DOTNET_VERSION
RUN DOTNET_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
Copy link
Member

@marcdumais-work marcdumais-work Jun 30, 2021

Choose a reason for hiding this comment

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

I think we might end-up missing some required packages, that would be marked as a dependency of the Debian package, and installed along.

Maybe better to keep installing with a Debian package for the main arch and have a different handling for arm64?


ENV DART_SDK /usr/lib/dart

RUN DART_ARCH= && dpkgArch="$(dpkg --print-architecture)" \
Copy link
Member

Choose a reason for hiding this comment

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

Potentially same issue for Dart. Additional we're removing several Debian packages, that used to be installed. I do not know enough about Dart to know if we'll be missing something at runtime.

At least until we figure this out, I suggest making this change only for arm64

@marcdumais-work
Copy link
Member

Which of these changes are problematic?

DOTNET and DART are the two that look suspicious to me ATM. We might need to supplement the pre-built binaries with OS--level dependencies that are expected to be present. Until we figure these out, I would be ok to keep the main architecture as-is for these languages, and having a custom setup for arm64.

If I understand correctly, GitHub workflows support arm64, to it may be possible to add that flavor of the full image to CI, by-passing the need to build on one's own board.

@marcdumais-work
Copy link
Member

@dm4tze I wanted to mention that it's highly recommended to somehow secure access to your container and its Theia app.

You can use our "https" example image as inspiration: https://github.com/theia-ide/theia-apps/tree/master/theia-https-docker .

Without something like this, the Theia app's file-system API (among other things) would be accessible from your LAN and become a potential "access point" e.g. for exploits that can breach your LAN, such as those that use DNS rebinding.

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

Successfully merging this pull request may close these issues.

3 participants