Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

linkless build #955

Merged
merged 12 commits into from
Jun 8, 2021
Merged

linkless build #955

merged 12 commits into from
Jun 8, 2021

Conversation

tsmaeder
Copy link
Contributor

@tsmaeder tsmaeder commented Dec 17, 2020

Signed-off-by: Thomas Mäder tmader@redhat.com

What does this PR do?

This is a proof of concept of a build process for che-theia that does not involve linking source folders: linking source folders introduces some problems because tools that manipulate paths will either see /projects/theia as a parent of a che-theia package or not, depending on whether the tools uses resolved file system paths or just manipulates the path string.

The idea of the PR is to move the assembly folder as a yarn workspace folder inside the che-theia repo and to yarn link all @Theia packages at the level of the che-theia repo root.

What issues does this PR fix or reference?

eclipse-che/che#16852

How to test this PR?

  1. In a self-hosting workspace, checkout the PR branch of che-theia into /projects
  2. Checkout master of theia into /projects
  3. Run yarn inside theia; wait for the build to finish
  4. cd into /projects/che-theia
  5. run the script linktheia.sh
  6. run yarn
  7. To run the back-end: cd assembly && yarn run start --hostname=0.0.0.0 --port=3010 --plugins=local-dir:/projects/theia/plugins,local-dir:/projects/che-theia/plugins
  8. To run the plugin host:
    • run the linktheia.sh script in the plugin host container
    • cd /projects/che-theia/extensions/eclipse-che-theia-plugin-remote/lib/node && node plugin-remote.js
  9. Open the theia-dev-flow endpoint

if you want to build against the latest Theia release (instead of against master), you can just remove the @theia folder from /projects/che-theia/node_modules and rerun yarn.

PR Checklist

As the author of this Pull Request I made sure that:

Reviewers

Reviewers, please comment how you tested the PR when approving it.

Happy Path Channel

HAPPY_PATH_CHANNEL=next

@che-bot
Copy link
Contributor

che-bot commented Dec 17, 2020

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:955
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@tsmaeder
Copy link
Contributor Author

@benoitf I would be interested if you see any major problems with my approach.

@benoitf
Copy link
Contributor

benoitf commented Jan 11, 2021

@tsmaeder I think you've done two steps in this PR (two birds, one stone) and usually when we mix some concerns it's hard to get it merge easily.

There are linkless and 'generator-less' as well (BTW there is still a script to run: linktheia.sh script)

so maybe target first linkless (as for example an option in generator) so everyone can try and there is no such breakage on all existing jobs.
if committers like it, option becomes default

and if committers don't like generator, we could remove it as well (another PR/step/issue)

@tsmaeder
Copy link
Contributor Author

@benoitf I'm looking for a validation of the concept before I update the generator. I was able to come up with a PoC in 1-2 days: fixing the generator to work would take me longer (I'd have to dive into it first).

@benoitf
Copy link
Contributor

benoitf commented Jan 12, 2021

@tsmaeder if it's introduced as a new flag I don't see any issue at all

@sunix
Copy link
Contributor

sunix commented Jan 13, 2021

@tsmaeder do you have a devfile that would setup that POC ?

@tsmaeder
Copy link
Contributor Author

@sunix the one here works fine

@sunix
Copy link
Contributor

sunix commented Jan 13, 2021

@sunix the one here works fine

So that one with theia and che-theia (to this fork/branch) side by side

@tsmaeder
Copy link
Contributor Author

tsmaeder commented Jan 13, 2021

@tsmaeder just rm -rf theia and che-theia if you have them, but the referenced devfile starts with no projects anyway.

@sunix
Copy link
Contributor

sunix commented Jan 13, 2021

step 8. maybe having a volume for HOME would help not to link twice.

@che-bot
Copy link
Contributor

che-bot commented Jan 27, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:955
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Jan 29, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:955
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Feb 16, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia docker.io/maxura/che-theia:955
che-theia-endpoint-runtime-binary docker.io/maxura/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 12, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 22, 2021

✅ E2E Happy path tests succeed 🎉

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@@ -70,7 +70,7 @@
"scripts": {
"prepare": "yarn run clean && yarn build",
"clean": "theia clean && rimraf errorShots",
"build": "theia build --mode development --config cdn/webpack.config.js --env.cdn=./cdn.json --env.monacopkg=@theia/monaco-editor-core@0.20.0 && yarn run override-vs-loader",
"build": "NODE_OPTIONS='--max-old-space-size=4096' theia build --mode development --config cdn/webpack.config.js --env.cdn=./cdn.json --env.monacopkg=@theia/monaco-editor-core@0.20.0 && yarn run override-vs-loader",
Copy link
Contributor

Choose a reason for hiding this comment

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

I would move it to .github/workflows/pr.yml ENV variable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've thought about this a bit more, and I think it's correct to set this only for the theia build: the size of memory needed depends on the task being executed, not the environment. Other tasks don't need that much max memory, and giving it to them can make them grab more than they need and take the memory away from other processes, thus reducing potential concurrency.

@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #955 (237e589) into master (eeb4526) will increase coverage by 2.95%.
The diff coverage is 54.31%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #955      +/-   ##
==========================================
+ Coverage   29.45%   32.40%   +2.95%     
==========================================
  Files         277      285       +8     
  Lines        9336     9683     +347     
  Branches     1380     1461      +81     
==========================================
+ Hits         2750     3138     +388     
+ Misses       6487     6447      -40     
+ Partials       99       98       -1     
Impacted Files Coverage Δ
...theia-about/src/browser/about-che-theia-dialog.tsx 0.00% <ø> (ø)
...e-sync-tracker/src/browser/sync-process-tracker.ts 0.00% <0.00%> (ø)
...ovisioner/src/node/git-configuration-controller.ts 0.00% <0.00%> (ø)
...eia-plugin-remote/src/node/hosted-plugin-remote.ts 0.00% <0.00%> (ø)
...theia-plugin-remote/src/node/plugin-host-custom.ts 0.00% <0.00%> (ø)
...in-remote/src/node/plugin-remote-backend-module.ts 0.00% <0.00%> (ø)
...theia-plugin-remote/src/node/plugin-remote-init.ts 0.00% <0.00%> (ø)
...-che-theia-plugin-remote/src/node/plugin-remote.ts 0.00% <0.00%> (ø)
...ugin-remote/src/node/server-plugin-proxy-runner.ts 0.00% <0.00%> (ø)
...plugin-remote/src/node/terminal-container-aware.ts 0.00% <0.00%> (ø)
... and 80 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 258d9d5...237e589. Read the comment docs.

@che-bot
Copy link
Contributor

che-bot commented Mar 25, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 25, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 26, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 29, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@che-bot
Copy link
Contributor

che-bot commented Mar 29, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che Single User on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

@ericwill ericwill mentioned this pull request May 4, 2021
32 tasks
@ericwill ericwill mentioned this pull request May 20, 2021
29 tasks
@benoitf
Copy link
Contributor

benoitf commented May 25, 2021

FYI I've an error on the link test:

 FAIL  tests/link.spec.ts
  ● Console

    console.error
      Error: Unable to execute the command yarn link @theia/bar: Error: Command failed: yarn link @theia/bar
error No registered package found called "@theia/bar".

          at new CliError (/tmp/che-theia/generator/src/cli-error.ts:17:9)
          at /tmp/che-theia/generator/src/command.ts:34:32
          at ChildProcess.exithandler (child_process.js:315:5)
          at ChildProcess.emit (events.js:314:20)
          at maybeClose (internal/child_process.js:1022:16)
          at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

      49 |         await link(cheTheiaDir, theiaDir, linkDir);
      50 |     } catch (e) {
    > 51 |         console.error(e);
         |                 ^
      52 |     }
      53 | }
      54 |

      at Object.<anonymous> (src/link.ts:51:17)
      at step (src/link.ts:5576:19)
      at Object.throw (src/link.ts:5306:14)
      at rejected (src/link.ts:5209:32)

  ● Test link command › test link

    expect(received).toBeTruthy()

    Received: false

      46 |         const zozPackage = path.resolve(srcFolder, 'node_modules/@theia/zoz/package.json');
      47 |
    > 48 |         expect(fs.existsSync(fooPackage)).toBeTruthy();
         |                                           ^
      49 |         expect(fs.existsSync(barPackage)).toBeTruthy();
      50 |         expect(fs.existsSync(zozPackage)).toBeTruthy();

@che-bot
Copy link
Contributor

che-bot commented May 25, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

@tsmaeder
Copy link
Contributor Author

@benoitf I can't reproduce the test failure. How are you running the tests?

@benoitf
Copy link
Contributor

benoitf commented May 31, 2021

@tsmaeder I think it's related to symlinks where theia is cloned
I've created tsmaeder#2 and it works for me with that configuration

@tsmaeder
Copy link
Contributor Author

So are you saying your link folder is itself in a symlinked location?

@benoitf
Copy link
Contributor

benoitf commented May 31, 2021

So are you saying your link folder is itself in a symlinked location?

@tsmaeder yes

@benoitf
Copy link
Contributor

benoitf commented May 31, 2021

it's a bug in yarn but unfortunately it's not yet solved (yarnpkg/yarn#7028 and yarnpkg/yarn#1297)

@che-bot
Copy link
Contributor

che-bot commented May 31, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Tested with Eclipse Che on K8S (minikube v1.1.1)

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

@benoitf
Copy link
Contributor

benoitf commented May 31, 2021

@tsmaeder could you please rebase/resolve the conflict ? so we can have PR checks running

tsmaeder and others added 12 commits June 8, 2021 07:04
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Copy link
Contributor

@benoitf benoitf left a comment

Choose a reason for hiding this comment

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

👍

@tsmaeder tsmaeder merged commit 732da85 into eclipse-che:master Jun 8, 2021
@che-bot che-bot added this to the 7.32 milestone Jun 8, 2021
@che-bot
Copy link
Contributor

che-bot commented Jun 8, 2021

❌ E2E Happy path tests failed ❗

Try Che-Theia editor only Try Che-Theia with Java/maven example Try Che-Theia with NodeJs example

See Details

name link
che-theia quay.io/crw_pr/che-theia:955
che-theia-endpoint-runtime-binary quay.io/crw_pr/che-theia-endpoint-runtime-binary:955

Test product:

  • Use comment "[crw-ci-test]" to rerun happy path E2E test.
  • Use comment "[crw-ci-test --rebuild]" to re-build the images and rerun happy path E2E test.

Eclipse Che QE channel: https://mattermost.eclipse.org/eclipse/channels/eclipse-che-qe

dmytro-ndp pushed a commit that referenced this pull request Jul 21, 2021
Introduce build process using yarn link

Signed-off-by: Thomas Mäder <tmader@redhat.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants