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

Theia devel 1.40 update #13

Closed
wants to merge 2 commits into from
Closed

Conversation

MarkFitzpatrickNN
Copy link
Collaborator

Update theia from version 1.35.0 to version 1.40.0.

@struanb
Copy link
Contributor

struanb commented Aug 18, 2023

Thanks @MarkFitzpatrickNN, looking at this now.

@struanb
Copy link
Contributor

struanb commented Aug 18, 2023

Your branch has a seemingly empty merge commit that I prefer to keep out of main, and the comment on the main commit (ec97b3e) should read Upgrade Theia to v1.40.0 including yarn.lock for consistent build (for clarity and consistency).

I've therefore cherry-picked ec97b3e into the main branch (we operate a rebase merge strategy on Dockside's main branch anyway) and amended the commit message accordingly.

Next I've tested build for other supported architectures as per https://github.com/newsnowlabs/dockside/blob/main/docs/developing/building-production-image.md with the following results:

  • ./build/build.sh --builder depot --tag test --platform linux/amd64 - PASS
  • ./build/build.sh --builder depot --tag test --platform linux/arm64 - PASS
  • ./build/build.sh --builder depot --tag test --platform linux/arm/v7 - FAIL

Thearm/v7 failure arises from building Theia 1.40.0, as I checked building the latest release which builds 1.35.0 and that still builds fine. Error is:

#0 78.48 $ theia build --mode production
#0 79.14 Failed to resolve module: @theia/electron
#0 112.4 
#0 112.4 <--- Last few GCs --->
#0 112.4 
#0 112.4 [7819:0x93cb9800]     4063 ms: Scavenge 1.7 (3.2) -> 1.7 (4.5) MB, 0.5 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure 
#0 112.4 [7819:0x93cb9800]     4066 ms: Mark-sweep (reduce) 1.7 (3.5) -> 1.2 (4.5) MB, 2.8 / 0.0 ms  (average mu = 1.000, current mu = 1.000) last resort GC in old space requested
#0 112.4 [7819:0x93cb9800]     4071 ms: Mark-sweep (reduce) 1.2 (3.5) -> 1.2 (4.0) MB, 5.6 / 0.0 ms  (average mu = 0.002, current mu = 0.002) last resort GC in old space requested
#0 112.4 
#0 112.4 
#0 112.4 <--- JS stacktrace --->
#0 112.4 
#0 112.4 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
#0 112.4 
#0 112.7 Error: webpack exited with an unexpected signal: SIGABRT.
#0 112.7     at ChildProcess.<anonymous> (/opt/dockside/ide/theia/theia-1.40.0/theia/node_modules/@theia/application-manager/lib/application-process.js:59:28)
#0 112.7     at ChildProcess.emit (events.js:400:28)
#0 112.7     at maybeClose (internal/child_process.js:1088:16)
#0 112.7     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
#0 112.7 error Command failed with exit code 1.
#0 112.7 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#0 112.7 error Command failed with exit code 1.
#0 112.7 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

@struanb
Copy link
Contributor

struanb commented Aug 19, 2023

I've tried numerous modifications to the Theia build command line - increasing --max_old_space_size from 4096 to 8192 and even 16384; other memory-management options like --optimize_for_size, --gc_global, and --compact_gc - all to no avail.

I've tried these options on Depot's arm hardware with 32GB RAM, so it is hard to see why memory shortage should be an issue.

I've reluctantly concluded that Theia 1.40.0 is incompatible with the linux/arm/v7 platform.

This presented a conundrum:

  1. Keep all platforms using Theia 1.35.0 until the issue is resolved upstream, holding up Theia upgrades for other Dockside platforms?
  2. Drop support for linux/arm/v7, required to run on rPI 32bit Raspbian?
  3. Modify the build process to support different Theia versions for different platforms?

(1) is not an option. I am reluctant to accept (2) right now, as while there is now a 64bit version of Raspbian able to run on rPi 4, it is still relatively new and seems a shame to drop support when Dockside still works.

And it is not inconceivable that this issue will arise again, with a new version of Theia working on some supported platforms but not yet on others.

I have therefore opted to modify the build process to support different Theia versions for different platforms. Docker does not support setting build variables to different values for different platforms. This therefore entailed moving the Theia version specification from build.sh into Dockerfile, and a variety of other changes to Dockerfile to facilitate the required env vars to be set to the intended value for each platform.

I am pushing the changes from your branch to a new branch https://github.com/newsnowlabs/dockside/tree/theia-devel-1.40-mixed. (Please note the yarn.lock for Theia must be in the Theia version build directory not the Dockside build directory: I've moved it to the right place in this branch).

@struanb struanb mentioned this pull request Aug 19, 2023
@struanb
Copy link
Contributor

struanb commented Aug 19, 2023

I am closing this PR having created a new one (#14) from the new branch. Please review the changes and comment there.

@struanb struanb closed this Aug 19, 2023
@MarkFitzpatrickNN
Copy link
Collaborator Author

Thanks Struan, I've made some notes on these smaller things that caught me out for future reference.

@struanb
Copy link
Contributor

struanb commented Aug 21, 2023

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

Successfully merging this pull request may close these issues.

2 participants