Skip to content

Add arm32v7 builder #1337

Closed
Closed

Description

@gleich

Create a new file called arm.Dockerfile that allows you to run it on arm32v7 CPUs such as the Raspberry Pi's CPU.

Activity

  1. nhooyr commented on Feb 4, 2020

    @nhooyr
    Contributor

    Could you elaborate on what the current problem is and how this helps?

  2. gleich commented on Feb 4, 2020

    @gleich
    Author

    At the moment the docker image for code-server only works on x86 processors (desktop processor) and returns the following error when you try to run on an arm32v7 processor (such as the Raspberry Pi):

    standard_init_linux.go:211: exec user process caused "exec format error"

    This is due to the fact that the docker image is built on an x86 processor. In this case, we don't even need to change the base image thanks to the fact that node has an arm image already available. So, in theory, this adds support for running code-server on a Raspberry Pi!

    One problem with this is that in order for it to work on a arm32v7 processor it needs to be built on an arm32v7 processor. Sadly github-actions and travis-ci both don't support you to run your CI on arm32 CPUs. There are a few solutions to this tough:

    1. Run a Jenkins server on a Raspberry Pi that you or someone on the team buys. I made a docker image that comes with Jenkins and docker installed https://hub.docker.com/repository/docker/mattgleich/arm32v7jenkins-docker
    2. Try building it on an x86 with a CPU arm emulation tool such as QEMU

    I am going to work to get this working and will submit a PR once done

  3. sr229 commented on Feb 5, 2020

    @sr229
    Contributor

    @nhooyr we tried building it over at Drone but it keeps OOMing, we're still investigating what we can do with the build toolchain since it should work under normal circumstances since we run with 128GB RAM in Drone Cloud

  4. nhooyr commented on Feb 5, 2020

    @nhooyr
    Contributor

    That is unfortunate news. Not sure what we can do.

  5. added
    enhancementSome improvement that isn't a feature
    and removed
    waiting-for-infoWaiting for more information from submitter
    on Feb 5, 2020
  6. nhooyr commented on Feb 5, 2020

    @nhooyr
    Contributor

    Ah so we need to compile for ARM32 on ARM64.

  7. sr229 commented on Feb 6, 2020

    @sr229
    Contributor

    I'll see on how to compile the project using 32-bit libs but AFAIK documentation to do it for Node.js is quite scarce but I'll keep looking.

  8. sr229 commented on Feb 8, 2020

    @sr229
    Contributor

    @nhooyr AFAIK we should be compiling this on a 32-bit capable container, preferrably Raspbian, in a ARM64 environment (Raspbian can run 32-bit userland against a 64 bit kernel so it shouldn't be an issue).

  9. aptalca commented on Feb 11, 2020

    @aptalca

    @sr229 I'm with linuxserver.io and we publish a code-server image. We use native builders with our jenkins and have a bunch of arm32v7 devices. If you point me to your specific build instructions, I'll try to build it and let you know.

  10. aptalca commented on Feb 12, 2020

    @aptalca

    I tried a build on an odroid xu4, running armbian buster (arm32v7), kernel 4.14.165.
    Ran in an ubuntu bionic docker container with node 12.15.0 and yarn 1.21.1
    Followed the steps from https://github.com/cdr/code-server#development
    yarn watch resulted in the following error:

    root@3d29582a8c4c:/tmp/vscode/src/vs/server# yarn watch
    yarn run v1.21.1
    $ cd ../../../ && yarn watch
    $ gulp watch --max_old_space_size=4095
    [15:29:46] Node flags detected: --max_old_space_size=4095
    [15:29:46] Respawned to PID: 8612
    
    <--- Last few GCs --->
    
    [8612:0x1e47950]     2561 ms: Mark-sweep 20.7 (29.5) -> 20.7 (29.5) MB, 52.8 / 0.0 ms  (average mu = 0.606, current mu = 0.001) allocation failure GC in old space requested
    [8612:0x1e47950]     2614 ms: Mark-sweep 20.7 (29.5) -> 20.7 (22.0) MB, 53.4 / 0.0 ms  (average mu = 0.437, current mu = 0.001) last resort GC in old space requested
    [8612:0x1e47950]     2669 ms: Mark-sweep 20.7 (22.0) -> 20.7 (22.0) MB, 54.6 / 0.0 ms  (average mu = 0.278, current mu = 0.001) last resort GC in old space requested
    
    
    <--- JS stacktrace --->
    
    ==== JS stack trace =========================================
    
    Security context: 0x35b0e235 <JSObject>
        0: builtin exit frame: compileFunction(this=0x2b042315 <JSGlobal Object>,0x2fd0a595 <JSArray[5]>,0x2fd0a585 <JSArray[0]>,0x25340275 <undefined>,0x253403bd <false>,0x25340275 <undefined>,0,0,0x2fd1f5e9 <String[#53]: /tmp/vscode/node_modules/typescript/lib/typescript.js>,0xb0580089 <Very long string[7797825]>,0x2b042315 <JSGlobal Object>)
    
        1: _compile [0x4407861d] [internal/modules/cjs/loader....
    
    FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
    Aborted (core dumped)
    error Command failed with exit code 134.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    error Command failed with exit code 134.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    
  11. nhooyr commented on Feb 12, 2020

    @nhooyr
    Contributor

    @aptalca yea thats the same error @sr229 was getting. We need to cross compile on 64bit arm for 32bit arm.

  12. aptalca commented on Feb 12, 2020

    @aptalca

    Oh I see now, my mistake. I hadn't read the linked thread on drone and incorrectly assumed drone was using arm64 builders for arm32 work and that cross compile was the issue. That's why I tried on native arm32.

  13. 72 remaining items

  14. eh8 commented on Mar 16, 2021

    @eh8

    There isn't that large demand if you ask me, plus most of the development happens in ARM64 or x86_64 hosts, so there won't be any demand for this.

    I can't speak beyond my own circumstances, but as I understand there many use Raspberry Pi/ODroid/etc either as standalone units or in k8'ed configuration as build servers which would suit code-server. It would be a presupposition to discount these platforms for lack of computing power/memory simply because there are small Raspberry Pis that exist.

    It also looks like @RobertCNelson was able to tweak the build scripts trivially to produce viable 32-bit ARM builds, so I would hope that code-server can reproduce the builds officially.

  15. jsjoeio commented on Mar 16, 2021

    @jsjoeio
    Contributor

    If it's trivial to add + maintain, then we'd be happy to support this.

    @eh8 we'd happily review a PR if you submitted one (same goes to you @RobertCNelson). You two probably more than we do (or me at least).

    Otherwise, we can try and take a look at this in the near future.

  16. added this to the v3.9.3 milestone on Mar 16, 2021
  17. sr229 commented on Mar 18, 2021

    @sr229
    Contributor

    There isn't that large demand if you ask me, plus most of the development happens in ARM64 or x86_64 hosts, so there won't be any demand for this.

    I can't speak beyond my own circumstances, but as I understand there many use Raspberry Pi/ODroid/etc either as standalone units or in k8'ed configuration as build servers which would suit code-server. It would be a presupposition to discount these platforms for lack of computing power/memory simply because there are small Raspberry Pis that exist.

    It also looks like @RobertCNelson was able to tweak the build scripts trivially to produce viable 32-bit ARM builds, so I would hope that code-server can reproduce the builds officially.

    This is a valid reason though it's pretty hard to compile for ARMv32 considering there aren't any more public builders offering this, and the fact it's a little hard to configure the CI to do the compile steps for it (only for it to break really horribly).

  18. modified the milestones: v3.9.3, On Deck on Mar 22, 2021
  19. self-assigned this
    on Apr 19, 2021
  20. oxy commented on Apr 19, 2021

    @oxy

    Now that we have arm64-on-x64 cross compile, it should be fairly simple to also do armv7-on-x64 builds; if there's no PRs for this, I'll look into it in the future, but there are currently other issues that are higher priority.

  21. modified the milestones: On Deck, 3.12.0 on Aug 3, 2021
  22. modified the milestones: 3.12.0, 3.11.2 on Aug 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementSome improvement that isn't a feature

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions