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

Commit a72bdb8

Browse files
committed
Add devfile and doc for developing of Che Theia remote plugin mechanism
Signed-off-by: Mykola Morhun <[email protected]>
1 parent e9fcf75 commit a72bdb8

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
### How to develop Che Theia remote plugin mechanism
3+
4+
_Please note, this doc provides a flow how to develop remote plugin mechanism in Che Theia, but not a remoute plugin._
5+
6+
First, create a workspace from prepared devfile, which could be found in the extension folder.
7+
When workspace is ready:
8+
- Init Che Theia. This could be done with `che:theia init` command in `/projects/theia` folder or run the init command.
9+
Che Theia sources will be awailable at `/projects/theia/che/che-theia`.
10+
- Now one may make changes in Che Theia remote plugin mechanism in both (Che Theia and Remote plugin) sides.
11+
- Build Che Theia from `theia-dev` container by executing `yarn` in `/projects/theia` folder or by running corresponding command.
12+
- Put your remote plugin(s) into `/projects/remote-plugins/` dorectory.
13+
Note that the plugins shouldn't have any external dependencies.
14+
- Run dev Che Theia and Remote plugins endpoint in `theia-dev` and `theia-remote-runtime-dev` containers correspondingly.
15+
One may use predefined commands to start them.
16+
- Open `theia-dev` route from `My Workspace` panel and test chenges.
17+
18+
Also it is possible to run watchers for remote plugin mechanism.
19+
In `theia-dev` container run `npx run watch @eclipse-che/theia-remote` from `/projects/theia` folder to recompile the extension on changes made.
20+
Also run `yarn watch` in `/projects/theia/examples/assembly` to bring the changes to Che Theia binaries.
21+
The command for this is also available.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
apiVersion: 1.0.0
2+
metadata:
3+
name: che-theia-remote-dev
4+
projects:
5+
- name: theia
6+
source:
7+
type: git
8+
location: 'https://github.com/theia-ide/theia.git'
9+
components:
10+
- type: cheEditor
11+
id: eclipse/che-theia/next
12+
alias: theia-editor
13+
- type: chePlugin
14+
id: eclipse/che-machine-exec-plugin/next
15+
- type: chePlugin
16+
id: che-incubator/typescript/latest
17+
- type: dockerimage
18+
image: eclipse/che-theia-dev:next
19+
alias: theia-dev
20+
mountSources: true
21+
env:
22+
- name: THEIA_PLUGIN_ENDPOINT_DISCOVERY_PORT
23+
value: '2504'
24+
memoryLimit: 3Gi
25+
- type: dockerimage
26+
image: eclipse/che-theia-dev:next
27+
alias: theia-remote-runtime-dev
28+
mountSources: true
29+
env:
30+
- name: THEIA_PLUGIN_ENDPOINT_DISCOVERY_PORT
31+
value: '2504'
32+
- name: THEIA_PLUGINS
33+
value: 'local-dir:///projects/remote-plugins/'
34+
memoryLimit: 1Gi
35+
commands:
36+
- name: Init Che Theia
37+
actions:
38+
- type: exec
39+
component: theia-dev
40+
command: che:theia init
41+
workdir: /projects/theia
42+
- name: Clean Che Theia
43+
actions:
44+
- type: exec
45+
component: theia-dev
46+
command: che:theia clean
47+
workdir: /projects/theia
48+
- name: Build Che Theia
49+
actions:
50+
- type: exec
51+
component: theia-dev
52+
command: yarn
53+
workdir: /projects/theia
54+
- name: Watch changes in Theia Remote Extension
55+
actions:
56+
- type: exec
57+
component: theia-dev
58+
command: 'cd /projects/theia && npx run watch @eclipse-che/theia-remote & cd /projects/theia/examples/assembly && yarn watch'
59+
- name: Run Dev Theia
60+
actions:
61+
- type: exec
62+
component: theia-dev
63+
command: 'yarn theia start --hostname=0.0.0.0 --port=3130'
64+
workdir: /projects/theia/examples/assembly
65+
- name: Run Remote Theia Plugin Endpoint
66+
actions:
67+
- type: exec
68+
component: theia-remote-runtime-dev
69+
command: 'node plugin-remote.js'
70+
workdir: /projects/theia/che/che-theia/extensions/eclipse-che-theia-plugin-remote/lib/node
71+
- name: Terminate all in Dev Theia
72+
actions:
73+
- type: exec
74+
component: theia-dev
75+
command: 'killall node'
76+
- name: Terminate all in Remote Theia Plugin Endpoint
77+
actions:
78+
- type: exec
79+
component: theia-remote-runtime-dev
80+
command: 'killall node'

0 commit comments

Comments
 (0)